STRUCT N_HDLC(9)
π 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 whiletbusywas 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 thatwrite_workuses. 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 π«Ά
n_hdlc_tty_close(9)n_hdlc_tty_open(9)n_hdlc_send_frames(9)n_hdlc_tty_write_work(9)n_hdlc_tty_wakeup(9)n_hdlc_tty_receive(9)n_hdlc_tty_read(9)n_hdlc_tty_write(9)n_hdlc_tty_ioctl(9)n_hdlc_tty_poll(9)n_hdlc_alloc(9)n_hdlc_buf_return(9)n_hdlc_buf_put(9)n_hdlc_buf_get(9)
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
- 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