OUT CHAR16 **MacString\r
);\r
\r
+/**\r
+ Detect media status for specified network device.\r
+\r
+ The underlying UNDI driver may or may not support reporting media status from\r
+ GET_STATUS command (PXE_STATFLAGS_GET_STATUS_NO_MEDIA_SUPPORTED). This routine\r
+ will try to invoke Snp->GetStatus() to get the media status: if media already\r
+ present, it return directly; if media not present, it will stop SNP and then\r
+ restart SNP to get the latest media status, this give chance to get the correct\r
+ media status for old UNDI driver which doesn't support reporting media status\r
+ from GET_STATUS command.\r
+ Note: there will be two limitations for current algorithm:\r
+ 1) for UNDI with this capability, in case of cable is not attached, there will\r
+ be an redundant Stop/Start() process;\r
+ 2) for UNDI without this capability, in case cable is attached in UNDI\r
+ initialize while unattached latter, NetLibDetectMedia() will report\r
+ MediaPresent as TRUE, this cause upper layer apps wait for timeout time.\r
+\r
+ @param[in] ServiceHandle The handle where network service binding protocols are\r
+ installed on.\r
+ @param[out] MediaPresent The pointer to store the media status.\r
+\r
+ @retval EFI_SUCCESS Media detection success.\r
+ @retval EFI_INVALID_PARAMETER ServiceHandle is not valid network device handle.\r
+ @retval EFI_UNSUPPORTED Network device does not support media detection.\r
+ @retval EFI_DEVICE_ERROR SNP is in unknown state.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+NetLibDetectMedia (\r
+ IN EFI_HANDLE ServiceHandle,\r
+ OUT BOOLEAN *MediaPresent\r
+ );\r
+\r
/**\r
Create an IPv4 device path node.\r
\r
@param[in] String The pointer to the Ascii string.\r
@param[out] Ip4Address The pointer to the converted IPv4 address.\r
\r
- @retval EFI_SUCCESS Convert to IPv4 address successfully. \r
+ @retval EFI_SUCCESS Convert to IPv4 address successfully.\r
@retval EFI_INVALID_PARAMETER The string is mal-formated or Ip4Address is NULL.\r
\r
**/\r
@param[in] String The pointer to the Ascii string.\r
@param[out] Ip6Address The pointer to the converted IPv6 address.\r
\r
- @retval EFI_SUCCESS Convert to IPv6 address successfully. \r
+ @retval EFI_SUCCESS Convert to IPv6 address successfully.\r
@retval EFI_INVALID_PARAMETER The string is mal-formated or Ip6Address is NULL.\r
\r
**/\r
@param[in] String The pointer to the Ascii string.\r
@param[out] Ip4Address The pointer to the converted IPv4 address.\r
\r
- @retval EFI_SUCCESS Convert to IPv4 address successfully. \r
+ @retval EFI_SUCCESS Convert to IPv4 address successfully.\r
@retval EFI_INVALID_PARAMETER The string is mal-formated or Ip4Address is NULL.\r
@retval EFI_OUT_OF_RESOURCES Fail to perform the operation due to lack of resource.\r
\r
@param[in] String The pointer to the Ascii string.\r
@param[out] Ip6Address The pointer to the converted IPv6 address.\r
\r
- @retval EFI_SUCCESS Convert to IPv6 address successfully. \r
+ @retval EFI_SUCCESS Convert to IPv6 address successfully.\r
@retval EFI_INVALID_PARAMETER The string is mal-formated or Ip6Address is NULL.\r
@retval EFI_OUT_OF_RESOURCES Fail to perform the operation due to lack of resource.\r
\r
@param[out] Ip6Address The pointer to the converted IPv6 address.\r
@param[out] PrefixLength The pointer to the converted prefix length.\r
\r
- @retval EFI_SUCCESS Convert to IPv6 address successfully. \r
+ @retval EFI_SUCCESS Convert to IPv6 address successfully.\r
@retval EFI_INVALID_PARAMETER The string is mal-formated or Ip6Address is NULL.\r
@retval EFI_OUT_OF_RESOURCES Fail to perform the operation due to lack of resource.\r
\r