return EFI_NOT_FOUND;\r
}\r
\r
+STATIC\r
+EFI_STATUS\r
+PvScsiSetPciAttributes (\r
+ IN OUT PVSCSI_DEV *Dev\r
+ )\r
+{\r
+ EFI_STATUS Status;\r
+\r
+ //\r
+ // Backup original PCI Attributes\r
+ //\r
+ Status = Dev->PciIo->Attributes (\r
+ Dev->PciIo,\r
+ EfiPciIoAttributeOperationGet,\r
+ 0,\r
+ &Dev->OriginalPciAttributes\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ return Status;\r
+ }\r
+\r
+ //\r
+ // TODO: Change PCI Attributes\r
+ //\r
+\r
+ return EFI_SUCCESS;\r
+}\r
+\r
+STATIC\r
+VOID\r
+PvScsiRestorePciAttributes (\r
+ IN PVSCSI_DEV *Dev\r
+ )\r
+{\r
+ Dev->PciIo->Attributes (\r
+ Dev->PciIo,\r
+ EfiPciIoAttributeOperationSet,\r
+ Dev->OriginalPciAttributes,\r
+ NULL\r
+ );\r
+}\r
+\r
STATIC\r
EFI_STATUS\r
PvScsiInit (\r
IN OUT PVSCSI_DEV *Dev\r
)\r
{\r
+ EFI_STATUS Status;\r
+\r
//\r
// Init configuration\r
//\r
Dev->MaxTarget = PcdGet8 (PcdPvScsiMaxTargetLimit);\r
Dev->MaxLun = PcdGet8 (PcdPvScsiMaxLunLimit);\r
\r
+ //\r
+ // Set PCI Attributes\r
+ //\r
+ Status = PvScsiSetPciAttributes (Dev);\r
+ if (EFI_ERROR (Status)) {\r
+ return Status;\r
+ }\r
+\r
//\r
// Populate the exported interface's attributes\r
//\r
IN OUT PVSCSI_DEV *Dev\r
)\r
{\r
- // Currently nothing to do here\r
+ PvScsiRestorePciAttributes (Dev);\r
}\r
\r
//\r