2 The header file of IScsiConfig.c
4 Copyright (c) 2004 - 2008, Intel Corporation
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
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.
19 The header file of IScsiConfig.c
23 #ifndef _ISCSI_CONFIG_H_
24 #define _ISCSI_CONFIG_H_
26 #include <Library/HiiLib.h>
27 #include <Library/ExtendedHiiLib.h>
28 #include <Library/IfrSupportLib.h>
29 #include <Library/ExtendedIfrSupportLib.h>
30 #include <Library/DebugLib.h>
31 #include <Library/BaseLib.h>
32 #include <Library/NetLib.h>
33 #include "IScsiConfigNVDataStruc.h"
35 extern UINT8 IScsiConfigDxeBin
[];
36 extern UINT8 IScsiDxeStrings
[];
38 #define ISCSI_INITATOR_NAME_VAR_NAME L"I_NAME"
40 #define ISCSI_CONFIG_VAR_ATTR (EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE)
42 #define ISCSI_FORM_CALLBACK_INFO_SIGNATURE EFI_SIGNATURE_32 ('I', 'f', 'c', 'i')
44 #define ISCSI_FORM_CALLBACK_INFO_FROM_FORM_CALLBACK(Callback) \
47 ISCSI_FORM_CALLBACK_INFO, \
49 ISCSI_FORM_CALLBACK_INFO_SIGNATURE \
54 typedef struct _ISCSI_MAC_INFO
{
59 typedef struct _ISCSI_DEVICE_LIST
{
61 ISCSI_MAC_INFO MacInfo
[1];
66 typedef struct _ISCSI_CONFIG_FORM_ENTRY
{
68 EFI_HANDLE Controller
;
70 EFI_STRING_ID PortTitleToken
;
71 EFI_STRING_ID PortTitleHelpToken
;
73 ISCSI_SESSION_CONFIG_NVDATA SessionConfigData
;
74 ISCSI_CHAP_AUTH_CONFIG_NVDATA AuthConfigData
;
75 } ISCSI_CONFIG_FORM_ENTRY
;
77 typedef struct _ISCSI_FORM_CALLBACK_INFO
{
79 EFI_HANDLE DriverHandle
;
80 EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess
;
81 EFI_HII_DATABASE_PROTOCOL
*HiiDatabase
;
82 EFI_HII_CONFIG_ROUTING_PROTOCOL
*ConfigRouting
;
85 EFI_HII_HANDLE RegisteredHandle
;
86 ISCSI_CONFIG_FORM_ENTRY
*Current
;
87 } ISCSI_FORM_CALLBACK_INFO
;
90 Updates the iSCSI configuration form to add/delete an entry for the iSCSI
91 device specified by the Controller.
93 @param DriverBindingHandle[in] The driverbinding handle.
95 @param Controller[in] The controller handle of the iSCSI device.
97 @param AddForm[in] Whether to add or delete a form entry.
99 @retval EFI_SUCCESS The iSCSI configuration form is updated.
101 @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
105 IScsiConfigUpdateForm (
106 IN EFI_HANDLE DriverBindingHandle
,
107 IN EFI_HANDLE Controller
,
112 Initialize the iSCSI configuration form.
114 @param DriverBindingHandle[in] The iSCSI driverbinding handle.
116 @retval EFI_SUCCESS The iSCSI configuration form is initialized.
118 @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
122 IScsiConfigFormInit (
123 IN EFI_HANDLE DriverBindingHandle
127 Unload the iSCSI configuration form, this includes: delete all the iSCSI
128 device configuration entries, uninstall the form callback protocol and
129 free the resources used.
131 @param DriverBindingHandle[in] The iSCSI driverbinding handle.
133 @retval EFI_SUCCESS The iSCSI configuration form is unloaded.
135 @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
139 IScsiConfigFormUnload (
140 IN EFI_HANDLE DriverBindingHandle