sound/virtio/virtio_ctl_msg.h
Source file repositories/reference/linux-study-clean/sound/virtio/virtio_ctl_msg.h
File Facts
- System
- Linux kernel
- Corpus path
sound/virtio/virtio_ctl_msg.h- Extension
.h- Size
- 2343 bytes
- Lines
- 79
- Domain
- Driver Families
- Bucket
- sound/virtio
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/atomic.hlinux/virtio.h
Detected Declarations
struct virtio_sndstruct virtio_snd_msgfunction virtsnd_ctl_msg_send_syncfunction virtsnd_ctl_msg_send_async
Annotated Snippet
#ifndef VIRTIO_SND_MSG_H
#define VIRTIO_SND_MSG_H
#include <linux/atomic.h>
#include <linux/virtio.h>
struct virtio_snd;
struct virtio_snd_msg;
void virtsnd_ctl_msg_ref(struct virtio_snd_msg *msg);
void virtsnd_ctl_msg_unref(struct virtio_snd_msg *msg);
void *virtsnd_ctl_msg_request(struct virtio_snd_msg *msg);
void *virtsnd_ctl_msg_response(struct virtio_snd_msg *msg);
struct virtio_snd_msg *virtsnd_ctl_msg_alloc(size_t request_size,
size_t response_size, gfp_t gfp);
int virtsnd_ctl_msg_send(struct virtio_snd *snd, struct virtio_snd_msg *msg,
struct scatterlist *out_sgs,
struct scatterlist *in_sgs, bool nowait);
/**
* virtsnd_ctl_msg_send_sync() - Simplified sending of synchronous message.
* @snd: VirtIO sound device.
* @msg: Control message.
*
* After returning from this function, the message will be deleted. If message
* content is still needed, the caller must additionally to
* virtsnd_ctl_msg_ref/unref() it.
*
* The msg_timeout_ms module parameter defines the message completion timeout.
* If the message is not completed within this time, the function will return an
* error.
*
* Context: Any context that permits to sleep.
* Return: 0 on success, -errno on failure.
*
* The return value is a message status code (VIRTIO_SND_S_XXX) converted to an
* appropriate -errno value.
*/
static inline int virtsnd_ctl_msg_send_sync(struct virtio_snd *snd,
struct virtio_snd_msg *msg)
{
return virtsnd_ctl_msg_send(snd, msg, NULL, NULL, false);
}
/**
* virtsnd_ctl_msg_send_async() - Simplified sending of asynchronous message.
* @snd: VirtIO sound device.
* @msg: Control message.
*
* Context: Any context.
* Return: 0 on success, -errno on failure.
*/
static inline int virtsnd_ctl_msg_send_async(struct virtio_snd *snd,
struct virtio_snd_msg *msg)
{
return virtsnd_ctl_msg_send(snd, msg, NULL, NULL, true);
}
void virtsnd_ctl_msg_cancel_all(struct virtio_snd *snd);
void virtsnd_ctl_msg_complete(struct virtio_snd_msg *msg);
int virtsnd_ctl_query_info(struct virtio_snd *snd, int command, int start_id,
int count, size_t size, void *info);
void virtsnd_ctl_notify_cb(struct virtqueue *vqueue);
#endif /* VIRTIO_SND_MSG_H */
Annotation
- Immediate include surface: `linux/atomic.h`, `linux/virtio.h`.
- Detected declarations: `struct virtio_snd`, `struct virtio_snd_msg`, `function virtsnd_ctl_msg_send_sync`, `function virtsnd_ctl_msg_send_async`.
- Atlas domain: Driver Families / sound/virtio.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.