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