STRUCT N_HDLC(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– NAME πŸ’–

struct n_hdlc β€” the per device instance data structure, bestie. it's literally the main character of this whole n_hdlc situation, and this page is its wiki 🫢

(this is struct n_hdlc(9), from the Kernel API Manual, if you were wondering what manual you wandered into ✨)

✨ SYNOPSIS ✨

okay so here's the whole struct, laid out, no edits, no vibes-based simplification, just the receipts πŸ‘‘

struct n_hdlc {
    bool tbusy;
    bool woke_up;
    struct n_hdlc_buf_list  tx_buf_list;
    struct n_hdlc_buf_list  rx_buf_list;
    struct n_hdlc_buf_list  tx_free_buf_list;
    struct n_hdlc_buf_list  rx_free_buf_list;
    struct work_struct      write_work;
    struct tty_struct       *tty_for_write_work;
 };

like she's giving "small struct, big responsibilities" and honestly? slay πŸŽ€


πŸŽ€ MEMBERS πŸŽ€

time for the member-by-member vibe check, one at a time, nothing skipped πŸ’…

  • tbusy β€” the reentrancy flag for the tx wakeup code. think of it as the "occupied!! do not disturb" sign for wakeup land πŸ™ˆ
  • woke_up β€” this is the little note-to-self that the tx wakeup needs to be run again, because it got called while tbusy was set. she was busy, the call got postponed, and this flag remembers 😭
  • tx_buf_list β€” list of pending transmit frame buffers. the outbox. the drafts folder. the "about to be sent" squad πŸ”₯
  • rx_buf_list β€” list of received frame buffers. everything that came in and is chilling here πŸ‘‘
  • tx_free_buf_list β€” list of unused transmit frame buffers. the spare, empty ones, waiting for their moment ⭐
  • rx_free_buf_list β€” list of unused received frame buffers. same energy, receive edition 🌸
  • write_work β€” work struct for deferred frame transmission. the whole "we'll send it later, we promise" arrangement πŸ¦‹
  • tty_for_write_work β€” pointer to the tty instance that write_work uses. literally who the write work belongs to πŸ’œ

not me listing all eight of them in order like a good student πŸ’€


🌈 SEE ALSO 🌈

the kernel file lives at ./drivers/tty/n_hdlc.c and honestly you should go read the whole thing, iykyk ✨

and here's the friend group, all of them, no cap, every single one 🫢


okay that's the whole page, bestie, you ate that πŸ’… and for the cute sign-off: this lives under ./drivers/tty, dated October 2026, and it's struct n_hdlc(9) β€” periodt πŸŽ€βœ¨

πŸ“¦ where this page comes from