STRUCT COMEDI_RANGEINFO(9)
π 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, oneunsigned int, she's efficient β¨range_ptrβ a pointer to an array ofstruct comedi_krangethat'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
- 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