uart_insert_char(9)
πΈ uart_insert_char(9) β the Kernel API Manual, but make it bestie-friendly πΈ
okay so welcome to the Kernel API Manual entry for uart_insert_char(9), and honestly? it's a little one-pager and it ate π
let's get into it.
β¨ NAME β¨
uart_insert_char β push a char to the uart layer π
like. you have a char. you want it in the uart layer. this is the function for that. slay.
π¦ SYNOPSIS π¦
void uart_insert_char (struct uart_port *port , unsigned int status ,
unsigned int overrun , u8 ch , u8 flag );
five arguments, one void, zero drama. (well. okay. some drama, there's an overrun mask involved, keep reading π«Ά)
π ARGUMENTS π
portβ the corresponding port. your port. the port in question. main character port energy πstatusβ the state of the serial port RX buffer (that'sLSRfor 8250, iykyk). basically the receipts of what the hardware is going through rn.overrunβ a mask of overrun bits instatus. yes, a mask, of the overrun bits, insidestatus. it's giving layered. it's giving onion. it's giving "please read the status carefully" π§ β¨chβ the character to push. the actual lil guy. the payload. theu8of the hour πflagβ the flag for the character (checkTTY_NORMALand friends, they're a whole friend group π)
π DESCRIPTION π
the user is responsible to call tty_flip_buffer_push when they are done with insertion. π this is you. this is your job. nobody else is gonna do it for you, bestie π
so like, uart_insert_char pushes the char in, right? but it does not push the flip buffer for you. that's on you. once you're done inserting, you call tty_flip_buffer_push. no cap. don't forget, fr fr π«Ά
β SEE ALSO β
the whole squad, in the order the manpage lists them, no rosters edited β
and all of it lives in the kernel file ./drivers/tty/serial/serial_core.c:
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_add_one_port(9)serial_core_remove_one_port(9)uart_match_port(9)uart_handle_dcd_change(9)uart_handle_cts_change(9)uart_try_toggle_sysrq(9)uart_get_rs485_mode(9)
and that's the page!! mwah π oh and the cute lil sign-off at the bottom says this one comes from ./drivers/tty/serial and it's dated October 2026 β iconic, timeless, 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