UINTN FlBaseAddrReg; \r
EFI_PCI_IO_PROTOCOL *PciIo; \r
USB_HC_DEV *HcDev;\r
+ UINT64 Supports;\r
\r
HcDev = NULL;\r
\r
//\r
Status = PciIo->Attributes (\r
PciIo,\r
- EfiPciIoAttributeOperationEnable,\r
- EFI_PCI_DEVICE_ENABLE,\r
- NULL\r
+ EfiPciIoAttributeOperationSupported,\r
+ 0,\r
+ &Supports\r
);\r
+ if (!EFI_ERROR (Status)) {\r
+ Supports &= EFI_PCI_DEVICE_ENABLE;\r
+ Status = PciIo->Attributes (\r
+ PciIo,\r
+ EfiPciIoAttributeOperationEnable,\r
+ Supports,\r
+ NULL\r
+ );\r
+ }\r
if (EFI_ERROR (Status)) {\r
gBS->CloseProtocol (\r
Controller,\r
--*/\r
{\r
USB_HC_DEV *HcDev;\r
+ EFI_STATUS Status;\r
+ UINT64 Supports;\r
\r
HcDev = USB_HC_DEV_FROM_THIS (This);\r
\r
//\r
// Disable the USB Host Controller\r
//\r
- HcDev->PciIo->Attributes (\r
- HcDev->PciIo,\r
- EfiPciIoAttributeOperationDisable,\r
- EFI_PCI_DEVICE_ENABLE,\r
- NULL\r
- );\r
+ Status = HcDev->PciIo->Attributes (\r
+ HcDev->PciIo,\r
+ EfiPciIoAttributeOperationSupported,\r
+ 0,\r
+ &Supports\r
+ );\r
+ if (!EFI_ERROR (Status)) {\r
+ Supports &= EFI_PCI_DEVICE_ENABLE;\r
+ Status = HcDev->PciIo->Attributes (\r
+ HcDev->PciIo,\r
+ EfiPciIoAttributeOperationDisable,\r
+ Supports,\r
+ NULL\r
+ );\r
+ }\r
\r
gBS->FreePool (HcDev);\r
\r