/** @file
Miscellaneous definitions for iSCSI driver.
Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
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
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
#ifndef _ISCSI_MISC_H_
#define _ISCSI_MISC_H_
#pragma pack(1)
typedef struct _ISCSI_SESSION_CONFIG_NVDATA {
#pragma pack()
/**
Calculate the prefix length of the IPv4 subnet mask.
@param[in] SubnetMask The IPv4 subnet mask.
@return The prefix length of the subnet mask.
@retval 0 Other errors as indicated.
**/
);
/**
Convert the hexadecimal encoded LUN string into the 64-bit LUN.
@param[in] Str The hexadecimal encoded LUN string.
@param[out] Lun Storage to return the 64-bit LUN.
@retval EFI_SUCCESS The 64-bit LUN is stored in Lun.
@retval EFI_INVALID_PARAMETER The string is malformatted.
**/
);
/**
Convert the 64-bit LUN into the hexadecimal encoded LUN string.
@param[in] Lun The 64-bit LUN.
@param[out] String The storage to return the hexadecimal encoded LUN string.
**/
);
/**
Convert the mac address into a hexadecimal encoded "-" seperated string.
@param[in] Mac The mac address.
@param[in] Len Length in bytes of the mac address.
@param[in] VlanId VLAN ID of the network device.
@param[out] Str The storage to return the mac string.
**/
);
/**
Convert the formatted IP address into the binary IP address.
@param[in] Str The UNICODE string.
@param[in] IpMode Indicates whether the IP address is v4 or v6.
@param[out] Ip The storage to return the ASCII string.
@retval EFI_SUCCESS The binary IP address is returned in Ip.
@retval EFI_INVALID_PARAMETER The IP string is malformatted or IpMode is
invalid.
**/
);
/**
Convert the binary encoded buffer into a hexadecimal encoded string.
@param[in] BinBuffer The buffer containing the binary data.
@param[in] BinLength Length of the binary buffer.
@param[in, out] HexStr Pointer to the string.
@param[in, out] HexLength The length of the string.
@retval EFI_SUCCESS The binary data is converted to the hexadecimal string
and the length of the string is updated.
@retval EFI_BUFFER_TOO_SMALL The string is too small.
@retval EFI_INVALID_PARAMETER The IP string is malformatted.
**/
);
/**
Convert the hexadecimal string into a binary encoded buffer.
@param[in, out] BinBuffer The binary buffer.
@param[in, out] BinLength Length of the binary buffer.
@param[in] HexStr The hexadecimal string.
@retval EFI_SUCCESS The hexadecimal string is converted into a binary
encoded buffer.
@retval EFI_BUFFER_TOO_SMALL The binary buffer is too small to hold the converted data.
**/
);
/**
Convert the decimal-constant string or hex-constant string into a numerical value.
@param[in] Str String in decimal or hex.
@return The numerical value.
**/
);
/**
Generate random numbers.
@param[in, out] Rand The buffer to contain random numbers.
@param[in] RandLength The length of the Rand buffer.
**/
);
/**
Record the NIC information in a global structure.
@param[in] Controller The handle of the controller.
@retval EFI_SUCCESS The operation is completed.
@retval EFI_OUT_OF_RESOURCES Do not have sufficient resource to finish this
operation.
**/
);
/**
Delete the recorded NIC information from a global structure. Also delete corresponding
attempts.
@param[in] Controller The handle of the controller.
@retval EFI_SUCCESS The operation completed.
@retval EFI_NOT_FOUND The NIC information to be deleted is not recorded.
**/
);
/**
Get the recorded NIC information from a global structure by the Index.
@param[in] NicIndex The index indicates the position of NIC info.
@return Pointer to the NIC info or NULL if not found.
**/
);
/**
Get the NIC's PCI location and return it accroding to the composited
format defined in iSCSI Boot Firmware Table.
@param[in] Controller The handle of the controller.
@param[out] Bus The bus number.
@param[out] Device The device number.
@param[out] Function The function number.
@return The composited representation of the NIC PCI location.
**/
);
/**
Read the EFI variable (VendorGuid/Name) and return a dynamically allocated
buffer, and the size of the buffer. If failure, return NULL.
@param[in] Name String part of EFI variable name.
@param[in] VendorGuid GUID part of EFI variable name.
@param[out] VariableSize Returns the size of the EFI variable that was read.
@return Dynamically allocated memory that contains a copy of the EFI variable.
@return Caller is responsible freeing the buffer.
@retval NULL Variable was not read.
**/
VOID *
);
/**
Create the iSCSI driver data.
@param[in] Image The handle of the driver image.
@param[in] Controller The handle of the controller.
@return The iSCSI driver data created.
@retval NULL Other errors as indicated.
**/
);
/**
Clean the iSCSI driver data.
@param[in] Private The iSCSI driver data.
**/
);
/**
Get the various configuration data of this iSCSI instance.
@param[in] Private The iSCSI driver data.
@retval EFI_SUCCESS Obtained the configuration of this instance.
@retval EFI_ABORTED The operation was aborted.
@retval Others Other errors as indicated.
**/
);
/**
Get the device path of the iSCSI tcp connection and update it.
@param[in] Session The iSCSI session data.
@return The updated device path.
@retval NULL Other errors as indicated.
**/
);
/**
Abort the session when the transition from BS to RT is initiated.
@param[in] Event The event signaled.
@param[in] Context The iSCSI driver data.
**/
);
#endif