summaryrefslogtreecommitdiff
path: root/usr/src/boot
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/boot')
-rw-r--r--usr/src/boot/sys/boot/efi/loader/comconsole.c49
1 files changed, 41 insertions, 8 deletions
diff --git a/usr/src/boot/sys/boot/efi/loader/comconsole.c b/usr/src/boot/sys/boot/efi/loader/comconsole.c
index 57168cca17..7fb19b11f1 100644
--- a/usr/src/boot/sys/boot/efi/loader/comconsole.c
+++ b/usr/src/boot/sys/boot/efi/loader/comconsole.c
@@ -310,28 +310,49 @@ comc_ischar(struct console *cp)
static char *
comc_asprint_mode(struct serial *sp)
{
- char par = 'n', *buf;
- int stop = 1;
+ char par, *buf;
+ char *stop;
if (sp == NULL)
return (NULL);
switch (sp->parity) {
- case NoParity: par = 'n';
+ case NoParity:
+ par = 'n';
break;
- case EvenParity: par = 'e';
+ case EvenParity:
+ par = 'e';
break;
- case OddParity: par = 'o';
+ case OddParity:
+ par = 'o';
+ break;
+ case MarkParity:
+ par = 'm';
+ break;
+ case SpaceParity:
+ par = 's';
+ break;
+ default:
+ par = 'n';
break;
}
+
switch (sp->stopbits) {
- case OneStopBit: stop = 1;
+ case OneStopBit:
+ stop = "1";
+ break;
+ case TwoStopBits:
+ stop = "2";
break;
- case TwoStopBits: stop = 2;
+ case OneFiveStopBits:
+ stop = "1.5";
+ break;
+ default:
+ stop = "1";
break;
}
- asprintf(&buf, "%ju,%d,%c,%d,-", sp->baudrate, sp->databits, par, stop);
+ asprintf(&buf, "%ju,%d,%c,%s,-", sp->baudrate, sp->databits, par, stop);
return (buf);
}
@@ -360,6 +381,10 @@ comc_parse_mode(struct serial *sp, const char *value)
return (CMD_ERROR);
switch (n) {
+ case 5: databits = 5;
+ break;
+ case 6: databits = 6;
+ break;
case 7: databits = 7;
break;
case 8: databits = 8;
@@ -376,6 +401,10 @@ comc_parse_mode(struct serial *sp, const char *value)
break;
case 'o': parity = OddParity;
break;
+ case 'm': parity = MarkParity;
+ break;
+ case 's': parity = SpaceParity;
+ break;
default:
return (CMD_ERROR);
}
@@ -387,6 +416,10 @@ comc_parse_mode(struct serial *sp, const char *value)
switch (*ep++) {
case '1': stopbits = OneStopBit;
+ if (ep[0] == '.' && ep[1] == '5') {
+ ep += 2;
+ stopbits = OneFiveStopBits;
+ }
break;
case '2': stopbits = TwoStopBits;
break;