serial_core_add_one_port(9)
π serial_core_add_one_port(9) π
okay so bestie, welcome to the Kernel API Manual, section 9 β this one's all about attaching a driver-defined port structure and honestly? it's giving backstage-pass energy ποΈβ¨
β¨ NAME β¨
serial_core_add_one_port β attach a driver-defined port structure π«Ά
πΈ SYNOPSIS πΈ
int serial_core_add_one_port (struct uart_driver *drv , struct uart_port
*uport );
π ARGUMENTS π
drvβ pointer to the uart low level driver structure for this port πuportβ uart port structure to use for this port π
π¦ CONTEXT π¦
task context, might sleep π΄ β like, literally, this thing is allowed to nap, so don't go calling it from somewhere spicy where sleeping is a crime, ngl.
β DESCRIPTION β
so the whole vibe here is this: this lets the driver drv register its own uart_port structure with the core driver. that's the entire main character moment π«
the main purpose? it lets the low level uart drivers expand uart_port instead of having, like, yet more levels of structures piled on top of each other π (we been knew, enough layering already).
π heads up bestie β the caller must hold port_mutex. no cap, that's not optional, that's the rule.
π SEE ALSO π
kernel file ./drivers/tty/serial/serial_core.c and, like, the whole friend group:
uart_write_wakeup(9)uart_update_timeout(9)uart_get_baud_rate(9)uart_get_divisor(9)uart_get_lsr_info(9)uart_console_write(9)uart_parse_earlycon(9)uart_parse_options(9)uart_set_options(9)uart_change_pm(9)uart_register_driver(9)uart_unregister_driver(9)serial_core_remove_one_port(9)uart_match_port(9)uart_handle_dcd_change(9)uart_handle_cts_change(9)uart_insert_char(9)uart_try_toggle_sysrq(9)uart_get_rs485_mode(9)
and that's the whole page, bestie π go forth and register those ports responsibly β¨
sign-off cuteness: this lil masterpiece lives in ./drivers/tty/serial, dropped October 2026, and it's filed under serial_core_add_one_port(9) ππ mwah, ily, happy hacking π§ββοΈ
π¦ 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