diff options
author | Wu Jiaxin <jiaxin.wu@intel.com> | 2013-10-25 08:07:26 +0000 |
---|---|---|
committer | jiaxinwu <jiaxinwu@6f19259b-4bc3-4df7-8a09-765794883524> | 2013-10-25 08:07:26 +0000 |
commit | b7cc5bf180e9deefc91a5e66e0b80fd222503608 (patch) | |
tree | 131122ba3d0e3a3e8d6488ef91a0fb550a7c3848 /NetworkPkg/IScsiDxe/IScsiDriver.c | |
parent | 05a300115ab80963e2a722aaaa8adbb3b6c5007c (diff) | |
download | edk2-b7cc5bf180e9deefc91a5e66e0b80fd222503608.zip edk2-b7cc5bf180e9deefc91a5e66e0b80fd222503608.tar.gz edk2-b7cc5bf180e9deefc91a5e66e0b80fd222503608.tar.bz2 |
Fix a bug about the iSCSI DHCP dependency issue.
Create rules to determine whether iSCSI need DHCP protocol in current configuration by examining user’s configuration data in DriverBindingSupported().
Signed-off-by: Wu Jiaxin <jiaxin.wu@intel.com >
Reviewed-by: Ye Ting <ting.ye@intel.com>
Reviewed-by: Fu Siyuan <siyuan.fu@intel.com>
git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14803 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'NetworkPkg/IScsiDxe/IScsiDriver.c')
-rw-r--r-- | NetworkPkg/IScsiDxe/IScsiDriver.c | 37 |
1 files changed, 28 insertions, 9 deletions
diff --git a/NetworkPkg/IScsiDxe/IScsiDriver.c b/NetworkPkg/IScsiDxe/IScsiDriver.c index cc452e7..6d6f9a1 100644 --- a/NetworkPkg/IScsiDxe/IScsiDriver.c +++ b/NetworkPkg/IScsiDxe/IScsiDriver.c @@ -112,13 +112,16 @@ IScsiSupported ( EFI_STATUS Status;
EFI_GUID *IScsiServiceBindingGuid;
EFI_GUID *TcpServiceBindingGuid;
+ EFI_GUID *DhcpServiceBindingGuid;
if (IpVersion == IP_VERSION_4) {
IScsiServiceBindingGuid = &gIScsiV4PrivateGuid;
TcpServiceBindingGuid = &gEfiTcp4ServiceBindingProtocolGuid;
+ DhcpServiceBindingGuid = &gEfiDhcp4ServiceBindingProtocolGuid;
} else {
IScsiServiceBindingGuid = &gIScsiV6PrivateGuid;
TcpServiceBindingGuid = &gEfiTcp6ServiceBindingProtocolGuid;
+ DhcpServiceBindingGuid = &gEfiDhcp6ServiceBindingProtocolGuid;
}
Status = gBS->OpenProtocol (
@@ -131,24 +134,40 @@ IScsiSupported ( );
if (!EFI_ERROR (Status)) {
return EFI_ALREADY_STARTED;
- } else {
+ }
+
+ Status = gBS->OpenProtocol (
+ ControllerHandle,
+ TcpServiceBindingGuid,
+ NULL,
+ This->DriverBindingHandle,
+ ControllerHandle,
+ EFI_OPEN_PROTOCOL_TEST_PROTOCOL
+ );
+ if (EFI_ERROR (Status)) {
+ return EFI_UNSUPPORTED;
+ }
+
+ Status = IScsiIsDevicePathSupported (RemainingDevicePath);
+ if (EFI_ERROR (Status)) {
+ return EFI_UNSUPPORTED;
+ }
+
+ if (IScsiDhcpIsConfigured (ControllerHandle, IpVersion)) {
Status = gBS->OpenProtocol (
ControllerHandle,
- TcpServiceBindingGuid,
+ DhcpServiceBindingGuid,
NULL,
This->DriverBindingHandle,
ControllerHandle,
EFI_OPEN_PROTOCOL_TEST_PROTOCOL
);
- if (!EFI_ERROR (Status)) {
- Status = IScsiIsDevicePathSupported (RemainingDevicePath);
- if (!EFI_ERROR (Status)) {
- return EFI_SUCCESS;
- }
+ if (EFI_ERROR (Status)) {
+ return EFI_UNSUPPORTED;
}
}
-
- return EFI_UNSUPPORTED;
+
+ return EFI_SUCCESS;
}
|