2008-04-17 10:28:51 +02:00
|
|
|
/** @file
|
2008-12-10 03:10:34 +01:00
|
|
|
The header file of IScsiConfig.c.
|
2007-12-24 03:20:21 +01:00
|
|
|
|
2010-04-24 11:33:45 +02:00
|
|
|
Copyright (c) 2004 - 2009, Intel Corporation. All rights reserved.<BR>
|
|
|
|
This program and the accompanying materials
|
2008-01-22 09:07:35 +01:00
|
|
|
are licensed and made available under the terms and conditions of the BSD License
|
|
|
|
which accompanies this distribution. The full text of the license may be found at
|
|
|
|
http://opensource.org/licenses/bsd-license.php
|
|
|
|
|
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
2007-12-24 03:20:21 +01:00
|
|
|
|
2008-04-17 10:28:51 +02:00
|
|
|
**/
|
2007-12-24 03:20:21 +01:00
|
|
|
|
|
|
|
#ifndef _ISCSI_CONFIG_H_
|
|
|
|
#define _ISCSI_CONFIG_H_
|
|
|
|
|
2009-04-13 08:05:15 +02:00
|
|
|
#include <Guid/MdeModuleHii.h>
|
2009-02-10 14:32:19 +01:00
|
|
|
#include <Protocol/HiiConfigRouting.h>
|
2008-01-21 15:39:56 +01:00
|
|
|
#include <Library/HiiLib.h>
|
2009-04-02 10:48:03 +02:00
|
|
|
#include <Library/DevicePathLib.h>
|
2007-12-24 03:20:21 +01:00
|
|
|
#include <Library/DebugLib.h>
|
|
|
|
#include <Library/BaseLib.h>
|
|
|
|
#include <Library/NetLib.h>
|
|
|
|
|
|
|
|
extern UINT8 IScsiConfigDxeBin[];
|
2008-01-22 09:07:35 +01:00
|
|
|
extern UINT8 IScsiDxeStrings[];
|
2007-12-24 03:20:21 +01:00
|
|
|
|
|
|
|
#define ISCSI_INITATOR_NAME_VAR_NAME L"I_NAME"
|
|
|
|
|
|
|
|
#define ISCSI_CONFIG_VAR_ATTR (EFI_VARIABLE_BOOTSERVICE_ACCESS | EFI_VARIABLE_NON_VOLATILE)
|
|
|
|
|
2008-12-16 16:34:21 +01:00
|
|
|
#define ISCSI_FORM_CALLBACK_INFO_SIGNATURE SIGNATURE_32 ('I', 'f', 'c', 'i')
|
2007-12-24 03:20:21 +01:00
|
|
|
|
2008-12-12 08:03:44 +01:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
If the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is clear,
|
|
|
|
then this macro return a pointer to a data structure ISCSI_FORM_CALLBACK_INFO.
|
|
|
|
|
|
|
|
If the DEBUG_PROPERTY_DEBUG_ASSERT_ENABLED bit of PcdDebugProperyMask is set,
|
|
|
|
The Signature field of the data structure ISCSI_FORM_CALLBACK_INFO
|
|
|
|
is compared to TestSignature. If the signatures match, then a pointer
|
|
|
|
to the pointer to a data structure ISCSI_FORM_CALLBACK_INFO is returned.
|
|
|
|
If the signatures do not match, then DebugAssert() is called with a description
|
|
|
|
of "CR has a bad signature" and Callback is returned.
|
|
|
|
|
|
|
|
If the data type ISCSI_FORM_CALLBACK_INFO_SIGNATURE does not contain the field
|
|
|
|
specified by Callback, then the module will not compile.
|
|
|
|
|
|
|
|
If ISCSI_FORM_CALLBACK_INFO_SIGNATURE does not contain a field called Signature,
|
|
|
|
then the module will not compile.
|
|
|
|
|
2009-01-13 09:44:22 +01:00
|
|
|
@param Callback Pointer to the specified field within the data
|
2008-12-12 08:03:44 +01:00
|
|
|
structure ISCSI_FORM_CALLBACK_INFO.
|
2009-01-13 09:44:22 +01:00
|
|
|
@return A pointer to the pointer to a data structure ISCSI_FORM_CALLBACK_INFO.
|
|
|
|
@retval Others Some unexpected error happened.
|
2008-12-12 08:03:44 +01:00
|
|
|
**/
|
|
|
|
|
2007-12-24 03:20:21 +01:00
|
|
|
#define ISCSI_FORM_CALLBACK_INFO_FROM_FORM_CALLBACK(Callback) \
|
|
|
|
CR ( \
|
|
|
|
Callback, \
|
|
|
|
ISCSI_FORM_CALLBACK_INFO, \
|
2008-01-21 15:39:56 +01:00
|
|
|
ConfigAccess, \
|
2007-12-24 03:20:21 +01:00
|
|
|
ISCSI_FORM_CALLBACK_INFO_SIGNATURE \
|
|
|
|
)
|
|
|
|
|
|
|
|
#pragma pack(1)
|
|
|
|
|
|
|
|
typedef struct _ISCSI_MAC_INFO {
|
|
|
|
EFI_MAC_ADDRESS Mac;
|
|
|
|
UINT8 Len;
|
2009-12-30 14:47:55 +01:00
|
|
|
UINT16 VlanId;
|
2007-12-24 03:20:21 +01:00
|
|
|
} ISCSI_MAC_INFO;
|
|
|
|
|
|
|
|
typedef struct _ISCSI_DEVICE_LIST {
|
|
|
|
UINT8 NumDevice;
|
|
|
|
ISCSI_MAC_INFO MacInfo[1];
|
|
|
|
} ISCSI_DEVICE_LIST;
|
|
|
|
|
|
|
|
#pragma pack()
|
|
|
|
|
|
|
|
typedef struct _ISCSI_CONFIG_FORM_ENTRY {
|
2008-02-14 10:40:22 +01:00
|
|
|
LIST_ENTRY Link;
|
2007-12-24 03:20:21 +01:00
|
|
|
EFI_HANDLE Controller;
|
|
|
|
CHAR16 MacString[95];
|
2008-10-21 07:55:27 +02:00
|
|
|
EFI_STRING_ID PortTitleToken;
|
|
|
|
EFI_STRING_ID PortTitleHelpToken;
|
2007-12-24 03:20:21 +01:00
|
|
|
|
|
|
|
ISCSI_SESSION_CONFIG_NVDATA SessionConfigData;
|
|
|
|
ISCSI_CHAP_AUTH_CONFIG_NVDATA AuthConfigData;
|
|
|
|
} ISCSI_CONFIG_FORM_ENTRY;
|
|
|
|
|
|
|
|
typedef struct _ISCSI_FORM_CALLBACK_INFO {
|
2008-01-21 15:39:56 +01:00
|
|
|
UINTN Signature;
|
|
|
|
EFI_HANDLE DriverHandle;
|
|
|
|
EFI_HII_CONFIG_ACCESS_PROTOCOL ConfigAccess;
|
|
|
|
EFI_HII_DATABASE_PROTOCOL *HiiDatabase;
|
|
|
|
EFI_HII_CONFIG_ROUTING_PROTOCOL *ConfigRouting;
|
|
|
|
UINT16 *KeyList;
|
|
|
|
VOID *FormBuffer;
|
|
|
|
EFI_HII_HANDLE RegisteredHandle;
|
|
|
|
ISCSI_CONFIG_FORM_ENTRY *Current;
|
2007-12-24 03:20:21 +01:00
|
|
|
} ISCSI_FORM_CALLBACK_INFO;
|
|
|
|
|
2009-04-02 10:48:03 +02:00
|
|
|
#pragma pack(1)
|
|
|
|
|
|
|
|
///
|
|
|
|
/// HII specific Vendor Device Path definition.
|
|
|
|
///
|
|
|
|
typedef struct {
|
|
|
|
VENDOR_DEVICE_PATH VendorDevicePath;
|
|
|
|
EFI_DEVICE_PATH_PROTOCOL End;
|
|
|
|
} HII_VENDOR_DEVICE_PATH;
|
|
|
|
|
|
|
|
#pragma pack()
|
|
|
|
|
2008-04-17 10:28:51 +02:00
|
|
|
/**
|
|
|
|
Updates the iSCSI configuration form to add/delete an entry for the iSCSI
|
|
|
|
device specified by the Controller.
|
|
|
|
|
2008-12-10 03:10:34 +01:00
|
|
|
@param[in] DriverBindingHandle The driverbinding handle.
|
|
|
|
@param[in] Controller The controller handle of the iSCSI device.
|
|
|
|
@param[in] AddForm Whether to add or delete a form entry.
|
2008-04-17 10:28:51 +02:00
|
|
|
|
|
|
|
@retval EFI_SUCCESS The iSCSI configuration form is updated.
|
|
|
|
@retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
|
2008-12-12 08:03:44 +01:00
|
|
|
@retval Others Other errors as indicated.
|
2008-04-17 10:28:51 +02:00
|
|
|
**/
|
2007-12-24 03:20:21 +01:00
|
|
|
EFI_STATUS
|
|
|
|
IScsiConfigUpdateForm (
|
|
|
|
IN EFI_HANDLE DriverBindingHandle,
|
|
|
|
IN EFI_HANDLE Controller,
|
|
|
|
IN BOOLEAN AddForm
|
|
|
|
);
|
|
|
|
|
2008-04-17 10:28:51 +02:00
|
|
|
/**
|
|
|
|
Initialize the iSCSI configuration form.
|
|
|
|
|
2008-12-10 03:10:34 +01:00
|
|
|
@param[in] DriverBindingHandle The iSCSI driverbinding handle.
|
2008-04-17 10:28:51 +02:00
|
|
|
|
2008-12-10 03:10:34 +01:00
|
|
|
@retval EFI_SUCCESS The iSCSI configuration form is initialized.
|
|
|
|
@retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
|
2008-12-12 08:03:44 +01:00
|
|
|
@retval Others Other errors as indicated.
|
2008-04-17 10:28:51 +02:00
|
|
|
**/
|
2007-12-24 03:20:21 +01:00
|
|
|
EFI_STATUS
|
|
|
|
IScsiConfigFormInit (
|
2008-12-12 08:03:44 +01:00
|
|
|
VOID
|
2007-12-24 03:20:21 +01:00
|
|
|
);
|
|
|
|
|
2008-04-17 10:28:51 +02:00
|
|
|
/**
|
|
|
|
Unload the iSCSI configuration form, this includes: delete all the iSCSI
|
|
|
|
device configuration entries, uninstall the form callback protocol and
|
|
|
|
free the resources used.
|
|
|
|
|
2008-12-10 03:10:34 +01:00
|
|
|
@param[in] DriverBindingHandle The iSCSI driverbinding handle.
|
|
|
|
|
2008-04-17 10:28:51 +02:00
|
|
|
@retval EFI_SUCCESS The iSCSI configuration form is unloaded.
|
|
|
|
@retval EFI_OUT_OF_RESOURCES Failed to allocate memory.
|
|
|
|
**/
|
2007-12-24 03:20:21 +01:00
|
|
|
EFI_STATUS
|
|
|
|
IScsiConfigFormUnload (
|
|
|
|
IN EFI_HANDLE DriverBindingHandle
|
|
|
|
);
|
|
|
|
|
|
|
|
#endif
|