Update AtapiPassThru driver in Option ROM package to support to produce EFI Driver...
authorqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 22 Nov 2007 07:15:08 +0000 (07:15 +0000)
committerqhuang8 <qhuang8@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 22 Nov 2007 07:15:08 +0000 (07:15 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4320 6f19259b-4bc3-4df7-8a09-765794883524

OptionRomPkg/AtapiPassThruDxe/AtapiPassThru.c
OptionRomPkg/AtapiPassThruDxe/AtapiPassThru.h
OptionRomPkg/AtapiPassThruDxe/AtapiPassThruDxe.inf
OptionRomPkg/AtapiPassThruDxe/DriverSupportedEfiVersion.c [new file with mode: 0644]
OptionRomPkg/OptionRomPkg.dec
OptionRomPkg/OptionRomPkg.dsc

index b15f292..482933d 100644 (file)
@@ -3390,5 +3390,18 @@ InitializeAtapiPassThru(
              );\r
   ASSERT_EFI_ERROR (Status);\r
 \r
+  //\r
+  // Install EFI Driver Supported EFI Version Protocol required for \r
+  // EFI drivers that are on PCI and other plug in cards.\r
+  //\r
+  gAtapiScsiPassThruDriverSupportedEfiVersion.FirmwareVersion = PcdGet32 (PcdDriverSupportedEfiVersion);\r
+  Status = gBS->InstallMultipleProtocolInterfaces (\r
+                  &ImageHandle,\r
+                  &gEfiDriverSupportedEfiVersionProtocolGuid,\r
+                  &gAtapiScsiPassThruDriverSupportedEfiVersion,\r
+                  NULL\r
+                  );\r
+  ASSERT_EFI_ERROR (Status);\r
+\r
   return Status;\r
 }\r
index 2187580..8e01256 100644 (file)
@@ -22,6 +22,7 @@
 #include <Protocol/ScsiPassThru.h>\r
 #include <Protocol/ScsiPassThruExt.h>\r
 #include <Protocol/PciIo.h>\r
+#include <Protocol/DriverSupportedEfiVersion.h>\r
 \r
 #include <Library/DebugLib.h>\r
 #include <Library/UefiDriverEntryPoint.h>\r
@@ -139,9 +140,10 @@ typedef struct {
 //\r
 // Global Variables\r
 //\r
-extern EFI_DRIVER_BINDING_PROTOCOL   gAtapiScsiPassThruDriverBinding;\r
-extern EFI_COMPONENT_NAME_PROTOCOL   gAtapiScsiPassThruComponentName;\r
-extern EFI_COMPONENT_NAME2_PROTOCOL  gAtapiScsiPassThruComponentName2;\r
+extern EFI_DRIVER_BINDING_PROTOCOL                gAtapiScsiPassThruDriverBinding;\r
+extern EFI_COMPONENT_NAME_PROTOCOL                gAtapiScsiPassThruComponentName;\r
+extern EFI_COMPONENT_NAME2_PROTOCOL               gAtapiScsiPassThruComponentName2;\r
+extern EFI_DRIVER_SUPPORTED_EFI_VERSION_PROTOCOL  gAtapiScsiPassThruDriverSupportedEfiVersion;\r
 \r
 //\r
 // ATAPI Command op code\r
index 378624e..9fe6f54 100644 (file)
@@ -36,6 +36,7 @@
 #\r
 \r
 [Sources.common]\r
+  DriverSupportedEfiVersion.c\r
   ComponentName.c\r
   AtapiPassThru.c\r
   AtapiPassThru.h\r
   gEfiScsiPassThruProtocolGuid                  # PROTOCOL BY_START\r
   gEfiExtScsiPassThruProtocolGuid               # PROTOCOL BY_START\r
   gEfiPciIoProtocolGuid                         # PROTOCOL TO_START\r
+  gEfiDriverSupportedEfiVersionProtocolGuid     # PROTOCOL ALWAYS_PRODUCED\r
 \r
 [FeaturePcd]\r
   gOptionRomPkgTokenSpaceGuid.PcdSupportScsiPassThru\r
   gOptionRomPkgTokenSpaceGuid.PcdSupportExtScsiPassThru\r
+\r
+[Pcd]\r
+  gOptionRomPkgTokenSpaceGuid.PcdDriverSupportedEfiVersion\r
+\r
diff --git a/OptionRomPkg/AtapiPassThruDxe/DriverSupportedEfiVersion.c b/OptionRomPkg/AtapiPassThruDxe/DriverSupportedEfiVersion.c
new file mode 100644 (file)
index 0000000..5496d7a
--- /dev/null
@@ -0,0 +1,20 @@
+/** @file\r
+  Copyright (c) 2007, Intel Corporation                                                         \r
+  All rights reserved. This program and the accompanying materials                          \r
+  are licensed and made available under the terms and conditions of the BSD License         \r
+  which accompanies this distribution.  The full text of the license may be found at        \r
+  http://opensource.org/licenses/bsd-license.php                                            \r
+\r
+  THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,                     \r
+  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.             \r
+\r
+  Module Name:  DriverSupportEfiVersion.c\r
+\r
+**/\r
+#include "AtapiPassThru.h"\r
+\r
+EFI_DRIVER_SUPPORTED_EFI_VERSION_PROTOCOL gAtapiScsiPassThruDriverSupportedEfiVersion = {\r
+  sizeof (EFI_DRIVER_SUPPORTED_EFI_VERSION_PROTOCOL), // Size of Protocol structure.\r
+  0                                                   // Version number to be filled at start up.\r
+};\r
+\r
index 7ada9ec..b6993d7 100644 (file)
@@ -28,4 +28,9 @@
   gOptionRomPkgTokenSpaceGuid.PcdSupportScsiPassThru|TRUE|BOOLEAN|0x00010001\r
   gOptionRomPkgTokenSpaceGuid.PcdSupportExtScsiPassThru|TRUE|BOOLEAN|0x00010002\r
 \r
+[PcdsFixedAtBuild.common]\r
+  gOptionRomPkgTokenSpaceGuid.PcdDriverSupportedEfiVersion|0x0002000a|UINT32|0x00010003\r
+\r
+[PcdsPatchableInModule.common]\r
+  gOptionRomPkgTokenSpaceGuid.PcdDriverSupportedEfiVersion|0x0002000a|UINT32|0x00010003\r
 \r
index ed53dbe..a65e5ce 100644 (file)
@@ -80,6 +80,7 @@
   gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000042\r
   gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x06\r
   gEfiMdePkgTokenSpaceGuid.PcdDebugClearMemoryValue|0x0\r
+  gOptionRomPkgTokenSpaceGuid.PcdDriverSupportedEfiVersion|0x0002000a # EFI_2_10_SYSTEM_TABLE_REVISION\r
 \r
 ################################################################################\r
 #\r