2010-04-19 21:16:01 +02:00
|
|
|
#include <ipxe/init.h>
|
|
|
|
#include <ipxe/serial.h>
|
2011-03-09 21:09:26 +01:00
|
|
|
#include <ipxe/console.h>
|
2012-03-26 18:25:08 +02:00
|
|
|
#include <config/console.h>
|
2008-06-04 22:00:46 +02:00
|
|
|
|
|
|
|
/** @file
|
|
|
|
*
|
|
|
|
* Serial console
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2012-03-26 18:25:08 +02:00
|
|
|
/* Set default console usage if applicable */
|
|
|
|
#if ! ( defined ( CONSOLE_SERIAL ) && CONSOLE_EXPLICIT ( CONSOLE_SERIAL ) )
|
|
|
|
#undef CONSOLE_SERIAL
|
2012-03-27 01:51:10 +02:00
|
|
|
#define CONSOLE_SERIAL ( CONSOLE_USAGE_ALL & ~CONSOLE_USAGE_LOG )
|
2012-03-26 18:25:08 +02:00
|
|
|
#endif
|
|
|
|
|
2008-06-04 22:00:46 +02:00
|
|
|
struct console_driver serial_console __console_driver;
|
|
|
|
|
|
|
|
static void serial_console_init ( void ) {
|
2012-10-05 16:14:12 +02:00
|
|
|
/*
|
|
|
|
* Check if serial driver initialization is done.
|
|
|
|
* If so, it's time to enable the serial console.
|
|
|
|
*/
|
|
|
|
if ( serial_initialized )
|
|
|
|
serial_console.disabled = 0;
|
2008-06-04 22:00:46 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
struct console_driver serial_console __console_driver = {
|
|
|
|
.putchar = serial_putc,
|
|
|
|
.getchar = serial_getc,
|
|
|
|
.iskey = serial_ischar,
|
|
|
|
.disabled = 1,
|
2012-03-26 18:25:08 +02:00
|
|
|
.usage = CONSOLE_SERIAL,
|
2008-06-04 22:00:46 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Serial console initialisation function
|
|
|
|
*/
|
|
|
|
struct init_fn serial_console_init_fn __init_fn ( INIT_CONSOLE ) = {
|
|
|
|
.initialise = serial_console_init,
|
|
|
|
};
|