STRUCT SERDEV_DEVICE_OPS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ 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:


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