enqueue_events(9)
π enqueue_events(9) β the kernel API manual, bestie edition
Okay so real talk: this is enqueue_events from the Kernel API Manual, section 9, and it's the lil function that takes EC events and drops them in the queue so userspace can finally read them. She's a middle man. She's a vibe courier. Let's get into it. π
β¨ NAME β¨
enqueue_events β place EC events in queue to be read by userspace.
Yep, that's the whole job. She puts the events in the queue. Userspace reads them later. Slay, honestly. π
π¦ SYNOPSIS π¦
int enqueue_events (struct device *dev , const u8 *buf , u32 length );
Three args, one int coming back at you. That's the whole signature, no notes. β¨
πΈ ARGUMENTS πΈ
devβ the device the events came from. Gotta know who's calling, right? π«Άbufβ the buffer of event data. This is where the actual events are chilling.lengthβ the length of the event data buffer. She needs to know how muchbufthere is, that's just math bestie.
π§ DESCRIPTION π§
Okay so here's the tea. β
buf contains a number of ec_event's, packed one after the other. Like sardines. Like besties in a photobooth. π
Each ec_event is of variable length β so no, you can't just assume they're all the same size and vibe-check your way through, that's not how this works.
The algorithm, in order,ε δΈΊε₯Ή's thorough:
- Start with the first event.
- Copy it into a persistent
ec_event. - Store that entry in the queue.
- Move on to the next
ec_eventinbuf. - Repeat.
Copy, store, next, repeat. Copy, store, next, repeat. It's giving "loop with main character energy." π₯
The "persistent" part is doing a LOT of work there ngl β the event gets copied out so it survives, because buf is not gonna be around forever. π
π RETURN π
0β on success π- negative error code β on failure π (yeah she can fail, and when she does she reports back with a negative number, periodt)
π SEE ALSO π
The kernel file ./drivers/platform/chrome/wilco_ec/event.c β that's the neighborhood this whole thing lives in, go say hi. π‘
And the rest of the squad:
struct ec_event(9)struct ec_event_queue(9)struct event_device_data(9)event_device_notify(9)event_read(9)free_device_data(9)event_device_probe(9)
iykyk π
And that's the page, bestie! π«Ά Cute lil sign-off time: this one comes to you from ./drivers/platform/chrome/wilc... (yes it got cut off in the original, tragic, RIP) and it's dated October 2026. Live laugh love, and may your ec_events always be correctly parcelled out. πβ¨π
π¦ 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