summaryrefslogtreecommitdiff
path: root/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/idebus.c
diff options
context:
space:
mode:
Diffstat (limited to 'IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/idebus.c')
-rw-r--r--IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/idebus.c39
1 files changed, 30 insertions, 9 deletions
diff --git a/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/idebus.c b/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/idebus.c
index 8f555c7cd5..48c2184696 100644
--- a/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/idebus.c
+++ b/IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/idebus.c
@@ -182,6 +182,7 @@ IDEBusDriverBindingStart (
UINT16 ControlBlockBaseAddr;
UINTN DataSize;
IDE_BUS_DRIVER_PRIVATE_DATA *IdeBusDriverPrivateData;
+ UINT64 Supports;
//
// Local variables declaration for IdeControllerInit support
@@ -297,10 +298,20 @@ IDEBusDriverBindingStart (
Status = PciIo->Attributes (
PciIo,
- EfiPciIoAttributeOperationEnable,
- EFI_PCI_DEVICE_ENABLE,
- NULL
+ EfiPciIoAttributeOperationSupported,
+ 0,
+ &Supports
);
+ if (!EFI_ERROR (Status)) {
+ Supports &= EFI_PCI_DEVICE_ENABLE;
+ Status = PciIo->Attributes (
+ PciIo,
+ EfiPciIoAttributeOperationEnable,
+ Supports,
+ NULL
+ );
+ }
+
if (EFI_ERROR (Status)) {
goto ErrorExit;
}
@@ -835,6 +846,7 @@ IDEBusDriverBindingStop (
BOOLEAN AllChildrenStopped;
UINTN Index;
IDE_BUS_DRIVER_PRIVATE_DATA *IdeBusDriverPrivateData;
+ UINT64 Supports;
IdeBusDriverPrivateData = NULL;
@@ -849,12 +861,21 @@ IDEBusDriverBindingStop (
EFI_OPEN_PROTOCOL_GET_PROTOCOL
);
if (!EFI_ERROR (Status)) {
- PciIo->Attributes (
- PciIo,
- EfiPciIoAttributeOperationDisable,
- EFI_PCI_IO_ATTRIBUTE_IDE_PRIMARY_IO | EFI_PCI_IO_ATTRIBUTE_IDE_SECONDARY_IO | EFI_PCI_DEVICE_ENABLE,
- NULL
- );
+ Status = PciIo->Attributes (
+ PciIo,
+ EfiPciIoAttributeOperationSupported,
+ 0,
+ &Supports
+ );
+ if (!EFI_ERROR (Status)) {
+ Supports &= EFI_PCI_IO_ATTRIBUTE_IDE_PRIMARY_IO | EFI_PCI_IO_ATTRIBUTE_IDE_SECONDARY_IO | EFI_PCI_DEVICE_ENABLE;
+ PciIo->Attributes (
+ PciIo,
+ EfiPciIoAttributeOperationDisable,
+ Supports,
+ NULL
+ );
+ }
}
gBS->OpenProtocol (