STRUCT UIO_INFO(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ struct uio_info(9) β€” like, the whole vibe of a UIO device, bestie πŸ¦‹

okay so this is from the Kernel API Manual, and it's literally the cheat sheet for struct uio_info β€” the thing that tells the kernel everything your UIO device can do ✨ no cap, this is the main character struct.


πŸ’– NAME πŸ’–

struct uio_info β€” UIO device capabilities 🫢

like… it's the capabilities list. for a UIO device. that's the whole assignment πŸ’…


🌸 SYNOPSIS 🌸

here's the struct in all its glory, typed out exactly, don't @ me:

struct uio_info {
    struct uio_device       *uio_dev;
    const char              *name;
    const char              *version;
    struct uio_mem          mem[MAX_UIO_MAPS];
    struct uio_port         port[MAX_UIO_PORT_REGIONS];
    long irq;
    unsigned long           irq_flags;
    void *priv;
    irqreturn_t (*handler)(int irq, struct uio_info *dev_info);
    int (*mmap_prepare)(struct uio_info *info, struct vm_area_desc *desc);
    int (*open)(struct uio_info *info, struct inode *inode);
    int (*release)(struct uio_info *info, struct inode *inode);
    int (*irqcontrol)(struct uio_info *info, s32 irq_on);
 };

πŸŽ€ Members πŸŽ€

bestie, let's go field by field, one by one, no skipping (I would never) πŸ’œ

  • uio_dev β€” the UIO device this info belongs to πŸ‘‘ like, whose info even is this
  • name β€” device name ✨ give it a cute one
  • version β€” device driver version πŸ”₯
  • mem β€” list of mappable memory regions, and size==0 means end of list 🧚 (the list just… stops, iconic)
  • port β€” list of port regions, size==0 for end of list πŸ™ˆ same deal
  • irq β€” interrupt number, or UIO_IRQ_CUSTOM ⭐
  • irq_flags β€” flags for request_irq πŸ’«
  • priv β€” optional private data πŸ“ optional!! it's giving low-maintenance
  • handler β€” the device's irq handler πŸ’€ the one actually doing the work
  • mmap_prepare β€” mmap_prepare operation for this uio device 🌈
  • open β€” open operation for this uio device πŸ’–
  • release β€” release operation for this uio device πŸ¦‹
  • irqcontrol β€” disable/enable irqs when 0/1 is written to /dev/uioX 🎯 (yes, that's the whole trigger, 0 or 1, periodt)

🌟 SEE ALSO 🌟

go read these next, iykyk πŸ“š

Kernel file ./include/linux/uio_driver.h, plus struct uio_mem(9), struct uio_port(9), uio_register_device(9), devm_uio_register_device(9) πŸ’…


okay that's the whole page, bestie πŸ’– huge slay. this one lives in ./include/linux, stamped October 2026, and it goes by struct uio_info(9) β€” go forth and register your devices πŸ«Άβœ¨πŸŽ€

πŸ“¦ where this page comes from