STRUCT MTU3(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct mtu3(9) β€” like, the whole entire vibe

okay so bestie, welcome to the Kernel API Manual ✨ this one's all about struct mtu3, and it's literally the device driver instance data. that's it, that's the whole NAME section, she's concise πŸ‘‘


🌸 SYNOPSIS 🌸

here's the whole struct, character for character, no cap β€” don't you dare touch a single semicolon:

struct mtu3 {
    spinlock_t lock;
    struct ssusb_mtk *ssusb;
    struct device *dev;
    void __iomem *mac_base;
    void __iomem *ippc_base;
    int irq;
    struct mtu3_fifo_info tx_fifo;
    struct mtu3_fifo_info rx_fifo;
    struct mtu3_ep *ep_array;
    struct mtu3_ep *in_eps;
    struct mtu3_ep *out_eps;
    struct mtu3_ep *ep0;
    int num_eps;
    int slot;
    int active_ep;
    struct dma_pool *qmu_gpd_pool;
    enum mtu3_g_ep0_state ep0_state;
    struct usb_gadget g;
    struct usb_gadget_driver *gadget_driver;
    struct mtu3_request ep0_req;
    u8 setup_buf[EP0_RESPONSE_BUF];
    enum usb_device_speed max_speed;
    enum usb_device_speed speed;
    unsigned is_active:1;
    unsigned may_wakeup:1;
    unsigned is_self_powered:1;
    unsigned test_mode:1;
    unsigned softconnect:1;
    unsigned u1_enable:1;
    unsigned u2_enable:1;
    unsigned u3_capable:1;
    unsigned delayed_status:1;
    unsigned gen2cp:1;
    unsigned connected:1;
    unsigned async_callbacks:1;
    unsigned separate_fifo:1;
    u8 address;
    u8 test_mode_nr;
    u32 hw_version;
 };

like?? the bitfields at the end are giving main character energy, they're all unsigned ... :1 and there are SO many of them 😭 but we respect her 🫢


πŸŽ€ Members πŸŽ€

okay this is the part where we go member by member, and ngl these ones have ✨lore✨:

  • slot β€” it's MTU3_U2_IP_SLOT_DEFAULT when you're U2 IP only, and MTU3_U3_IP_SLOT_DEFAULT when you're U3 IP. pick your fighter πŸ’…
  • ep0_req β€” a dummy request, used while handling standard USB requests for GET_STATUS and SET_SEL. she's fake but she's doing important work πŸ™ˆ
  • setup_buf β€” the ep0 response buffer for GET_STATUS and SET_SEL requests. note that it's a u8 setup_buf[EP0_RESPONSE_BUF], bestie, exact size and everything πŸ’–
  • may_wakeup β€” means the device's remote wakeup is enabled. so like, she's allowed to wake you up 🌈
  • is_self_powered β€” this one is reported in device status and the config descriptor. double duty, iconic πŸ‘‘
  • u3_capable β€” is capable of supporting USB3. slay ⭐
  • delayed_status β€” true when function drivers ask for delayed status. she's on ✨delay✨ fr fr
  • gen2cp β€” compatible with USB3 Gen2 IP. gen2 coded πŸ”₯
lowkey notice how the manpage only spells out these specific members? yeah. the rest of the struct is in the SYNOPSIS up there β€” we kept every single field, we just didn't invent commentary that wasn't in the source. don't come for me πŸ’€

πŸ¦‹ SEE ALSO πŸ¦‹

go read these next, bestie, they're all in the kernel file ./drivers/usb/mtu3/mtu3.h:

  • enum mtu3_g_ep0_state(9)
  • enum mtu3_dr_force_mode(9)
  • struct mtu3_fifo_info(9)
  • struct qmu_gpd(9)
  • struct mtu3_gpd_ring(9)
  • struct otg_switch_mtk(9)
  • struct ssusb_mtk(9)
  • struct mtu3_ep(9)

like, that's a whole friend group right there 😭 go say hi to all of them 🫢


and that's the page!! this lil beauty lives at ./drivers/usb/mtu3 and it's dated October 2026 β€” put that in your calendar, periodt πŸ’…βœ¨πŸŒΈ

πŸ“¦ where this page comes from