STRUCT COMEDI_RANGEINFO(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– STRUCT COMEDI_RANGEINFO(9) πŸ’–

okay so this is the kernel API manual page for struct comedi_rangeinfo, and bestie, it's literally the little struct that goes and fetches the range table for a channel. that's the whole vibe. iykyk πŸ¦‹


✨ NAME ✨

struct comedi_rangeinfo β€” used to retrieve the range table for a channel πŸ’…


🌸 SYNOPSIS 🌸

struct comedi_rangeinfo {
    unsigned int range_type;
    void __user *range_ptr;
 };

that's it, that's the struct, two members, main character energy only πŸŽ€


🧚 MEMBERS 🧚

  • range_type β€” okay so this one's doing a whole lot of encoding, no cap. it packs the subdevice index into bits 31:24, the channel index into bits 23:16, and the range table length into bits 15:0. three things, one unsigned int, she's efficient ✨
  • range_ptr β€” a pointer to an array of struct comedi_krange that's gonna get filled in with the range table for the channel or subdevice. it's giving "bring your own buffer" 🫢

πŸ’œ DESCRIPTION πŸ’œ

so this struct is what you use with the COMEDI_RANGEINFO ioctl to retrieve the range table β€” either for one specific channel (when the subdevice has the SDF_RANGETYPE flag set, which is the signal that the range table depends on the channel), or for the subdevice as a whole (when the SDF_RANGETYPE flag is clear, meaning the range table is shared by all the channels). two modes, one struct, iconic honestly πŸ‘‘

the range_type value is an input to the ioctl, and where does it come from? from a previous use of the COMEDI_SUBDINFO ioctl if the SDF_RANGETYPE flag is clear, or from the COMEDI_CHANINFO ioctl if the SDF_RANGETYPE flag is set. so like, you don't just make this number up, bestie β€” go get it from the right place first πŸ’€

fr fr, keep track of which flag is set before you go picking your source ioctl, because range_type is an input here, not an output πŸ™ˆ

🌈 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_krange(9)
  • struct comedi_subdinfo(9)
  • struct comedi_devinfo(9)
  • struct comedi_devconfig(9)
  • struct comedi_bufconfig(9)
  • struct comedi_bufinfo(9)

like, the whole comedi friend group, we love a linked list of besties 🫢✨


✨ and that's the page!! ✨ this one lives in ./include/uapi/linux, dated October 2026 β€” slay, go read the other comedi pages, ily, bye πŸ’–πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from