STRUCT IIO_DMA_BUFFER_BLOCK(9)
π struct iio_dma_buffer_block(9) β the Kernel API Manual, but make it make sense
okay bestie, so we're in the kernel API manual for struct iio_dma_buffer_block(9) β yes that's the whole title, no this isn't a drill π this is literally the struct that describes one IIO buffer block, and we're about to know her intimately.
β¨ NAME β¨
struct iio_dma_buffer_block β IIO buffer block. that's it, that's the name, short and iconic π
π¦ SYNOPSIS π¦
here's the whole struct, verbatim, don't touch a single character:
struct iio_dma_buffer_block {
struct list_head head;
size_t bytes_used;
void *vaddr;
dma_addr_t phys_addr;
size_t size;
struct iio_dma_buffer_queue *queue;
struct kref kref;
enum iio_block_state state;
bool cyclic;
bool fileio;
struct sg_table *sg_table;
struct dma_fence *fence;
};
like, look at her. twelve members. main character energy fr fr π
πΈ Members πΈ
every single field, no skipping, we don't do that here π«Ά
headβ the list head. she's astruct list_head, she links πbytes_usedβ number of bytes that actually contain valid data. not the whole thing, just the real ones β¨vaddrβ the virutal address of the block's memory (yes "virutal", that's genuinely what the doc says, not me being sloppy ππ). avoid *.phys_addrβ the physical address of the block's memory. adma_addr_t. the real-real address π₯sizeβ total size of the block, in bytes. the whole vibe, not just the used part πqueueβ the parent DMA buffer queue, as astruct iio_dma_buffer_queue *. who's her mom? that's her mom.krefβ astruct krefused to manage the lifetime of the block. keeping her alive, responsibly π§stateβ current state of the block, of typeenum iio_block_state. vibe check as a field πcyclicβ abool,trueif this is a cyclic buffer. she loops πfileioβ abool,trueif this buffer is used for fileio mode. lowkey a whole different mode πsg_tableβ DMA table for the transfer when transferring a DMABUF. astruct sg_table *that does the heavy lifting βfenceβ DMA fence to be signaled when a DMABUF transfer is complete. astruct dma_fence *. she's literally the "we're done here" signal, no cap π¦
π SEE ALSO π
go read these next, i'm obsessed:
- Kernel file
./include/linux/iio/buffer-dma.h enum iio_block_state(9)struct iio_dma_buffer_queue_fileio(9)struct iio_dma_buffer_queue(9)struct iio_dma_buffer_ops(9)
ngl this whole page is documented under./include/linux/iio, dated October 2026, and the footer is out here calling itselfstruct iio_dma_buffer_block(9)again like we forgot π
and that's the tea, bestie β periodt. go forth and buffer responsibly ππ
π¦ 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