From 08d4d7fe9db04c8f44ac063d4b722fb3e8f3fffe Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Wed, 5 Nov 2025 12:16:22 +0000 Subject: [uart] Make baud rate a property of the UART Make the current baud rate (if specified) a property of the UART, to allow the default_serial_console() function to specify the default baud rate as well as the default UART device. Signed-off-by: Michael Brown --- src/include/ipxe/uart.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/include') diff --git a/src/include/ipxe/uart.h b/src/include/ipxe/uart.h index 15adfa932..f2ecf3ce9 100644 --- a/src/include/ipxe/uart.h +++ b/src/include/ipxe/uart.h @@ -22,6 +22,9 @@ struct uart { /** List of registered UARTs */ struct list_head list; + /** Baud rate (if specified) */ + unsigned int baud; + /** UART operations */ struct uart_operations *op; /** Driver-private data */ @@ -56,10 +59,9 @@ struct uart_operations { * Initialise UART * * @v uart UART - * @v baud Baud rate, or zero to leave unchanged * @ret rc Return status code */ - int ( * init ) ( struct uart *uart, unsigned int baud ); + int ( * init ) ( struct uart *uart ); /** * Flush transmitted data * @@ -109,13 +111,12 @@ uart_receive ( struct uart *uart ) { * Initialise UART * * @v uart UART - * @v baud Baud rate, or zero to leave unchanged * @ret rc Return status code */ static inline __attribute__ (( always_inline )) int -uart_init ( struct uart *uart, unsigned int baud ) { +uart_init ( struct uart *uart ) { - return uart->op->init ( uart, baud ); + return uart->op->init ( uart ); } /** -- cgit v1.2.3-55-g7522