]>
Commit | Line | Data |
---|---|---|
1 | /** @file\r | |
2 | The header file of functions for configuring or getting the parameters\r | |
3 | relating to iSCSI.\r | |
4 | \r | |
5 | Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r | |
6 | This program and the accompanying materials\r | |
7 | are licensed and made available under the terms and conditions of the BSD License\r | |
8 | which accompanies this distribution. The full text of the license may be found at\r | |
9 | http://opensource.org/licenses/bsd-license.php\r | |
10 | \r | |
11 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
12 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
13 | \r | |
14 | **/\r | |
15 | \r | |
16 | #ifndef _ISCSI_CONFIG_H_\r | |
17 | #define _ISCSI_CONFIG_H_\r | |
18 | \r | |
19 | #include "IScsiConfigNVDataStruc.h"\r | |
20 | \r | |
21 | typedef struct _ISCSI_FORM_CALLBACK_INFO ISCSI_FORM_CALLBACK_INFO;\r | |
22 | \r | |
23 | extern UINT8 IScsiConfigVfrBin[];\r | |
24 | extern UINT8 IScsiDxeStrings[];\r | |
25 | extern ISCSI_FORM_CALLBACK_INFO *mCallbackInfo;\r | |
26 | extern EFI_GUID mVendorGuid;\r | |
27 | \r | |
28 | \r | |
29 | #define VAR_OFFSET(Field) \\r | |
30 | ((UINT16) ((UINTN) &(((ISCSI_CONFIG_IFR_NVDATA *) 0)->Field)))\r | |
31 | \r | |
32 | #define QUESTION_ID(Field) \\r | |
33 | ((UINT16) (VAR_OFFSET (Field) + CONFIG_OPTION_OFFSET))\r | |
34 | \r | |
35 | \r | |
36 | #define DYNAMIC_ONE_OF_VAR_OFFSET VAR_OFFSET (Enabled)\r | |
37 | #define DYNAMIC_ORDERED_LIST_QUESTION_ID QUESTION_ID (DynamicOrderedList)\r | |
38 | #define DYNAMIC_ORDERED_LIST_VAR_OFFSET VAR_OFFSET (DynamicOrderedList)\r | |
39 | #define ATTEMPT_DEL_QUESTION_ID QUESTION_ID (DeleteAttemptList)\r | |
40 | #define ATTEMPT_DEL_VAR_OFFSET VAR_OFFSET (DeleteAttemptList)\r | |
41 | \r | |
42 | //\r | |
43 | // sizeof (EFI_MAC_ADDRESS) * 3\r | |
44 | //\r | |
45 | #define ISCSI_MAX_MAC_STRING_LEN 96\r | |
46 | \r | |
47 | #define ISCSI_INITATOR_NAME_VAR_NAME L"I_NAME"\r | |
48 | \r | |
49 | #define ISCSI_CONFIG_VAR_ATTR (EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE)\r | |
50 | \r | |
51 | #define ISCSI_FORM_CALLBACK_INFO_SIGNATURE SIGNATURE_32 ('I', 'f', 'c', 'i')\r | |
52 | \r | |
53 | #define ISCSI_FORM_CALLBACK_INFO_FROM_FORM_CALLBACK(Callback) \\r | |
54 | CR ( \\r | |
55 | Callback, \\r | |
56 | ISCSI_FORM_CALLBACK_INFO, \\r | |
57 | ConfigAccess, \\r | |
58 | ISCSI_FORM_CALLBACK_INFO_SIGNATURE \\r | |
59 | )\r | |
60 | \r | |
61 | #pragma pack(1)\r | |
62 | struct _ISCSI_ATTEMPT_CONFIG_NVDATA {\r | |
63 | LIST_ENTRY Link;\r | |
64 | UINT8 NicIndex;\r | |
65 | UINT8 AttemptConfigIndex;\r | |
66 | BOOLEAN DhcpSuccess;\r | |
67 | BOOLEAN ValidiBFTPath;\r | |
68 | BOOLEAN ValidPath;\r | |
69 | UINT8 AutoConfigureMode;\r | |
70 | EFI_STRING_ID AttemptTitleToken;\r | |
71 | EFI_STRING_ID AttemptTitleHelpToken;\r | |
72 | CHAR8 AttemptName[ATTEMPT_NAME_MAX_SIZE];\r | |
73 | CHAR8 MacString[ISCSI_MAX_MAC_STRING_LEN];\r | |
74 | EFI_IP_ADDRESS PrimaryDns;\r | |
75 | EFI_IP_ADDRESS SecondaryDns;\r | |
76 | EFI_IP_ADDRESS DhcpServer;\r | |
77 | ISCSI_SESSION_CONFIG_NVDATA SessionConfigData;\r | |
78 | UINT8 AuthenticationType;\r | |
79 | union {\r | |
80 | ISCSI_CHAP_AUTH_CONFIG_NVDATA CHAP;\r | |
81 | } AuthConfigData;\r | |
82 | \r | |
83 | };\r | |
84 | \r | |
85 | ///\r | |
86 | /// HII specific Vendor Device Path definition.\r | |
87 | ///\r | |
88 | typedef struct {\r | |
89 | VENDOR_DEVICE_PATH VendorDevicePath;\r | |
90 | EFI_DEVICE_PATH_PROTOCOL End;\r | |
91 | } HII_VENDOR_DEVICE_PATH;\r | |
92 | \r | |
93 | #pragma pack()\r | |
94 | \r | |
95 | struct _ISCSI_FORM_CALLBACK_INFO {\r | |
96 | UINT32 Signature;\r | |
97 | EFI_HANDLE DriverHandle;\r | |
98 | EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess;\r | |
99 | UINT16 *KeyList;\r | |
100 | VOID *FormBuffer;\r | |
101 | EFI_HII_HANDLE RegisteredHandle;\r | |
102 | ISCSI_ATTEMPT_CONFIG_NVDATA *Current;\r | |
103 | };\r | |
104 | \r | |
105 | /**\r | |
106 | Initialize the iSCSI configuration form.\r | |
107 | \r | |
108 | @param[in] DriverBindingHandle The iSCSI driverbinding handle.\r | |
109 | \r | |
110 | @retval EFI_SUCCESS The iSCSI configuration form is initialized.\r | |
111 | @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r | |
112 | \r | |
113 | **/\r | |
114 | EFI_STATUS\r | |
115 | IScsiConfigFormInit (\r | |
116 | IN EFI_HANDLE DriverBindingHandle\r | |
117 | );\r | |
118 | \r | |
119 | /**\r | |
120 | Unload the iSCSI configuration form, this includes: delete all the iSCSI\r | |
121 | configuration entries, uninstall the form callback protocol, and\r | |
122 | free the resources used.\r | |
123 | \r | |
124 | @param[in] DriverBindingHandle The iSCSI driverbinding handle.\r | |
125 | \r | |
126 | @retval EFI_SUCCESS The iSCSI configuration form is unloaded.\r | |
127 | @retval Others Failed to unload the form.\r | |
128 | \r | |
129 | **/\r | |
130 | EFI_STATUS\r | |
131 | IScsiConfigFormUnload (\r | |
132 | IN EFI_HANDLE DriverBindingHandle\r | |
133 | );\r | |
134 | \r | |
135 | /**\r | |
136 | Update the MAIN form to display the configured attempts.\r | |
137 | \r | |
138 | **/\r | |
139 | VOID\r | |
140 | IScsiConfigUpdateAttempt (\r | |
141 | VOID\r | |
142 | );\r | |
143 | \r | |
144 | /**\r | |
145 | Get the attempt config data from global structure by the ConfigIndex.\r | |
146 | \r | |
147 | @param[in] AttemptConfigIndex The unique index indicates the attempt.\r | |
148 | \r | |
149 | @return Pointer to the attempt config data.\r | |
150 | @retval NULL The attempt configuration data can not be found.\r | |
151 | \r | |
152 | **/\r | |
153 | ISCSI_ATTEMPT_CONFIG_NVDATA *\r | |
154 | IScsiConfigGetAttemptByConfigIndex (\r | |
155 | IN UINT8 AttemptConfigIndex\r | |
156 | );\r | |
157 | \r | |
158 | #endif\r |