2 The header file of functions for configuring or getting the parameters
5 Copyright (c) 2004 - 2015, 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
;
28 #define VAR_OFFSET(Field) \
29 ((UINT16) ((UINTN) &(((ISCSI_CONFIG_IFR_NVDATA *) 0)->Field)))
31 #define QUESTION_ID(Field) \
32 ((UINT16) (VAR_OFFSET (Field) + CONFIG_OPTION_OFFSET))
35 #define DYNAMIC_ONE_OF_VAR_OFFSET VAR_OFFSET (Enabled)
36 #define DYNAMIC_ORDERED_LIST_QUESTION_ID QUESTION_ID (DynamicOrderedList)
37 #define DYNAMIC_ORDERED_LIST_VAR_OFFSET VAR_OFFSET (DynamicOrderedList)
38 #define ATTEMPT_DEL_QUESTION_ID QUESTION_ID (DeleteAttemptList)
39 #define ATTEMPT_DEL_VAR_OFFSET VAR_OFFSET (DeleteAttemptList)
42 // sizeof (EFI_MAC_ADDRESS) * 3
44 #define ISCSI_MAX_MAC_STRING_LEN 96
46 #define ISCSI_INITATOR_NAME_VAR_NAME L"I_NAME"
48 #define ISCSI_CONFIG_VAR_ATTR (EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE)
50 #define ISCSI_FORM_CALLBACK_INFO_SIGNATURE SIGNATURE_32 ('I', 'f', 'c', 'i')
52 #define ISCSI_FORM_CALLBACK_INFO_FROM_FORM_CALLBACK(Callback) \
55 ISCSI_FORM_CALLBACK_INFO, \
57 ISCSI_FORM_CALLBACK_INFO_SIGNATURE \
61 struct _ISCSI_ATTEMPT_CONFIG_NVDATA
{
64 UINT8 AttemptConfigIndex
;
66 BOOLEAN ValidiBFTPath
;
68 UINT8 AutoConfigureMode
;
69 EFI_STRING_ID AttemptTitleToken
;
70 EFI_STRING_ID AttemptTitleHelpToken
;
71 CHAR8 AttemptName
[ATTEMPT_NAME_MAX_SIZE
];
72 CHAR8 MacString
[ISCSI_MAX_MAC_STRING_LEN
];
73 EFI_IP_ADDRESS PrimaryDns
;
74 EFI_IP_ADDRESS SecondaryDns
;
75 EFI_IP_ADDRESS DhcpServer
;
76 ISCSI_SESSION_CONFIG_NVDATA SessionConfigData
;
77 UINT8 AuthenticationType
;
79 ISCSI_CHAP_AUTH_CONFIG_NVDATA CHAP
;
81 BOOLEAN AutoConfigureSuccess
;
85 /// HII specific Vendor Device Path definition.
88 VENDOR_DEVICE_PATH VendorDevicePath
;
89 EFI_DEVICE_PATH_PROTOCOL End
;
90 } HII_VENDOR_DEVICE_PATH
;
94 struct _ISCSI_FORM_CALLBACK_INFO
{
96 EFI_HANDLE DriverHandle
;
97 EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess
;
100 EFI_HII_HANDLE RegisteredHandle
;
101 ISCSI_ATTEMPT_CONFIG_NVDATA
*Current
;
105 Initialize the iSCSI configuration form.
107 @param[in] DriverBindingHandle The iSCSI driverbinding handle.
109 @retval EFI_SUCCESS The iSCSI configuration form is initialized.
110 @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
114 IScsiConfigFormInit (
115 IN EFI_HANDLE DriverBindingHandle
119 Unload the iSCSI configuration form, this includes: delete all the iSCSI
120 configuration entries, uninstall the form callback protocol, and
121 free the resources used.
123 @param[in] DriverBindingHandle The iSCSI driverbinding handle.
125 @retval EFI_SUCCESS The iSCSI configuration form is unloaded.
126 @retval Others Failed to unload the form.
130 IScsiConfigFormUnload (
131 IN EFI_HANDLE DriverBindingHandle
135 Update the MAIN form to display the configured attempts.
139 IScsiConfigUpdateAttempt (
144 Get the attempt config data from global structure by the ConfigIndex.
146 @param[in] AttemptConfigIndex The unique index indicates the attempt.
148 @return Pointer to the attempt config data.
149 @retval NULL The attempt configuration data can not be found.
152 ISCSI_ATTEMPT_CONFIG_NVDATA
*
153 IScsiConfigGetAttemptByConfigIndex (
154 IN UINT8 AttemptConfigIndex