]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.h
update file header
[mirror_edk2.git] / MdeModulePkg / Universal / Network / IScsiDxe / IScsiMisc.h
index 4eb4247c6fefa22f7bd600b68ca75ff1a5545e12..cde79aa52587b358807351587776d67baa30cc21 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   Miscellaneous definitions for IScsi driver.\r
 \r
-Copyright (c) 2004 - 2008, Intel Corporation\r
+Copyright (c) 2004 - 2008, Intel Corporation.<BR>\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -10,21 +10,17 @@ http://opensource.org/licenses/bsd-license.php
 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
-Module Name:\r
-\r
-  IScsiMisc.h\r
-\r
-Abstract:\r
-\r
-  Miscellaneous definitions for IScsi driver.\r
-\r
 **/\r
 \r
 #ifndef _ISCSI_MISC_H_\r
 #define _ISCSI_MISC_H_\r
 \r
+#include <Library/BaseLib.h>\r
+\r
+typedef struct _ISCSI_SESSION_CONFIG_DATA ISCSI_SESSION_CONFIG_DATA;\r
+\r
 #pragma pack(1)\r
-typedef struct _ISCSI_SESSION_CONFIG_NVDATA {\r
+typedef struct {\r
   BOOLEAN           Enabled;\r
 \r
   BOOLEAN           InitiatorInfoFromDhcp;\r
@@ -51,10 +47,10 @@ struct _ISCSI_SESSION_CONFIG_DATA {
 /**\r
   Calculate the prefix length of the IPv4 subnet mask.\r
 \r
-  @param  SubnetMask[in] The IPv4 subnet mask.\r
-\r
-  @retval UINT8          The prefix length of the subnet mask.\r
+  @param[in]  SubnetMask The IPv4 subnet mask.\r
 \r
+  @return The prefix length of the subnet mask.\r
+  @return 0 Some unexpected error happened.\r
 **/\r
 UINT8\r
 IScsiGetSubnetMaskPrefixLength (\r
@@ -64,14 +60,11 @@ IScsiGetSubnetMaskPrefixLength (
 /**\r
   Convert the hexadecimal encoded LUN string into the 64-bit LUN. \r
 \r
-  @param  Str[in]               The hexadecimal encoded LUN string.\r
-\r
-  @param  Lun[out]              Storage to return the 64-bit LUN.\r
+  @param[in]   Str             The hexadecimal encoded LUN string.\r
+  @param[out]  Lun             Storage to return the 64-bit LUN.\r
 \r
   @retval EFI_SUCCESS           The 64-bit LUN is stored in Lun.\r
-\r
   @retval EFI_INVALID_PARAMETER The string is malformatted.\r
-\r
 **/\r
 EFI_STATUS\r
 IScsiAsciiStrToLun (\r
@@ -82,28 +75,22 @@ IScsiAsciiStrToLun (
 /**\r
   Convert the 64-bit LUN into the hexadecimal encoded LUN string.\r
 \r
-  @param  Lun[in]  The 64-bit LUN.\r
-\r
-  @param  Str[out] The storage to return the hexadecimal encoded LUN string.\r
-\r
-  @retval None.\r
-\r
+  @param[in]   Lun The 64-bit LUN.\r
+  @param[out]  Str The storage to return the hexadecimal encoded LUN string.\r
 **/\r
 VOID\r
 IScsiLunToUnicodeStr (\r
   IN UINT8    *Lun,\r
-  OUT CHAR16  *String\r
+  OUT CHAR16  *Str\r
   );\r
 \r
 /**\r
   Convert the ASCII string into a UNICODE string.\r
 \r
-  @param  Source[out]      The ASCII string.\r
-\r
-  @param  Destination[out] The storage to return the UNICODE string.\r
-\r
-  @retval CHAR16 *         Pointer to the UNICODE string.\r
+  @param[in]   Source      The ASCII string.\r
+  @param[out]  Destination The storage to return the UNICODE string.\r
 \r
+  @return CHAR16 *         Pointer to the UNICODE string.\r
 **/\r
 CHAR16 *\r
 IScsiAsciiStrToUnicodeStr (\r
@@ -114,12 +101,10 @@ IScsiAsciiStrToUnicodeStr (
 /**\r
   Convert the UNICODE string into an ASCII string.\r
 \r
-  @param  Source[in]       The UNICODE string.\r
-\r
-  @param  Destination[out] The storage to return the ASCII string.\r
-\r
-  @retval CHAR8 *          Pointer to the ASCII string.\r
+  @param[in]  Source       The UNICODE string.\r
+  @param[out] Destination  The storage to return the ASCII string.\r
 \r
+  @return CHAR8 *          Pointer to the ASCII string.\r
 **/\r
 CHAR8 *\r
 IScsiUnicodeStrToAsciiStr (\r
@@ -130,14 +115,9 @@ IScsiUnicodeStrToAsciiStr (
 /**\r
   Convert the mac address into a hexadecimal encoded "-" seperated string.\r
 \r
-  @param  Mac[in]  The mac address.\r
-\r
-  @param  Len[in]  Length in bytes of the mac address.\r
-\r
-  @param  Str[out] The storage to return the mac string.\r
-\r
-  @retval None.\r
-\r
+  @param[in]  Mac The mac address.\r
+  @param[in]  Len  Length in bytes of the mac address.\r
+  @param[out] Str The storage to return the mac string.\r
 **/\r
 VOID\r
 IScsiMacAddrToStr (\r
@@ -149,14 +129,11 @@ IScsiMacAddrToStr (
 /**\r
   Convert the decimal dotted IPv4 address into the binary IPv4 address.\r
 \r
-  @param  Str[in]               The UNICODE string.\r
-\r
-  @param  Ip[out]               The storage to return the ASCII string.\r
+  @param[in]   Str             The UNICODE string.\r
+  @param[out]  Ip              The storage to return the ASCII string.\r
 \r
   @retval EFI_SUCCESS           The binary IP address is returned in Ip.\r
-\r
   @retval EFI_INVALID_PARAMETER The IP string is malformatted.\r
-\r
 **/\r
 EFI_STATUS\r
 IScsiAsciiStrToIp (\r
@@ -167,19 +144,15 @@ IScsiAsciiStrToIp (
 /**\r
   Convert the binary encoded buffer into a hexadecimal encoded string.\r
 \r
-  @param  BinBuffer[in]        The buffer containing the binary data.\r
+  @param[in]       BinBuffer   The buffer containing the binary data.\r
+  @param[in]       BinLength   Length of the binary buffer.\r
+  @param[in, out]  HexStr      Pointer to the string.\r
+  @param[in, out]  HexLength   The length of the string.\r
 \r
-  @param  BinLength[in]        Length of the binary buffer.\r
-\r
-  @param  HexStr[in][out]      Pointer to the string.\r
-\r
-  @param  HexLength[in][out]   The length of the string.\r
-\r
-  @retval EFI_SUCCESS          The binary data is converted to the hexadecimal string\r
+  @retval EFI_SUCCESS          The binary data is converted to the hexadecimal string \r
                                and the length of the string is updated.\r
-\r
   @retval EFI_BUFFER_TOO_SMALL The string is too small.\r
-\r
+  @retval EFI_INVALID_PARAMETER The IP string is malformatted.\r
 **/\r
 EFI_STATUS\r
 IScsiBinToHex (\r
@@ -192,17 +165,13 @@ IScsiBinToHex (
 /**\r
   Convert the hexadecimal string into a binary encoded buffer.\r
 \r
-  @param  BinBuffer[in][out]   The binary buffer.\r
-\r
-  @param  BinLength[in][out]   Length of the binary buffer.\r
-\r
-  @param  HexStr[in]           The hexadecimal string.\r
+  @param[in, out]  BinBuffer   The binary buffer.\r
+  @param[in, out]  BinLength   Length of the binary buffer.\r
+  @param[in]       HexStr      The hexadecimal string.\r
 \r
   @retval EFI_SUCCESS          The hexadecimal string is converted into a binary\r
                                encoded buffer.\r
-\r
   @retval EFI_BUFFER_TOO_SMALL The binary buffer is too small to hold the converted data.s\r
-\r
 **/\r
 EFI_STATUS\r
 IScsiHexToBin (\r
@@ -214,12 +183,8 @@ IScsiHexToBin (
 /**\r
   Generate random numbers.\r
 \r
-  @param  Rand[in][out]  The buffer to contain random numbers.\r
-\r
-  @param  RandLength[in] The length of the Rand buffer.\r
-\r
-  @retval None.\r
-\r
+  @param[in, out]  Rand       The buffer to contain random numbers.\r
+  @param[in]       RandLength The length of the Rand buffer.\r
 **/\r
 VOID\r
 IScsiGenRandom (\r
@@ -230,12 +195,11 @@ IScsiGenRandom (
 /**\r
   Create the iSCSI driver data..\r
 \r
-  @param  Image[in]      The handle of the driver image.\r
-\r
-  @param  Controller[in] The handle of the controller.\r
-\r
-  @retval The iSCSI driver data created.\r
+  @param[in] Image      The handle of the driver image.\r
+  @param[in] Controller The handle of the controller.\r
 \r
+  @return The iSCSI driver data created.\r
+  @return NULL Some unexpected error happened.\r
 **/\r
 ISCSI_DRIVER_DATA *\r
 IScsiCreateDriverData (\r
@@ -246,10 +210,7 @@ IScsiCreateDriverData (
 /**\r
   Clean the iSCSI driver data.\r
 \r
-  @param  Private[in] The iSCSI driver data.\r
-\r
-  @retval None.\r
-\r
+  @param[in]  Private The iSCSI driver data.\r
 **/\r
 VOID\r
 IScsiCleanDriverData (\r
@@ -257,15 +218,13 @@ IScsiCleanDriverData (
   );\r
 \r
 /**\r
-\r
   Get the various configuration data of this iSCSI instance.\r
 \r
-  @param  Private[in]   The iSCSI driver data.\r
+  @param[in]  Private   The iSCSI driver data.\r
 \r
   @retval EFI_SUCCESS   The configuration of this instance is got.\r
-\r
-  @retval EFI_NOT_FOUND This iSCSI instance is not configured yet.\r
-\r
+  @retval EFI_ABORTED   The operation was aborted.\r
+  @retval Others        Some unexpected error happened.\r
 **/\r
 EFI_STATUS\r
 IScsiGetConfigData (\r
@@ -275,12 +234,12 @@ IScsiGetConfigData (
 /**\r
   Get the device path of the iSCSI tcp connection and update it.\r
 \r
-  @param  Private[in] The iSCSI driver data.\r
-\r
-  @retval The updated device path.\r
+  @param[in]  Private The iSCSI driver data.\r
 \r
+  @return The updated device path.\r
+  @return NULL Some unexpected error happened.\r
 **/\r
-EFI_DEVICE_PATH_PROTOCOL  *\r
+EFI_DEVICE_PATH_PROTOCOL *\r
 IScsiGetTcpConnDevicePath (\r
   IN ISCSI_DRIVER_DATA  *Private\r
   );\r
@@ -288,12 +247,8 @@ IScsiGetTcpConnDevicePath (
 /**\r
   Abort the session when the transition from BS to RT is initiated.\r
 \r
-  @param  Event[in]   The event signaled.\r
-\r
-  @param  Context[in] The iSCSI driver data.\r
-\r
-  @retval None.\r
-\r
+  @param[in]   Event  The event signaled.\r
+  @param[in]  Context The iSCSI driver data.\r
 **/\r
 VOID\r
 EFIAPI\r
@@ -302,6 +257,6 @@ IScsiOnExitBootService (
   IN VOID       *Context\r
   );\r
 \r
-extern CHAR16 NibbleToHexChar(UINT8 Nibble);\r
+\r
 \r
 #endif\r