X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=MdeModulePkg%2FUniversal%2FNetwork%2FMnpDxe%2FMnpMain.c;h=d96178a1d9943a3b835c030a38be35a6d4b21094;hp=e34936f3b861c0736f423bef7d8c3897e64f6770;hb=c0fd7f734e2d33e22215899b40a47b843129541d;hpb=779ae3579848a36319d67a6ba012b4b9aa88aa6b
diff --git a/MdeModulePkg/Universal/Network/MnpDxe/MnpMain.c b/MdeModulePkg/Universal/Network/MnpDxe/MnpMain.c
index e34936f3b8..d96178a1d9 100644
--- a/MdeModulePkg/Universal/Network/MnpDxe/MnpMain.c
+++ b/MdeModulePkg/Universal/Network/MnpDxe/MnpMain.c
@@ -1,15 +1,8 @@
/** @file
Implementation of Managed Network Protocol public services.
-Copyright (c) 2005 - 2009, 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.
+Copyright (c) 2005 - 2016, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent
**/
@@ -52,6 +45,7 @@ MnpGetModeData (
EFI_SIMPLE_NETWORK_PROTOCOL *Snp;
EFI_TPL OldTpl;
EFI_STATUS Status;
+ UINT32 InterruptStatus;
if (This == NULL) {
return EFI_INVALID_PARAMETER;
@@ -73,6 +67,12 @@ MnpGetModeData (
// Copy the underlayer Snp mode data.
//
Snp = Instance->MnpServiceData->MnpDeviceData->Snp;
+
+ //
+ // Upon successful return of GetStatus(), the Snp->Mode->MediaPresent
+ // will be updated to reflect any change of media status
+ //
+ Snp->GetStatus (Snp, &InterruptStatus, NULL);
CopyMem (SnpModeData, Snp->Mode, sizeof (*SnpModeData));
}
@@ -545,7 +545,10 @@ MnpTransmit (
//
// Build the tx packet
//
- MnpBuildTxPacket (MnpServiceData, Token->Packet.TxData, &PktBuf, &PktLen);
+ Status = MnpBuildTxPacket (MnpServiceData, Token->Packet.TxData, &PktBuf, &PktLen);
+ if (EFI_ERROR (Status)) {
+ goto ON_EXIT;
+ }
//
// OK, send the packet synchronously.