/** @file\r
The implementation of iSCSI protocol based on RFC3720.\r
\r
-Copyright (c) 2004 - 2009, Intel Corporation.<BR>\r
+Copyright (c) 2004 - 2010, Intel Corporation.<BR>\r
All rights reserved. This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
\r
@retval EFI_SUCCESS The iSCSI session login procedure finished.\r
@retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r
+ @retval EFI_NO_MEDIA There was a media error.\r
@retval Others Other errors as indicated.\r
+\r
**/\r
EFI_STATUS\r
IScsiSessionLogin (\r
ISCSI_SESSION *Session;\r
ISCSI_CONNECTION *Conn;\r
EFI_TCP4_PROTOCOL *Tcp4;\r
+ BOOLEAN MediaPresent;\r
\r
Session = &Private->Session;\r
\r
+ //\r
+ // Check media status before session login\r
+ //\r
+ MediaPresent = TRUE;\r
+ NetLibDetectMedia (Private->Controller, &MediaPresent);\r
+ if (!MediaPresent) {\r
+ return EFI_NO_MEDIA;\r
+ }\r
+\r
//\r
// Create a connection for the session.\r
//\r