Configure word length
This commit is contained in:
parent
91d135a12c
commit
fd5b663793
5 changed files with 19 additions and 22 deletions
|
@ -104,7 +104,8 @@ do_real_config (struct grub_serial_port *port)
|
|||
|
||||
/* Set the line status. */
|
||||
status |= (parities[port->config.parity]
|
||||
| port->config.word_len | stop_bits[port->config.stop_bits]);
|
||||
| (port->config.word_len - 5)
|
||||
| stop_bits[port->config.stop_bits]);
|
||||
grub_outb (status, port->port + UART_LCR);
|
||||
|
||||
/* In Yeeloong serial port has only 3 wires. */
|
||||
|
@ -185,6 +186,9 @@ serial_hw_configure (struct grub_serial_port *port,
|
|||
&& config->stop_bits != GRUB_SERIAL_STOP_BITS_2)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "unsupported stop bits");
|
||||
|
||||
if (config->word_len < 5 || config->word_len > 8)
|
||||
return grub_error (GRUB_ERR_BAD_ARGUMENT, "unsupported word length");
|
||||
|
||||
port->config = *config;
|
||||
port->configured = 0;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue