uart_set_options(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– uart_set_options(9) πŸ’–

okay so this is a page from the Kernel API Manual (yes, the Kernel API Manual, we're fancy now) and it's all about uart_set_options β€” the little function that gets your serial console parameters set up. bestie, it's giving "backstage pass to the tty subsystem" and i'm obsessed. πŸŽ€


✨ NAME ✨

uart_set_options β€” setup the serial console parameters πŸ¦‹


🌸 SYNOPSIS 🌸

int uart_set_options (struct uart_port *port , struct console *co , int
baud , int parity , int bits , int flow );

like, yes, that's a whole lotta ints. it's fine. we get through it together. πŸ’œ


🌈 ARGUMENTS 🌈

  • port β€” pointer to the serial port's uart_port structure, aka the main character of this whole operation πŸ‘‘
  • co β€” the console pointer, no cap
  • baud β€” the baud rate ⭐
  • parity β€” the parity character, and it's one of these three cuties: 'n' (none), 'o' (odd), 'e' (even)
  • bits β€” number of data bits πŸ“
  • flow β€” flow control character β€” 'r' (rts)

πŸ”₯ DESCRIPTION πŸ”₯

Locking: the caller must hold console_list_lock in order to serialize early initialization of the serial-console lock. fr fr, this is not a suggestion, this is the assignment 😭 hold the lock or don't come to the function. πŸ’…

lowkey important: that locking rule is the entire description. don't skip it, bestie. πŸ™ˆ

🧚 SEE ALSO 🧚

Kernel file ./drivers/tty/serial/serial_core.c β€” here's the whole friend group, all linked up 🫢


and that's the page, bestie! this one lives in ./drivers/tty/serial and it's stamped October 2026 β€” so like, remember it fondly, and go hold that console_list_lock. slay. πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from