]> git.proxmox.com Git - mirror_edk2.git/blame - MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.h
Update Module BaseName to avoid the same name.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / IScsiDxe / IScsiConfig.h
CommitLineData
12618416 1/** @file\r
d272bf7d 2 The header file of IScsiConfig.c.\r
6a690e23 3\r
b0c975b6 4Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>\r
e5eed7d3 5This program and the accompanying materials\r
7a444476 6are licensed and made available under the terms and conditions of the BSD License\r
7which accompanies this distribution. The full text of the license may be found at\r
8http://opensource.org/licenses/bsd-license.php\r
9\r
10THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
11WITHOUT 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
7e3bcccb 18#include <Guid/MdeModuleHii.h>\r
b9982883 19#include <Protocol/HiiConfigRouting.h>\r
93e3992d 20#include <Library/HiiLib.h>\r
f6f910dd 21#include <Library/DevicePathLib.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
26extern UINT8 IScsiConfigDxeBin[];\r
6a690e23 27\r
28#define ISCSI_INITATOR_NAME_VAR_NAME L"I_NAME"\r
29\r
30#define ISCSI_CONFIG_VAR_ATTR (EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE)\r
31\r
f3f2e05d 32#define ISCSI_FORM_CALLBACK_INFO_SIGNATURE SIGNATURE_32 ('I', 'f', 'c', 'i')\r
6a690e23 33\r
963dbb30 34\r
35\r
36/**\r
37 If the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear, \r
38 then this macro return a pointer to a data structure ISCSI_FORM_CALLBACK_INFO.\r
39\r
40 If the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set, \r
41 The Signature field of the data structure ISCSI_FORM_CALLBACK_INFO \r
42 is compared to TestSignature. If the signatures match, then a pointer \r
43 to the pointer to a data structure ISCSI_FORM_CALLBACK_INFO is returned. \r
44 If the signatures do not match, then DebugAssert() is called with a description \r
45 of "CR has a bad signature" and Callback is returned. \r
46\r
47 If the data type ISCSI_FORM_CALLBACK_INFO_SIGNATURE does not contain the field\r
48 specified by Callback, then the module will not compile.\r
49\r
50 If ISCSI_FORM_CALLBACK_INFO_SIGNATURE does not contain a field called Signature, \r
51 then the module will not compile.\r
52\r
55a64ae0 53 @param Callback Pointer to the specified field within the data \r
963dbb30 54 structure ISCSI_FORM_CALLBACK_INFO.\r
55a64ae0 55 @return A pointer to the pointer to a data structure ISCSI_FORM_CALLBACK_INFO.\r
56 @retval Others Some unexpected error happened.\r
963dbb30 57**/\r
58\r
6a690e23 59#define ISCSI_FORM_CALLBACK_INFO_FROM_FORM_CALLBACK(Callback) \\r
60 CR ( \\r
61 Callback, \\r
62 ISCSI_FORM_CALLBACK_INFO, \\r
93e3992d 63 ConfigAccess, \\r
6a690e23 64 ISCSI_FORM_CALLBACK_INFO_SIGNATURE \\r
65 )\r
66\r
67#pragma pack(1)\r
68\r
69typedef struct _ISCSI_MAC_INFO {\r
70 EFI_MAC_ADDRESS Mac;\r
71 UINT8 Len;\r
779ae357 72 UINT16 VlanId;\r
6a690e23 73} ISCSI_MAC_INFO;\r
74\r
75typedef 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
82typedef 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
93typedef 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
f6f910dd 105#pragma pack(1)\r
106\r
107///\r
108/// HII specific Vendor Device Path definition.\r
109///\r
110typedef struct {\r
111 VENDOR_DEVICE_PATH VendorDevicePath;\r
112 EFI_DEVICE_PATH_PROTOCOL End;\r
113} HII_VENDOR_DEVICE_PATH;\r
114\r
115#pragma pack()\r
116\r
12618416 117/**\r
118 Updates the iSCSI configuration form to add/delete an entry for the iSCSI\r
119 device specified by the Controller.\r
120\r
d272bf7d 121 @param[in] DriverBindingHandle The driverbinding handle.\r
122 @param[in] Controller The controller handle of the iSCSI device.\r
123 @param[in] AddForm Whether to add or delete a form entry.\r
12618416 124\r
125 @retval EFI_SUCCESS The iSCSI configuration form is updated.\r
12618416 126 @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r
963dbb30 127 @retval Others Other errors as indicated.\r
12618416 128**/\r
6a690e23 129EFI_STATUS\r
130IScsiConfigUpdateForm (\r
131 IN EFI_HANDLE DriverBindingHandle,\r
132 IN EFI_HANDLE Controller,\r
133 IN BOOLEAN AddForm\r
134 );\r
135\r
12618416 136/**\r
137 Initialize the iSCSI configuration form.\r
138\r
d272bf7d 139 @param[in] DriverBindingHandle The iSCSI driverbinding handle.\r
12618416 140\r
d272bf7d 141 @retval EFI_SUCCESS The iSCSI configuration form is initialized.\r
142 @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r
963dbb30 143 @retval Others Other errors as indicated.\r
12618416 144**/\r
6a690e23 145EFI_STATUS\r
146IScsiConfigFormInit (\r
963dbb30 147 VOID\r
6a690e23 148 );\r
149\r
12618416 150/**\r
151 Unload the iSCSI configuration form, this includes: delete all the iSCSI\r
152 device configuration entries, uninstall the form callback protocol and\r
153 free the resources used.\r
154\r
d272bf7d 155 @param[in] DriverBindingHandle The iSCSI driverbinding handle.\r
156 \r
12618416 157 @retval EFI_SUCCESS The iSCSI configuration form is unloaded.\r
12618416 158 @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r
12618416 159**/\r
6a690e23 160EFI_STATUS\r
161IScsiConfigFormUnload (\r
162 IN EFI_HANDLE DriverBindingHandle\r
163 );\r
164\r
165#endif\r