2 The header file of IScsiConfig.c.
4 Copyright (c) 2004 - 2009, Intel Corporation.<BR>
5 All rights reserved. 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
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.
15 #ifndef _ISCSI_CONFIG_H_
16 #define _ISCSI_CONFIG_H_
18 #include <Guid/MdeModuleHii.h>
19 #include <Protocol/HiiConfigRouting.h>
20 #include <Library/HiiLib.h>
21 #include <Library/DevicePathLib.h>
22 #include <Library/DebugLib.h>
23 #include <Library/BaseLib.h>
24 #include <Library/NetLib.h>
26 extern UINT8 IScsiConfigDxeBin
[];
27 extern UINT8 IScsiDxeStrings
[];
29 #define ISCSI_INITATOR_NAME_VAR_NAME L"I_NAME"
31 #define ISCSI_CONFIG_VAR_ATTR (EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE)
33 #define ISCSI_FORM_CALLBACK_INFO_SIGNATURE SIGNATURE_32 ('I', 'f', 'c', 'i')
38 If the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear,
39 then this macro return a pointer to a data structure ISCSI_FORM_CALLBACK_INFO.
41 If the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set,
42 The Signature field of the data structure ISCSI_FORM_CALLBACK_INFO
43 is compared to TestSignature. If the signatures match, then a pointer
44 to the pointer to a data structure ISCSI_FORM_CALLBACK_INFO is returned.
45 If the signatures do not match, then DebugAssert() is called with a description
46 of "CR has a bad signature" and Callback is returned.
48 If the data type ISCSI_FORM_CALLBACK_INFO_SIGNATURE does not contain the field
49 specified by Callback, then the module will not compile.
51 If ISCSI_FORM_CALLBACK_INFO_SIGNATURE does not contain a field called Signature,
52 then the module will not compile.
54 @param Callback Pointer to the specified field within the data
55 structure ISCSI_FORM_CALLBACK_INFO.
56 @return A pointer to the pointer to a data structure ISCSI_FORM_CALLBACK_INFO.
57 @retval Others Some unexpected error happened.
60 #define ISCSI_FORM_CALLBACK_INFO_FROM_FORM_CALLBACK(Callback) \
63 ISCSI_FORM_CALLBACK_INFO, \
65 ISCSI_FORM_CALLBACK_INFO_SIGNATURE \
70 typedef struct _ISCSI_MAC_INFO
{
76 typedef struct _ISCSI_DEVICE_LIST
{
78 ISCSI_MAC_INFO MacInfo
[1];
83 typedef struct _ISCSI_CONFIG_FORM_ENTRY
{
85 EFI_HANDLE Controller
;
87 EFI_STRING_ID PortTitleToken
;
88 EFI_STRING_ID PortTitleHelpToken
;
90 ISCSI_SESSION_CONFIG_NVDATA SessionConfigData
;
91 ISCSI_CHAP_AUTH_CONFIG_NVDATA AuthConfigData
;
92 } ISCSI_CONFIG_FORM_ENTRY
;
94 typedef struct _ISCSI_FORM_CALLBACK_INFO
{
96 EFI_HANDLE DriverHandle
;
97 EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess
;
98 EFI_HII_DATABASE_PROTOCOL
*HiiDatabase
;
99 EFI_HII_CONFIG_ROUTING_PROTOCOL
*ConfigRouting
;
102 EFI_HII_HANDLE RegisteredHandle
;
103 ISCSI_CONFIG_FORM_ENTRY
*Current
;
104 } ISCSI_FORM_CALLBACK_INFO
;
109 /// HII specific Vendor Device Path definition.
112 VENDOR_DEVICE_PATH VendorDevicePath
;
113 EFI_DEVICE_PATH_PROTOCOL End
;
114 } HII_VENDOR_DEVICE_PATH
;
119 Updates the iSCSI configuration form to add/delete an entry for the iSCSI
120 device specified by the Controller.
122 @param[in] DriverBindingHandle The driverbinding handle.
123 @param[in] Controller The controller handle of the iSCSI device.
124 @param[in] AddForm Whether to add or delete a form entry.
126 @retval EFI_SUCCESS The iSCSI configuration form is updated.
127 @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
128 @retval Others Other errors as indicated.
131 IScsiConfigUpdateForm (
132 IN EFI_HANDLE DriverBindingHandle
,
133 IN EFI_HANDLE Controller
,
138 Initialize the iSCSI configuration form.
140 @param[in] DriverBindingHandle The iSCSI driverbinding handle.
142 @retval EFI_SUCCESS The iSCSI configuration form is initialized.
143 @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
144 @retval Others Other errors as indicated.
147 IScsiConfigFormInit (
152 Unload the iSCSI configuration form, this includes: delete all the iSCSI
153 device configuration entries, uninstall the form callback protocol and
154 free the resources used.
156 @param[in] DriverBindingHandle The iSCSI driverbinding handle.
158 @retval EFI_SUCCESS The iSCSI configuration form is unloaded.
159 @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
162 IScsiConfigFormUnload (
163 IN EFI_HANDLE DriverBindingHandle