STRUCT IIO_DEV(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ struct iio_dev(9) ✨

okay so bestie, welcome to the manual page for struct iio_dev β€” the industrial I/O device. this is the man page struct iio_dev(9) from the Kernel API Manual, and we're gonna make it make sense together. periodt πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

struct iio_dev {
    int modes;
    struct device                   dev;
    struct iio_buffer               *buffer;
    int scan_bytes;
    unsigned int                    scan_timestamp_offset;
    const unsigned long             *available_scan_masks;
    unsigned int                    masklength;
    const unsigned long             *active_scan_mask;
    bool scan_timestamp;
    struct iio_trigger              *trig;
    struct iio_poll_func            *pollfunc;
    struct iio_poll_func            *pollfunc_event;
    struct iio_chan_spec const      *channels;
    int num_channels;
    const char                      *name;
    const char                      *label;
    const struct iio_info           *info;
    const struct iio_buffer_setup_ops       *setup_ops;
    void *priv;
 };

🌸 Members 🌸

no cap, here's the breakdown of every single member. i got you 🫢

  • modes β€” [DRIVER] a bitmask listing all the operating modes your IIO device supports. this list should be initialized before you register the IIO device. it can also get filled up by the IIO core as a result of enabling particular features in the driver (peep iio_triggered_event_setup for that one). slay πŸ”₯
  • dev β€” [DRIVER] the device structure. should be assigned a parent and owner. iconic behavior tbh πŸ‘‘
  • buffer β€” [DRIVER] any buffer that's present. it's giving "whatever buffer you got" πŸ’€
  • scan_bytes β€” [INTERN] num bytes captured to be fed to buffer demux. literally the byte count for the demux feed πŸŽ€
  • scan_timestamp_offset β€” [INTERN] cache of the offset (in bytes) for the timestamp in the scan buffer. lowkey just a lil cached offset moment ✨
  • available_scan_masks β€” [DRIVER] optional array of allowed bitmasks. sort the array in order of preference, the most preferred masks first. main character ordering energy fr fr 🌟
  • masklength β€” [INTERN] the length of the mask established from channels. the way this ties back to channels... iykyk πŸ”—
  • active_scan_mask β€” [INTERN] union of all scan masks requested by buffers. union slay πŸ’…
  • scan_timestamp β€” [INTERN] set if any buffers have requested timestamp. it's a bool, it's giving yes/no, iconic πŸ’–
  • trig β€” [INTERN] current device trigger (buffer modes). the trigger bestie 🎯
  • pollfunc β€” [DRIVER] function run on trigger being received. run bestie run πŸƒβ€β™€οΈ
  • pollfunc_event β€” [DRIVER] function run on events trigger being received. events edition, we love to see it πŸŽͺ
  • channels β€” [DRIVER] channel specification structure table. the channel table, obsessed πŸ—‚οΈ
  • num_channels β€” [DRIVER] number of channels specified in channels. literally just the count, periodt πŸ”’
  • name β€” [DRIVER] name of the device. the name!! 🏷️
  • label β€” [DRIVER] unique name to identify which device this is. unique label so you know who's who in the group chat πŸ’¬
  • info β€” [DRIVER] callbacks and constant info from driver. the callback lore πŸ“ž
  • setup_ops β€” [DRIVER] callbacks to call before and after buffer enable/disable. before AND after, she does both πŸ’ƒ
  • priv β€” [DRIVER] reference to driver's private information. MUST be accessed ONLY via the iio_priv helper. okay this is serious bestie β€” MUST and ONLY, no negotiating, do not come for her πŸ™…β€β™€οΈ
πŸ’€ real talk: priv is MUST be accessed ONLY via iio_priv. don't try her. the caps lock is there for a reason.

πŸŽ€ SEE ALSO πŸŽ€

bestie, go down the rabbit hole β€” kernel file ./include/linux/iio/iio.h plus all of these:


🌈 and that's the whole struct bestie. every field, every flag, every vibe. you're gonna do amazing. mwah πŸ’‹

sending you good vibes from the kernel source, ./include/linux/iio 🌸 β€” October 2026, struct iio_dev(9). stay iconic, stay privileged (the access kind, not the other kind) πŸ˜­πŸ’œ

πŸ“¦ where this page comes from