using_dma(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… using_dma(9) β€” the using_dma page, bestie edition ✨

okay so this is a page from the Kernel API Manual (the 9 section, kernel stuff, iykyk) and it's literally just one tiny function that tells you if the driver is doing DMA. short king energy, but let's get into it 🫢


✨ NAME ✨

using_dma β€” return the DMA status of the driver. that's it. that's the whole job πŸ’–


πŸŽ€ SYNOPSIS πŸŽ€

bool using_dma (struct dwc2_hsotg *hsotg );

it returns a bool and takes exactly one argument. clean. minimal. iconic. ✨


🌸 ARGUMENTS 🌸

  • hsotg β€” The driver state. that's the whole description, no notes, she said what she said πŸ’…

πŸ¦‹ DESCRIPTION πŸ¦‹

so the function returns true if we're using DMA. simple as that, no cap πŸ’€

but here's the tea: currently the DMA support code is worked into everywhere that needs it, however the AMBA DMA implementation in the hardware can only DMA from 32bit aligned addresses. meaning gadgets like the CDC Ethernet cannot work, because they often pass packets that are not 32bit aligned. like, the hardware just won't take them 😭

unfortunately the choice to use DMA or not is global to the controller and seems to be only settable when the controller is being put through a core reset. so we got two options, bestie: either we fix the gadgets to take account of DMA alignment, or we add bounce buffers (yuerk) πŸ™ˆ

and last thing β€” g_using_dma is set depending on dts flag. that's the flag, that's the vibe check, periodt ⭐


πŸ’œ SEE ALSO πŸ’œ

so this page hangs out with basically the entire ./drivers/usb/dwc2/gadget.c friend group (also in the Kernel file ./drivers/usb/dwc2/gadget.c). roll call, everyone say hi πŸ‘‘:

like I said. the whole friend group. bring snacks πŸ“


and that's the page!! 🌈 little sign-off for the metadata girlies: this one lives under ./drivers/usb/dwc2, it's dated October 2026, and it's page using_dma(9) of the Kernel API Manual. mwah, go read the other eighty-whatever pages, ily πŸ’–πŸŽ€βœ¨

πŸ“¦ where this page comes from