summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/Network/IScsiDxe
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/Universal/Network/IScsiDxe
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/Universal/Network/IScsiDxe')
-rw-r--r--MdeModulePkg/Universal/Network/IScsiDxe/IScsiDhcp.c14
-rw-r--r--MdeModulePkg/Universal/Network/IScsiDxe/IScsiDhcp.h4
-rw-r--r--MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c14
-rw-r--r--MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.h4
4 files changed, 32 insertions, 4 deletions
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDhcp.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDhcp.c
index 996a290610..c770e27631 100644
--- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDhcp.c
+++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDhcp.c
@@ -1,7 +1,7 @@
/** @file
iSCSI DHCP related configuration routines.
-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 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
@@ -344,7 +344,9 @@ IScsiParseDhcpAck (
@retval EFI_SUCCESS The DNS information is got from the DHCP ACK.
@retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
+ @retval EFI_NO_MEDIA There was a media error.
@retval Others Other errors as indicated.
+
**/
EFI_STATUS
IScsiDoDhcp (
@@ -358,12 +360,22 @@ IScsiDoDhcp (
EFI_STATUS Status;
EFI_DHCP4_PACKET_OPTION *ParaList;
EFI_DHCP4_CONFIG_DATA Dhcp4ConfigData;
+ BOOLEAN MediaPresent;
Dhcp4Handle = NULL;
Dhcp4 = NULL;
ParaList = NULL;
//
+ // Check media status before do DHCP
+ //
+ MediaPresent = TRUE;
+ NetLibDetectMedia (Controller, &MediaPresent);
+ if (!MediaPresent) {
+ return EFI_NO_MEDIA;
+ }
+
+ //
// Create a DHCP4 child instance and get the protocol.
//
Status = NetLibCreateServiceChild (
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDhcp.h b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDhcp.h
index 07b30a936c..eefc5b37a8 100644
--- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDhcp.h
+++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDhcp.h
@@ -1,7 +1,7 @@
/** @file
The header file of IScsiDhcp.
-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 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
@@ -47,7 +47,9 @@ typedef struct _ISCSI_ROOT_PATH_FIELD {
@retval EFI_SUCCESS The DNS information is got from the DHCP ACK.
@retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
+ @retval EFI_NO_MEDIA There was a media error.
@retval Others Other errors as indicated.
+
**/
EFI_STATUS
IScsiDoDhcp (
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c
index ac0d8d821f..2261bc17f0 100644
--- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c
+++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c
@@ -1,7 +1,7 @@
/** @file
The implementation of iSCSI protocol based on RFC3720.
-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 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
@@ -276,7 +276,9 @@ IScsiDestroyConnection (
@retval EFI_SUCCESS The iSCSI session login procedure finished.
@retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
+ @retval EFI_NO_MEDIA There was a media error.
@retval Others Other errors as indicated.
+
**/
EFI_STATUS
IScsiSessionLogin (
@@ -287,10 +289,20 @@ IScsiSessionLogin (
ISCSI_SESSION *Session;
ISCSI_CONNECTION *Conn;
EFI_TCP4_PROTOCOL *Tcp4;
+ BOOLEAN MediaPresent;
Session = &Private->Session;
//
+ // Check media status before session login
+ //
+ MediaPresent = TRUE;
+ NetLibDetectMedia (Private->Controller, &MediaPresent);
+ if (!MediaPresent) {
+ return EFI_NO_MEDIA;
+ }
+
+ //
// Create a connection for the session.
//
Conn = IScsiCreateConnection (Private, Session);
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.h b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.h
index 93fe2af5b7..e11565e301 100644
--- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.h
+++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.h
@@ -1,7 +1,7 @@
/** @file
The header file of iSCSI Protocol that defines many specific data structures.
-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 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
@@ -692,7 +692,9 @@ IScsiDestroyConnection (
@retval EFI_SUCCESS The iSCSI session login procedure finished.
@retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
+ @retval EFI_NO_MEDIA There was a media error.
@retval Others Other errors as indicated.
+
**/
EFI_STATUS
IScsiSessionLogin (