summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Include/Library
diff options
context:
space:
mode:
authorxdu2 <xdu2@6f19259b-4bc3-4df7-8a09-765794883524>2010-02-03 04:37:53 +0000
committerxdu2 <xdu2@6f19259b-4bc3-4df7-8a09-765794883524>2010-02-03 04:37:53 +0000
commitdd29f3edb9849b7bb51f0ae4be8941a760846ef3 (patch)
tree7528311856c074ad70c21c850b0843c424ed0a77 /MdeModulePkg/Include/Library
parente51e619ed77a75b0992197574a8e376f76357a7a (diff)
downloadedk2-platforms-dd29f3edb9849b7bb51f0ae4be8941a760846ef3.tar.xz
For network dynamic media support:
1. add library function NetLibDetectMedia to NetLib for media detection 2. update MnpDxe to periodically poll for media status update and check for media status before packet transmit 3. update Ip4Dxe to return ModeData using Mnp->GetModeData() 4. update IScsiDxe to check for media status before try to do DHCP and session login 5. update UefiPxeBcDxe to check for media status before PXE start git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@9919 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Include/Library')
-rw-r--r--MdeModulePkg/Include/Library/NetLib.h44
1 files changed, 39 insertions, 5 deletions
diff --git a/MdeModulePkg/Include/Library/NetLib.h b/MdeModulePkg/Include/Library/NetLib.h
index 3a3b1901f6..854aa0fee0 100644
--- a/MdeModulePkg/Include/Library/NetLib.h
+++ b/MdeModulePkg/Include/Library/NetLib.h
@@ -1093,6 +1093,40 @@ NetLibGetMacString (
);
/**
+ Detect media status for specified network device.
+
+ The underlying UNDI driver may or may not support reporting media status from
+ GET_STATUS command (PXE_STATFLAGS_GET_STATUS_NO_MEDIA_SUPPORTED). This routine
+ will try to invoke Snp->GetStatus() to get the media status: if media already
+ present, it return directly; if media not present, it will stop SNP and then
+ restart SNP to get the latest media status, this give chance to get the correct
+ media status for old UNDI driver which doesn't support reporting media status
+ from GET_STATUS command.
+ Note: there will be two limitations for current algorithm:
+ 1) for UNDI with this capability, in case of cable is not attached, there will
+ be an redundant Stop/Start() process;
+ 2) for UNDI without this capability, in case cable is attached in UNDI
+ initialize while unattached latter, NetLibDetectMedia() will report
+ MediaPresent as TRUE, this cause upper layer apps wait for timeout time.
+
+ @param[in] ServiceHandle The handle where network service binding protocols are
+ installed on.
+ @param[out] MediaPresent The pointer to store the media status.
+
+ @retval EFI_SUCCESS Media detection success.
+ @retval EFI_INVALID_PARAMETER ServiceHandle is not valid network device handle.
+ @retval EFI_UNSUPPORTED Network device does not support media detection.
+ @retval EFI_DEVICE_ERROR SNP is in unknown state.
+
+**/
+EFI_STATUS
+EFIAPI
+NetLibDetectMedia (
+ IN EFI_HANDLE ServiceHandle,
+ OUT BOOLEAN *MediaPresent
+ );
+
+/**
Create an IPv4 device path node.
The header type of IPv4 device path node is MESSAGING_DEVICE_PATH.
@@ -1201,7 +1235,7 @@ NetLibDefaultUnload (
@param[in] String The pointer to the Ascii string.
@param[out] Ip4Address The pointer to the converted IPv4 address.
- @retval EFI_SUCCESS Convert to IPv4 address successfully.
+ @retval EFI_SUCCESS Convert to IPv4 address successfully.
@retval EFI_INVALID_PARAMETER The string is mal-formated or Ip4Address is NULL.
**/
@@ -1218,7 +1252,7 @@ NetLibAsciiStrToIp4 (
@param[in] String The pointer to the Ascii string.
@param[out] Ip6Address The pointer to the converted IPv6 address.
- @retval EFI_SUCCESS Convert to IPv6 address successfully.
+ @retval EFI_SUCCESS Convert to IPv6 address successfully.
@retval EFI_INVALID_PARAMETER The string is mal-formated or Ip6Address is NULL.
**/
@@ -1234,7 +1268,7 @@ NetLibAsciiStrToIp6 (
@param[in] String The pointer to the Ascii string.
@param[out] Ip4Address The pointer to the converted IPv4 address.
- @retval EFI_SUCCESS Convert to IPv4 address successfully.
+ @retval EFI_SUCCESS Convert to IPv4 address successfully.
@retval EFI_INVALID_PARAMETER The string is mal-formated or Ip4Address is NULL.
@retval EFI_OUT_OF_RESOURCES Fail to perform the operation due to lack of resource.
@@ -1252,7 +1286,7 @@ NetLibStrToIp4 (
@param[in] String The pointer to the Ascii string.
@param[out] Ip6Address The pointer to the converted IPv6 address.
- @retval EFI_SUCCESS Convert to IPv6 address successfully.
+ @retval EFI_SUCCESS Convert to IPv6 address successfully.
@retval EFI_INVALID_PARAMETER The string is mal-formated or Ip6Address is NULL.
@retval EFI_OUT_OF_RESOURCES Fail to perform the operation due to lack of resource.
@@ -1272,7 +1306,7 @@ NetLibStrToIp6 (
@param[out] Ip6Address The pointer to the converted IPv6 address.
@param[out] PrefixLength The pointer to the converted prefix length.
- @retval EFI_SUCCESS Convert to IPv6 address successfully.
+ @retval EFI_SUCCESS Convert to IPv6 address successfully.
@retval EFI_INVALID_PARAMETER The string is mal-formated or Ip6Address is NULL.
@retval EFI_OUT_OF_RESOURCES Fail to perform the operation due to lack of resource.