]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.h
MdeModulePkg: Clean up source files
[mirror_edk2.git] / MdeModulePkg / Universal / Network / IScsiDxe / IScsiDriver.h
CommitLineData
12618416 1/** @file\r
94451634 2 The header file of IScsiDriver.c.\r
6a690e23 3\r
d1102dba 4Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>\r
e5eed7d3 5This program and the accompanying materials\r
7a444476 6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
6a690e23 12\r
12618416 13**/\r
6a690e23 14\r
15#ifndef _ISCSI_DRIVER_H_\r
16#define _ISCSI_DRIVER_H_\r
17\r
9ece9bd3 18#include <Uefi.h>\r
6a690e23 19#include <Protocol/DevicePath.h>\r
20#include <Protocol/LoadedImage.h>\r
5451bd96 21#include <Protocol/HiiConfigAccess.h>\r
22#include <Protocol/HiiDatabase.h>\r
6a690e23 23#include <Library/UefiDriverEntryPoint.h>\r
24#include <Library/UefiBootServicesTableLib.h>\r
25#include <Library/UefiLib.h>\r
26#include <Library/DevicePathLib.h>\r
9cb8724d 27#include <Protocol/DriverBinding.h>\r
28#include <Protocol/ScsiPassThruExt.h>\r
94451634 29\r
6a690e23 30#define ISCSI_INITIATOR_NAME_VAR_NAME L"I_NAME"\r
31\r
6a690e23 32typedef struct _ISCSI_PRIVATE_PROTOCOL {\r
33 UINT32 Reserved;\r
34} ISCSI_PRIVATE_PROTOCOL;\r
35\r
fd6f5e52 36//\r
37// EFI Driver Binding Protocol for iSCSI driver.\r
38//\r
12618416 39\r
94451634 40/**\r
d1102dba 41 Tests to see if this driver supports a given controller. If a child device is provided,\r
94451634 42 it further tests to see if this driver supports creating a handle for the specified child device.\r
43\r
753f9e69 44 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
d1102dba
LG
45 @param[in] ControllerHandle The handle of the controller to test. This handle\r
46 must support a protocol interface that supplies\r
753f9e69 47 an I/O abstraction to the driver.\r
d1102dba 48 @param[in] RemainingDevicePath A pointer to the remaining portion of a device path.\r
753f9e69 49 This parameter is ignored by device drivers, and is optional for bus drivers.\r
50\r
51\r
52 @retval EFI_SUCCESS The device specified by ControllerHandle and\r
53 RemainingDevicePath is supported by the driver specified by This.\r
54 @retval EFI_ALREADY_STARTED The device specified by ControllerHandle and\r
55 RemainingDevicePath is already being managed by the driver\r
56 specified by This.\r
57 @retval EFI_ACCESS_DENIED The device specified by ControllerHandle and\r
58 RemainingDevicePath is already being managed by a different\r
59 driver or an application that requires exclusive acces.\r
60 Currently not implemented.\r
61 @retval EFI_UNSUPPORTED The device specified by ControllerHandle and\r
62 RemainingDevicePath is not supported by the driver specified by This.\r
12618416 63**/\r
6a690e23 64EFI_STATUS\r
65EFIAPI\r
66IScsiDriverBindingSupported (\r
67 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
68 IN EFI_HANDLE ControllerHandle,\r
69 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r
70 );\r
71\r
12618416 72/**\r
d1102dba
LG
73 Start this driver on ControllerHandle. The Start() function is designed to be\r
74 invoked from the EFI boot service ConnectController(). As a result, much of\r
75 the error checking on the parameters to Start() has been moved into this\r
76 common boot service. It is legal to call Start() from other locations,\r
94451634 77 but the following calling restrictions must be followed or the system behavior will not be deterministic.\r
78 1. ControllerHandle must be a valid EFI_HANDLE.\r
79 2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned\r
80 EFI_DEVICE_PATH_PROTOCOL.\r
81 3. Prior to calling Start(), the Supported() function for the driver specified by This must\r
d1102dba 82 have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS.\r
94451634 83\r
753f9e69 84 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
d1102dba
LG
85 @param[in] ControllerHandle The handle of the controller to start. This handle\r
86 must support a protocol interface that supplies\r
753f9e69 87 an I/O abstraction to the driver.\r
d1102dba 88 @param[in] RemainingDevicePath A pointer to the remaining portion of a device path.\r
753f9e69 89 This parameter is ignored by device drivers, and is optional for bus drivers.\r
90\r
91 @retval EFI_SUCCESS The device was started.\r
92 @retval EFI_DEVICE_ERROR The device could not be started due to a device error.\r
93 Currently not implemented.\r
94 @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r
95 @retval Others The driver failded to start the device.\r
12618416 96**/\r
6a690e23 97EFI_STATUS\r
98EFIAPI\r
99IScsiDriverBindingStart (\r
100 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
101 IN EFI_HANDLE ControllerHandle,\r
102 IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r
103 );\r
104\r
12618416 105/**\r
d1102dba
LG
106 Stop this driver on ControllerHandle.\r
107\r
94451634 108 Release the control of this controller and remove the IScsi functions. The Stop()\r
d1102dba
LG
109 function is designed to be invoked from the EFI boot service DisconnectController().\r
110 As a result, much of the error checking on the parameters to Stop() has been moved\r
111 into this common boot service. It is legal to call Stop() from other locations,\r
94451634 112 but the following calling restrictions must be followed or the system behavior will not be deterministic.\r
113 1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this\r
114 same driver's Start() function.\r
115 2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid\r
116 EFI_HANDLE. In addition, all of these handles must have been created in this driver's\r
117 Start() function, and the Start() function must have called OpenProtocol() on\r
118 ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.\r
d1102dba 119\r
753f9e69 120 @param[in] This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r
d1102dba
LG
121 @param[in] ControllerHandle A handle to the device being stopped. The handle must\r
122 support a bus specific I/O protocol for the driver\r
753f9e69 123 to use to stop the device.\r
124 @param[in] NumberOfChildren The number of child device handles in ChildHandleBuffer.Not used.\r
d1102dba 125 @param[in] ChildHandleBuffer An array of child handles to be freed. May be NULL\r
753f9e69 126 if NumberOfChildren is 0.Not used.\r
127\r
128 @retval EFI_SUCCESS The device was stopped.\r
129 @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.\r
12618416 130**/\r
6a690e23 131EFI_STATUS\r
132EFIAPI\r
133IScsiDriverBindingStop (\r
134 IN EFI_DRIVER_BINDING_PROTOCOL *This,\r
135 IN EFI_HANDLE ControllerHandle,\r
136 IN UINTN NumberOfChildren,\r
c5de0d55 137 IN EFI_HANDLE *ChildHandleBuffer OPTIONAL\r
6a690e23 138 );\r
139\r
6a690e23 140#endif\r