STRUCT D40_CHAN(9)
π struct d40_chan(9) β the Kernel API Manual, but make it cute π
okay so bestie, we're deep in the kernel API manual rn and this is struct d40_chan β literally the struct that describes a channel. yes, that kind of channel. sit down, grab a strawberry π, and lemme walk you through every single field because there are a LOT and none of them are getting skipped.
β¨ NAME β¨
struct d40_chan β Struct that describes a channel. that's it, that's the whole name section, she's efficient π
πΈ SYNOPSIS πΈ
struct d40_chan {
spinlock_t lock;
int log_num;
int pending_tx;
bool busy;
struct d40_phy_res *phy_chan;
struct dma_chan chan;
struct tasklet_struct tasklet;
struct list_head client;
struct list_head pending_queue;
struct list_head active;
struct list_head done;
struct list_head queue;
struct list_head prepare_queue;
struct stedma40_chan_cfg dma_cfg;
struct dma_slave_config slave_config;
bool configured;
struct d40_base *base;
u32 src_def_cfg;
u32 dst_def_cfg;
struct d40_def_lcsp log_def;
struct d40_log_lli_full *lcpa;
dma_addr_t runtime_addr;
enum dma_transfer_direction runtime_direction;
};
look at her. twenty-two members. main character energy fr fr π
π¦ Members π¦
okay so this is the part where we go member by member, no skipping, no "etc." β every single one gets her moment:
lockβ a spinlock whose whole job is protecting this struct. she's the bodyguard, no cap π«Άlog_numβ the logical number of this channel, if there is one. "if any" β sometimes she's logged, sometimes she's mysterious πpending_txβ how many transfers are still pending. this one gets passed back and forth between the interrupt handler and the tasklet, like a group chat relay π«‘busyβ gets set totruewhen a transfer is actively ongoing on this channel. she's booked and busy, literally πphy_chanβ pointer to the physical channel this instance is running on. and heads up: if this pointer isNULL, then the channel isn't allocated. gone. not it. πchanβ the DMA engine handle. that's the vibe check for the DMA engine.taskletβ a tasklet that gets scheduled from interrupt context so it can complete a transfer and call the client callback. she's doing the follow-up work after the interrupt pops off π₯clientβ the client-owned descriptor list. it's giving "your stuff, not mine" πpending_queueβ submitted jobs that are waiting to be issued byissue_pending. the queue before the queue, iykyk β¨activeβ the active descriptor. the one currently on stage πdoneβ completed jobs. the finished pile, iconic πqueueβ queued jobs. yes, there's alsopending_queueandprepare_queue. three queues, three vibes, don't @ me πprepare_queueβ prepared jobs. she's prepping before she preps, that's the level of organization we standma_cfgβ the client configuration of this dma channelslave_configβ DMA slave configurationconfiguredβ whether thedma_cfgconfiguration is valid. a boolean of truth πbaseβ pointer to the device instance structsrc_def_cfgβ default cfg register setting for srcdst_def_cfgβ default cfg register setting for dstlog_defβ default logical channel settingslcpaβ pointer to the dst and src lcpa settingsruntime_addrβ the runtime configured addressruntime_directionβ the runtime configured direction
π Description π
this struct can either "be" a logical channel or a physical channel β the quotes around "be" are doing a lot of heavy lifting here and honestly? she contains multitudes π§
β SEE ALSO β
go read these, bestie, they're all in the kernel file ./drivers/dma/ste_dma40.c:
struct stedma40_platform_data(9)enum d40_command(9)struct d40_interrupt_lookup(9)struct d40_reg_val(9)struct d40_lli_pool(9)struct d40_desc(9)struct d40_lcla_pool(9)struct d40_phy_res(9)struct d40_gen_dmac(9)struct d40_base(9)
okay bestie that's the whole page, every single member accounted for, nothing dropped, we ate and left no crumbs π β¨
and that's a wrap from ./drivers/dma, dated October 2026 β mwah, see you in the next manual page π«Άπ
π¦ 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