STRUCT COMEDI_BUFCONFIG(9)
π struct comedi_bufconfig(9) π
okay bestie, welcome to the Kernel API Manual β this one's all about struct comedi_bufconfig, and honestly? it's giving "small struct, big responsibilities" π
β¨ NAME β¨
struct comedi_bufconfig β the struct you use to set or get the buffer size for a subdevice. that's it, that's the whole vibe π«Ά
πΈ SYNOPSIS πΈ
struct comedi_bufconfig {
unsigned int subdevice;
unsigned int flags;
unsigned int maximum_size;
unsigned int size;
unsigned int unused[4];
};
π Members π
subdeviceβ the subdevice index. which subdevice we're talking about, no cap πflagsβ literally not used. it's just sitting there. iconic but unemployed πmaximum_sizeβ the biggest buffer size you're allowed to have.sizeβ the buffer size. the actual one. the main character πunusedβ reserved for future use. it's a[4]array of pure potential β¨
π¦ Description π¦
so here's the tea, bestie π this struct gets used with the COMEDI_BUFCONFIG ioctl to get or configure the maximum buffer size and the current buffer size for a COMEDI subdevice β but only one that supports asynchronous commands, iykyk.
if the subdevice does not support asynchronous commands, then maximum_size and size are just ignored and set to 0. like, they don't even get a chance π
on ioctl input, non-zero values of maximum_size and size specify a new maximum size and a new current size (in bytes), respectively. both of these will be rounded up to a multiple of PAGE_SIZE π and heads up β specifying a new maximum size requires admin capabilities. so yeah, bring your permission slip π
on ioctl output, maximum_size and size are set to the current maximum buffer size and the current buffer size, respectively. that's the whole read-back situation, slay β
β¨ quick recap for the group chat: input = you set it (needs admin for the max), output = it tells you what it currently is. PAGE_SIZE rounding applies. no async support? zeros. periodt π
π₯ SEE ALSO π₯
- Kernel file
./include/uapi/linux/comedi.h enum comedi_subdevice_type(9)enum comedi_io_direction(9)enum configuration_ids(9)enum comedi_digital_trig_op(9)enum comedi_support_level(9)enum comedi_counter_status_flags(9)struct comedi_insn(9)struct comedi_insnlist(9)struct comedi_cmd(9)struct comedi_chaninfo(9)struct comedi_rangeinfo(9)struct comedi_krange(9)struct comedi_subdinfo(9)struct comedi_devinfo(9)struct comedi_devconfig(9)struct comedi_bufinfo(9)
and that's the whole page, bestie! π it lives over in ./include/uapi/linux and this particular glow-up is dated October 2026 β go forth and configure those buffers 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