2 The header file of functions for configuring or getting the parameters
5 Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 #ifndef _ISCSI_CONFIG_H_
17 #define _ISCSI_CONFIG_H_
19 #include "IScsiConfigNVDataStruc.h"
21 typedef struct _ISCSI_FORM_CALLBACK_INFO ISCSI_FORM_CALLBACK_INFO
;
23 extern UINT8 IScsiConfigVfrBin
[];
24 extern UINT8 IScsiDxeStrings
[];
25 extern ISCSI_FORM_CALLBACK_INFO
*mCallbackInfo
;
26 extern EFI_GUID mVendorGuid
;
29 #define VAR_OFFSET(Field) \
30 ((UINT16) ((UINTN) &(((ISCSI_CONFIG_IFR_NVDATA *) 0)->Field)))
32 #define QUESTION_ID(Field) \
33 ((UINT16) (VAR_OFFSET (Field) + CONFIG_OPTION_OFFSET))
36 #define DYNAMIC_ONE_OF_VAR_OFFSET VAR_OFFSET (Enabled)
37 #define DYNAMIC_ORDERED_LIST_QUESTION_ID QUESTION_ID (DynamicOrderedList)
38 #define DYNAMIC_ORDERED_LIST_VAR_OFFSET VAR_OFFSET (DynamicOrderedList)
39 #define ATTEMPT_DEL_QUESTION_ID QUESTION_ID (DeleteAttemptList)
40 #define ATTEMPT_DEL_VAR_OFFSET VAR_OFFSET (DeleteAttemptList)
43 // sizeof (EFI_MAC_ADDRESS) * 3
45 #define ISCSI_MAX_MAC_STRING_LEN 96
47 #define ISCSI_INITATOR_NAME_VAR_NAME L"I_NAME"
49 #define ISCSI_CONFIG_VAR_ATTR (EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE)
51 #define ISCSI_FORM_CALLBACK_INFO_SIGNATURE SIGNATURE_32 ('I', 'f', 'c', 'i')
53 #define ISCSI_FORM_CALLBACK_INFO_FROM_FORM_CALLBACK(Callback) \
56 ISCSI_FORM_CALLBACK_INFO, \
58 ISCSI_FORM_CALLBACK_INFO_SIGNATURE \
62 struct _ISCSI_ATTEMPT_CONFIG_NVDATA
{
65 UINT8 AttemptConfigIndex
;
67 BOOLEAN ValidiBFTPath
;
69 UINT8 AutoConfigureMode
;
70 EFI_STRING_ID AttemptTitleToken
;
71 EFI_STRING_ID AttemptTitleHelpToken
;
72 CHAR8 AttemptName
[ATTEMPT_NAME_MAX_SIZE
];
73 CHAR8 MacString
[ISCSI_MAX_MAC_STRING_LEN
];
74 EFI_IP_ADDRESS PrimaryDns
;
75 EFI_IP_ADDRESS SecondaryDns
;
76 EFI_IP_ADDRESS DhcpServer
;
77 ISCSI_SESSION_CONFIG_NVDATA SessionConfigData
;
78 UINT8 AuthenticationType
;
80 ISCSI_CHAP_AUTH_CONFIG_NVDATA CHAP
;
86 /// HII specific Vendor Device Path definition.
89 VENDOR_DEVICE_PATH VendorDevicePath
;
90 EFI_DEVICE_PATH_PROTOCOL End
;
91 } HII_VENDOR_DEVICE_PATH
;
95 struct _ISCSI_FORM_CALLBACK_INFO
{
97 EFI_HANDLE DriverHandle
;
98 EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess
;
101 EFI_HII_HANDLE RegisteredHandle
;
102 ISCSI_ATTEMPT_CONFIG_NVDATA
*Current
;
106 Initialize the iSCSI configuration form.
108 @param[in] DriverBindingHandle The iSCSI driverbinding handle.
110 @retval EFI_SUCCESS The iSCSI configuration form is initialized.
111 @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
115 IScsiConfigFormInit (
116 IN EFI_HANDLE DriverBindingHandle
120 Unload the iSCSI configuration form, this includes: delete all the iSCSI
121 configuration entries, uninstall the form callback protocol, and
122 free the resources used.
124 @param[in] DriverBindingHandle The iSCSI driverbinding handle.
126 @retval EFI_SUCCESS The iSCSI configuration form is unloaded.
127 @retval Others Failed to unload the form.
131 IScsiConfigFormUnload (
132 IN EFI_HANDLE DriverBindingHandle
136 Update the MAIN form to display the configured attempts.
140 IScsiConfigUpdateAttempt (
145 Get the attempt config data from global structure by the ConfigIndex.
147 @param[in] AttemptConfigIndex The unique index indicates the attempt.
149 @return Pointer to the attempt config data.
150 @retval NULL The attempt configuration data can not be found.
153 ISCSI_ATTEMPT_CONFIG_NVDATA
*
154 IScsiConfigGetAttemptByConfigIndex (
155 IN UINT8 AttemptConfigIndex