X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=NetworkPkg%2FUefiPxeBcDxe%2FPxeBcDriver.c;h=3c1d400d502ca63a08d07cbb96f90c6198498658;hp=8dd787be1a00aed74701804713b3d7a6ff77ed75;hb=ecf98fbcf858b9cb09ff0ac1c2a09c0111b4026b;hpb=2fad330f6baf350f80d043529f6a78ffec75daaa
diff --git a/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c b/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c
index 8dd787be1a..3c1d400d50 100644
--- a/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c
+++ b/NetworkPkg/UefiPxeBcDxe/PxeBcDriver.c
@@ -4,13 +4,7 @@
(C) Copyright 2014 Hewlett-Packard Development Company, L.P.
Copyright (c) 2007 - 2018, Intel Corporation. All rights reserved.
- This program and the accompanying materials
- are licensed and made available under the terms and conditions of the BSD License
- which accompanies this distribution. The full text of the license may be found at
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+ SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -256,7 +250,7 @@ PxeBcDestroyIp4Children (
);
FreePool (Private->Ip4Nic->DevicePath);
- if (Private->Snp != NULL) {
+ if (Private->Snp != NULL) {
//
// Close SNP from the child virtual handle
//
@@ -266,7 +260,7 @@ PxeBcDestroyIp4Children (
This->DriverBindingHandle,
Private->Ip4Nic->Controller
);
-
+
gBS->UninstallProtocolInterface (
Private->Ip4Nic->Controller,
&gEfiSimpleNetworkProtocolGuid,
@@ -416,7 +410,7 @@ PxeBcDestroyIp6Children (
NULL
);
FreePool (Private->Ip6Nic->DevicePath);
-
+
if (Private->Snp != NULL) {
//
// Close SNP from the child virtual handle
@@ -489,7 +483,7 @@ PxeBcCheckIpv6Support (
//
// Get the NIC handle by SNP protocol.
- //
+ //
Handle = NetLibGetSnpHandle (ControllerHandle, NULL);
if (Handle == NULL) {
return EFI_NOT_FOUND;
@@ -535,7 +529,7 @@ PxeBcCheckIpv6Support (
if (EFI_ERROR (Status) || InfoBlock == NULL) {
FreePool (InfoBlock);
return EFI_NOT_FOUND;
- }
+ }
*Ipv6Support = ((EFI_ADAPTER_INFO_UNDI_IPV6_SUPPORT *) InfoBlock)->Ipv6Support;
FreePool (InfoBlock);
@@ -814,7 +808,7 @@ PxeBcCreateIp4Children (
}
//
- // Open SNP on the child handle BY_DRIVER. It will prevent any additionally
+ // Open SNP on the child handle BY_DRIVER|EXCLUSIVE. It will prevent any additionally
// layering to perform the experiment.
//
Status = gBS->OpenProtocol (
@@ -823,7 +817,7 @@ PxeBcCreateIp4Children (
(VOID **) &Snp,
This->DriverBindingHandle,
Private->Ip4Nic->Controller,
- EFI_OPEN_PROTOCOL_BY_DRIVER
+ EFI_OPEN_PROTOCOL_BY_DRIVER|EFI_OPEN_PROTOCOL_EXCLUSIVE
);
if (EFI_ERROR (Status)) {
goto ON_ERROR;
@@ -951,7 +945,7 @@ PxeBcCreateIp6Children (
if (Private->Snp != NULL) {
for (Index = 0; Index < Private->Snp->Mode->HwAddressSize; Index++) {
Private->IaId |= (Private->Snp->Mode->CurrentAddress.Addr[Index] << ((Index << 3) & 31));
- }
+ }
}
//
@@ -1140,7 +1134,7 @@ PxeBcCreateIp6Children (
if (EFI_ERROR (Status)) {
goto ON_ERROR;
}
-
+
if (Private->Snp != NULL) {
//
// Install SNP protocol on purpose is for some OS loader backward
@@ -1157,7 +1151,7 @@ PxeBcCreateIp6Children (
}
//
- // Open SNP on the child handle BY_DRIVER. It will prevent any additionally
+ // Open SNP on the child handle BY_DRIVER|EXCLUSIVE. It will prevent any additionally
// layering to perform the experiment.
//
Status = gBS->OpenProtocol (
@@ -1166,7 +1160,7 @@ PxeBcCreateIp6Children (
(VOID **) &Snp,
This->DriverBindingHandle,
Private->Ip6Nic->Controller,
- EFI_OPEN_PROTOCOL_BY_DRIVER
+ EFI_OPEN_PROTOCOL_BY_DRIVER|EFI_OPEN_PROTOCOL_EXCLUSIVE
);
if (EFI_ERROR (Status)) {
goto ON_ERROR;
@@ -1269,16 +1263,11 @@ PxeBcDriverEntryPoint (
&gPxeBcComponentName2
);
if (EFI_ERROR (Status)) {
- gBS->UninstallMultipleProtocolInterfaces (
- ImageHandle,
- &gEfiDriverBindingProtocolGuid,
- &gPxeBcIp4DriverBinding,
- &gEfiComponentName2ProtocolGuid,
- &gPxeBcComponentName2,
- &gEfiComponentNameProtocolGuid,
- &gPxeBcComponentName,
- NULL
- );
+ EfiLibUninstallDriverBindingComponentName2 (
+ &gPxeBcIp4DriverBinding,
+ &gPxeBcComponentName,
+ &gPxeBcComponentName2
+ );
}
return Status;
@@ -1293,7 +1282,7 @@ PxeBcDriverEntryPoint (
@param[in] RemainingDevicePath Optional parameter used to pick a specific child
device to be started.
@param[in] IpVersion IP_VERSION_4 or IP_VERSION_6.
-
+
@retval EFI_SUCCESS This driver supports this device.
@retval EFI_UNSUPPORTED This driver does not support this device.
@@ -1310,7 +1299,7 @@ PxeBcSupported (
EFI_STATUS Status;
EFI_GUID *DhcpServiceBindingGuid;
EFI_GUID *MtftpServiceBindingGuid;
-
+
if (IpVersion == IP_VERSION_4) {
DhcpServiceBindingGuid = &gEfiDhcp4ServiceBindingProtocolGuid;
MtftpServiceBindingGuid = &gEfiMtftp4ServiceBindingProtocolGuid;
@@ -1453,7 +1442,7 @@ PxeBcStart (
//
// Install PxeBaseCodePrivate protocol onto the real NIC handler.
- // PxeBaseCodePrivate protocol is only used to keep the relationship between
+ // PxeBaseCodePrivate protocol is only used to keep the relationship between
// NIC handle and virtual child handles.
// gEfiCallerIdGuid will be used as its protocol guid.
//
@@ -1470,7 +1459,7 @@ PxeBcStart (
//
// Try to locate SNP protocol.
//
- NetLibGetSnpHandle(ControllerHandle, &Private->Snp);
+ NetLibGetSnpHandle(ControllerHandle, &Private->Snp);
}
if (IpVersion == IP_VERSION_4) {