/** @file\r
Implementation of driver entry point and driver binding protocol.\r
\r
-Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) Microsoft Corporation.<BR>\r
SPDX-License-Identifier: BSD-2-Clause-Patent\r
\r
**/\r
// the IO BAR. Save the index of the BAR into the adapter info structure.\r
// for regular 32bit BARs, 0 is memory mapped, 1 is io mapped\r
//\r
- Snp->MemoryBarIndex = 0;\r
- Snp->IoBarIndex = 1;\r
+ Snp->MemoryBarIndex = PCI_MAX_BAR;\r
+ Snp->IoBarIndex = PCI_MAX_BAR;\r
FoundMemoryBar = FALSE;\r
FoundIoBar = FALSE;\r
for (BarIndex = 0; BarIndex < PCI_MAX_BAR; BarIndex++) {\r
PxeShutdown (Snp);\r
PxeStop (Snp);\r
\r
- //\r
- // Create EXIT_BOOT_SERIVES Event\r
- //\r
- Status = gBS->CreateEventEx (\r
- EVT_NOTIFY_SIGNAL,\r
- TPL_NOTIFY,\r
- SnpNotifyExitBootServices,\r
- Snp,\r
- &gEfiEventExitBootServicesGuid,\r
- &Snp->ExitBootServicesEvent\r
- );\r
- if (EFI_ERROR (Status)) {\r
- goto Error_DeleteSNP;\r
+ if (PcdGetBool (PcdSnpCreateExitBootServicesEvent)) {\r
+ //\r
+ // Create EXIT_BOOT_SERIVES Event\r
+ //\r
+ Status = gBS->CreateEventEx (\r
+ EVT_NOTIFY_SIGNAL,\r
+ TPL_CALLBACK,\r
+ SnpNotifyExitBootServices,\r
+ Snp,\r
+ &gEfiEventExitBootServicesGuid,\r
+ &Snp->ExitBootServicesEvent\r
+ );\r
+ if (EFI_ERROR (Status)) {\r
+ goto Error_DeleteSNP;\r
+ }\r
}\r
\r
//\r
return Status;\r
}\r
\r
- //\r
- // Close EXIT_BOOT_SERIVES Event\r
- //\r
- gBS->CloseEvent (Snp->ExitBootServicesEvent);\r
+ if (PcdGetBool (PcdSnpCreateExitBootServicesEvent)) {\r
+ //\r
+ // Close EXIT_BOOT_SERVICES Event\r
+ //\r
+ gBS->CloseEvent (Snp->ExitBootServicesEvent);\r
+ }\r
\r
Status = gBS->CloseProtocol (\r
Controller,\r
@param ImageHandle The driver image handle.\r
@param SystemTable The system table.\r
\r
- @retval EFI_SUCEESS Initialization routine has found UNDI hardware,\r
+ @retval EFI_SUCCESS Initialization routine has found UNDI hardware,\r
loaded it's ROM, and installed a notify event for\r
- the Network Indentifier Interface Protocol\r
+ the Network Identifier Interface Protocol\r
successfully.\r
@retval Other Return value from HandleProtocol for\r
DeviceIoProtocol or LoadedImageProtocol\r