]> git.proxmox.com Git - mirror_edk2.git/blob - MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.h
update file header
[mirror_edk2.git] / MdeModulePkg / Universal / Network / IScsiDxe / IScsiConfig.h
1 /** @file
2 The header file of IScsiConfig.c.
3
4 Copyright (c) 2004 - 2008, Intel Corporation.<BR>
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
9
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
12
13 **/
14
15 #ifndef _ISCSI_CONFIG_H_
16 #define _ISCSI_CONFIG_H_
17
18 #include <Library/HiiLib.h>
19 #include <Library/ExtendedHiiLib.h>
20 #include <Library/IfrSupportLib.h>
21 #include <Library/ExtendedIfrSupportLib.h>
22 #include <Library/DebugLib.h>
23 #include <Library/BaseLib.h>
24 #include <Library/NetLib.h>
25
26 extern UINT8 IScsiConfigDxeBin[];
27 extern UINT8 IScsiDxeStrings[];
28
29 #define ISCSI_INITATOR_NAME_VAR_NAME L"I_NAME"
30
31 #define ISCSI_CONFIG_VAR_ATTR (EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE)
32
33 #define ISCSI_FORM_CALLBACK_INFO_SIGNATURE EFI_SIGNATURE_32 ('I', 'f', 'c', 'i')
34
35 #define ISCSI_FORM_CALLBACK_INFO_FROM_FORM_CALLBACK(Callback) \
36 CR ( \
37 Callback, \
38 ISCSI_FORM_CALLBACK_INFO, \
39 ConfigAccess, \
40 ISCSI_FORM_CALLBACK_INFO_SIGNATURE \
41 )
42
43 #pragma pack(1)
44
45 typedef struct _ISCSI_MAC_INFO {
46 EFI_MAC_ADDRESS Mac;
47 UINT8 Len;
48 } ISCSI_MAC_INFO;
49
50 typedef struct _ISCSI_DEVICE_LIST {
51 UINT8 NumDevice;
52 ISCSI_MAC_INFO MacInfo[1];
53 } ISCSI_DEVICE_LIST;
54
55 #pragma pack()
56
57 typedef struct _ISCSI_CONFIG_FORM_ENTRY {
58 LIST_ENTRY Link;
59 EFI_HANDLE Controller;
60 CHAR16 MacString[95];
61 EFI_STRING_ID PortTitleToken;
62 EFI_STRING_ID PortTitleHelpToken;
63
64 ISCSI_SESSION_CONFIG_NVDATA SessionConfigData;
65 ISCSI_CHAP_AUTH_CONFIG_NVDATA AuthConfigData;
66 } ISCSI_CONFIG_FORM_ENTRY;
67
68 typedef struct _ISCSI_FORM_CALLBACK_INFO {
69 UINTN Signature;
70 EFI_HANDLE DriverHandle;
71 EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess;
72 EFI_HII_DATABASE_PROTOCOL *HiiDatabase;
73 EFI_HII_CONFIG_ROUTING_PROTOCOL *ConfigRouting;
74 UINT16 *KeyList;
75 VOID *FormBuffer;
76 EFI_HII_HANDLE RegisteredHandle;
77 ISCSI_CONFIG_FORM_ENTRY *Current;
78 } ISCSI_FORM_CALLBACK_INFO;
79
80 /**
81 Updates the iSCSI configuration form to add/delete an entry for the iSCSI
82 device specified by the Controller.
83
84 @param[in] DriverBindingHandle The driverbinding handle.
85 @param[in] Controller The controller handle of the iSCSI device.
86 @param[in] AddForm Whether to add or delete a form entry.
87
88 @retval EFI_SUCCESS The iSCSI configuration form is updated.
89 @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
90 @retval Others Some unexpected errors happened.
91 **/
92 EFI_STATUS
93 IScsiConfigUpdateForm (
94 IN EFI_HANDLE DriverBindingHandle,
95 IN EFI_HANDLE Controller,
96 IN BOOLEAN AddForm
97 );
98
99 /**
100 Initialize the iSCSI configuration form.
101
102 @param[in] DriverBindingHandle The iSCSI driverbinding handle.
103
104 @retval EFI_SUCCESS The iSCSI configuration form is initialized.
105 @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
106 @retval Others Some unexpected error happened.
107 **/
108 EFI_STATUS
109 IScsiConfigFormInit (
110 IN EFI_HANDLE DriverBindingHandle
111 );
112
113 /**
114 Unload the iSCSI configuration form, this includes: delete all the iSCSI
115 device configuration entries, uninstall the form callback protocol and
116 free the resources used.
117
118 @param[in] DriverBindingHandle The iSCSI driverbinding handle.
119
120 @retval EFI_SUCCESS The iSCSI configuration form is unloaded.
121 @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
122 **/
123 EFI_STATUS
124 IScsiConfigFormUnload (
125 IN EFI_HANDLE DriverBindingHandle
126 );
127
128 #endif