]>
Commit | Line | Data |
---|---|---|
12618416 | 1 | /** @file\r |
d272bf7d | 2 | The header file of IScsiConfig.c.\r |
6a690e23 | 3 | \r |
d272bf7d | 4 | Copyright (c) 2004 - 2008, Intel Corporation.<BR>\r |
7a444476 | 5 | All rights reserved. This program and the accompanying materials\r |
6 | are licensed and made available under the terms and conditions of the BSD License\r | |
7 | which accompanies this distribution. The full text of the license may be found at\r | |
8 | http://opensource.org/licenses/bsd-license.php\r | |
9 | \r | |
10 | THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r | |
11 | WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r | |
6a690e23 | 12 | \r |
12618416 | 13 | **/\r |
6a690e23 | 14 | \r |
15 | #ifndef _ISCSI_CONFIG_H_\r | |
16 | #define _ISCSI_CONFIG_H_\r | |
17 | \r | |
93e3992d | 18 | #include <Library/HiiLib.h>\r |
9226efe5 | 19 | #include <Library/ExtendedHiiLib.h>\r |
93e3992d | 20 | #include <Library/IfrSupportLib.h>\r |
9226efe5 | 21 | #include <Library/ExtendedIfrSupportLib.h>\r |
6a690e23 | 22 | #include <Library/DebugLib.h>\r |
23 | #include <Library/BaseLib.h>\r | |
6a690e23 | 24 | #include <Library/NetLib.h>\r |
6a690e23 | 25 | \r |
26 | extern UINT8 IScsiConfigDxeBin[];\r | |
7a444476 | 27 | extern UINT8 IScsiDxeStrings[];\r |
6a690e23 | 28 | \r |
29 | #define ISCSI_INITATOR_NAME_VAR_NAME L"I_NAME"\r | |
30 | \r | |
31 | #define ISCSI_CONFIG_VAR_ATTR (EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE)\r | |
32 | \r | |
f3f2e05d | 33 | #define ISCSI_FORM_CALLBACK_INFO_SIGNATURE SIGNATURE_32 ('I', 'f', 'c', 'i')\r |
6a690e23 | 34 | \r |
963dbb30 | 35 | \r |
36 | \r | |
37 | /**\r | |
38 | If the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear, \r | |
39 | then this macro return a pointer to a data structure ISCSI_FORM_CALLBACK_INFO.\r | |
40 | \r | |
41 | If the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set, \r | |
42 | The Signature field of the data structure ISCSI_FORM_CALLBACK_INFO \r | |
43 | is compared to TestSignature. If the signatures match, then a pointer \r | |
44 | to the pointer to a data structure ISCSI_FORM_CALLBACK_INFO is returned. \r | |
45 | If the signatures do not match, then DebugAssert() is called with a description \r | |
46 | of "CR has a bad signature" and Callback is returned. \r | |
47 | \r | |
48 | If the data type ISCSI_FORM_CALLBACK_INFO_SIGNATURE does not contain the field\r | |
49 | specified by Callback, then the module will not compile.\r | |
50 | \r | |
51 | If ISCSI_FORM_CALLBACK_INFO_SIGNATURE does not contain a field called Signature, \r | |
52 | then the module will not compile.\r | |
53 | \r | |
54 | @param Callback Pointer to the specified field within the data \r | |
55 | structure ISCSI_FORM_CALLBACK_INFO.\r | |
56 | @return a pointer to the pointer to a data structure ISCSI_FORM_CALLBACK_INFO.\r | |
57 | @return Others Some unexpected error happened.\r | |
58 | **/\r | |
59 | \r | |
6a690e23 | 60 | #define ISCSI_FORM_CALLBACK_INFO_FROM_FORM_CALLBACK(Callback) \\r |
61 | CR ( \\r | |
62 | Callback, \\r | |
63 | ISCSI_FORM_CALLBACK_INFO, \\r | |
93e3992d | 64 | ConfigAccess, \\r |
6a690e23 | 65 | ISCSI_FORM_CALLBACK_INFO_SIGNATURE \\r |
66 | )\r | |
67 | \r | |
68 | #pragma pack(1)\r | |
69 | \r | |
70 | typedef struct _ISCSI_MAC_INFO {\r | |
71 | EFI_MAC_ADDRESS Mac;\r | |
72 | UINT8 Len;\r | |
73 | } ISCSI_MAC_INFO;\r | |
74 | \r | |
75 | typedef struct _ISCSI_DEVICE_LIST {\r | |
76 | UINT8 NumDevice;\r | |
77 | ISCSI_MAC_INFO MacInfo[1];\r | |
78 | } ISCSI_DEVICE_LIST;\r | |
79 | \r | |
80 | #pragma pack()\r | |
81 | \r | |
82 | typedef struct _ISCSI_CONFIG_FORM_ENTRY {\r | |
e48e37fc | 83 | LIST_ENTRY Link;\r |
6a690e23 | 84 | EFI_HANDLE Controller;\r |
85 | CHAR16 MacString[95];\r | |
6c7a807a | 86 | EFI_STRING_ID PortTitleToken;\r |
87 | EFI_STRING_ID PortTitleHelpToken;\r | |
6a690e23 | 88 | \r |
89 | ISCSI_SESSION_CONFIG_NVDATA SessionConfigData;\r | |
90 | ISCSI_CHAP_AUTH_CONFIG_NVDATA AuthConfigData;\r | |
91 | } ISCSI_CONFIG_FORM_ENTRY;\r | |
92 | \r | |
93 | typedef struct _ISCSI_FORM_CALLBACK_INFO {\r | |
93e3992d | 94 | UINTN Signature;\r |
95 | EFI_HANDLE DriverHandle;\r | |
96 | EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess;\r | |
97 | EFI_HII_DATABASE_PROTOCOL *HiiDatabase;\r | |
98 | EFI_HII_CONFIG_ROUTING_PROTOCOL *ConfigRouting;\r | |
99 | UINT16 *KeyList;\r | |
100 | VOID *FormBuffer;\r | |
101 | EFI_HII_HANDLE RegisteredHandle;\r | |
102 | ISCSI_CONFIG_FORM_ENTRY *Current;\r | |
6a690e23 | 103 | } ISCSI_FORM_CALLBACK_INFO;\r |
104 | \r | |
12618416 | 105 | /**\r |
106 | Updates the iSCSI configuration form to add/delete an entry for the iSCSI\r | |
107 | device specified by the Controller.\r | |
108 | \r | |
d272bf7d | 109 | @param[in] DriverBindingHandle The driverbinding handle.\r |
110 | @param[in] Controller The controller handle of the iSCSI device.\r | |
111 | @param[in] AddForm Whether to add or delete a form entry.\r | |
12618416 | 112 | \r |
113 | @retval EFI_SUCCESS The iSCSI configuration form is updated.\r | |
12618416 | 114 | @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r |
963dbb30 | 115 | @retval Others Other errors as indicated.\r |
12618416 | 116 | **/\r |
6a690e23 | 117 | EFI_STATUS\r |
118 | IScsiConfigUpdateForm (\r | |
119 | IN EFI_HANDLE DriverBindingHandle,\r | |
120 | IN EFI_HANDLE Controller,\r | |
121 | IN BOOLEAN AddForm\r | |
122 | );\r | |
123 | \r | |
12618416 | 124 | /**\r |
125 | Initialize the iSCSI configuration form.\r | |
126 | \r | |
d272bf7d | 127 | @param[in] DriverBindingHandle The iSCSI driverbinding handle.\r |
12618416 | 128 | \r |
d272bf7d | 129 | @retval EFI_SUCCESS The iSCSI configuration form is initialized.\r |
130 | @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r | |
963dbb30 | 131 | @retval Others Other errors as indicated.\r |
12618416 | 132 | **/\r |
6a690e23 | 133 | EFI_STATUS\r |
134 | IScsiConfigFormInit (\r | |
963dbb30 | 135 | VOID\r |
6a690e23 | 136 | );\r |
137 | \r | |
12618416 | 138 | /**\r |
139 | Unload the iSCSI configuration form, this includes: delete all the iSCSI\r | |
140 | device configuration entries, uninstall the form callback protocol and\r | |
141 | free the resources used.\r | |
142 | \r | |
d272bf7d | 143 | @param[in] DriverBindingHandle The iSCSI driverbinding handle.\r |
144 | \r | |
12618416 | 145 | @retval EFI_SUCCESS The iSCSI configuration form is unloaded.\r |
12618416 | 146 | @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r |
12618416 | 147 | **/\r |
6a690e23 | 148 | EFI_STATUS\r |
149 | IScsiConfigFormUnload (\r | |
150 | IN EFI_HANDLE DriverBindingHandle\r | |
151 | );\r | |
152 | \r | |
153 | #endif\r |