/* Sets the control bits on a serial device. */
RETURN_STATUS EFIAPI SerialPortSetControl(IN UINT32 Control)
/* Sets the control bits on a serial device. */
RETURN_STATUS EFIAPI SerialPortSetControl(IN UINT32 Control)
{
  UINT8  Mcr;
  if ((Control & (~(EFI_SERIAL_REQUEST_TO_SEND | EFI_SERIAL_DATA_TERMINAL_READY))) != 0) {
    return RETURN_UNSUPPORTED;
  }
  Mcr  = IoRead8 ((UINT16)gUartBase + MCR_OFFSET);
  Mcr &= (~(MCR_DTRC | MCR_RTS));
  if ((Control & EFI_SERIAL_DATA_TERMINAL_READY) == EFI_SERIAL_DATA_TERMINAL_READY) {
    Mcr |= MCR_DTRC;
  }
  if ((Control & EFI_SERIAL_REQUEST_TO_SEND) == EFI_SERIAL_REQUEST_TO_SEND) {
    Mcr |= MCR_RTS;
  }
  IoWrite8 ((UINT16)gUartBase + MCR_OFFSET, Mcr);
  return RETURN_SUCCESS;
}