STRUCT COMEDI_BUFCONFIG(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸŽ€ 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