STRUCT COMEDI_SUBDINFO(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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 from enum 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 to 5 (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 the SDF_MAXDATA subdevice flag is clear πŸ“
  • flags β€” channel flags for all channels, whenever the SDF_FLAGS subdevice flag is clear πŸ’œ
  • range_type β€” the range type for all channels, whenever the SDF_RANGETYPE subdevice flag is clear. it encodes three things: the subdevice index (bits 27:24), a dummy channel index 0 (bits 23:16), and the range table length (bits 15: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 to COMEDI_SUPPORTED if the subdevice supports the INSN_BITS instruction, or COMEDI_UNSUPPORTED if 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 the COMEDI_SUBDINFO ioctl). so it's your fault, but make it official πŸ’…
  • SDF_LOCKED β€” the subdevice is locked by a COMEDI_LOCK ioctl. πŸ”’
  • SDF_LOCK_OWNER β€” the subdevice is locked by a COMEDI_LOCK ioctl 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 as SDF_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