)\r
{\r
USB_HC_DEV *Uhc;\r
+ UINT64 Supports;\r
\r
//\r
// Uninstall the USB_HC and USB_HC2 protocol, then disable the controller\r
\r
UhciFreeAllAsyncReq (Uhc);\r
UhciDestoryFrameList (Uhc);\r
-\r
+ \r
+ Uhc->PciIo->Attributes (\r
+ Uhc->PciIo,\r
+ EfiPciIoAttributeOperationSupported,\r
+ 0,\r
+ &Supports\r
+ );\r
+ Supports &= EFI_PCI_DEVICE_ENABLE;\r
Uhc->PciIo->Attributes (\r
Uhc->PciIo,\r
EfiPciIoAttributeOperationDisable,\r
- EFI_PCI_DEVICE_ENABLE,\r
+ Supports,\r
NULL\r
);\r
\r
EFI_STATUS Status;\r
EFI_PCI_IO_PROTOCOL *PciIo;\r
USB_HC_DEV *Uhc;\r
+ UINT64 Supports;\r
\r
//\r
// Open PCIIO, then enable the EHC device and turn off emulation\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
\r
if (EFI_ERROR (Status)) {\r
goto CLOSE_PCIIO;\r