]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.h
clean up the un-suitable ';' location when declaring the functions.
[mirror_edk2.git] / MdeModulePkg / Universal / Network / IScsiDxe / IScsiMisc.h
index 33315ae581915efcd4d2532222122f8ab8616d25..4eb4247c6fefa22f7bd600b68ca75ff1a5545e12 100644 (file)
@@ -1,6 +1,7 @@
-/*++\r
+/** @file\r
+  Miscellaneous definitions for IScsi driver.\r
 \r
-Copyright (c) 2004 - 2007, Intel Corporation\r
+Copyright (c) 2004 - 2008, Intel Corporation\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
@@ -15,9 +16,9 @@ Module Name:
 \r
 Abstract:\r
 \r
-  Miscellaneous definitions for iSCSI driver.\r
+  Miscellaneous definitions for IScsi driver.\r
 \r
---*/\r
+**/\r
 \r
 #ifndef _ISCSI_MISC_H_\r
 #define _ISCSI_MISC_H_\r
@@ -47,35 +48,97 @@ struct _ISCSI_SESSION_CONFIG_DATA {
   EFI_IPv4_ADDRESS            DhcpServer;\r
 };\r
 \r
+/**\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
+\r
+**/\r
 UINT8\r
 IScsiGetSubnetMaskPrefixLength (\r
   IN EFI_IPv4_ADDRESS  *SubnetMask\r
   );\r
 \r
+/**\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
+\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
   IN  CHAR8  *Str,\r
   OUT UINT8  *Lun\r
   );\r
 \r
+/**\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
+**/\r
 VOID\r
 IScsiLunToUnicodeStr (\r
   IN UINT8    *Lun,\r
   OUT CHAR16  *String\r
   );\r
 \r
-CHAR16                    *\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
+\r
+**/\r
+CHAR16 *\r
 IScsiAsciiStrToUnicodeStr (\r
   IN  CHAR8   *Source,\r
   OUT CHAR16  *Destination\r
   );\r
 \r
-CHAR8                     *\r
+/**\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
+\r
+**/\r
+CHAR8 *\r
 IScsiUnicodeStrToAsciiStr (\r
   IN  CHAR16  *Source,\r
   OUT CHAR8   *Destination\r
   );\r
 \r
+/**\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
+**/\r
 VOID\r
 IScsiMacAddrToStr (\r
   IN  EFI_MAC_ADDRESS  *Mac,\r
@@ -83,12 +146,41 @@ IScsiMacAddrToStr (
   OUT CHAR16           *Str\r
   );\r
 \r
+/**\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
+\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
   IN  CHAR8             *Str,\r
   OUT EFI_IPv4_ADDRESS  *Ip\r
   );\r
 \r
+/**\r
+  Convert the binary encoded buffer into a hexadecimal encoded string.\r
+\r
+  @param  BinBuffer[in]        The buffer containing the binary data.\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
+                               and the length of the string is updated.\r
+\r
+  @retval EFI_BUFFER_TOO_SMALL The string is too small.\r
+\r
+**/\r
 EFI_STATUS\r
 IScsiBinToHex (\r
   IN     UINT8  *BinBuffer,\r
@@ -97,6 +189,21 @@ IScsiBinToHex (
   IN OUT UINT32 *HexLength\r
   );\r
 \r
+/**\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
+\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
   IN OUT UINT8  *BinBuffer,\r
@@ -104,33 +211,90 @@ IScsiHexToBin (
   IN     CHAR8  *HexStr\r
   );\r
 \r
+/**\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
+**/\r
 VOID\r
 IScsiGenRandom (\r
   IN OUT UINT8  *Rand,\r
   IN     UINTN  RandLength\r
   );\r
 \r
-ISCSI_DRIVER_DATA         *\r
+/**\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
+\r
+**/\r
+ISCSI_DRIVER_DATA *\r
 IScsiCreateDriverData (\r
   IN EFI_HANDLE  Image,\r
   IN EFI_HANDLE  Controller\r
   );\r
 \r
+/**\r
+  Clean the iSCSI driver data.\r
+\r
+  @param  Private[in] The iSCSI driver data.\r
+\r
+  @retval None.\r
+\r
+**/\r
 VOID\r
 IScsiCleanDriverData (\r
   IN ISCSI_DRIVER_DATA  *Private\r
   );\r
 \r
+/**\r
+\r
+  Get the various configuration data of this iSCSI instance.\r
+\r
+  @param  Private[in]   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
+**/\r
 EFI_STATUS\r
 IScsiGetConfigData (\r
   IN ISCSI_DRIVER_DATA  *Private\r
   );\r
 \r
+/**\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
+\r
+**/\r
 EFI_DEVICE_PATH_PROTOCOL  *\r
 IScsiGetTcpConnDevicePath (\r
   IN ISCSI_DRIVER_DATA  *Private\r
   );\r
 \r
+/**\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
+**/\r
 VOID\r
 EFIAPI\r
 IScsiOnExitBootService (\r