Configure word length

This commit is contained in:
Vladimir 'phcoder' Serbinenko 2010-07-18 15:07:59 +02:00
parent 91d135a12c
commit fd5b663793
5 changed files with 19 additions and 22 deletions

View file

@ -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;