stand: eficom: Don't preemtively assume flow control
Remove rtsdtr_off. It's basically unused. Expand its meaning, but put changing flow control to under an ifdef. We shouldn't set it unless we're sure we need to do so. UEFI normally initializes the device correctly, and we should avoid needless changes that aren't user requested. Sponsored by: Netflix Reviewed by: tsoome Differential Revision: https://reviews.freebsd.org/D40009
This commit is contained in:
parent
66826fd54a
commit
cb2da74905
@ -47,7 +47,6 @@ struct serial {
|
|||||||
uint32_t databits;
|
uint32_t databits;
|
||||||
EFI_PARITY_TYPE parity;
|
EFI_PARITY_TYPE parity;
|
||||||
EFI_STOP_BITS_TYPE stopbits;
|
EFI_STOP_BITS_TYPE stopbits;
|
||||||
uint32_t rtsdtr_off; /* boolean */
|
|
||||||
int ioaddr; /* index in handles array */
|
int ioaddr; /* index in handles array */
|
||||||
EFI_HANDLE currdev; /* current serial device */
|
EFI_HANDLE currdev; /* current serial device */
|
||||||
EFI_HANDLE condev; /* EFI Console device */
|
EFI_HANDLE condev; /* EFI Console device */
|
||||||
@ -275,7 +274,6 @@ comc_probe(struct console *sc)
|
|||||||
comc_port->databits = 8;
|
comc_port->databits = 8;
|
||||||
comc_port->parity = DefaultParity;
|
comc_port->parity = DefaultParity;
|
||||||
comc_port->stopbits = DefaultStopBits;
|
comc_port->stopbits = DefaultStopBits;
|
||||||
comc_port->rtsdtr_off = 0; /* rts-dtr is on */
|
|
||||||
|
|
||||||
handle = NULL;
|
handle = NULL;
|
||||||
env = getenv("efi_com_port");
|
env = getenv("efi_com_port");
|
||||||
@ -515,7 +513,6 @@ static bool
|
|||||||
comc_setup(void)
|
comc_setup(void)
|
||||||
{
|
{
|
||||||
EFI_STATUS status;
|
EFI_STATUS status;
|
||||||
UINT32 control;
|
|
||||||
char *ev;
|
char *ev;
|
||||||
|
|
||||||
/* port is not usable */
|
/* port is not usable */
|
||||||
@ -544,18 +541,17 @@ comc_setup(void)
|
|||||||
return (false);
|
return (false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef EFI_FORCE_RTS
|
||||||
if (comc_port->sio->GetControl != NULL && comc_port->sio->SetControl != NULL) {
|
if (comc_port->sio->GetControl != NULL && comc_port->sio->SetControl != NULL) {
|
||||||
|
UINT32 control;
|
||||||
|
|
||||||
status = comc_port->sio->GetControl(comc_port->sio, &control);
|
status = comc_port->sio->GetControl(comc_port->sio, &control);
|
||||||
if (EFI_ERROR(status))
|
if (EFI_ERROR(status))
|
||||||
return (false);
|
return (false);
|
||||||
if (comc_port->rtsdtr_off) {
|
control |= EFI_SERIAL_REQUEST_TO_SEND;
|
||||||
control &= ~(EFI_SERIAL_REQUEST_TO_SEND |
|
|
||||||
EFI_SERIAL_DATA_TERMINAL_READY);
|
|
||||||
} else {
|
|
||||||
control |= EFI_SERIAL_REQUEST_TO_SEND;
|
|
||||||
}
|
|
||||||
(void) comc_port->sio->SetControl(comc_port->sio, control);
|
(void) comc_port->sio->SetControl(comc_port->sio, control);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
/* Mark this port usable. */
|
/* Mark this port usable. */
|
||||||
eficom.c_flags |= (C_PRESENTIN | C_PRESENTOUT);
|
eficom.c_flags |= (C_PRESENTIN | C_PRESENTOUT);
|
||||||
return (true);
|
return (true);
|
||||||
|
Loading…
Reference in New Issue
Block a user