STRUCT COMEDI_SUBDINFO(9)
β¨ struct comedi_subdinfo(9) β¨
okay bestie, settle in π
this is a kernel API manual page for struct comedi_subdinfo, and it's literally the little info packet that tells you everything about a subdevice. no cap, it's giving "backstage pass to the hardware" energy π
πΈ NAME πΈ
struct comedi_subdinfo β used to retrieve information about a subdevice π
β¨ SYNOPSIS β¨
struct comedi_subdinfo {
unsigned int type;
unsigned int n_chan;
unsigned int subd_flags;
unsigned int timer_type;
unsigned int len_chanlist;
unsigned int maxdata;
unsigned int flags;
unsigned int range_type;
unsigned int settling_time_0;
unsigned int insn_bits_support;
unsigned int unused[8];
};
π¦ Members π¦
typeβ the subdevice's type, straight fromenum comedi_subdevice_type. iykyk π«Άn_chanβ how many channels this subdevice supports. the channel headcount fr fr πsubd_flagsβ a whole mix of static and dynamic flags describing different aspects of the subdevice plus its current state. it's giving "mood ring but make it bitmasks" πtimer_typeβ the timer type. always set to5(the "nanosecond timer"). iconic, consistent, never changes πlen_chanlistβ the maximum length of a channel list, but only if the subdevice supports asynchronous acquisition commands. conditional queen β¨maxdataβ the maximum sample value for all channels, whenever theSDF_MAXDATAsubdevice flag is clear πflagsβ channel flags for all channels, whenever theSDF_FLAGSsubdevice flag is clear πrange_typeβ the range type for all channels, whenever theSDF_RANGETYPEsubdevice flag is clear. it encodes three things: the subdevice index (bits27:24), a dummy channel index0(bits23:16), and the range table length (bits15:0). she's packed, she's layered, she's doing the most πsettling_time_0β literally not used. that's it, that's the whole member πinsn_bits_supportβ set toCOMEDI_SUPPORTEDif the subdevice supports theINSN_BITSinstruction, orCOMEDI_UNSUPPORTEDif it does not. binary vibes only πunusedβ reserved for future use. the placeholder bestie, holding space for tomorrow πΈ
π Description π
so here's the tea: this struct goes with the COMEDI_SUBDINFO ioctl, which copies an array of struct comedi_subdinfo back to user space, with one element per subdevice. to actually use this you need to know the number of subdevices, and you get that from the COMEDI_DEVINFO ioctl. no skipping steps, bestie π€
these are the subd_flags values that may be ORed together... π
SDF_BUSYβ the subdevice is busy processing an asynchronous command or a synchronous instruction. she's occupied, do not disturb πSDF_BUSY_OWNERβ the subdevice is busy processing an asynchronous acquisition command that was started on the current file object (the file object issuing theCOMEDI_SUBDINFOioctl). so it's your fault, but make it official πSDF_LOCKEDβ the subdevice is locked by aCOMEDI_LOCKioctl. πSDF_LOCK_OWNERβ the subdevice is locked by aCOMEDI_LOCKioctl from the current file object. you did the locking, congrats πSDF_MAXDATAβ maximum sample values are channel-specific. β¨SDF_FLAGSβ channel flags are channel-specific. πSDF_RANGETYPEβ range types are channel-specific. πSDF_PWM_COUNTERβ PWM can switch off automatically. β‘SDF_PWM_HBRIDGEβ or PWM is signed (H-bridge). π¦SDF_CMDβ the subdevice supports asynchronous commands. π₯SDF_SOFT_CALIBRATEDβ the subdevice uses software calibration. π§SDF_CMD_WRITEβ the subdevice supports asynchronous commands in the output ("write") direction. βοΈSDF_CMD_READβ the subdevice supports asynchronous commands in the input ("read") direction. πSDF_READABLEβ the subdevice is readable (e.g. analog input). πSDF_WRITABLE(aliased asSDF_WRITEABLE) β the subdevice is writable (e.g. analog output). yes bestie, there are two spellings, both valid, don't come for me πSDF_INTERNALβ the subdevice has no externally visible lines. private account energy πSDF_GROUNDβ the subdevice can use ground as an analog reference. πSDF_COMMONβ the subdevice can use a common analog reference. π€SDF_DIFFβ the subdevice can use differential inputs (or outputs). ββSDF_OTHERβ the subdevice can use some other analog reference. the mystery option πSDF_DITHERβ the subdevice can do dithering. β¨SDF_DEGLITCHβ the subdevice can do deglitching. π§ΌSDF_MMAPβ this is never set. ever. don't ask, it's just not happening π ββοΈSDF_RUNNINGβ an asynchronous command is still running. πββοΈSDF_LSAMPLβ the subdevice uses "long" (32-bit) samples (for asynchronous command data). 32-bit and thriving πͺSDF_PACKEDβ the subdevice packs several DIO samples into a single sample (for asynchronous command data). compression queen π
heads up bestie: no "channel flags" (flags) values are currently defined at all. empty list, zero entries, nothing to see π
π₯ SEE ALSO π₯
Kernel file ./include/uapi/linux/comedi.h, plus these absolute icons:
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_devinfo(9)struct comedi_devconfig(9)struct comedi_bufconfig(9)struct comedi_bufinfo(9)
aaaand that's the page!! π«Ά this one came from the kernel file under ./include/uapi/linux, dated October 2026, and it's struct comedi_subdinfo(9) β go forth and read your subdevice info, bestie, you've got this πβ¨π
π¦ 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