X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=NetworkPkg%2FIScsiDxe%2FIScsiMisc.h;h=caa2f94bb1b90d9d758b547b88d74ca896dca5aa;hb=ba8ea42738cf5caa8855c59da5359b8e7929568f;hp=fd9e3af764407b35dd89b2f1a1e61ae4feb0da91;hpb=18b24f924f06f2345c0410d145d14e1a9a500dc8;p=mirror_edk2.git diff --git a/NetworkPkg/IScsiDxe/IScsiMisc.h b/NetworkPkg/IScsiDxe/IScsiMisc.h index fd9e3af764..caa2f94bb1 100644 --- a/NetworkPkg/IScsiDxe/IScsiMisc.h +++ b/NetworkPkg/IScsiDxe/IScsiMisc.h @@ -1,7 +1,7 @@ /** @file Miscellaneous definitions for iSCSI driver. -Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.
+Copyright (c) 2004 - 2017, 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 @@ -17,6 +17,23 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. typedef struct _ISCSI_DRIVER_DATA ISCSI_DRIVER_DATA; +/// +/// IPv4 Device Path Node Length +/// +#define IP4_NODE_LEN_NEW_VERSIONS 27 + +/// +/// IPv6 Device Path Node Length +/// +#define IP6_NODE_LEN_OLD_VERSIONS 43 +#define IP6_NODE_LEN_NEW_VERSIONS 60 + +/// +/// The ignored field StaticIpAddress's offset in old IPv6 Device Path +/// +#define IP6_OLD_IPADDRESS_OFFSET 42 + + #pragma pack(1) typedef struct _ISCSI_SESSION_CONFIG_NVDATA { UINT16 TargetPort; @@ -29,14 +46,23 @@ typedef struct _ISCSI_SESSION_CONFIG_NVDATA { BOOLEAN InitiatorInfoFromDhcp; BOOLEAN TargetInfoFromDhcp; + CHAR8 TargetName[ISCSI_NAME_MAX_SIZE]; EFI_IP_ADDRESS TargetIp; UINT8 PrefixLength; UINT8 BootLun[8]; - UINT16 ConnectTimeout; ///< timout value in milliseconds + UINT16 ConnectTimeout; ///< timout value in milliseconds. UINT8 ConnectRetryCount; UINT8 IsId[6]; + + BOOLEAN RedirectFlag; + UINT16 OriginalTargetPort; // The port of proxy/virtual target. + EFI_IP_ADDRESS OriginalTargetIp; // The address of proxy/virtual target. + + BOOLEAN DnsMode; // Flag indicate whether the Target address is expressed as URL format. + CHAR8 TargetUrl[ISCSI_TARGET_URI_MAX_SIZE]; + } ISCSI_SESSION_CONFIG_NVDATA; #pragma pack() @@ -217,6 +243,44 @@ IScsiRemoveNic ( IN EFI_HANDLE Controller ); +/** + Create and initialize the Attempts. + + @param[in] AttemptNum The number of Attempts will be created. + + @retval EFI_SUCCESS The Attempts have been created successfully. + @retval Others Failed to create the Attempt. + +**/ +EFI_STATUS +IScsiCreateAttempts ( + IN UINTN AttemptNum + ); + +/** + Create the iSCSI configuration Keywords for each attempt. + + @param[in] KeywordNum The number Sets of Keywords will be created. + + @retval EFI_SUCCESS The operation is completed. + @retval Others Failed to create the Keywords. + +**/ +EFI_STATUS +IScsiCreateKeywords ( + IN UINTN KeywordNum + ); + +/** + + Free the attempt configure data variable. + +**/ +VOID +IScsiCleanAttemptVariable ( + IN VOID + ); + /** Get the recorded NIC information from a global structure by the Index. @@ -232,7 +296,7 @@ IScsiGetNicInfoByIndex ( /** - Get the NIC's PCI location and return it accroding to the composited + Get the NIC's PCI location and return it according to the composited format defined in iSCSI Boot Firmware Table. @param[in] Controller The handle of the controller. @@ -290,10 +354,13 @@ IScsiCreateDriverData ( /** Clean the iSCSI driver data. - @param[in] Private The iSCSI driver data. + @param[in] Private The iSCSI driver data. + + @retval EFI_SUCCES The clean operation is successful. + @retval Others Other errors as indicated. **/ -VOID +EFI_STATUS IScsiCleanDriverData ( IN ISCSI_DRIVER_DATA *Private ); @@ -314,6 +381,20 @@ IScsiDhcpIsConfigured ( IN UINT8 IpVersion ); +/** + Check wheather the Controller handle is configured to use DNS protocol. + + @param[in] Controller The handle of the controller. + + @retval TRUE The handle of the controller need the DNS protocol. + @retval FALSE The handle of the controller does not need the DNS protocol. + +**/ +BOOLEAN +IScsiDnsIsConfigured ( + IN EFI_HANDLE Controller + ); + /** Get the various configuration data of this iSCSI instance.