]>
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 | |
33 | #define ISCSI_FORM_CALLBACK_INFO_SIGNATURE EFI_SIGNATURE_32 ('I', 'f', 'c', 'i')\r | |
34 | \r | |
35 | #define ISCSI_FORM_CALLBACK_INFO_FROM_FORM_CALLBACK(Callback) \\r | |
36 | CR ( \\r | |
37 | Callback, \\r | |
38 | ISCSI_FORM_CALLBACK_INFO, \\r | |
93e3992d | 39 | ConfigAccess, \\r |
6a690e23 | 40 | ISCSI_FORM_CALLBACK_INFO_SIGNATURE \\r |
41 | )\r | |
42 | \r | |
43 | #pragma pack(1)\r | |
44 | \r | |
45 | typedef struct _ISCSI_MAC_INFO {\r | |
46 | EFI_MAC_ADDRESS Mac;\r | |
47 | UINT8 Len;\r | |
48 | } ISCSI_MAC_INFO;\r | |
49 | \r | |
50 | typedef struct _ISCSI_DEVICE_LIST {\r | |
51 | UINT8 NumDevice;\r | |
52 | ISCSI_MAC_INFO MacInfo[1];\r | |
53 | } ISCSI_DEVICE_LIST;\r | |
54 | \r | |
55 | #pragma pack()\r | |
56 | \r | |
57 | typedef struct _ISCSI_CONFIG_FORM_ENTRY {\r | |
e48e37fc | 58 | LIST_ENTRY Link;\r |
6a690e23 | 59 | EFI_HANDLE Controller;\r |
60 | CHAR16 MacString[95];\r | |
6c7a807a | 61 | EFI_STRING_ID PortTitleToken;\r |
62 | EFI_STRING_ID PortTitleHelpToken;\r | |
6a690e23 | 63 | \r |
64 | ISCSI_SESSION_CONFIG_NVDATA SessionConfigData;\r | |
65 | ISCSI_CHAP_AUTH_CONFIG_NVDATA AuthConfigData;\r | |
66 | } ISCSI_CONFIG_FORM_ENTRY;\r | |
67 | \r | |
68 | typedef struct _ISCSI_FORM_CALLBACK_INFO {\r | |
93e3992d | 69 | UINTN Signature;\r |
70 | EFI_HANDLE DriverHandle;\r | |
71 | EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess;\r | |
72 | EFI_HII_DATABASE_PROTOCOL *HiiDatabase;\r | |
73 | EFI_HII_CONFIG_ROUTING_PROTOCOL *ConfigRouting;\r | |
74 | UINT16 *KeyList;\r | |
75 | VOID *FormBuffer;\r | |
76 | EFI_HII_HANDLE RegisteredHandle;\r | |
77 | ISCSI_CONFIG_FORM_ENTRY *Current;\r | |
6a690e23 | 78 | } ISCSI_FORM_CALLBACK_INFO;\r |
79 | \r | |
12618416 | 80 | /**\r |
81 | Updates the iSCSI configuration form to add/delete an entry for the iSCSI\r | |
82 | device specified by the Controller.\r | |
83 | \r | |
d272bf7d | 84 | @param[in] DriverBindingHandle The driverbinding handle.\r |
85 | @param[in] Controller The controller handle of the iSCSI device.\r | |
86 | @param[in] AddForm Whether to add or delete a form entry.\r | |
12618416 | 87 | \r |
88 | @retval EFI_SUCCESS The iSCSI configuration form is updated.\r | |
12618416 | 89 | @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r |
d272bf7d | 90 | @retval Others Some unexpected errors happened.\r |
12618416 | 91 | **/\r |
6a690e23 | 92 | EFI_STATUS\r |
93 | IScsiConfigUpdateForm (\r | |
94 | IN EFI_HANDLE DriverBindingHandle,\r | |
95 | IN EFI_HANDLE Controller,\r | |
96 | IN BOOLEAN AddForm\r | |
97 | );\r | |
98 | \r | |
12618416 | 99 | /**\r |
100 | Initialize the iSCSI configuration form.\r | |
101 | \r | |
d272bf7d | 102 | @param[in] DriverBindingHandle The iSCSI driverbinding handle.\r |
12618416 | 103 | \r |
d272bf7d | 104 | @retval EFI_SUCCESS The iSCSI configuration form is initialized.\r |
105 | @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r | |
106 | @retval Others Some unexpected error happened.\r | |
12618416 | 107 | **/\r |
6a690e23 | 108 | EFI_STATUS\r |
109 | IScsiConfigFormInit (\r | |
110 | IN EFI_HANDLE DriverBindingHandle\r | |
111 | );\r | |
112 | \r | |
12618416 | 113 | /**\r |
114 | Unload the iSCSI configuration form, this includes: delete all the iSCSI\r | |
115 | device configuration entries, uninstall the form callback protocol and\r | |
116 | free the resources used.\r | |
117 | \r | |
d272bf7d | 118 | @param[in] DriverBindingHandle The iSCSI driverbinding handle.\r |
119 | \r | |
12618416 | 120 | @retval EFI_SUCCESS The iSCSI configuration form is unloaded.\r |
12618416 | 121 | @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r |
12618416 | 122 | **/\r |
6a690e23 | 123 | EFI_STATUS\r |
124 | IScsiConfigFormUnload (\r | |
125 | IN EFI_HANDLE DriverBindingHandle\r | |
126 | );\r | |
127 | \r | |
128 | #endif\r |