]>
Commit | Line | Data |
---|---|---|
12618416 | 1 | /** @file\r |
94451634 | 2 | The header file of IScsiDriver.c.\r |
6a690e23 | 3 | \r |
94451634 | 4 | Copyright (c) 2004 - 2008, Intel Corporation.<BR>\r |
7a444476 | 5 | All rights reserved. This program and the accompanying materials\r |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT 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 | |
18 | #include <PiDxe.h>\r | |
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 | |
29 | #include <Protocol/IScsiInitiatorName.h>\r | |
30 | #include <Protocol/Ip4Config.h>\r | |
31 | #include <Protocol/ComponentName.h>\r | |
32 | #include <Protocol/ComponentName2.h>\r | |
6a690e23 | 33 | \r |
94451634 | 34 | \r |
6a690e23 | 35 | #define ISCSI_PRIVATE_GUID \\r |
36a975dd | 36 | { 0xfa3cde4c, 0x87c2, 0x427d, {0xae, 0xde, 0x7d, 0xd0, 0x96, 0xc8, 0x8c, 0x58} }\r |
6a690e23 | 37 | \r |
38 | #define ISCSI_INITIATOR_NAME_VAR_NAME L"I_NAME"\r | |
39 | \r | |
40 | extern EFI_COMPONENT_NAME2_PROTOCOL gIScsiComponentName2;\r | |
41 | extern EFI_COMPONENT_NAME_PROTOCOL gIScsiComponentName;\r | |
42 | \r | |
6a690e23 | 43 | \r |
44 | extern EFI_GUID mIScsiPrivateGuid;\r | |
45 | \r | |
46 | typedef struct _ISCSI_PRIVATE_PROTOCOL {\r | |
47 | UINT32 Reserved;\r | |
48 | } ISCSI_PRIVATE_PROTOCOL;\r | |
49 | \r | |
50 | //\r | |
51 | // EFI Driver Binding Protocol for iSCSI driver.\r | |
52 | //\r | |
12618416 | 53 | \r |
94451634 | 54 | /**\r |
55 | Tests to see if this driver supports a given controller. If a child device is provided, \r | |
56 | it further tests to see if this driver supports creating a handle for the specified child device.\r | |
57 | \r | |
58 | @param This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r | |
59 | @param ControllerHandle The handle of the controller to test. This handle \r | |
60 | must support a protocol interface that supplies \r | |
61 | an I/O abstraction to the driver.\r | |
62 | @param RemainingDevicePath A pointer to the remaining portion of a device path. \r | |
63 | This parameter is ignored by device drivers, and is optional for bus drivers.\r | |
64 | \r | |
65 | \r | |
66 | @retval EFI_SUCCESS The device specified by ControllerHandle and\r | |
67 | RemainingDevicePath is supported by the driver specified by This.\r | |
68 | @retval EFI_ALREADY_STARTED The device specified by ControllerHandle and\r | |
69 | RemainingDevicePath is already being managed by the driver\r | |
70 | specified by This.\r | |
71 | @retval EFI_ACCESS_DENIED The device specified by ControllerHandle and\r | |
72 | RemainingDevicePath is already being managed by a different\r | |
73 | driver or an application that requires exclusive acces.\r | |
74 | Currently not implemented.\r | |
75 | @retval EFI_UNSUPPORTED The device specified by ControllerHandle and\r | |
76 | RemainingDevicePath is not supported by the driver specified by This.\r | |
12618416 | 77 | **/\r |
6a690e23 | 78 | EFI_STATUS\r |
79 | EFIAPI\r | |
80 | IScsiDriverBindingSupported (\r | |
81 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
82 | IN EFI_HANDLE ControllerHandle,\r | |
83 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r | |
84 | );\r | |
85 | \r | |
12618416 | 86 | /**\r |
94451634 | 87 | Start this driver on ControllerHandle. The Start() function is designed to be \r |
88 | invoked from the EFI boot service ConnectController(). As a result, much of \r | |
89 | the error checking on the parameters to Start() has been moved into this \r | |
90 | common boot service. It is legal to call Start() from other locations, \r | |
91 | but the following calling restrictions must be followed or the system behavior will not be deterministic.\r | |
92 | 1. ControllerHandle must be a valid EFI_HANDLE.\r | |
93 | 2. If RemainingDevicePath is not NULL, then it must be a pointer to a naturally aligned\r | |
94 | EFI_DEVICE_PATH_PROTOCOL.\r | |
95 | 3. Prior to calling Start(), the Supported() function for the driver specified by This must\r | |
96 | have been called with the same calling parameters, and Supported() must have returned EFI_SUCCESS. \r | |
97 | \r | |
98 | @param This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r | |
99 | @param ControllerHandle The handle of the controller to start. This handle \r | |
100 | must support a protocol interface that supplies \r | |
101 | an I/O abstraction to the driver.\r | |
102 | @param RemainingDevicePath A pointer to the remaining portion of a device path. \r | |
103 | This parameter is ignored by device drivers, and is optional for bus drivers.\r | |
104 | \r | |
105 | @retval EFI_SUCCESS The device was started.\r | |
106 | @retval EFI_DEVICE_ERROR The device could not be started due to a device error.Currently not implemented.\r | |
107 | @retval EFI_OUT_OF_RESOURCES The request could not be completed due to a lack of resources.\r | |
108 | @retval other The driver failded to start the device.\r | |
12618416 | 109 | **/\r |
6a690e23 | 110 | EFI_STATUS\r |
111 | EFIAPI\r | |
112 | IScsiDriverBindingStart (\r | |
113 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
114 | IN EFI_HANDLE ControllerHandle,\r | |
115 | IN EFI_DEVICE_PATH_PROTOCOL *RemainingDevicePath OPTIONAL\r | |
116 | );\r | |
117 | \r | |
12618416 | 118 | /**\r |
94451634 | 119 | Stop this driver on ControllerHandle. \r |
120 | \r | |
121 | Release the control of this controller and remove the IScsi functions. The Stop()\r | |
122 | function is designed to be invoked from the EFI boot service DisconnectController(). \r | |
123 | As a result, much of the error checking on the parameters to Stop() has been moved \r | |
124 | into this common boot service. It is legal to call Stop() from other locations, \r | |
125 | but the following calling restrictions must be followed or the system behavior will not be deterministic.\r | |
126 | 1. ControllerHandle must be a valid EFI_HANDLE that was used on a previous call to this\r | |
127 | same driver's Start() function.\r | |
128 | 2. The first NumberOfChildren handles of ChildHandleBuffer must all be a valid\r | |
129 | EFI_HANDLE. In addition, all of these handles must have been created in this driver's\r | |
130 | Start() function, and the Start() function must have called OpenProtocol() on\r | |
131 | ControllerHandle with an Attribute of EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER.\r | |
132 | \r | |
133 | @param This A pointer to the EFI_DRIVER_BINDING_PROTOCOL instance.\r | |
134 | @param ControllerHandle A handle to the device being stopped. The handle must \r | |
135 | support a bus specific I/O protocol for the driver \r | |
136 | to use to stop the device.\r | |
137 | @param NumberOfChildren The number of child device handles in ChildHandleBuffer.Not used.\r | |
138 | @param ChildHandleBuffer An array of child handles to be freed. May be NULL \r | |
139 | if NumberOfChildren is 0.Not used.\r | |
140 | \r | |
141 | @retval EFI_SUCCESS The device was stopped.\r | |
142 | @retval EFI_DEVICE_ERROR The device could not be stopped due to a device error.\r | |
12618416 | 143 | **/\r |
6a690e23 | 144 | EFI_STATUS\r |
145 | EFIAPI\r | |
146 | IScsiDriverBindingStop (\r | |
147 | IN EFI_DRIVER_BINDING_PROTOCOL *This,\r | |
148 | IN EFI_HANDLE ControllerHandle,\r | |
149 | IN UINTN NumberOfChildren,\r | |
150 | IN EFI_HANDLE *ChildHandleBuffer\r | |
151 | );\r | |
152 | \r | |
153 | //\r | |
12618416 | 154 | // EFI Component Name Protocol for IScsi driver.\r |
6a690e23 | 155 | //\r |
12618416 | 156 | /**\r |
157 | Retrieves a Unicode string that is the user readable name of the EFI Driver.\r | |
158 | \r | |
159 | This function retrieves the user readable name of a driver in the form of a\r | |
160 | Unicode string. If the driver specified by This has a user readable name in\r | |
161 | the language specified by Language, then a pointer to the driver name is\r | |
162 | returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r | |
163 | by This does not support the language specified by Language,\r | |
164 | then EFI_UNSUPPORTED is returned.\r | |
165 | \r | |
166 | @param This[in] A pointer to the EFI_COMPONENT_NAME_PROTOCOL\r | |
167 | instance.\r | |
168 | \r | |
169 | @param Language[in] A pointer to a three character ISO 639-2 language\r | |
170 | identifier.\r | |
171 | This is the language of the driver name that that\r | |
172 | the caller is requesting, and it must match one of\r | |
173 | the languages specified in SupportedLanguages. \r | |
174 | The number of languages supported by a driver is up\r | |
175 | to the driver writer.\r | |
176 | \r | |
177 | @param DriverName[out] A pointer to the Unicode string to return.\r | |
178 | This Unicode string is the name of the\r | |
179 | driver specified by This in the language\r | |
180 | specified by Language.\r | |
181 | \r | |
182 | @retval EFI_SUCCESS The Unicode string for the Driver specified by\r | |
183 | This and the language specified by Language was\r | |
184 | returned in DriverName.\r | |
185 | \r | |
186 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
187 | \r | |
188 | @retval EFI_INVALID_PARAMETER DriverName is NULL.\r | |
189 | \r | |
190 | @retval EFI_UNSUPPORTED The driver specified by This does not support\r | |
191 | the language specified by Language.\r | |
192 | \r | |
193 | **/\r | |
6a690e23 | 194 | EFI_STATUS\r |
195 | EFIAPI\r | |
196 | IScsiComponentNameGetDriverName (\r | |
197 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
198 | IN CHAR8 *Language,\r | |
199 | OUT CHAR16 **DriverName\r | |
200 | );\r | |
201 | \r | |
12618416 | 202 | /**\r |
203 | Retrieves a Unicode string that is the user readable name of the controller\r | |
204 | that is being managed by an EFI Driver.\r | |
205 | \r | |
206 | @param This[in] A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r | |
207 | \r | |
208 | @param ControllerHandle[in] The handle of a controller that the driver specified by\r | |
209 | This is managing. This handle specifies the controller\r | |
210 | whose name is to be returned.\r | |
211 | \r | |
212 | @param ChildHandle[in] The handle of the child controller to retrieve the name\r | |
213 | of. This is an optional parameter that may be NULL. It\r | |
214 | will be NULL for device drivers. It will also be NULL\r | |
215 | for a bus drivers that wish to retrieve the name of the\r | |
216 | bus controller. It will not be NULL for a bus driver\r | |
217 | that wishes to retrieve the name of a child controller.\r | |
218 | \r | |
219 | @param Language[in] A pointer to a three character ISO 639-2 language \r | |
220 | identifier. This is the language of the controller name\r | |
221 | that that the caller is requesting, and it must match one\r | |
222 | of the languages specified in SupportedLanguages. The\r | |
223 | number of languages supported by a driver is up to the\r | |
224 | driver writer.\r | |
225 | \r | |
226 | @param ControllerName[out] A pointer to the Unicode string to return. This Unicode\r | |
227 | string is the name of the controller specified by \r | |
228 | ControllerHandle and ChildHandle in the language \r | |
229 | specified by Language from the point of view of the \r | |
230 | driver specified by This. \r | |
231 | \r | |
232 | @retval EFI_SUCCESS The Unicode string for the user readable name in the \r | |
233 | language specified by Language for the driver \r | |
234 | specified by This was returned in DriverName.\r | |
235 | \r | |
236 | @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r | |
237 | \r | |
238 | @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r | |
239 | \r | |
240 | @retval EFI_INVALID_PARAMETER Language is NULL.\r | |
241 | \r | |
242 | @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r | |
243 | \r | |
244 | @retval EFI_UNSUPPORTED The driver specified by This is not currently managing\r | |
245 | the controller specified by ControllerHandle and ChildHandle.\r | |
246 | \r | |
247 | @retval EFI_UNSUPPORTED The driver specified by This does not support the \r | |
248 | language specified by Language.\r | |
249 | \r | |
250 | **/\r | |
6a690e23 | 251 | EFI_STATUS\r |
252 | EFIAPI\r | |
253 | IScsiComponentNameGetControllerName (\r | |
254 | IN EFI_COMPONENT_NAME_PROTOCOL *This,\r | |
255 | IN EFI_HANDLE ControllerHandle,\r | |
256 | IN EFI_HANDLE ChildHandle OPTIONAL,\r | |
257 | IN CHAR8 *Language,\r | |
258 | OUT CHAR16 **ControllerName\r | |
259 | );\r | |
260 | \r | |
6a690e23 | 261 | #endif\r |