summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.h
diff options
context:
space:
mode:
authoreric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>2008-01-22 08:07:35 +0000
committereric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>2008-01-22 08:07:35 +0000
commit7a444476b4ffb405006ee36d0f2cec80c2d4b348 (patch)
treecb8c0bb40870c5ea06b2cba5d44049eaa43b949e /MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.h
parent08a4be3b4541adcf8e230c31e5e409448c606a5c (diff)
downloadedk2-platforms-7a444476b4ffb405006ee36d0f2cec80c2d4b348.tar.xz
move iscsi driver into network directory, and change its name to comply with name convention.
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@4612 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.h')
-rw-r--r--MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.h143
1 files changed, 143 insertions, 0 deletions
diff --git a/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.h b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.h
new file mode 100644
index 0000000000..33315ae581
--- /dev/null
+++ b/MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.h
@@ -0,0 +1,143 @@
+/*++
+
+Copyright (c) 2004 - 2007, Intel Corporation
+All rights reserved. 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
+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.
+
+Module Name:
+
+ IScsiMisc.h
+
+Abstract:
+
+ Miscellaneous definitions for iSCSI driver.
+
+--*/
+
+#ifndef _ISCSI_MISC_H_
+#define _ISCSI_MISC_H_
+
+#pragma pack(1)
+typedef struct _ISCSI_SESSION_CONFIG_NVDATA {
+ BOOLEAN Enabled;
+
+ BOOLEAN InitiatorInfoFromDhcp;
+ EFI_IPv4_ADDRESS LocalIp;
+ EFI_IPv4_ADDRESS SubnetMask;
+ EFI_IPv4_ADDRESS Gateway;
+
+ BOOLEAN TargetInfoFromDhcp;
+ CHAR8 TargetName[ISCSI_NAME_MAX_SIZE];
+ EFI_IPv4_ADDRESS TargetIp;
+ UINT16 TargetPort;
+ UINT8 BootLun[8];
+} ISCSI_SESSION_CONFIG_NVDATA;
+#pragma pack()
+
+struct _ISCSI_SESSION_CONFIG_DATA {
+ ISCSI_SESSION_CONFIG_NVDATA NvData;
+
+ EFI_IPv4_ADDRESS PrimaryDns;
+ EFI_IPv4_ADDRESS SecondaryDns;
+ EFI_IPv4_ADDRESS DhcpServer;
+};
+
+UINT8
+IScsiGetSubnetMaskPrefixLength (
+ IN EFI_IPv4_ADDRESS *SubnetMask
+ );
+
+EFI_STATUS
+IScsiAsciiStrToLun (
+ IN CHAR8 *Str,
+ OUT UINT8 *Lun
+ );
+
+VOID
+IScsiLunToUnicodeStr (
+ IN UINT8 *Lun,
+ OUT CHAR16 *String
+ );
+
+CHAR16 *
+IScsiAsciiStrToUnicodeStr (
+ IN CHAR8 *Source,
+ OUT CHAR16 *Destination
+ );
+
+CHAR8 *
+IScsiUnicodeStrToAsciiStr (
+ IN CHAR16 *Source,
+ OUT CHAR8 *Destination
+ );
+
+VOID
+IScsiMacAddrToStr (
+ IN EFI_MAC_ADDRESS *Mac,
+ IN UINT32 Len,
+ OUT CHAR16 *Str
+ );
+
+EFI_STATUS
+IScsiAsciiStrToIp (
+ IN CHAR8 *Str,
+ OUT EFI_IPv4_ADDRESS *Ip
+ );
+
+EFI_STATUS
+IScsiBinToHex (
+ IN UINT8 *BinBuffer,
+ IN UINT32 BinLength,
+ IN OUT CHAR8 *HexStr,
+ IN OUT UINT32 *HexLength
+ );
+
+EFI_STATUS
+IScsiHexToBin (
+ IN OUT UINT8 *BinBuffer,
+ IN OUT UINT32 *BinLength,
+ IN CHAR8 *HexStr
+ );
+
+VOID
+IScsiGenRandom (
+ IN OUT UINT8 *Rand,
+ IN UINTN RandLength
+ );
+
+ISCSI_DRIVER_DATA *
+IScsiCreateDriverData (
+ IN EFI_HANDLE Image,
+ IN EFI_HANDLE Controller
+ );
+
+VOID
+IScsiCleanDriverData (
+ IN ISCSI_DRIVER_DATA *Private
+ );
+
+EFI_STATUS
+IScsiGetConfigData (
+ IN ISCSI_DRIVER_DATA *Private
+ );
+
+EFI_DEVICE_PATH_PROTOCOL *
+IScsiGetTcpConnDevicePath (
+ IN ISCSI_DRIVER_DATA *Private
+ );
+
+VOID
+EFIAPI
+IScsiOnExitBootService (
+ IN EFI_EVENT Event,
+ IN VOID *Context
+ );
+
+extern CHAR16 NibbleToHexChar(UINT8 Nibble);
+
+#endif