summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c
diff options
context:
space:
mode:
authorSteven Kinney <steven.kinney@linaro.org>2013-12-17 14:11:15 -0600
committerSteven Kinney <steven.kinney@linaro.org>2013-12-17 14:11:15 -0600
commit18110e987bb049e24ade0fb63b5577def8f99114 (patch)
tree9e8970d250ea95ffdc01cf81480a17c9b3f515cd /MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c
parentaec0833cc55918a9111af736171ba8ceb976824e (diff)
parent709b5d97be16420bc96161221903abb006c076a1 (diff)
Merging uefi-next/linaro-release into masterlinaro-uefi-2013.12
Signed-off-by: Steven Kinney <steven.kinney@linaro.org>
Diffstat (limited to 'MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c')
-rw-r--r--MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c67
1 files changed, 55 insertions, 12 deletions
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c
index f668fe3d9..f4663d9f5 100644
--- a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c
+++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c
@@ -1,7 +1,7 @@
/** @file
The entry point of IScsi driver.
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
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
@@ -24,6 +24,44 @@ EFI_DRIVER_BINDING_PROTOCOL gIScsiDriverBinding = {
};
/**
+ Tests to see if this driver supports the RemainingDevicePath.
+
+ @param[in] RemainingDevicePath A pointer to the remaining portion of a device path. This
+ parameter is ignored by device drivers, and is optional for bus
+ drivers. For bus drivers, if this parameter is not NULL, then
+ the bus driver must determine if the bus controller specified
+ by ControllerHandle and the child controller specified
+ by RemainingDevicePath are both supported by this
+ bus driver.
+
+ @retval EFI_SUCCESS The RemainingDevicePath is supported or NULL.
+ @retval EFI_UNSUPPORTED The device specified by ControllerHandle and
+ RemainingDevicePath is not supported by the driver specified by This.
+**/
+EFI_STATUS
+IScsiIsDevicePathSupported (
+ IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL
+ )
+{
+ EFI_DEVICE_PATH_PROTOCOL *CurrentDevicePath;
+
+ CurrentDevicePath = RemainingDevicePath;
+ if (CurrentDevicePath != NULL) {
+ while (!IsDevicePathEnd (CurrentDevicePath)) {
+ if ((CurrentDevicePath->Type == MESSAGING_DEVICE_PATH) && (CurrentDevicePath->SubType == MSG_ISCSI_DP)) {
+ return EFI_SUCCESS;
+ }
+
+ CurrentDevicePath = NextDevicePathNode (CurrentDevicePath);
+ }
+
+ return EFI_UNSUPPORTED;
+ }
+
+ return EFI_SUCCESS;
+}
+
+/**
Tests to see if this driver supports a given controller. If a child device is provided,
it further tests to see if this driver supports creating a handle for the specified child device.
@@ -56,7 +94,6 @@ IScsiDriverBindingSupported (
)
{
EFI_STATUS Status;
- EFI_DEVICE_PATH_PROTOCOL *CurrentDevicePath;
Status = gBS->OpenProtocol (
ControllerHandle,
@@ -82,17 +119,23 @@ IScsiDriverBindingSupported (
return EFI_UNSUPPORTED;
}
- CurrentDevicePath = RemainingDevicePath;
- if (CurrentDevicePath != NULL) {
- while (!IsDevicePathEnd (CurrentDevicePath)) {
- if ((CurrentDevicePath->Type == MESSAGING_DEVICE_PATH) && (CurrentDevicePath->SubType == MSG_ISCSI_DP)) {
- return EFI_SUCCESS;
- }
+ Status = IScsiIsDevicePathSupported (RemainingDevicePath);
+ if (EFI_ERROR (Status)) {
+ return EFI_UNSUPPORTED;
+ }
- CurrentDevicePath = NextDevicePathNode (CurrentDevicePath);
+ if (IScsiDhcpIsConfigured (ControllerHandle)) {
+ Status = gBS->OpenProtocol (
+ ControllerHandle,
+ &gEfiDhcp4ServiceBindingProtocolGuid,
+ NULL,
+ This->DriverBindingHandle,
+ ControllerHandle,
+ EFI_OPEN_PROTOCOL_TEST_PROTOCOL
+ );
+ if (EFI_ERROR (Status)) {
+ return EFI_UNSUPPORTED;
}
-
- return EFI_UNSUPPORTED;
}
return EFI_SUCCESS;
@@ -170,7 +213,7 @@ IScsiDriverBindingStart (
goto ON_ERROR;
}
- //
+ //
// Always install private protocol no matter what happens later. We need to
// keep the relationship between ControllerHandle and ChildHandle.
//