mirror of
https://github.com/ipxe/ipxe
synced 2026-02-01 07:26:44 +03:00
[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>
This commit is contained in:
@@ -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 );
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user