summaryrefslogtreecommitdiffstats
path: root/src/include
diff options
context:
space:
mode:
authorMichael Brown2025-11-05 13:16:22 +0100
committerMichael Brown2025-11-05 13:18:17 +0100
commit08d4d7fe9db04c8f44ac063d4b722fb3e8f3fffe (patch)
tree082fb1f6e8efd467bf0c7709e52ba0008e7bfc64 /src/include
parent[uart] Support 16550 UARTs accessed via either MMIO or port I/O (diff)
downloadipxe-08d4d7fe9db04c8f44ac063d4b722fb3e8f3fffe.tar.gz
ipxe-08d4d7fe9db04c8f44ac063d4b722fb3e8f3fffe.tar.xz
ipxe-08d4d7fe9db04c8f44ac063d4b722fb3e8f3fffe.zip
[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 <mcb30@ipxe.org>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/ipxe/uart.h11
1 files changed, 6 insertions, 5 deletions
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 );
}
/**