STRUCT MIPS_EJTAG_FDC_TTY_PORT(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ struct mips_ejtag_fdc_tty_port(9) πŸ¦‹

ok so this is a page from the Kernel API Manual, and bestie, it's literally the whole lore on one little wrapper struct πŸ’…


✨ NAME ✨

struct mips_ejtag_fdc_tty_port β€” the wrapper struct for an FDC tty_port, no cap 🫢


🌸 SYNOPSIS 🌸

struct mips_ejtag_fdc_tty_port {
    struct tty_port                  port;
    struct mips_ejtag_fdc_tty       *driver;
    raw_spinlock_t rx_lock;
    void *rx_buf;
    spinlock_t xmit_lock;
    unsigned int                     xmit_cnt;
    unsigned int                     xmit_head;
    unsigned int                     xmit_tail;
    struct completion                xmit_empty;
 };

like… look at her. iconic. πŸ‘‘


πŸŽ€ Members πŸŽ€

okay so here's the member-by-member rundown, and every single one is important so don't skip πŸ™ˆ

  • port β€” the TTY port data. that's the whole vibe of the thing πŸ’–
  • driver β€” the TTY driver. the main character, honestly ✨
  • rx_lock β€” the lock for rx_buf. it protects between the hard interrupt and user context. it's also held during read SWITCH operations. so like, it's doing a lot of work, respect her πŸ’…
  • rx_buf β€” the read buffer. the little home where the incoming bytes chill 🏠
  • xmit_lock β€” the lock for xmit_*, and for port.xmit_buf. it protects between user context and the kernel thread. and listen πŸ‘€ it gets used from the chars_in_buffer/write_room TTY callbacks, which are used during wait operations β€” so a mutex is unsuitable here. like, a mutex literally cannot sit with her. not the vibe. no cap πŸ”₯
  • xmit_cnt β€” the size of the xmit buffer contents πŸ“
  • xmit_head β€” the head of the xmit buffer, where data is written ✍️
  • xmit_tail β€” the tail of the xmit buffer, where data is read πŸ“–
  • xmit_empty β€” the completion for the xmit buffer being empty. she's the "we're done here" notification πŸŽ€

🌈 SEE ALSO 🌈

bestie there is a whole friend group, go say hi to all of them 🫢


πŸ’€ reminder bestie: xmit_lock is a spinlock for a reason β€” it's reachable from chars_in_buffer/write_room callbacks during wait operations, so a mutex is unsuitable. don't go swapping it, i'm begging πŸ™

and that's the whole page!! sign-off time 🧚

this absolute banger lives in ./drivers/tty, dated October 2026, and it's filed under struct mips_...fdc_tty_port(9) in the Kernel API Manual. slay, go read the kernel source, ily πŸ’œβœ¨

πŸ“¦ where this page comes from