drivers/usb/gadget/function/u_midi2.h
Source file repositories/reference/linux-study-clean/drivers/usb/gadget/function/u_midi2.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/usb/gadget/function/u_midi2.h- Extension
.h- Size
- 2289 bytes
- Lines
- 82
- Domain
- Driver Families
- Bucket
- drivers/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.
- 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/usb/composite.hsound/asound.h
Detected Declarations
struct f_midi2_optsstruct f_midi2_ep_optsstruct f_midi2_block_optsstruct f_midi2_block_infostruct f_midi2_ep_infostruct f_midi2_card_infostruct f_midi2_block_optsstruct f_midi2_ep_optsstruct f_midi2_opts
Annotated Snippet
struct f_midi2_block_info {
unsigned int direction; /* FB direction: 1-3 */
unsigned int first_group; /* first UMP group: 0-15 */
unsigned int num_groups; /* number of UMP groups: 1-16 */
unsigned int midi1_first_group; /* first UMP group for MIDI 1.0 */
unsigned int midi1_num_groups; /* number of UMP groups for MIDI 1.0 */
unsigned int ui_hint; /* UI-hint: 0-3 */
unsigned int midi_ci_version; /* MIDI-CI version: 0-255 */
unsigned int sysex8_streams; /* number of sysex8 streams: 0-255 */
unsigned int is_midi1; /* MIDI 1.0 port: 0-2 */
bool active; /* FB active flag: bool */
const char *name; /* FB name */
};
/* UMP Endpoint info */
struct f_midi2_ep_info {
unsigned int protocol_caps; /* protocol capabilities: 1-3 */
unsigned int protocol; /* default protocol: 1-2 */
unsigned int manufacturer; /* manufacturer id: 0-0xffffff */
unsigned int family; /* device family id: 0-0xffff */
unsigned int model; /* device model id: 0x-0xffff */
unsigned int sw_revision; /* software revision: 32bit */
const char *ep_name; /* Endpoint name */
const char *product_id; /* Product ID */
};
struct f_midi2_card_info {
bool process_ump; /* process UMP stream: bool */
bool static_block; /* static FBs: bool */
unsigned int req_buf_size; /* request buffer size */
unsigned int num_reqs; /* number of requests */
const char *iface_name; /* interface name */
};
struct f_midi2_block_opts {
struct config_group group;
unsigned int id;
struct f_midi2_block_info info;
struct f_midi2_ep_opts *ep;
};
struct f_midi2_ep_opts {
struct config_group group;
unsigned int index;
struct f_midi2_ep_info info;
struct f_midi2_block_opts *blks[SNDRV_UMP_MAX_BLOCKS];
struct f_midi2_opts *opts;
};
#define MAX_UMP_EPS 4
#define MAX_CABLES 16
struct f_midi2_opts {
struct usb_function_instance func_inst;
struct mutex lock;
int refcnt;
struct f_midi2_card_info info;
unsigned int num_eps;
struct f_midi2_ep_opts *eps[MAX_UMP_EPS];
};
#endif /* U_MIDI2_H */
Annotation
- Immediate include surface: `linux/usb/composite.h`, `sound/asound.h`.
- Detected declarations: `struct f_midi2_opts`, `struct f_midi2_ep_opts`, `struct f_midi2_block_opts`, `struct f_midi2_block_info`, `struct f_midi2_ep_info`, `struct f_midi2_card_info`, `struct f_midi2_block_opts`, `struct f_midi2_ep_opts`, `struct f_midi2_opts`.
- Atlas domain: Driver Families / drivers/usb.
- 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.