STRUCT D40_CHAN(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 to true when 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 is NULL, 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 by issue_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 also pending_queue and prepare_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 stan
  • dma_cfg β€” the client configuration of this dma channel
  • slave_config β€” DMA slave configuration
  • configured β€” whether the dma_cfg configuration is valid. a boolean of truth πŸ’–
  • base β€” pointer to the device instance struct
  • src_def_cfg β€” default cfg register setting for src
  • dst_def_cfg β€” default cfg register setting for dst
  • log_def β€” default logical channel settings
  • lcpa β€” pointer to the dst and src lcpa settings
  • runtime_addr β€” the runtime configured address
  • runtime_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