Both AtaAtapiPassThruStart() and AtaAtapiPassThruStop() fetch the
supported attributes of the device, just so they can toggle the
IO+MMIO+BusMaster subset.
After we compute this bitmask in AtaAtapiPassThruStart(), we can cache it
for later, and save the fetch in AtaAtapiPassThruStop().
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Brijesh Singh <brijesh.singh@amd.com>
Cc: Eric Dong <eric.dong@intel.com>
Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
+ 0, // EnabledPciAttributes\r
0, // OriginalAttributes\r
0, // PreviousPort\r
0, // PreviousPortMultiplier\r
0, // OriginalAttributes\r
0, // PreviousPort\r
0, // PreviousPortMultiplier\r
EFI_IDE_CONTROLLER_INIT_PROTOCOL *IdeControllerInit;\r
ATA_ATAPI_PASS_THRU_INSTANCE *Instance;\r
EFI_PCI_IO_PROTOCOL *PciIo;\r
EFI_IDE_CONTROLLER_INIT_PROTOCOL *IdeControllerInit;\r
ATA_ATAPI_PASS_THRU_INSTANCE *Instance;\r
EFI_PCI_IO_PROTOCOL *PciIo;\r
+ UINT64 EnabledPciAttributes;\r
UINT64 OriginalPciAttributes;\r
\r
Status = EFI_SUCCESS;\r
UINT64 OriginalPciAttributes;\r
\r
Status = EFI_SUCCESS;\r
PciIo,\r
EfiPciIoAttributeOperationSupported,\r
0,\r
PciIo,\r
EfiPciIoAttributeOperationSupported,\r
0,\r
+ &EnabledPciAttributes\r
);\r
if (!EFI_ERROR (Status)) {\r
);\r
if (!EFI_ERROR (Status)) {\r
- Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE;\r
+ EnabledPciAttributes &= (UINT64)EFI_PCI_DEVICE_ENABLE;\r
Status = PciIo->Attributes (\r
PciIo,\r
EfiPciIoAttributeOperationEnable,\r
Status = PciIo->Attributes (\r
PciIo,\r
EfiPciIoAttributeOperationEnable,\r
+ EnabledPciAttributes,\r
Instance->ControllerHandle = Controller;\r
Instance->IdeControllerInit = IdeControllerInit;\r
Instance->PciIo = PciIo;\r
Instance->ControllerHandle = Controller;\r
Instance->IdeControllerInit = IdeControllerInit;\r
Instance->PciIo = PciIo;\r
+ Instance->EnabledPciAttributes = EnabledPciAttributes;\r
Instance->OriginalPciAttributes = OriginalPciAttributes;\r
Instance->AtaPassThru.Mode = &Instance->AtaPassThruMode;\r
Instance->ExtScsiPassThru.Mode = &Instance->ExtScsiPassThruMode;\r
Instance->OriginalPciAttributes = OriginalPciAttributes;\r
Instance->AtaPassThru.Mode = &Instance->AtaPassThruMode;\r
Instance->ExtScsiPassThru.Mode = &Instance->ExtScsiPassThruMode;\r
EFI_ATA_PASS_THRU_PROTOCOL *AtaPassThru;\r
EFI_PCI_IO_PROTOCOL *PciIo;\r
EFI_AHCI_REGISTERS *AhciRegisters;\r
EFI_ATA_PASS_THRU_PROTOCOL *AtaPassThru;\r
EFI_PCI_IO_PROTOCOL *PciIo;\r
EFI_AHCI_REGISTERS *AhciRegisters;\r
\r
DEBUG ((EFI_D_INFO, "==AtaAtapiPassThru Stop== Controller = %x\n", Controller));\r
\r
\r
DEBUG ((EFI_D_INFO, "==AtaAtapiPassThru Stop== Controller = %x\n", Controller));\r
\r
//\r
// Disable this ATA host controller.\r
//\r
//\r
// Disable this ATA host controller.\r
//\r
- Status = PciIo->Attributes (\r
- PciIo,\r
- EfiPciIoAttributeOperationSupported,\r
- 0,\r
- &Supports\r
- );\r
- if (!EFI_ERROR (Status)) {\r
- Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE;\r
- PciIo->Attributes (\r
- PciIo,\r
- EfiPciIoAttributeOperationDisable,\r
- Supports,\r
- NULL\r
- );\r
- }\r
+ PciIo->Attributes (\r
+ PciIo,\r
+ EfiPciIoAttributeOperationDisable,\r
+ Instance->EnabledPciAttributes,\r
+ NULL\r
+ );\r
\r
//\r
// Restore original PCI attributes\r
\r
//\r
// Restore original PCI attributes\r
// The attached device list\r
//\r
LIST_ENTRY DeviceList;\r
// The attached device list\r
//\r
LIST_ENTRY DeviceList;\r
+ UINT64 EnabledPciAttributes;\r
UINT64 OriginalPciAttributes;\r
\r
//\r
UINT64 OriginalPciAttributes;\r
\r
//\r