sound/xen/xen_snd_front_evtchnl.h

Source file repositories/reference/linux-study-clean/sound/xen/xen_snd_front_evtchnl.h

File Facts

System
Linux kernel
Corpus path
sound/xen/xen_snd_front_evtchnl.h
Extension
.h
Size
2268 bytes
Lines
89
Domain
Driver Families
Bucket
sound/xen
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.

Dependency Surface

Detected Declarations

Annotated Snippet

struct xen_snd_front_evtchnl {
	struct xen_snd_front_info *front_info;
	int gref;
	int port;
	int irq;
	int index;
	/* State of the event channel. */
	enum xen_snd_front_evtchnl_state state;
	enum xen_snd_front_evtchnl_type type;
	/* Current response id or next expected incoming event id. */
	u16 evt_id;
	/* Next request id. */
	u16 evt_next_id;
	/* Shared ring access lock. */
	struct mutex ring_io_lock;
	union {
		struct {
			struct xen_sndif_front_ring ring;
			struct completion completion;
			/* Serializer for backend IO: request/response. */
			struct mutex req_io_lock;

			/* Latest response status. */
			int resp_status;
			union {
				struct xensnd_query_hw_param hw_param;
			} resp;
		} req;
		struct {
			struct xensnd_event_page *page;
			/* This is needed to handle XENSND_EVT_CUR_POS event. */
			struct snd_pcm_substream *substream;
		} evt;
	} u;
};

struct xen_snd_front_evtchnl_pair {
	struct xen_snd_front_evtchnl req;
	struct xen_snd_front_evtchnl evt;
};

int xen_snd_front_evtchnl_create_all(struct xen_snd_front_info *front_info,
				     int num_streams);

void xen_snd_front_evtchnl_free_all(struct xen_snd_front_info *front_info);

int xen_snd_front_evtchnl_publish_all(struct xen_snd_front_info *front_info);

void xen_snd_front_evtchnl_flush(struct xen_snd_front_evtchnl *evtchnl);
void xen_snd_front_evtchnl_set_connected(struct xen_snd_front_evtchnl *channel,
					 bool is_connected);

void xen_snd_front_evtchnl_pair_set_connected(struct xen_snd_front_evtchnl_pair *evt_pair,
					      bool is_connected);

void xen_snd_front_evtchnl_pair_clear(struct xen_snd_front_evtchnl_pair *evt_pair);

#endif /* __XEN_SND_FRONT_EVTCHNL_H */

Annotation

Implementation Notes