drivers/usb/gadget/udc/bdc/bdc.h
Source file repositories/reference/linux-study-clean/drivers/usb/gadget/udc/bdc/bdc.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/usb/gadget/udc/bdc/bdc.h- Extension
.h- Size
- 12348 bytes
- Lines
- 490
- 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/kernel.hlinux/usb.hlinux/device.hlinux/spinlock.hlinux/list.hlinux/dma-mapping.hlinux/mm.hlinux/debugfs.hlinux/usb/ch9.hlinux/usb/gadget.hlinux/unaligned.h
Detected Declarations
struct bdc_bdstruct bdc_srstruct bd_tablestruct bd_liststruct bdc_reqstruct bd_transferstruct bdc_reqstruct bdc_scratchpadstruct bdc_epstruct bdc_cmd_paramsstruct srrstruct bdcenum bdc_ep0_stateenum bdc_link_statefunction bdc_readlfunction bdc_writel
Annotated Snippet
struct bdc_bd {
__le32 offset[4];
};
/* Status report in Status report ring(srr) */
struct bdc_sr {
__le32 offset[4];
};
/* bd_table: contiguous bd's in a table */
struct bd_table {
struct bdc_bd *start_bd;
/* dma address of start bd of table*/
dma_addr_t dma;
};
/*
* Each endpoint has a bdl(buffer descriptor list), bdl consists of 1 or more bd
* table's chained to each other through a chain bd, every table has equal
* number of bds. the software uses bdi(bd index) to refer to particular bd in
* the list.
*/
struct bd_list {
/* Array of bd table pointers*/
struct bd_table **bd_table_array;
/* How many tables chained to each other */
int num_tabs;
/* Max_bdi = num_tabs * num_bds_table - 1 */
int max_bdi;
/* current enq bdi from sw point of view */
int eqp_bdi;
/* current deq bdi from sw point of view */
int hwd_bdi;
/* numbers of bds per table */
int num_bds_table;
};
struct bdc_req;
/* Representation of a transfer, one transfer can have multiple bd's */
struct bd_transfer {
struct bdc_req *req;
/* start bd index */
int start_bdi;
/* this will be the next hw dqp when this transfer completes */
int next_hwd_bdi;
/* number of bds in this transfer */
int num_bds;
};
/*
* Representation of a gadget request, every gadget request is contained
* by 1 bd_transfer.
*/
struct bdc_req {
struct usb_request usb_req;
struct list_head queue;
struct bdc_ep *ep;
/* only one Transfer per request */
struct bd_transfer bd_xfr;
int epnum;
};
/* scratchpad buffer needed by bdc hardware */
struct bdc_scratchpad {
dma_addr_t sp_dma;
void *buff;
u32 size;
};
/* endpoint representation */
struct bdc_ep {
struct usb_ep usb_ep;
struct list_head queue;
struct bdc *bdc;
u8 ep_type;
u8 dir;
u8 ep_num;
const struct usb_ss_ep_comp_descriptor *comp_desc;
const struct usb_endpoint_descriptor *desc;
unsigned int flags;
char name[20];
/* endpoint bd list*/
struct bd_list bd_list;
/*
* HW generates extra event for multi bd tranfers, this flag helps in
* ignoring the extra event
*/
bool ignore_next_sr;
};
Annotation
- Immediate include surface: `linux/kernel.h`, `linux/usb.h`, `linux/device.h`, `linux/spinlock.h`, `linux/list.h`, `linux/dma-mapping.h`, `linux/mm.h`, `linux/debugfs.h`.
- Detected declarations: `struct bdc_bd`, `struct bdc_sr`, `struct bd_table`, `struct bd_list`, `struct bdc_req`, `struct bd_transfer`, `struct bdc_req`, `struct bdc_scratchpad`, `struct bdc_ep`, `struct bdc_cmd_params`.
- 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.