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