diff options
| author | Jared Pan <jared.pan@dell.com> | 2026-06-24 09:21:47 +0800 |
|---|---|---|
| committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2026-06-30 17:27:16 +0000 |
| commit | 9a65be14eb21910a21e0a11e0014c1b20a8ee6ef (patch) | |
| tree | 91dfd91693a76acd676f715405a62763c39497da | |
| parent | 24788b6190abc736d614a7218f72ac7a0f27924a (diff) | |
| download | edk2-9a65be14eb21910a21e0a11e0014c1b20a8ee6ef.tar.gz edk2-9a65be14eb21910a21e0a11e0014c1b20a8ee6ef.zip | |
NetworkPkg/SnpDxe: Fix MAC address passthrough support
During SnpUndi32Initialize(), CurrentAddress is unconditionally
overwritten with PermanentAddress before UNDI initialization. This
causes MAC address passthrough (MacPassthru) to fail, as the NIC's
actual current address, which may differ from its permanent address,
is lost.
After UNDI initialization completes, call PxeGetStnAddr() to read
the NIC's station address via the UNDI interface and update
CurrentAddress, PermanentAddress, and BroadcastAddress in the mode
structure with the values reported by the hardware.
The call is added to both initialization paths: the cable-detect
success path and the fallback no-cable-detect path.
Signed-off-by: Jared Pan <jared.pan@dell.com>
| -rw-r--r-- | NetworkPkg/SnpDxe/Initialize.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/NetworkPkg/SnpDxe/Initialize.c b/NetworkPkg/SnpDxe/Initialize.c index ffd914623c..7bbe30ddb9 100644 --- a/NetworkPkg/SnpDxe/Initialize.c +++ b/NetworkPkg/SnpDxe/Initialize.c @@ -188,6 +188,7 @@ SnpUndi32Initialize ( )
{
EFI_STATUS EfiStatus;
+ EFI_STATUS StnAddrStatus;
SNP_DRIVER *Snp;
EFI_TPL OldTpl;
@@ -253,6 +254,11 @@ SnpUndi32Initialize ( //
if (Snp->CableDetectSupported) {
if (PxeInit (Snp, PXE_OPFLAGS_INITIALIZE_DETECT_CABLE) == EFI_SUCCESS) {
+ StnAddrStatus = PxeGetStnAddr (Snp);
+ if (EFI_ERROR (StnAddrStatus)) {
+ DEBUG ((DEBUG_WARN, "%a: failed to refresh station address (%r)\n", __func__, StnAddrStatus));
+ }
+
goto ON_EXIT;
}
}
@@ -273,6 +279,11 @@ SnpUndi32Initialize ( PxeGetStatus (Snp, NULL, FALSE);
}
+ StnAddrStatus = PxeGetStnAddr (Snp);
+ if (EFI_ERROR (StnAddrStatus)) {
+ DEBUG ((DEBUG_WARN, "%a: failed to refresh station address (%r)\n", __func__, StnAddrStatus));
+ }
+
ON_EXIT:
gBS->RestoreTPL (OldTpl);
|
