STRUCT SERDEV_DEVICE_OPS(9)
β¨ struct serdev_device_ops(9) β¨
okay so bestie, welcome to the Kernel API Manual π β this little page is all about struct serdev_device_ops, and it's genuinely not as scary as it looks, i promise. it's just the callback ops for a serdev device, no cap.
π NAME π
struct serdev_device_ops β the callback operations for a serdev device. that's it, that's the vibe. π¦
πΈ SYNOPSIS πΈ
here's the whole struct, copied exactly because i would never mess with your code:
struct serdev_device_ops {
size_t (*receive_buf)(struct serdev_device *, const u8 *, size_t);
void (*write_wakeup)(struct serdev_device *);
};
two function pointers, two moods. let's get into them π
β Members β
receive_bufβ this one gets called whenever data comes in from the device π₯ it returns the number of bytes accepted, and heads up: it may sleep π΄ so don't go calling it from somewhere that can't handle a lil nap.write_wakeupβ this one fires when you're ready to transmit more data β¨ and the big rule here? it must not sleep π«π΄ not even a little. keep it quick, keep it awake, periodt.
π SEE ALSO π
go peek at the kernel file ./include/linux/serdev.h and then these iconic friends:
struct serdev_device(9)struct serdev_device_driver(9)struct serdev_controller(9)serdev_device_put(9)serdev_controller_put(9)serdev_device_driver_unregister(9)
and that's the whole page, bestie π«Ά this came from ./include/linux, dated October 2026, and it's literally titled struct serdev_device_ops(9) β go forth and slay your serdev callbacks ππ
π¦ 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