/* Clear the port interrupt and error status. It will also clear HBA interrupt status. */
VOID EFIAPI AhciClearPortStatus(IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT8 Port)
/* Clear the port interrupt and error status. It will also clear HBA interrupt status. */
VOID EFIAPI AhciClearPortStatus(IN EFI_PCI_IO_PROTOCOL *PciIo, IN UINT8 Port)
{
  UINT32  Offset;
  Offset = EFI_AHCI_PORT_START + Port * EFI_AHCI_PORT_REG_WIDTH + EFI_AHCI_PORT_SERR;
  AhciWriteReg (PciIo, Offset, AhciReadReg (PciIo, Offset));
  Offset = EFI_AHCI_PORT_START + Port * EFI_AHCI_PORT_REG_WIDTH + EFI_AHCI_PORT_IS;
  AhciWriteReg (PciIo, Offset, AhciReadReg (PciIo, Offset));
  AhciWriteReg (PciIo, EFI_AHCI_IS_OFFSET, AhciReadReg (PciIo, EFI_AHCI_IS_OFFSET));
}