include/linux/usb/midi-v2.h

Source file repositories/reference/linux-study-clean/include/linux/usb/midi-v2.h

File Facts

System
Linux kernel
Corpus path
include/linux/usb/midi-v2.h
Extension
.h
Size
3633 bytes
Lines
95
Domain
Core OS
Bucket
Core Kernel Interface
Inferred role
Core OS: implementation source
Status
source implementation candidate

Why This File Exists

Core operating-system implementation surface: boot, tasks, memory, VFS, syscall-facing interfaces, synchronization, credentials, and isolation.

Dependency Surface

Detected Declarations

Annotated Snippet

struct usb_ms20_endpoint_descriptor {
	__u8  bLength;			/* 4+n */
	__u8  bDescriptorType;		/* USB_DT_CS_ENDPOINT */
	__u8  bDescriptorSubtype;	/* USB_MS_GENERAL_2_0 */
	__u8  bNumGrpTrmBlock;		/* Number of Group Terminal Blocks: n */
	__u8  baAssoGrpTrmBlkID[];	/* ID of the Group Terminal Blocks [n] */
} __packed;

#define USB_DT_MS20_ENDPOINT_SIZE(n)	(4 + (n))

/* As above, but more useful for defining your own descriptors: */
#define DECLARE_USB_MS20_ENDPOINT_DESCRIPTOR(n)			\
struct usb_ms20_endpoint_descriptor_##n {			\
	__u8  bLength;						\
	__u8  bDescriptorType;					\
	__u8  bDescriptorSubtype;				\
	__u8  bNumGrpTrmBlock;					\
	__u8  baAssoGrpTrmBlkID[n];				\
} __packed

/* 5.4.1 Class-Specific Group Terminal Block Header Descriptor */
struct usb_ms20_gr_trm_block_header_descriptor {
	__u8  bLength;			/* 5 */
	__u8  bDescriptorType;		/* USB_DT_CS_GR_TRM_BLOCK */
	__u8  bDescriptorSubtype;	/* USB_MS_GR_TRM_BLOCK_HEADER */
	__le16 wTotalLength;		/* Total number of bytes */
} __packed;

/* 5.4.2.1 Group Terminal Block Descriptor */
struct usb_ms20_gr_trm_block_descriptor {
	__u8  bLength;			/* 13 */
	__u8  bDescriptorType;		/* USB_DT_CS_GR_TRM_BLOCK */
	__u8  bDescriptorSubtype;	/* USB_MS_GR_TRM_BLOCK */
	__u8  bGrpTrmBlkID;		/* ID of this Group Terminal Block */
	__u8  bGrpTrmBlkType;		/* Group Terminal Block Type */
	__u8  nGroupTrm;		/* The first member Group Terminal in this block */
	__u8  nNumGroupTrm;		/* Number of member Group Terminals spanned */
	__u8  iBlockItem;		/* String ID of Block item */
	__u8  bMIDIProtocol;		/* Default MIDI protocol */
	__le16 wMaxInputBandwidth;	/* Max input bandwidth capability in 4kB/s */
	__le16 wMaxOutputBandwidth;	/* Max output bandwidth capability in 4kB/s */
} __packed;

#endif /* __LINUX_USB_MIDI_V2_H */

Annotation

Implementation Notes