+ Status = Dev->PciIo->Attributes (\r
+ Dev->PciIo,\r
+ EfiPciIoAttributeOperationGet,\r
+ 0,\r
+ &Dev->OriginalPciAttributes\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ goto CloseProtocol;\r
+ }\r
+\r
+ //\r
+ // Enable I/O Space & Bus-Mastering\r
+ //\r
+ Status = Dev->PciIo->Attributes (\r
+ Dev->PciIo,\r
+ EfiPciIoAttributeOperationEnable,\r
+ (EFI_PCI_IO_ATTRIBUTE_IO |\r
+ EFI_PCI_IO_ATTRIBUTE_BUS_MASTER),\r
+ NULL\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ goto CloseProtocol;\r
+ }\r
+\r
+ //\r
+ // Signal device supports 64-bit DMA addresses\r
+ //\r
+ Status = Dev->PciIo->Attributes (\r
+ Dev->PciIo,\r
+ EfiPciIoAttributeOperationEnable,\r
+ EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE,\r
+ NULL\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ //\r
+ // Warn user that device will only be using 32-bit DMA addresses.\r
+ //\r
+ // Note that this does not prevent the device/driver from working\r
+ // and therefore we only warn and continue as usual.\r
+ //\r
+ DEBUG ((\r
+ DEBUG_WARN,\r
+ "%a: failed to enable 64-bit DMA addresses\n",\r
+ __FUNCTION__\r
+ ));\r
+ }\r
+\r