STRUCT LINEREQ(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ NAME ✨

okay so bestie, meet struct linereq(9) from the Kernel API Manual β€” it's literally the struct that contains the state of a userspace line request. no cap, it's giving main-character energy for your GPIO line request lore. πŸ’…


🌸 SYNOPSIS 🌸

here's the exact shape of this cutie, bestie β€” field names and all, copy them character for character:

struct linereq {
    struct gpio_device *gdev;
    const char *label;
    u32 num_lines;
    wait_queue_head_t wait;
    struct notifier_block device_unregistered_nb;
    u32 event_buffer_size;
    struct gpio_v2_line_event *events;
    atomic_t seqno;
    struct mutex config_mutex;
    struct line lines[];
 };

🫢 Members 🫢

  • gdev β€” the GPIO device that this line request is all about. πŸ’–
  • label β€” the consumer label, aka the little tag used to tag GPIO descriptors. πŸŽ€
  • num_lines β€” the number of lines in the lines array. ✨
  • wait β€” the wait queue that handles blocking reads of events. πŸ¦‹
  • device_unregistered_nb β€” the notifier block for receiving gdev unregister events. πŸ‘‘
  • event_buffer_size β€” the number of elements allocated in events. 🌸
  • events β€” the KFIFO for the GPIO events. πŸ”₯
  • seqno β€” the sequence number for edge events generated on all lines in this line request. heads up though: this is not used when num_lines is 1, because the line_seqno is then the same and it's cheaper to calculate. πŸ’€
  • config_mutex β€” the mutex for serializing ioctl calls to ensure consistency of configuration, particularly those multi-step accesses to desc flags. 🫢
  • lines β€” the lines held by this line request, with num_lines elements. πŸ’œ

πŸ”₯ SEE ALSO πŸ”₯


mwah πŸ’‹ β€” this one comes from ./drivers/gpio, October 2026, and yes bestie, it's literally struct linereq(9). 🧚

πŸ“¦ where this page comes from