STRUCT PXA_EP(9)
๐ struct pxa_ep(9) โ the pxa endpoint, bestie edition ๐
okay so this is a page from the Kernel API Manual about struct pxa_ep, and honestly? it's giving "old USB gadget driver lore" and i'm obsessed. let's get into it ๐
โจ SYNOPSIS โจ
here's the whole struct, laid out exactly as it is, no cap:
struct pxa_ep {
struct pxa_udc *dev;
struct list_head queue;
spinlock_t lock;
unsigned enabled:1;
unsigned in_handle_ep:1;
unsigned idx:5;
char *name;
unsigned dir_in:1;
unsigned addr:4;
unsigned config:2;
unsigned interface:3;
unsigned alternate:3;
unsigned fifo_size;
unsigned type;
#ifdef CONFIG_PM;
u32 udccsr_value;
u32 udccr_value;
#endif;
struct stats stats;
};
๐ฆ Members ๐ฆ
bestie, meet the fields. every single one. line by line, no skipping ๐
devโ the udc device ๐queueโ the requests queue ๐lockโ the lock that guards thepxa_epdata (that means the queues and the stats) ๐enabledโtruewhen the endpoint is enabled โ and to be clear, that means not stopped by the gadget layer โจin_handle_epโ the number of recursions of thehandle_epfunction. it exists to prevent deadlocks or infinite recursions of types:
irq->handle_ep->req_done->req.complete->pxa_ep_queue->handle_ep
or
pxa_ep_queue->handle_ep->req_done->req.complete->pxa_ep_queue
like, that's the whole reason. protecting us from ourselves ๐ญ
idxโ the endpoint index (1=> epA,2=> epB, ...,24=> epX) ๐ขnameโ the endpoint name (for trace/debug purpose) ๐ท๏ธdir_inโ1if it's an IN endpoint,0if it's an OUT endpoint ๐addrโ the usb endpoint number ๐ฎconfigโ the configuration in which this endpoint is active โ๏ธinterfaceโ the interface in which this endpoint is active ๐alternateโ the altsetting in which this endpoint is active ๐fifo_sizeโ max packet size in the endpoint fifo ๐ฆtypeโ the endpoint type (bulk, iso, int, ...) ๐udccsr_valueโ save register ofUDCCSR0for suspend/resume ๐พudccr_valueโ save register ofUDCCRfor suspend/resume ๐พstatsโ endpoint statistics ๐
๐ Description ๐
okay so this is where it gets real. the *PROBLEM* is that pxa's endpoint configuration scheme is both misdesigned and full of implementation bugs. misdesigned how? it cares about config/interface/altsetting, which places needless limits on device capability. and the bugs? they force it to be set up for use more or less like a pxa255. yeah. that's the situation. ๐
and because we define the pxa_ep statically, we must guess all needed pxa_ep for all gadget which may work with this udc driver. guessing. statically. iconic in the worst way ngl ๐ญ
fr fr, that's the actual documented state of things โ i'm not adding drama, the manpage said *PROBLEM* with the asterisks and everything ๐
๐ธ SEE ALSO ๐ธ
go read these too, bestie, they're in the kernel file ./drivers/usb/gadget/udc/pxa27x_udc.h ๐
struct udc_usb_ep(9)struct pxa27x_request(9)struct pxa_udc(9)
and that's the whole vibe check ๐ซถ this page lives in ./drivers/usb/gadget/udc and it's dated October 2026 โ shoutout to the source, mwah ๐โจ๐
๐ฆ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms