sound/usb/line6/driver.h

Source file repositories/reference/linux-study-clean/sound/usb/line6/driver.h

File Facts

System
Linux kernel
Corpus path
sound/usb/line6/driver.h
Extension
.h
Size
5868 bytes
Lines
215
Domain
Driver Families
Bucket
sound/usb
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 line6_properties {
	/* Card id string (maximum 16 characters).
	 * This can be used to address the device in ALSA programs as
	 * "default:CARD=<id>"
	 */
	const char *id;

	/* Card short name (maximum 32 characters) */
	const char *name;

	/* Bit vector defining this device's capabilities in line6usb driver */
	int capabilities;

	int altsetting;

	unsigned int ctrl_if;
	unsigned int ep_ctrl_r;
	unsigned int ep_ctrl_w;
	unsigned int ep_audio_r;
	unsigned int ep_audio_w;
};

/* Capability bits */
enum {
	/* device supports settings parameter via USB */
	LINE6_CAP_CONTROL =	1 << 0,
	/* device supports PCM input/output via USB */
	LINE6_CAP_PCM =		1 << 1,
	/* device supports hardware monitoring */
	LINE6_CAP_HWMON =	1 << 2,
	/* device requires output data when input is read */
	LINE6_CAP_IN_NEEDS_OUT = 1 << 3,
	/* device uses raw MIDI via USB (data endpoints) */
	LINE6_CAP_CONTROL_MIDI = 1 << 4,
	/* device provides low-level information */
	LINE6_CAP_CONTROL_INFO = 1 << 5,
	/* device provides hardware monitoring volume control */
	LINE6_CAP_HWMON_CTL =	1 << 6,
};

/*
	 Common data shared by all Line 6 devices.
	 Corresponds to a pair of USB endpoints.
*/
struct usb_line6 {
	/* USB device */
	struct usb_device *usbdev;

	/* Properties */
	const struct line6_properties *properties;

	/* Interval for data USB packets */
	int interval;
	/* ...for isochronous transfers framing */
	int intervals_per_second;

	/* Number of isochronous URBs used for frame transfers */
	int iso_buffers;

	/* Maximum size of data USB packet */
	int max_packet_size;

	/* Device representing the USB interface */
	struct device *ifcdev;

	/* Line 6 sound card data structure.
	 * Each device has at least MIDI or PCM.
	 */
	struct snd_card *card;

	/* Line 6 PCM device data structure */
	struct snd_line6_pcm *line6pcm;

	/* Line 6 MIDI device data structure */
	struct snd_line6_midi *line6midi;

	/* URB for listening to POD data endpoint */
	struct urb *urb_listen;

	/* Buffer for incoming data from POD data endpoint */
	unsigned char *buffer_listen;

	/* Buffer for message to be processed, generated from MIDI layer */
	unsigned char *buffer_message;

	/* Length of message to be processed, generated from MIDI layer  */
	int message_length;

	/* Circular buffer for non-MIDI control messages */
	struct {

Annotation

Implementation Notes