STRUCT LINEREQ(9)
β¨ 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 thelinesarray. β¨waitβ the wait queue that handles blocking reads of events. π¦device_unregistered_nbβ the notifier block for receivinggdevunregister events. πevent_buffer_sizeβ the number of elements allocated inevents. πΈ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 whennum_linesis 1, because theline_seqnois 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, withnum_lineselements. π
π₯ SEE ALSO π₯
- Kernel file
./drivers/gpio/gpiolib-cdev.c struct linehandle_state(9)struct line(9)struct lineevent_state(9)gpio_chrdev_open(9)gpio_chrdev_release(9)
mwah π β this one comes from ./drivers/gpio, October 2026, and yes bestie, it's literally struct linereq(9). π§
π¦ 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