mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-20 12:14:27 +02:00
Update SnpDxe to support dynamic media detect.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9994 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
993702aa7b
commit
c777c3574e
@ -54,6 +54,10 @@ PxeGetStatus (
|
|||||||
Snp->Cdb.OpFlags |= PXE_OPFLAGS_GET_INTERRUPT_STATUS;
|
Snp->Cdb.OpFlags |= PXE_OPFLAGS_GET_INTERRUPT_STATUS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Snp->MediaStatusSupported) {
|
||||||
|
Snp->Cdb.OpFlags |= PXE_OPFLAGS_GET_MEDIA_STATUS;
|
||||||
|
}
|
||||||
|
|
||||||
Snp->Cdb.CPBsize = PXE_CPBSIZE_NOT_USED;
|
Snp->Cdb.CPBsize = PXE_CPBSIZE_NOT_USED;
|
||||||
Snp->Cdb.CPBaddr = PXE_CPBADDR_NOT_USED;
|
Snp->Cdb.CPBaddr = PXE_CPBADDR_NOT_USED;
|
||||||
|
|
||||||
@ -121,6 +125,15 @@ PxeGetStatus (
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//
|
||||||
|
// Update MediaPresent field of EFI_SIMPLE_NETWORK_MODE if the UNDI support
|
||||||
|
// returning media status from GET_STATUS command
|
||||||
|
//
|
||||||
|
if (Snp->MediaStatusSupported) {
|
||||||
|
Snp->Snp.Mode->MediaPresent =
|
||||||
|
(BOOLEAN) (((Snp->Cdb.StatFlags & PXE_STATFLAGS_GET_STATUS_NO_MEDIA) != 0) ? FALSE : TRUE);
|
||||||
|
}
|
||||||
|
|
||||||
return EFI_SUCCESS;
|
return EFI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -581,6 +581,16 @@ SimpleNetworkDriverStart (
|
|||||||
Snp->Mode.MediaPresentSupported = FALSE;
|
Snp->Mode.MediaPresentSupported = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch (InitStatFlags & PXE_STATFLAGS_GET_STATUS_NO_MEDIA_MASK) {
|
||||||
|
case PXE_STATFLAGS_GET_STATUS_NO_MEDIA_SUPPORTED:
|
||||||
|
Snp->MediaStatusSupported = TRUE;
|
||||||
|
break;
|
||||||
|
|
||||||
|
case PXE_STATFLAGS_GET_STATUS_NO_MEDIA_NOT_SUPPORTED:
|
||||||
|
default:
|
||||||
|
Snp->MediaStatusSupported = FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
if ((Pxe->hw.Implementation & PXE_ROMID_IMP_STATION_ADDR_SETTABLE) != 0) {
|
if ((Pxe->hw.Implementation & PXE_ROMID_IMP_STATION_ADDR_SETTABLE) != 0) {
|
||||||
Snp->Mode.MacAddressChangeable = TRUE;
|
Snp->Mode.MacAddressChangeable = TRUE;
|
||||||
} else {
|
} else {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/** @file
|
/** @file
|
||||||
Declaration of strctures and functions for SnpDxe driver.
|
Declaration of strctures and functions for SnpDxe driver.
|
||||||
|
|
||||||
Copyright (c) 2004 - 2009, Intel Corporation. <BR>
|
Copyright (c) 2004 - 2010, Intel Corporation. <BR>
|
||||||
All rights reserved. This program and the accompanying materials are licensed
|
All rights reserved. This program and the accompanying materials are licensed
|
||||||
and made available under the terms and conditions of the BSD License which
|
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
|
accompanies this distribution. The full text of the license may be found at
|
||||||
@ -122,6 +122,12 @@ typedef struct {
|
|||||||
} MapList[MAX_MAP_LENGTH];
|
} MapList[MAX_MAP_LENGTH];
|
||||||
|
|
||||||
EFI_EVENT ExitBootServicesEvent;
|
EFI_EVENT ExitBootServicesEvent;
|
||||||
|
|
||||||
|
//
|
||||||
|
// Whether UNDI support reporting media status from GET_STATUS command,
|
||||||
|
// i.e. PXE_STATFLAGS_GET_STATUS_NO_MEDIA_SUPPORTED
|
||||||
|
//
|
||||||
|
BOOLEAN MediaStatusSupported;
|
||||||
} SNP_DRIVER;
|
} SNP_DRIVER;
|
||||||
|
|
||||||
#define EFI_SIMPLE_NETWORK_DEV_FROM_THIS(a) CR (a, SNP_DRIVER, Snp, SNP_DRIVER_SIGNATURE)
|
#define EFI_SIMPLE_NETWORK_DEV_FROM_THIS(a) CR (a, SNP_DRIVER, Snp, SNP_DRIVER_SIGNATURE)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user