MdeModulePkg: Refine SNP driver's media status check logic.
Some UNDI drivers may not support the cable detect in UNDI INITIALIZE command, but support the media present check in UNDI GET_STATUS command. Current SNP driver will set the MediaPresentSupported field to FALSE in EFI_SIMPLE_NETWORK_MODE for such case, which forbid the media detect from the callers. This patch updates the SNP driver to support such kind of UNDIs for media detect. MediaPresentSupported will be set to TRUE, and a GET_STATUS command will be issued immediately after INITIALIZE command in SNP->Initialize() function, to refresh the value of MediaPresent in SNP mode data. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-By: Ye Ting <ting.ye@intel.com> Reviewed-By: Wu Jiaxin <jiaxin.wu@intel.com>
This commit is contained in:
@@ -18,24 +18,25 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
/**
|
||||
Call undi to get the status of the interrupts, get the list of recycled transmit
|
||||
buffers that completed transmitting. The recycled transmit buffer address will
|
||||
be saved into Snp->RecycledTxBuf.
|
||||
be saved into Snp->RecycledTxBuf. This function will also update the MediaPresent
|
||||
field of EFI_SIMPLE_NETWORK_MODE if UNDI support it.
|
||||
|
||||
@param Snp Pointer to snp driver structure.
|
||||
@param InterruptStatusPtr A non null pointer to contain the interrupt
|
||||
status.
|
||||
@param GetTransmittedBuf Set to TRUE to retrieve the recycled transmit
|
||||
buffer address.
|
||||
@param[in] Snp Pointer to snp driver structure.
|
||||
@param[out] InterruptStatusPtr A non null pointer to contain the interrupt
|
||||
status.
|
||||
@param[in] GetTransmittedBuf Set to TRUE to retrieve the recycled transmit
|
||||
buffer address.
|
||||
|
||||
@retval EFI_SUCCESS The status of the network interface was retrieved.
|
||||
@retval EFI_DEVICE_ERROR The command could not be sent to the network
|
||||
interface.
|
||||
@retval EFI_SUCCESS The status of the network interface was retrieved.
|
||||
@retval EFI_DEVICE_ERROR The command could not be sent to the network
|
||||
interface.
|
||||
|
||||
**/
|
||||
EFI_STATUS
|
||||
PxeGetStatus (
|
||||
SNP_DRIVER *Snp,
|
||||
UINT32 *InterruptStatusPtr,
|
||||
BOOLEAN GetTransmittedBuf
|
||||
IN SNP_DRIVER *Snp,
|
||||
OUT UINT32 *InterruptStatusPtr,
|
||||
IN BOOLEAN GetTransmittedBuf
|
||||
)
|
||||
{
|
||||
PXE_DB_GET_STATUS *Db;
|
||||
|
Reference in New Issue
Block a user