drivers/usb/musb/musb_core.h
Source file repositories/reference/linux-study-clean/drivers/usb/musb/musb_core.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/usb/musb/musb_core.h- Extension
.h- Size
- 16026 bytes
- Lines
- 624
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/slab.hlinux/list.hlinux/interrupt.hlinux/errno.hlinux/timer.hlinux/device.hlinux/usb/ch9.hlinux/usb/gadget.hlinux/usb.hlinux/usb/otg.hlinux/usb/musb.hlinux/phy/phy.hlinux/workqueue.hmusb_debug.hmusb_dma.hmusb_io.hmusb_gadget.hlinux/usb/hcd.hmusb_host.hmusb_regs.h
Detected Declarations
struct musbstruct musb_hw_epstruct musb_epstruct musb_qhstruct musb_iostruct musb_platform_opsstruct musb_hw_epstruct musb_csr_regsstruct musb_context_registersstruct musbenum musb_h_ep0_stateenum musb_g_ep0_statefunction musb_read_fifosizefunction musb_configure_ep0function musb_platform_set_vbusfunction musb_platform_enablefunction musb_platform_disablefunction musb_platform_set_modefunction musb_platform_try_idlefunction musb_platform_recoverfunction musb_platform_get_vbus_statusfunction musb_platform_initfunction musb_platform_exitfunction musb_platform_pre_root_reset_endfunction musb_platform_post_root_reset_endfunction musb_platform_clear_ep_rxintrfunction musb_set_statefunction musb_get_state
Annotated Snippet
struct musb_platform_ops {
#define MUSB_G_NO_SKB_RESERVE BIT(9)
#define MUSB_DA8XX BIT(8)
#define MUSB_PRESERVE_SESSION BIT(7)
#define MUSB_DMA_UX500 BIT(6)
#define MUSB_DMA_CPPI41 BIT(5)
#define MUSB_DMA_CPPI BIT(4)
#define MUSB_DMA_TUSB_OMAP BIT(3)
#define MUSB_DMA_INVENTRA BIT(2)
#define MUSB_IN_TUSB BIT(1)
#define MUSB_INDEXED_EP BIT(0)
u32 quirks;
int (*init)(struct musb *musb);
int (*exit)(struct musb *musb);
void (*enable)(struct musb *musb);
void (*disable)(struct musb *musb);
u32 (*ep_offset)(u8 epnum, u16 offset);
void (*ep_select)(void __iomem *mbase, u8 epnum);
u16 fifo_mode;
u32 (*fifo_offset)(u8 epnum);
u32 (*busctl_offset)(u8 epnum, u16 offset);
u8 (*readb)(void __iomem *addr, u32 offset);
void (*writeb)(void __iomem *addr, u32 offset, u8 data);
u8 (*clearb)(void __iomem *addr, u32 offset);
u16 (*readw)(void __iomem *addr, u32 offset);
void (*writew)(void __iomem *addr, u32 offset, u16 data);
u16 (*clearw)(void __iomem *addr, u32 offset);
void (*read_fifo)(struct musb_hw_ep *hw_ep, u16 len, u8 *buf);
void (*write_fifo)(struct musb_hw_ep *hw_ep, u16 len, const u8 *buf);
u16 (*get_toggle)(struct musb_qh *qh, int is_out);
u16 (*set_toggle)(struct musb_qh *qh, int is_out, struct urb *urb);
struct dma_controller *
(*dma_init) (struct musb *musb, void __iomem *base);
void (*dma_exit)(struct dma_controller *c);
int (*set_mode)(struct musb *musb, u8 mode);
void (*try_idle)(struct musb *musb, unsigned long timeout);
int (*recover)(struct musb *musb);
int (*vbus_status)(struct musb *musb);
void (*set_vbus)(struct musb *musb, int on);
void (*pre_root_reset_end)(struct musb *musb);
void (*post_root_reset_end)(struct musb *musb);
int (*phy_callback)(enum musb_vbus_id_status status);
void (*clear_ep_rxintr)(struct musb *musb, int epnum);
};
/*
* struct musb_hw_ep - endpoint hardware (bidirectional)
*
* Ordered slightly for better cacheline locality.
*/
struct musb_hw_ep {
struct musb *musb;
void __iomem *fifo;
void __iomem *regs;
#if IS_ENABLED(CONFIG_USB_MUSB_TUSB6010)
void __iomem *conf;
#endif
/* index in musb->endpoints[] */
u8 epnum;
/* hardware configuration, possibly dynamic */
bool is_shared_fifo;
bool tx_double_buffered;
bool rx_double_buffered;
u16 max_packet_sz_tx;
u16 max_packet_sz_rx;
struct dma_channel *tx_channel;
struct dma_channel *rx_channel;
#if IS_ENABLED(CONFIG_USB_MUSB_TUSB6010)
/* TUSB has "asynchronous" and "synchronous" dma modes */
dma_addr_t fifo_async;
dma_addr_t fifo_sync;
void __iomem *fifo_sync_va;
#endif
/* currently scheduled peripheral endpoint */
struct musb_qh *in_qh;
struct musb_qh *out_qh;
u8 rx_reinit;
Annotation
- Immediate include surface: `linux/slab.h`, `linux/list.h`, `linux/interrupt.h`, `linux/errno.h`, `linux/timer.h`, `linux/device.h`, `linux/usb/ch9.h`, `linux/usb/gadget.h`.
- Detected declarations: `struct musb`, `struct musb_hw_ep`, `struct musb_ep`, `struct musb_qh`, `struct musb_io`, `struct musb_platform_ops`, `struct musb_hw_ep`, `struct musb_csr_regs`, `struct musb_context_registers`, `struct musb`.
- Atlas domain: Driver Families / drivers/usb.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.