]> git.proxmox.com Git - mirror_edk2.git/commitdiff
[Description]
authoreric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 17 Apr 2008 08:28:51 +0000 (08:28 +0000)
committereric_tian <eric_tian@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 17 Apr 2008 08:28:51 +0000 (08:28 +0000)
change the old code style to comply with Doxgen format
[Impaction]
add comments for every function
[Reference Info]
add comments to achieve the highest standard of code quality matrix

git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5079 6f19259b-4bc3-4df7-8a09-765794883524

25 files changed:
MdeModulePkg/Universal/Network/IScsiDxe/ComponentName.c
MdeModulePkg/Universal/Network/IScsiDxe/IScsiCHAP.c
MdeModulePkg/Universal/Network/IScsiDxe/IScsiCHAP.h
MdeModulePkg/Universal/Network/IScsiDxe/IScsiCommon.h
MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.c
MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfig.h
MdeModulePkg/Universal/Network/IScsiDxe/IScsiConfigNVDataStruc.h
MdeModulePkg/Universal/Network/IScsiDxe/IScsiDhcp.c
MdeModulePkg/Universal/Network/IScsiDxe/IScsiDhcp.h
MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.c
MdeModulePkg/Universal/Network/IScsiDxe/IScsiDriver.h
MdeModulePkg/Universal/Network/IScsiDxe/IScsiExtScsiPassThru.c
MdeModulePkg/Universal/Network/IScsiDxe/IScsiExtScsiPassThru.h
MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.c
MdeModulePkg/Universal/Network/IScsiDxe/IScsiIbft.h
MdeModulePkg/Universal/Network/IScsiDxe/IScsiImpl.h
MdeModulePkg/Universal/Network/IScsiDxe/IScsiInitiatorName.c
MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.c
MdeModulePkg/Universal/Network/IScsiDxe/IScsiMisc.h
MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c
MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.h
MdeModulePkg/Universal/Network/IScsiDxe/IScsiTcp4Io.c
MdeModulePkg/Universal/Network/IScsiDxe/IScsiTcp4Io.h
MdeModulePkg/Universal/Network/IScsiDxe/Md5.c
MdeModulePkg/Universal/Network/IScsiDxe/Md5.h

index 3deab7705b17fff215bb53e3380a36d0610bbd65..bb7484e2dd5ef23769fced590ecc2c605b14e5f1 100644 (file)
@@ -1,6 +1,7 @@
-/*++\r
+/** @file\r
+  UEFI Component Name(2) protocol implementation.\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
@@ -17,7 +18,7 @@ Abstract:
 \r
   ComponentName protocol for iSCSI.\r
 \r
---*/\r
+**/\r
 \r
 #include "IScsiImpl.h"\r
 \r
@@ -40,10 +41,48 @@ GLOBAL_REMOVE_IF_UNREFERENCED EFI_COMPONENT_NAME2_PROTOCOL    gIScsiComponentNam
 };\r
 \r
 GLOBAL_REMOVE_IF_UNREFERENCED EFI_UNICODE_STRING_TABLE mIScsiDriverNameTable[] = {\r
-       {"eng;en", L"iSCSI Driver"}, \r
-       {NULL, NULL}\r
+  {"eng;en", L"iSCSI Driver"}, \r
+  {NULL, NULL}\r
 };\r
 \r
+/**\r
+  Retrieves a Unicode string that is the user readable name of the EFI Driver.\r
+\r
+  This function retrieves the user readable name of a driver in the form of a\r
+  Unicode string. If the driver specified by This has a user readable name in\r
+  the language specified by Language, then a pointer to the driver name is\r
+  returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
+  by This does not support the language specified by Language,\r
+  then EFI_UNSUPPORTED is returned.\r
+\r
+  @param  This[in]              A pointer to the EFI_COMPONENT_NAME_PROTOCOL\r
+                                instance.\r
+\r
+  @param  Language[in]          A pointer to a three character ISO 639-2 language\r
+                                identifier.\r
+                                This is the language of the driver name that that\r
+                                the caller is requesting, and it must match one of\r
+                                the languages specified in SupportedLanguages.  \r
+                                The number of languages supported by a driver is up\r
+                                to the driver writer.\r
+\r
+  @param  DriverName[out]       A pointer to the Unicode string to return.\r
+                                This Unicode string is the name of the\r
+                                driver specified by This in the language\r
+                                specified by Language.\r
+\r
+  @retval EFI_SUCCESS           The Unicode string for the Driver specified by\r
+                                This and the language specified by Language was\r
+                                returned in DriverName.\r
+\r
+  @retval EFI_INVALID_PARAMETER Language is NULL.\r
+\r
+  @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
+\r
+  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
+                                the language specified by Language.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IScsiComponentNameGetDriverName (\r
@@ -51,32 +90,6 @@ IScsiComponentNameGetDriverName (
   IN  CHAR8                         *Language,\r
   OUT CHAR16                        **DriverName\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Retrieves a Unicode string that is the user readable name of the EFI Driver.\r
-\r
-  Arguments:\r
-    This       - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
-    Language   - A pointer to a three character ISO 639-2 language identifier.\r
-                 This is the language of the driver name that that the caller \r
-                 is requesting, and it must match one of the languages specified\r
-                 in SupportedLanguages.  The number of languages supported by a \r
-                 driver is up to the driver writer.\r
-    DriverName - A pointer to the Unicode string to return.  This Unicode string\r
-                 is the name of the driver specified by This in the language \r
-                 specified by Language.\r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The Unicode string for the Driver specified by This\r
-                            and the language specified by Language was returned \r
-                            in DriverName.\r
-    EFI_INVALID_PARAMETER - Language is NULL.\r
-    EFI_INVALID_PARAMETER - DriverName is NULL.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support the \r
-                            language specified by Language.\r
-\r
---*/\r
 {\r
   return LookupUnicodeString2 (\r
           Language,\r
@@ -87,6 +100,55 @@ IScsiComponentNameGetDriverName (
           );\r
 }\r
 \r
+/**\r
+  Retrieves a Unicode string that is the user readable name of the controller\r
+  that is being managed by an EFI Driver.\r
+\r
+  @param  This[in]              A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
+\r
+  @param  ControllerHandle[in]  The handle of a controller that the driver specified by\r
+                                This is managing.  This handle specifies the controller\r
+                                whose name is to be returned.\r
+\r
+  @param  ChildHandle[in]       The handle of the child controller to retrieve the name\r
+                                of.  This is an optional parameter that may be NULL.  It\r
+                                will be NULL for device drivers.  It will also be NULL\r
+                                for a bus drivers that wish to retrieve the name of the\r
+                                bus controller.  It will not be NULL for a bus driver\r
+                                that wishes to retrieve the name of a child controller.\r
+\r
+  @param  Language[in]          A pointer to a three character ISO 639-2 language \r
+                                identifier.  This is the language of the controller name\r
+                                that that the caller is requesting, and it must match one\r
+                                of the languages specified in SupportedLanguages.  The\r
+                                number of languages supported by a driver is up to the\r
+                                driver writer.\r
+\r
+  @param  ControllerName[out]   A pointer to the Unicode string to return.  This Unicode\r
+                                string is the name of the controller specified by \r
+                                ControllerHandle and ChildHandle in the language \r
+                                specified by Language from the point of view of the \r
+                                driver specified by This. \r
+\r
+  @retval EFI_SUCCESS           The Unicode string for the user readable name in the \r
+                                language specified by Language for the driver \r
+                                specified by This was returned in DriverName.\r
+\r
+  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
+\r
+  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r
+\r
+  @retval EFI_INVALID_PARAMETER Language is NULL.\r
+\r
+  @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
+\r
+  @retval EFI_UNSUPPORTED       The driver specified by This is not currently managing\r
+                                the controller specified by ControllerHandle and ChildHandle.\r
+\r
+  @retval EFI_UNSUPPORTED       The driver specified by This does not support the \r
+                                language specified by Language.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IScsiComponentNameGetControllerName (\r
@@ -96,51 +158,6 @@ IScsiComponentNameGetControllerName (
   IN  CHAR8                         *Language,\r
   OUT CHAR16                        **ControllerName\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Retrieves a Unicode string that is the user readable name of the controller\r
-    that is being managed by an EFI Driver.\r
-\r
-  Arguments:\r
-    This             - A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
-    ControllerHandle - The handle of a controller that the driver specified by \r
-                       This is managing.  This handle specifies the controller \r
-                       whose name is to be returned.\r
-    ChildHandle      - The handle of the child controller to retrieve the name \r
-                       of.  This is an optional parameter that may be NULL.  It \r
-                       will be NULL for device drivers.  It will also be NULL \r
-                       for a bus drivers that wish to retrieve the name of the \r
-                       bus controller.  It will not be NULL for a bus driver \r
-                       that wishes to retrieve the name of a child controller.\r
-    Language         - A pointer to a three character ISO 639-2 language \r
-                       identifier.  This is the language of the controller name \r
-                       that that the caller is requesting, and it must match one\r
-                       of the languages specified in SupportedLanguages.  The \r
-                       number of languages supported by a driver is up to the \r
-                       driver writer.\r
-    ControllerName   - A pointer to the Unicode string to return.  This Unicode\r
-                       string is the name of the controller specified by \r
-                       ControllerHandle and ChildHandle in the language \r
-                       specified by Language from the point of view of the \r
-                       driver specified by This. \r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The Unicode string for the user readable name in the \r
-                            language specified by Language for the driver \r
-                            specified by This was returned in DriverName.\r
-    EFI_INVALID_PARAMETER - ControllerHandle is not a valid EFI_HANDLE.\r
-    EFI_INVALID_PARAMETER - ChildHandle is not NULL and it is not a valid \r
-                            EFI_HANDLE.\r
-    EFI_INVALID_PARAMETER - Language is NULL.\r
-    EFI_INVALID_PARAMETER - ControllerName is NULL.\r
-    EFI_UNSUPPORTED       - The driver specified by This is not currently \r
-                            managing the controller specified by \r
-                            ControllerHandle and ChildHandle.\r
-    EFI_UNSUPPORTED       - The driver specified by This does not support the \r
-                            language specified by Language.\r
-\r
---*/\r
 {\r
   return EFI_UNSUPPORTED;\r
 }\r
index 4dca145318e27f066bd8ea7d64252a2014002909..0dcb9a8796249b16da649669cd91a23e62ec9332 100644 (file)
@@ -1,6 +1,7 @@
-/*++\r
+/** @file\r
+  Challenge-Handshake Authentication Protocol (CHAP) Configuration\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,7 +16,9 @@ Module Name:
 \r
 Abstract:\r
 \r
---*/\r
+  This file is for CHAP configuration\r
+\r
+**/\r
 \r
 #include "IScsiImpl.h"\r
 #include "Md5.h"\r
@@ -92,30 +95,26 @@ IScsiCHAPAuthTarget (
   return Status;\r
 }\r
 \r
-EFI_STATUS\r
-IScsiCHAPOnRspReceived (\r
-  IN ISCSI_CONNECTION  *Conn,\r
-  IN BOOLEAN           Transit\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   This function checks the received iSCSI Login Response during the security\r
   negotiation stage.\r
   \r
-Arguments:\r
+  @param  Conn[in]             The iSCSI connection.\r
 \r
-  Conn    - The iSCSI connection.\r
-  Transit - The transit flag of the latest iSCSI Login Response.\r
+  @param  Transit[in]          The transit flag of the latest iSCSI Login Response.\r
 \r
-Returns:\r
+  @retval EFI_SUCCESS          The Login Response passed the CHAP validation.\r
 \r
-  EFI_SUCCESS          - The Login Response passed the CHAP validation.\r
-  EFI_OUT_OF_RESOURCES - Failed to allocate memory.\r
-  EFI_PROTOCOL_ERROR   - Some kind of protocol error happend.\r
+  @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r
 \r
---*/\r
+  @retval EFI_PROTOCOL_ERROR   Some kind of protocol error happend.\r
+\r
+**/\r
+EFI_STATUS\r
+IScsiCHAPOnRspReceived (\r
+  IN ISCSI_CONNECTION  *Conn,\r
+  IN BOOLEAN           Transit\r
+  )\r
 {\r
   EFI_STATUS                Status;\r
   ISCSI_SESSION             *Session;\r
@@ -288,31 +287,27 @@ ON_EXIT:
   return Status;\r
 }\r
 \r
-EFI_STATUS\r
-IScsiCHAPToSendReq (\r
-  IN ISCSI_CONNECTION  *Conn,\r
-  IN NET_BUF           *Pdu\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   This function fills the CHAP authentication information into the login PDU\r
   during the security negotiation stage in the iSCSI connection login.\r
-  \r
-Arguments:\r
 \r
-  Conn - The iSCSI connection.\r
-  Pdu  - The PDU to send out.\r
+  @param  Conn[in]             The iSCSI connection.\r
 \r
-Returns:\r
+  @param  Pdu[in]              The PDU to send out.\r
 \r
-  EFI_SUCCESS          - All check passed and the phase-related CHAP authentication\r
-                         info is filled into the iSCSI PDU.\r
-  EFI_OUT_OF_RESOURCES - Failed to allocate memory.\r
-  EFI_PROTOCOL_ERROR   - Some kind of protocol error happend.\r
+  @retval EFI_SUCCESS          All check passed and the phase-related CHAP\r
+                               authentication info is filled into the iSCSI PDU.\r
 \r
---*/\r
+  @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r
+\r
+  @retval EFI_PROTOCOL_ERROR   Some kind of protocol error happend.\r
+\r
+**/\r
+EFI_STATUS\r
+IScsiCHAPToSendReq (\r
+  IN ISCSI_CONNECTION  *Conn,\r
+  IN NET_BUF           *Pdu\r
+  )\r
 {\r
   EFI_STATUS                Status;\r
   ISCSI_SESSION             *Session;\r
index 2889167b32b19f67a40a41ce3fee4d187ffcc220..bd5b13c00c180581519b09a6b452025354a1ae31 100644 (file)
@@ -1,4 +1,5 @@
-/*++\r
+/** @file\r
+  The header file of CHAP configuration\r
 \r
 Copyright (c) 2004 - 2007, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
@@ -14,8 +15,8 @@ Module Name:
   IScsiCHAP.h\r
 \r
 Abstract:\r
-\r
---*/\r
+  the header file for CHAP\r
+**/\r
 \r
 #ifndef _ISCSI_CHAP_H_\r
 #define _ISCSI_CHAP_H_\r
@@ -80,12 +81,43 @@ typedef struct _ISCSI_CHAP_AUTH_DATA {
   UINT32                        OutChallengeLength;\r
 } ISCSI_CHAP_AUTH_DATA;\r
 \r
+/**\r
+  This function checks the received iSCSI Login Response during the security\r
+  negotiation stage.\r
+  \r
+  @param  Conn[in]             The iSCSI connection.\r
+\r
+  @param  Transit[in]          The transit flag of the latest iSCSI Login Response.\r
+\r
+  @retval EFI_SUCCESS          The Login Response passed the CHAP validation.\r
+\r
+  @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r
+\r
+  @retval EFI_PROTOCOL_ERROR   Some kind of protocol error happend.\r
+\r
+**/\r
 EFI_STATUS\r
 IScsiCHAPOnRspReceived (\r
   IN ISCSI_CONNECTION  *Conn,\r
   IN BOOLEAN           Transit\r
   );\r
 \r
+/**\r
+  This function fills the CHAP authentication information into the login PDU\r
+  during the security negotiation stage in the iSCSI connection login.\r
+\r
+  @param  Conn[in]             The iSCSI connection.\r
+\r
+  @param  Pdu[in]              The PDU to send out.\r
+\r
+  @retval EFI_SUCCESS          All check passed and the phase-related CHAP\r
+                               authentication info is filled into the iSCSI PDU.\r
+\r
+  @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r
+\r
+  @retval EFI_PROTOCOL_ERROR   Some kind of protocol error happend.\r
+\r
+**/\r
 EFI_STATUS\r
 IScsiCHAPToSendReq (\r
   IN ISCSI_CONNECTION  *Conn,\r
index 3f5e0187b7d6c7123f5dfa98f7016d29c8482c40..cd5d257d9e887f9952fed2ddd14e72db4673aad9 100644 (file)
@@ -1,6 +1,7 @@
-/*++\r
+/** @file\r
+  The common header file of Iscsi\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,7 +16,9 @@ Module Name:
 \r
 Abstract:\r
 \r
---*/\r
+  The common header file of Iscsi\r
+\r
+**/\r
 \r
 #ifndef _ISCSI_COMMON_H_\r
 #define _ISCSI_COMMON_H_\r
index 494415211166af6abff29cdfd03ecd8342f07eb5..e196ffda3da87413b4072bb4b7270fbdee36be58 100644 (file)
@@ -1,4 +1,5 @@
-/*++\r
+/** @file\r
+  Helper functions for configuring or getting the parameters relating to ISCSI\r
 \r
 Copyright (c) 2004 - 2008, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
@@ -15,7 +16,9 @@ Module Name:
 \r
 Abstract:\r
 \r
---*/\r
+  Helper functions for configuring or getting the parameters relating to ISCSI\r
+\r
+**/\r
 \r
 #include "IScsiImpl.h"\r
 \r
@@ -29,76 +32,56 @@ LIST_ENTRY      mIScsiConfigFormList = {
   &mIScsiConfigFormList\r
 };\r
 \r
+/**\r
+  Convert the IPv4 address into a dotted string.\r
+\r
+  @param  Ip[in]   The IPv4 address.\r
+\r
+  @param  Str[out] The dotted IP string.\r
+\r
+  @retval None.\r
+\r
+**/\r
 STATIC\r
 VOID\r
 IScsiIpToStr (\r
   IN  EFI_IPv4_ADDRESS  *Ip,\r
   OUT CHAR16            *Str\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Convert the IPv4 address into a dotted string.\r
-\r
-Arguments:\r
-\r
-  Ip  - The IPv4 address.\r
-  Str - The dotted IP string.\r
-\r
-Returns:\r
-\r
-  None.\r
-\r
---*/\r
 {\r
   UnicodeSPrint ( Str, 2 * IP4_STR_MAX_SIZE, L"%d.%d.%d.%d", Ip->Addr[0], Ip->Addr[1], Ip->Addr[2], Ip->Addr[3]);\r
 }\r
 \r
-VOID\r
-PopUpInvalidNotify (\r
-  IN CHAR16 *Warning\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Pop up an invalid notify which displays the message in Warning.\r
 \r
-Arguments:\r
-\r
-  Warning - The warning message.\r
+  @param  Warning[in] The warning message.\r
 \r
-Returns:\r
+  @retval None.\r
 \r
-  None.\r
-\r
---*/\r
+**/\r
+VOID\r
+PopUpInvalidNotify (\r
+  IN CHAR16 *Warning\r
+  )\r
 {\r
   EFI_INPUT_KEY             Key;\r
 \r
   IfrLibCreatePopUp (1, &Key, Warning);\r
 }\r
 \r
-EFI_STATUS\r
-IScsiUpdateDeviceList (\r
-  VOID\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Update the list of iSCSI devices the iSCSI driver is controlling.\r
 \r
-Arguments:\r
-\r
-  None.\r
+  @param  None.\r
 \r
-Returns:\r
+  @retval None.\r
 \r
-  None.\r
-\r
---*/\r
+**/\r
+EFI_STATUS\r
+IScsiUpdateDeviceList (\r
+  VOID\r
+  )\r
 {\r
   EFI_STATUS                  Status;\r
   ISCSI_DEVICE_LIST           *DeviceList;\r
@@ -226,26 +209,19 @@ Returns:
   return Status;\r
 }\r
 \r
+/**\r
+  Get the iSCSI configuration form entry by the index of the goto opcode actived.\r
+\r
+  @param  Index[in] The 0-based index of the goto opcode actived.\r
+\r
+  @retval The iSCSI configuration form entry found.\r
+\r
+**/\r
 STATIC\r
 ISCSI_CONFIG_FORM_ENTRY *\r
 IScsiGetConfigFormEntryByIndex (\r
   IN UINT32 Index\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Get the iSCSI configuration form entry by the index of the goto opcode actived.\r
-\r
-Arguments:\r
-\r
-  Index - The 0-based index of the goto opcode actived.\r
-\r
-Returns:\r
-\r
-  The iSCSI configuration form entry found.\r
-\r
---*/\r
 {\r
   UINT32                  CurrentIndex;\r
   LIST_ENTRY              *Entry;\r
@@ -266,28 +242,22 @@ Returns:
   return ConfigFormEntry;\r
 }\r
 \r
+/**\r
+  Convert the iSCSI configuration data into the IFR data.\r
+\r
+  @param  ConfigFormEntry[in] The iSCSI configuration form entry.\r
+\r
+  @param  IfrNvData[in]       The IFR nv data.\r
+\r
+  @retval None.\r
+\r
+**/\r
 STATIC\r
 VOID\r
 IScsiConvertDeviceConfigDataToIfrNvData (\r
   IN ISCSI_CONFIG_FORM_ENTRY  *ConfigFormEntry,\r
   IN ISCSI_CONFIG_IFR_NVDATA  *IfrNvData\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Convert the iSCSI configuration data into the IFR data.\r
-\r
-Arguments:\r
-\r
-  ConfigFormEntry - The iSCSI configuration form entry.\r
-  IfrNvData       - The IFR nv data.\r
-\r
-Returns:\r
-\r
-  None.\r
-\r
---*/\r
 {\r
   ISCSI_SESSION_CONFIG_NVDATA   *SessionConfigData;\r
   ISCSI_CHAP_AUTH_CONFIG_NVDATA *AuthConfigData;\r
@@ -324,7 +294,33 @@ Returns:
   IScsiAsciiStrToUnicodeStr (AuthConfigData->ReverseCHAPSecret, IfrNvData->ReverseCHAPSecret);\r
 }\r
 \r
+/**\r
+  This function allows a caller to extract the current configuration for one\r
+  or more named elements from the target driver.\r
+\r
+  @param  This[in]              Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
+\r
+  @param  Request[in]           A null-terminated Unicode string in <ConfigRequest> format.\r
 \r
+  @param  Progress[out]         On return, points to a character in the Request string.\r
+                                Points to the string's null terminator if request was successful.\r
+                                Points to the most recent '&' before the first failing name/value\r
+                                pair (or the beginning of the string if the failure is in the\r
+                                first name/value pair) if the request was not successful.\r
+\r
+  @param  Results[out]          A null-terminated Unicode string in <ConfigAltResp> format which\r
+                                has all values filled in for the names in the Request string.\r
+                                String to be allocated by the called function.\r
+\r
+  @retval EFI_SUCCESS           The Results is filled with the requested values.\r
+\r
+  @retval EFI_OUT_OF_RESOURCES  Not enough memory to store the results.\r
+\r
+  @retval EFI_INVALID_PARAMETER Request is NULL, illegal syntax, or unknown name.\r
+\r
+  @retval EFI_NOT_FOUND         Routing data doesn't match any storage in this driver.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IScsiFormExtractConfig (\r
@@ -333,31 +329,6 @@ IScsiFormExtractConfig (
   OUT EFI_STRING                             *Progress,\r
   OUT EFI_STRING                             *Results\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    This function allows a caller to extract the current configuration for one\r
-    or more named elements from the target driver.\r
-\r
-  Arguments:\r
-    This       - Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
-    Request    - A null-terminated Unicode string in <ConfigRequest> format.\r
-    Progress   - On return, points to a character in the Request string.\r
-                 Points to the string's null terminator if request was successful.\r
-                 Points to the most recent '&' before the first failing name/value\r
-                 pair (or the beginning of the string if the failure is in the\r
-                 first name/value pair) if the request was not successful.\r
-    Results    - A null-terminated Unicode string in <ConfigAltResp> format which\r
-                 has all values filled in for the names in the Request string.\r
-                 String to be allocated by the called function.\r
-\r
-  Returns:\r
-    EFI_SUCCESS           - The Results is filled with the requested values.\r
-    EFI_OUT_OF_RESOURCES  - Not enough memory to store the results.\r
-    EFI_INVALID_PARAMETER - Request is NULL, illegal syntax, or unknown name.\r
-    EFI_NOT_FOUND         - Routing data doesn't match any storage in this driver.\r
-\r
---*/\r
 {\r
   EFI_STATUS                       Status;\r
   CHAR8                            InitiatorName[ISCSI_NAME_IFR_MAX_SIZE];\r
@@ -406,6 +377,25 @@ IScsiFormExtractConfig (
   return Status;\r
 }\r
 \r
+/**\r
+  This function processes the results of changes in configuration.\r
+\r
+  @param  This[in]              Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
+\r
+  @param  Configuration[in]     A null-terminated Unicode string in <ConfigResp> format.\r
+\r
+  @param  Progress[out]         A pointer to a string filled in with the offset of the most\r
+                                recent '&' before the first failing name/value pair (or the\r
+                                beginning of the string if the failure is in the first\r
+                                name/value pair) or the terminating NULL if all was successful.\r
+\r
+  @retval EFI_SUCCESS           The Results is processed successfully.\r
+\r
+  @retval EFI_INVALID_PARAMETER Configuration is NULL.\r
+\r
+  @retval EFI_NOT_FOUND         Routing data doesn't match any storage in this driver.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IScsiFormRouteConfig (\r
@@ -413,29 +403,35 @@ IScsiFormRouteConfig (
   IN  CONST EFI_STRING                       Configuration,\r
   OUT EFI_STRING                             *Progress\r
   )\r
-/*++\r
+{\r
+  return EFI_SUCCESS;\r
+}\r
 \r
-  Routine Description:\r
-    This function processes the results of changes in configuration.\r
+/**\r
+  This function processes the results of changes in configuration.\r
 \r
-  Arguments:\r
-    This          - Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
-    Configuration - A null-terminated Unicode string in <ConfigResp> format.\r
-    Progress      - A pointer to a string filled in with the offset of the most\r
-                    recent '&' before the first failing name/value pair (or the\r
-                    beginning of the string if the failure is in the first\r
-                    name/value pair) or the terminating NULL if all was successful.\r
+  @param  This[in]             Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
 \r
-  Returns:\r
-    EFI_SUCCESS           - The Results is processed successfully.\r
-    EFI_INVALID_PARAMETER - Configuration is NULL.\r
-    EFI_NOT_FOUND         - Routing data doesn't match any storage in this driver.\r
+  @param  Action[in]           Specifies the type of action taken by the browser.\r
 \r
---*/\r
-{\r
-  return EFI_SUCCESS;\r
-}\r
+  @param  QuestionId[in]       A unique value which is sent to the original exporting driver\r
+                               so that it can identify the type of data to expect.\r
+\r
+  @param  Type[in]             The type of value for the question.\r
+\r
+  @param  Value[in]            A pointer to the data being sent to the original exporting driver.\r
+\r
+  @param  ActionRequest[out]   On return, points to the action requested by the callback function.\r
+\r
+  @retval EFI_SUCCESS          The callback successfully handled the action.\r
+\r
+  @retval EFI_OUT_OF_RESOURCES Not enough storage is available to hold the variable and its data.\r
 \r
+  @retval EFI_DEVICE_ERROR     The variable could not be saved.\r
+\r
+  @retval EFI_UNSUPPORTED      The specified Action is not supported by the callback.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IScsiFormCallback (\r
@@ -446,27 +442,6 @@ IScsiFormCallback (
   IN  EFI_IFR_TYPE_VALUE                     *Value,\r
   OUT EFI_BROWSER_ACTION_REQUEST             *ActionRequest\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    This function processes the results of changes in configuration.\r
-\r
-  Arguments:\r
-    This          - Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL.\r
-    Action        - Specifies the type of action taken by the browser.\r
-    QuestionId    - A unique value which is sent to the original exporting driver\r
-                    so that it can identify the type of data to expect.\r
-    Type          - The type of value for the question.\r
-    Value         - A pointer to the data being sent to the original exporting driver.\r
-    ActionRequest - On return, points to the action requested by the callback function.\r
-\r
-  Returns:\r
-    EFI_SUCCESS          - The callback successfully handled the action.\r
-    EFI_OUT_OF_RESOURCES - Not enough storage is available to hold the variable and its data.\r
-    EFI_DEVICE_ERROR     - The variable could not be saved.\r
-    EFI_UNSUPPORTED      - The specified Action is not supported by the callback.\r
-\r
---*/\r
 {\r
   ISCSI_FORM_CALLBACK_INFO  *Private;\r
   UINTN                     BufferSize;\r
@@ -722,32 +697,27 @@ IScsiFormCallback (
   return Status;\r
 }\r
 \r
-\r
-EFI_STATUS\r
-IScsiConfigUpdateForm (\r
-  IN EFI_HANDLE  DriverBindingHandle,\r
-  IN EFI_HANDLE  Controller,\r
-  IN BOOLEAN     AddForm\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Updates the iSCSI configuration form to add/delete an entry for the iSCSI\r
   device specified by the Controller.\r
 \r
-Arguments:\r
+  @param  DriverBindingHandle[in] The driverbinding handle.\r
+\r
+  @param  Controller[in]          The controller handle of the iSCSI device.\r
 \r
-  DriverBindingHandle - The driverbinding handle.\r
-  Controller          - The controller handle of the iSCSI device.\r
-  AddForm             - Whether to add or delete a form entry.\r
+  @param  AddForm[in]             Whether to add or delete a form entry.\r
 \r
-Returns:\r
+  @retval EFI_SUCCESS             The iSCSI configuration form is updated.\r
 \r
-  EFI_SUCCESS          - The iSCSI configuration form is updated.\r
-  EFI_OUT_OF_RESOURCES - Failed to allocate memory.\r
+  @retval EFI_OUT_OF_RESOURCES    Failed to allocate memory.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+IScsiConfigUpdateForm (\r
+  IN EFI_HANDLE  DriverBindingHandle,\r
+  IN EFI_HANDLE  Controller,\r
+  IN BOOLEAN     AddForm\r
+  )\r
 {\r
   LIST_ENTRY                  *Entry;\r
   ISCSI_CONFIG_FORM_ENTRY     *ConfigFormEntry;\r
@@ -887,26 +857,20 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
-EFI_STATUS\r
-IScsiConfigFormInit (\r
-  IN EFI_HANDLE  DriverBindingHandle\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Initialize the iSCSI configuration form.\r
 \r
-Arguments:\r
+  @param  DriverBindingHandle[in] The iSCSI driverbinding handle.\r
 \r
-  DriverBindingHandle - The iSCSI driverbinding handle.\r
+  @retval EFI_SUCCESS             The iSCSI configuration form is initialized.\r
 \r
-Returns:\r
+  @retval EFI_OUT_OF_RESOURCES    Failed to allocate memory.\r
 \r
-  EFI_SUCCESS          - The iSCSI configuration form is initialized.\r
-  EFI_OUT_OF_RESOURCES - Failed to allocate memory.\r
-\r
---*/\r
+**/\r
+EFI_STATUS\r
+IScsiConfigFormInit (\r
+  IN EFI_HANDLE  DriverBindingHandle\r
+  )\r
 {\r
   EFI_STATUS                  Status;\r
   EFI_HII_DATABASE_PROTOCOL   *HiiDatabase;\r
@@ -980,28 +944,22 @@ Returns:
   return Status;\r
 }\r
 \r
-EFI_STATUS\r
-IScsiConfigFormUnload (\r
-  IN EFI_HANDLE  DriverBindingHandle\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Unload the iSCSI configuration form, this includes: delete all the iSCSI\r
   device configuration entries, uninstall the form callback protocol and\r
   free the resources used.\r
 \r
-Arguments:\r
-\r
-  DriverBindingHandle - The iSCSI driverbinding handle.\r
+  @param  DriverBindingHandle[in] The iSCSI driverbinding handle.\r
 \r
-Returns:\r
+  @retval EFI_SUCCESS             The iSCSI configuration form is unloaded.\r
 \r
-  EFI_SUCCESS          - The iSCSI configuration form is unloaded.\r
-  EFI_OUT_OF_RESOURCES - Failed to allocate memory.\r
+  @retval EFI_OUT_OF_RESOURCES    Failed to allocate memory.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+IScsiConfigFormUnload (\r
+  IN EFI_HANDLE  DriverBindingHandle\r
+  )\r
 {\r
   ISCSI_CONFIG_FORM_ENTRY     *ConfigFormEntry;\r
 \r
index c3c664d449293eb3c52c72aabf3d262e97ec23f8..8f48be9a1402e5ef17af1b0493cd1fe05587bf94 100644 (file)
@@ -1,6 +1,7 @@
-/*++\r
+/** @file\r
+  The header file of IScsiConfig.c\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,8 +16,9 @@ Module Name:
 \r
 Abstract:\r
 \r
+  The header file of IScsiConfig.c\r
 \r
---*/\r
+**/\r
 \r
 #ifndef _ISCSI_CONFIG_H_\r
 #define _ISCSI_CONFIG_H_\r
@@ -84,6 +86,21 @@ typedef struct _ISCSI_FORM_CALLBACK_INFO {
   ISCSI_CONFIG_FORM_ENTRY          *Current;\r
 } ISCSI_FORM_CALLBACK_INFO;\r
 \r
+/**\r
+  Updates the iSCSI configuration form to add/delete an entry for the iSCSI\r
+  device specified by the Controller.\r
+\r
+  @param  DriverBindingHandle[in] The driverbinding handle.\r
+\r
+  @param  Controller[in]          The controller handle of the iSCSI device.\r
+\r
+  @param  AddForm[in]             Whether to add or delete a form entry.\r
+\r
+  @retval EFI_SUCCESS             The iSCSI configuration form is updated.\r
+\r
+  @retval EFI_OUT_OF_RESOURCES    Failed to allocate memory.\r
+\r
+**/\r
 EFI_STATUS\r
 IScsiConfigUpdateForm (\r
   IN EFI_HANDLE  DriverBindingHandle,\r
@@ -91,11 +108,33 @@ IScsiConfigUpdateForm (
   IN BOOLEAN     AddForm\r
   );\r
 \r
+/**\r
+  Initialize the iSCSI configuration form.\r
+\r
+  @param  DriverBindingHandle[in] The iSCSI driverbinding handle.\r
+\r
+  @retval EFI_SUCCESS             The iSCSI configuration form is initialized.\r
+\r
+  @retval EFI_OUT_OF_RESOURCES    Failed to allocate memory.\r
+\r
+**/\r
 EFI_STATUS\r
 IScsiConfigFormInit (\r
   IN EFI_HANDLE  DriverBindingHandle\r
   );\r
 \r
+/**\r
+  Unload the iSCSI configuration form, this includes: delete all the iSCSI\r
+  device configuration entries, uninstall the form callback protocol and\r
+  free the resources used.\r
+\r
+  @param  DriverBindingHandle[in] The iSCSI driverbinding handle.\r
+\r
+  @retval EFI_SUCCESS             The iSCSI configuration form is unloaded.\r
+\r
+  @retval EFI_OUT_OF_RESOURCES    Failed to allocate memory.\r
+\r
+**/\r
 EFI_STATUS\r
 IScsiConfigFormUnload (\r
   IN EFI_HANDLE  DriverBindingHandle\r
index 768547a31476bcfdb9c6827033407d686e327e85..516b45913e3d3367492242bcc9293222bf9fb385 100644 (file)
@@ -1,4 +1,5 @@
-/*++\r
+/** @file\r
+  Define NVData structures used by the iSCSI configuration component\r
 \r
 Copyright (c) 2004 - 2007, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
@@ -17,7 +18,7 @@ Abstract:
  \r
   NVData structure used by the iSCSI configuration component.\r
 \r
---*/\r
+**/\r
 \r
 #ifndef _ISCSI_NVDATASTRUC_H_\r
 #define _ISCSI_NVDATASTRUC_H_\r
index df4772b8c4b3ec9544da4a4c05f8edf96405ff24..6b7e83d2ceb0a451eb20524d99682bd8109a8b11 100644 (file)
@@ -1,4 +1,5 @@
-/*++\r
+/**\r
+  ISci DHCP related configuration routines.\r
 \r
 Copyright (c) 2004 - 2007, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
@@ -15,12 +16,30 @@ Module Name:
 \r
 Abstract:\r
 \r
-  iSCSI DHCP related configuration routines.\r
+  IScsi DHCP related configuration routines.\r
 \r
---*/\r
+**/\r
 \r
 #include "IScsiImpl.h"\r
 \r
+/**\r
+  Extract the Root Path option and get the required target information.\r
+\r
+  @param  RootPath[in]          The RootPath.\r
+\r
+  @param  Length[in]            Length of the RootPath option payload.\r
+\r
+  @param  ConfigNvData[in]      The iSCSI session configuration data read from nonvolatile device.\r
+\r
+  @retval EFI_SUCCESS           All required information is extracted from the RootPath option.\r
+\r
+  @retval EFI_NOT_FOUND         The RootPath is not an iSCSI RootPath.\r
+\r
+  @retval EFI_OUT_OF_RESOURCES  Failed to allocate memory.\r
+\r
+  @retval EFI_INVALID_PARAMETER The RootPath is mal-formatted.\r
+\r
+**/\r
 STATIC\r
 EFI_STATUS\r
 IScsiDhcpExtractRootPath (\r
@@ -28,26 +47,6 @@ IScsiDhcpExtractRootPath (
   IN UINT8                        Length,\r
   IN ISCSI_SESSION_CONFIG_NVDATA  *ConfigNvData\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Extract the Root Path option and get the required target information.\r
-  \r
-Arguments:\r
-\r
-  RootPath     - The RootPath.\r
-  Length       - Length of the RootPath option payload.\r
-  ConfigNvData - The iSCSI session configuration data read from nonvolatile device.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - All required information is extracted from the RootPath option.\r
-  EFI_NOT_FOUND         - The RootPath is not an iSCSI RootPath.\r
-  EFI_OUT_OF_RESOURCES  - Failed to allocate memory.\r
-  EFI_INVALID_PARAMETER - The RootPath is mal-formatted.\r
-\r
---*/\r
 {\r
   EFI_STATUS            Status;\r
   UINT8                 IScsiRootPathIdLen;\r
@@ -183,6 +182,28 @@ ON_EXIT:
   return Status;\r
 }\r
 \r
+/**\r
+  The callback function registerd to the DHCP4 instance which is used to select\r
+  the qualified DHCP OFFER.\r
+  \r
+  @param  This[in]         The DHCP4 protocol.\r
+\r
+  @param  Context[in]      The context set when configuring the DHCP4 protocol.\r
+\r
+  @param  CurrentState[in] The current state of the DHCP4 protocol.\r
+\r
+  @param  Dhcp4Event[in]   The event occurs in the current state.\r
+\r
+  @param  Packet[in]       The DHCP packet that is to be sent or already received. \r
+\r
+  @param  NewPackt[out]    The packet used to replace the above Packet.\r
+\r
+  @retval EFI_NOT_READY    The DHCP OFFER packet doesn't match our requirements.\r
+\r
+  @retval EFI_SUCCESS      Either the DHCP OFFER is qualified or we're not intereseted\r
+                           in the Dhcp4Event.\r
+\r
+**/\r
 STATIC\r
 EFI_STATUS\r
 IScsiDhcpSelectOffer (\r
@@ -193,29 +214,6 @@ IScsiDhcpSelectOffer (
   IN  EFI_DHCP4_PACKET    * Packet, OPTIONAL\r
   OUT EFI_DHCP4_PACKET    **NewPacket OPTIONAL\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  The callback function registerd to the DHCP4 instance which is used to select\r
-  the qualified DHCP OFFER.\r
-  \r
-Arguments:\r
-\r
-  This         - The DHCP4 protocol.\r
-  Context      - The context set when configuring the DHCP4 protocol.\r
-  CurrentState - The current state of the DHCP4 protocol.\r
-  Dhcp4Event   - The event occurs in the current state.\r
-  Packet       - The DHCP packet that is to be sent or already received.\r
-  NewPackt     - The packet used to replace the above Packet.\r
-\r
-Returns:\r
-\r
-  EFI_NOT_READY - The DHCP OFFER packet doesn't match our requirements.\r
-  EFI_SUCCESS   - Either the DHCP OFFER is qualified or we're not intereseted\r
-                  in the Dhcp4Event.\r
-\r
---*/\r
 {\r
   EFI_STATUS              Status;\r
   UINT32                  OptionCount;\r
@@ -267,30 +265,27 @@ Returns:
   return Status;\r
 }\r
 \r
-EFI_STATUS\r
-IScsiParseDhcpAck (\r
-  IN EFI_DHCP4_PROTOCOL         *Dhcp4,\r
-  IN ISCSI_SESSION_CONFIG_DATA  *ConfigData\r
-  )\r
-/*++\r
+/**\r
+  Parse the DHCP ACK to get the address configuration and DNS information.\r
 \r
-Routine Description:\r
+  @param  Dhcp4[in]             The DHCP4 protocol.\r
 \r
-  Parse the DHCP ACK to get the address configuration and DNS information.\r
-  \r
-Arguments:\r
+  @param  ConfigData[in]        The session configuration data.\r
 \r
-  Dhcp4      - The DHCP4 protocol.\r
-  ConfigData - The session configuration data.\r
+  @retval EFI_SUCCESS           The DNS information is got from the DHCP ACK.\r
 \r
-Returns:\r
+  @retval EFI_NO_MAPPING        DHCP failed to acquire address and other information.\r
 \r
-  EFI_SUCCESS           - The DNS information is got from the DHCP ACK.\r
-  EFI_NO_MAPPING        - DHCP failed to acquire address and other information.\r
-  EFI_INVALID_PARAMETER - The DHCP ACK's DNS option is mal-formatted.\r
-  EFI_DEVICE_ERROR      - Some unexpected error happened.\r
+  @retval EFI_INVALID_PARAMETER The DHCP ACK's DNS option is mal-formatted.\r
 \r
---*/\r
+  @retval EFI_DEVICE_ERROR      Some unexpected error happened.\r
+\r
+**/\r
+EFI_STATUS\r
+IScsiParseDhcpAck (\r
+  IN EFI_DHCP4_PROTOCOL         *Dhcp4,\r
+  IN ISCSI_SESSION_CONFIG_DATA  *ConfigData\r
+  )\r
 {\r
   EFI_STATUS              Status;\r
   EFI_DHCP4_MODE_DATA     Dhcp4ModeData;\r
@@ -366,32 +361,30 @@ Returns:
   return Status;\r
 }\r
 \r
-EFI_STATUS\r
-IScsiDoDhcp (\r
-  IN EFI_HANDLE                 Image,\r
-  IN EFI_HANDLE                 Controller,\r
-  IN ISCSI_SESSION_CONFIG_DATA  *ConfigData\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Parse the DHCP ACK to get the address configuration and DNS information.\r
   \r
-Arguments:\r
+  @param  Image[in]             The handle of the driver image.\r
+\r
+  @param  Controller[in]        The handle of the controller;\r
 \r
-  Image      - The handle of the driver image.\r
-  Controller - The handle of the controller;\r
-  ConfigData - The session configuration data.\r
+  @param  ConfigData[in]        The session configuration data.\r
 \r
-Returns:\r
+  @retval EFI_SUCCESS           The DNS information is got from the DHCP ACK.\r
 \r
-  EFI_SUCCESS           - The DNS information is got from the DHCP ACK.\r
-  EFI_NO_MAPPING        - DHCP failed to acquire address and other information.\r
-  EFI_INVALID_PARAMETER - The DHCP ACK's DNS option is mal-formatted.\r
-  EFI_DEVICE_ERROR      - Some unexpected error happened.\r
+  @retval EFI_NO_MAPPING        DHCP failed to acquire address and other information.\r
 \r
---*/\r
+  @retval EFI_INVALID_PARAMETER The DHCP ACK's DNS option is mal-formatted.\r
+\r
+  @retval EFI_DEVICE_ERROR      Some unexpected error happened.\r
+\r
+**/\r
+EFI_STATUS\r
+IScsiDoDhcp (\r
+  IN EFI_HANDLE                 Image,\r
+  IN EFI_HANDLE                 Controller,\r
+  IN ISCSI_SESSION_CONFIG_DATA  *ConfigData\r
+  )\r
 {\r
   EFI_HANDLE              Dhcp4Handle;\r
   EFI_DHCP4_PROTOCOL      *Dhcp4;\r
index 92b303976e0a9826ffde9b9614f21b9f7a203eba..75bc7a16732ce5441c8bb8a0845d961470b46134 100644 (file)
@@ -1,4 +1,5 @@
-/*++\r
+/** @file\r
+  Data structure for DHCP support\r
 \r
 Copyright (c) 2004 - 2008, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
@@ -14,8 +15,9 @@ Module Name:
   IScsiDhcp.h\r
 \r
 Abstract:\r
+  The header file of IScsiDhcp.c\r
 \r
---*/\r
+**/\r
 \r
 #ifndef _ISCSI_DHCP_H_\r
 #define _ISCSI_DHCP_H_\r
@@ -45,6 +47,24 @@ typedef struct _ISCSI_ROOT_PATH_FIELD {
   UINT8 Len;\r
 } ISCSI_ROOT_PATH_FIELD;\r
 \r
+/**\r
+  Parse the DHCP ACK to get the address configuration and DNS information.\r
+  \r
+  @param  Image[in]             The handle of the driver image.\r
+\r
+  @param  Controller[in]        The handle of the controller;\r
+\r
+  @param  ConfigData[in]        The session configuration data.\r
+\r
+  @retval EFI_SUCCESS           The DNS information is got from the DHCP ACK.\r
+\r
+  @retval EFI_NO_MAPPING        DHCP failed to acquire address and other information.\r
+\r
+  @retval EFI_INVALID_PARAMETER The DHCP ACK's DNS option is mal-formatted.\r
+\r
+  @retval EFI_DEVICE_ERROR      Some unexpected error happened.\r
+\r
+**/\r
 EFI_STATUS\r
 IScsiDoDhcp (\r
   IN EFI_HANDLE                 Image,\r
index de93240b05114143c853ac48f37e2a8af4f4d462..beee62c51bad0fcd2868a4d8db0f5f873f1bf66a 100644 (file)
@@ -1,4 +1,5 @@
-/*++\r
+/** @file\r
+  The entry point of IScsi driver\r
 \r
 Copyright (c) 2004 - 2008, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
@@ -14,8 +15,9 @@ Module Name:
   IScsiDriver.c\r
 \r
 Abstract:\r
+  The entry point of IScsi driver\r
 \r
---*/\r
+**/\r
 \r
 #include "IScsiImpl.h"\r
 \r
@@ -30,32 +32,29 @@ EFI_DRIVER_BINDING_PROTOCOL gIScsiDriverBinding = {
 \r
 EFI_GUID                    mIScsiPrivateGuid   = ISCSI_PRIVATE_GUID;\r
 \r
-EFI_STATUS\r
-EFIAPI\r
-IScsiDriverBindingSupported (\r
-  IN EFI_DRIVER_BINDING_PROTOCOL  * This,\r
-  IN EFI_HANDLE                   ControllerHandle,\r
-  IN EFI_DEVICE_PATH_PROTOCOL     * RemainingDevicePath OPTIONAL\r
-  )\r
-/*++\r
+/**\r
+  Test to see if IScsi driver supports the given controller. \r
 \r
-Routine Description:\r
+  @param  This[in]                Protocol instance pointer.\r
 \r
-  Test to see if iSCSI driver supports the given controller. \r
+  @param  ControllerHandle[in]    Handle of controller to test.\r
 \r
-Arguments:\r
+  @param  RemainingDevicePath[in] Optional parameter use to pick a specific child device to start.\r
 \r
-  This                - Protocol instance pointer.\r
-  ControllerHandle    - Handle of controller to test.\r
-  RemainingDevicePath - Optional parameter use to pick a specific child device to start.\r
+  @retval EFI_SUCCES              This driver supports the controller.\r
 \r
-Returns:\r
+  @retval EFI_ALREADY_STARTED     This driver is already running on this device.\r
 \r
-  EFI_SUCCES          - This driver supports the controller.\r
-  EFI_ALREADY_STARTED - This driver is already running on this device.\r
-  EFI_UNSUPPORTED     - This driver doesn't support the controller.\r
+  @retval EFI_UNSUPPORTED         This driver doesn't support the controller.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+IScsiDriverBindingSupported (\r
+  IN EFI_DRIVER_BINDING_PROTOCOL  * This,\r
+  IN EFI_HANDLE                   ControllerHandle,\r
+  IN EFI_DEVICE_PATH_PROTOCOL     * RemainingDevicePath OPTIONAL\r
+  )\r
 {\r
   EFI_STATUS                Status;\r
   EFI_DEVICE_PATH_PROTOCOL  *CurrentDevicePath;\r
@@ -100,6 +99,20 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Start to manage the controller. \r
+\r
+  @param  This[in]                Protocol instance pointer.\r
+\r
+  @param  ControllerHandle[in]    Handle of the controller.\r
+\r
+  @param  RemainingDevicePath[in] Optional parameter use to pick a specific child device to start.\r
+\r
+  @retval EFI_SUCCES              This driver supports this device.\r
+\r
+  @retval EFI_ALREADY_STARTED     This driver is already running on this device.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IScsiDriverBindingStart (\r
@@ -107,24 +120,6 @@ IScsiDriverBindingStart (
   IN EFI_HANDLE                   ControllerHandle,\r
   IN EFI_DEVICE_PATH_PROTOCOL     * RemainingDevicePath OPTIONAL\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Start to manage the controller. \r
-\r
-Arguments:\r
-\r
-  This                - Protocol instance pointer.\r
-  ControllerHandle    - Handle of the controller.\r
-  RemainingDevicePath - Optional parameter use to pick a specific child device to start.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCES          - This driver supports this device.\r
-  EFI_ALREADY_STARTED - This driver is already running on this device.\r
-\r
---*/\r
 {\r
   EFI_STATUS        Status;\r
   ISCSI_DRIVER_DATA *Private;\r
@@ -209,6 +204,20 @@ ON_ERROR:
   return Status;\r
 }\r
 \r
+/**\r
+  Release the control of this controller and remove the IScsi functions.\r
+\r
+  @param  This[in]              Protocol instance pointer.\r
+\r
+  @param  ControllerHandle[in]  Handle of controller to stop.\r
+\r
+  @param  NumberOfChildren[in]  Not used.\r
+\r
+  @param  ChildHandleBuffer[in] Not used.\r
+\r
+  @retval EFI_SUCCES            This driver supports this device.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IScsiDriverBindingStop (\r
@@ -217,24 +226,6 @@ IScsiDriverBindingStop (
   IN UINTN                        NumberOfChildren,\r
   IN EFI_HANDLE                   *ChildHandleBuffer\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Release the control of this controller and remove the iSCSI functions.\r
-\r
-Arguments:\r
-\r
-  This                - Protocol instance pointer.\r
-  ControllerHandle    - Handle of controller to stop.\r
-  NumberOfChildren    - Not used.\r
-  ChildHandleBuffer   - Not used.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCES          - This driver supports this device.\r
-\r
---*/\r
 {\r
   EFI_HANDLE                      IScsiController;\r
   EFI_STATUS                      Status;\r
@@ -315,27 +306,21 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
-EFI_STATUS\r
-EFIAPI\r
-EfiIScsiUnload (\r
-  IN EFI_HANDLE  ImageHandle\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Unload the iSCSI driver.\r
 \r
-Arguments:\r
-\r
-  ImageHandle - The handle of the driver image.\r
+  @param  ImageHandle[in]  The handle of the driver image.\r
 \r
-Returns:\r
+  @retval EFI_SUCCESS      The driver is unloaded.\r
 \r
-  EFI_SUCCESS      - The driver is unloaded.\r
-  EFI_DEVICE_ERROR - Some unexpected error happened.\r
+  @retval EFI_DEVICE_ERROR Some unexpected error happened.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+EfiIScsiUnload (\r
+  IN EFI_HANDLE  ImageHandle\r
+  )\r
 {\r
   EFI_STATUS  Status;\r
   UINTN       DeviceHandleCount;\r
@@ -389,29 +374,24 @@ Returns:
   return Status;\r
 }\r
 \r
-EFI_STATUS\r
-EFIAPI\r
-IScsiDriverEntryPoint (\r
-  IN EFI_HANDLE         ImageHandle,\r
-  IN EFI_SYSTEM_TABLE   *SystemTable\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Initialize the global variables publish the driver binding protocol.\r
 \r
-Arguments:\r
+  @param  ImageHandle[in]  The handle of the driver image.\r
 \r
-  ImageHandle - The handle of the driver image.\r
-  SystemTable - The EFI system table.\r
+  @param  SystemTable[in]  The EFI system table.\r
 \r
-Returns:\r
+  @retval EFI_SUCCESS      The protocols are installed.\r
 \r
-  EFI_SUCCESS      - The protocols are installed.\r
-  EFI_DEVICE_ERROR - Some unexpected error happened.\r
+  @retval EFI_DEVICE_ERROR Some unexpected error happened.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+IScsiDriverEntryPoint (\r
+  IN EFI_HANDLE         ImageHandle,\r
+  IN EFI_SYSTEM_TABLE   *SystemTable\r
+  )\r
 {\r
   EFI_STATUS                         Status;\r
   EFI_ISCSI_INITIATOR_NAME_PROTOCOL  *IScsiInitiatorName;\r
index b6a43243a7ba9c2b6194a2df6375fa6630eb6b52..a66fc151e9642acbe6fdb35049aa213b3e4ed4e3 100644 (file)
@@ -1,4 +1,5 @@
-/*++\r
+/** @file\r
+  The header file of IScsiDriver.c\r
 \r
 Copyright (c) 2004 - 2008, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
@@ -14,8 +15,9 @@ Module Name:
   IScsiDriver.h\r
 \r
 Abstract:\r
+  The header file of IScsiDriver.c\r
 \r
---*/\r
+**/\r
 \r
 #ifndef _ISCSI_DRIVER_H_\r
 #define _ISCSI_DRIVER_H_\r
@@ -55,6 +57,22 @@ typedef struct _ISCSI_PRIVATE_PROTOCOL {
 //\r
 // EFI Driver Binding Protocol for iSCSI driver.\r
 //\r
+/**\r
+  Test to see if IScsi driver supports the given controller. \r
+\r
+  @param  This[in]                Protocol instance pointer.\r
+\r
+  @param  ControllerHandle[in]    Handle of controller to test.\r
+\r
+  @param  RemainingDevicePath[in] Optional parameter use to pick a specific child device to start.\r
+\r
+  @retval EFI_SUCCES              This driver supports the controller.\r
+\r
+  @retval EFI_ALREADY_STARTED     This driver is already running on this device.\r
+\r
+  @retval EFI_UNSUPPORTED         This driver doesn't support the controller.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IScsiDriverBindingSupported (\r
@@ -63,6 +81,20 @@ IScsiDriverBindingSupported (
   IN EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath OPTIONAL\r
   );\r
 \r
+/**\r
+  Start to manage the controller. \r
+\r
+  @param  This[in]                Protocol instance pointer.\r
+\r
+  @param  ControllerHandle[in]    Handle of the controller.\r
+\r
+  @param  RemainingDevicePath[in] Optional parameter use to pick a specific child device to start.\r
+\r
+  @retval EFI_SUCCES              This driver supports this device.\r
+\r
+  @retval EFI_ALREADY_STARTED     This driver is already running on this device.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IScsiDriverBindingStart (\r
@@ -71,6 +103,20 @@ IScsiDriverBindingStart (
   IN EFI_DEVICE_PATH_PROTOCOL     *RemainingDevicePath OPTIONAL\r
   );\r
 \r
+/**\r
+  Release the control of this controller and remove the IScsi functions.\r
+\r
+  @param  This[in]              Protocol instance pointer.\r
+\r
+  @param  ControllerHandle[in]  Handle of controller to stop.\r
+\r
+  @param  NumberOfChildren[in]  Not used.\r
+\r
+  @param  ChildHandleBuffer[in] Not used.\r
+\r
+  @retval EFI_SUCCES            This driver supports this device.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IScsiDriverBindingStop (\r
@@ -81,8 +127,46 @@ IScsiDriverBindingStop (
   );\r
 \r
 //\r
-// EFI Component Name Protocol for iSCSI driver.\r
+// EFI Component Name Protocol for IScsi driver.\r
 //\r
+/**\r
+  Retrieves a Unicode string that is the user readable name of the EFI Driver.\r
+\r
+  This function retrieves the user readable name of a driver in the form of a\r
+  Unicode string. If the driver specified by This has a user readable name in\r
+  the language specified by Language, then a pointer to the driver name is\r
+  returned in DriverName, and EFI_SUCCESS is returned. If the driver specified\r
+  by This does not support the language specified by Language,\r
+  then EFI_UNSUPPORTED is returned.\r
+\r
+  @param  This[in]              A pointer to the EFI_COMPONENT_NAME_PROTOCOL\r
+                                instance.\r
+\r
+  @param  Language[in]          A pointer to a three character ISO 639-2 language\r
+                                identifier.\r
+                                This is the language of the driver name that that\r
+                                the caller is requesting, and it must match one of\r
+                                the languages specified in SupportedLanguages.  \r
+                                The number of languages supported by a driver is up\r
+                                to the driver writer.\r
+\r
+  @param  DriverName[out]       A pointer to the Unicode string to return.\r
+                                This Unicode string is the name of the\r
+                                driver specified by This in the language\r
+                                specified by Language.\r
+\r
+  @retval EFI_SUCCESS           The Unicode string for the Driver specified by\r
+                                This and the language specified by Language was\r
+                                returned in DriverName.\r
+\r
+  @retval EFI_INVALID_PARAMETER Language is NULL.\r
+\r
+  @retval EFI_INVALID_PARAMETER DriverName is NULL.\r
+\r
+  @retval EFI_UNSUPPORTED       The driver specified by This does not support\r
+                                the language specified by Language.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IScsiComponentNameGetDriverName (\r
@@ -91,6 +175,55 @@ IScsiComponentNameGetDriverName (
   OUT CHAR16                        **DriverName\r
   );\r
 \r
+/**\r
+  Retrieves a Unicode string that is the user readable name of the controller\r
+  that is being managed by an EFI Driver.\r
+\r
+  @param  This[in]              A pointer to the EFI_COMPONENT_NAME_PROTOCOL instance.\r
+\r
+  @param  ControllerHandle[in]  The handle of a controller that the driver specified by\r
+                                This is managing.  This handle specifies the controller\r
+                                whose name is to be returned.\r
+\r
+  @param  ChildHandle[in]       The handle of the child controller to retrieve the name\r
+                                of.  This is an optional parameter that may be NULL.  It\r
+                                will be NULL for device drivers.  It will also be NULL\r
+                                for a bus drivers that wish to retrieve the name of the\r
+                                bus controller.  It will not be NULL for a bus driver\r
+                                that wishes to retrieve the name of a child controller.\r
+\r
+  @param  Language[in]          A pointer to a three character ISO 639-2 language \r
+                                identifier.  This is the language of the controller name\r
+                                that that the caller is requesting, and it must match one\r
+                                of the languages specified in SupportedLanguages.  The\r
+                                number of languages supported by a driver is up to the\r
+                                driver writer.\r
+\r
+  @param  ControllerName[out]   A pointer to the Unicode string to return.  This Unicode\r
+                                string is the name of the controller specified by \r
+                                ControllerHandle and ChildHandle in the language \r
+                                specified by Language from the point of view of the \r
+                                driver specified by This. \r
+\r
+  @retval EFI_SUCCESS           The Unicode string for the user readable name in the \r
+                                language specified by Language for the driver \r
+                                specified by This was returned in DriverName.\r
+\r
+  @retval EFI_INVALID_PARAMETER ControllerHandle is not a valid EFI_HANDLE.\r
+\r
+  @retval EFI_INVALID_PARAMETER ChildHandle is not NULL and it is not a valid EFI_HANDLE.\r
+\r
+  @retval EFI_INVALID_PARAMETER Language is NULL.\r
+\r
+  @retval EFI_INVALID_PARAMETER ControllerName is NULL.\r
+\r
+  @retval EFI_UNSUPPORTED       The driver specified by This is not currently managing\r
+                                the controller specified by ControllerHandle and ChildHandle.\r
+\r
+  @retval EFI_UNSUPPORTED       The driver specified by This does not support the \r
+                                language specified by Language.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IScsiComponentNameGetControllerName (\r
@@ -102,8 +235,35 @@ IScsiComponentNameGetControllerName (
   );\r
 \r
 //\r
-// EFI iSCSI Initiator Name Protocol for iSCSI driver.\r
+// EFI IScsi Initiator Name Protocol for IScsi driver.\r
 //\r
+/**\r
+  Retrieves the current set value of iSCSI Initiator Name. \r
+\r
+  @param  This[in]              Pointer to the EFI_ISCSI_INITIATOR_NAME_PROTOCOL instance.\r
+\r
+  @param  BufferSize[in][out]   Size of the buffer in bytes pointed to by Buffer / Actual\r
+                                size of the variable data buffer.\r
+\r
+  @param  Buffer[out]           Pointer to the buffer for data to be read.\r
+\r
+  @retval EFI_SUCCESS           Data was successfully retrieved into the provided \r
+                                buffer and the BufferSize was sufficient to handle the\r
+                                iSCSI initiator name.\r
+  @retval EFI_BUFFER_TOO_SMALL  BufferSize is too small for the result. BufferSize will\r
+                                be updated with the size required to complete the request.\r
+                                Buffer will not be affected.\r
+\r
+  @retval EFI_INVALID_PARAMETER BufferSize is NULL. BufferSize and Buffer will not be\r
+                                affected.\r
+\r
+  @retval EFI_INVALID_PARAMETER Buffer is NULL. BufferSize and Buffer will not be\r
+                                affected.\r
+\r
+  @retval EFI_DEVICE_ERROR      The iSCSI initiator name could not be retrieved due to\r
+                                a hardware error.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IScsiGetInitiatorName (\r
@@ -112,6 +272,35 @@ IScsiGetInitiatorName (
   OUT    VOID                               *Buffer\r
   );\r
 \r
+/**\r
+  Sets the iSCSI Initiator Name. \r
+\r
+  @param  This[in]              Pointer to the EFI_ISCSI_INITIATOR_NAME_PROTOCOL instance.\r
+\r
+  @param  BufferSize[in][out]   Size of the buffer in bytes pointed to by Buffer.\r
+\r
+  @param  Buffer[out]           Pointer to the buffer for data to be written.\r
+  \r
+  @retval EFI_SUCCESS           Data was successfully stored by the protocol.\r
+\r
+  @retval EFI_UNSUPPORTED       Platform policies do not allow for data to be written.\r
+\r
+  @retval EFI_INVALID_PARAMETER BufferSize exceeds the maximum allowed limit.\r
+                                BufferSize will be updated with the maximum size\r
+                                required to complete the request.\r
+\r
+  @retval EFI_INVALID_PARAMETER Buffersize is NULL. BufferSize and Buffer will not be\r
+                                affected.\r
+\r
+  @retval EFI_INVALID_PARAMETER Buffer is NULL. BufferSize and Buffer will not be affected.\r
+\r
+  @retval EFI_DEVICE_ERROR      The data could not be stored due to a hardware error.\r
+\r
+  @retval EFI_OUT_OF_RESOURCES  Not enough storage is available to hold the data.\r
+\r
+  @retval EFI_PROTOCOL_ERROR    Input iSCSI initiator name does not adhere to RFC 3720.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IScsiSetInitiatorName (\r
index 697424ad72585075205599d399eb57aa49719268..2e99efc03279fb19087d9ff26c8cd8c31eda037d 100644 (file)
@@ -1,4 +1,5 @@
-/*++\r
+/** @file\r
+  The IScsi's EFI_EXT_SCSI_PASS_THRU_PROTOCOL driver\r
 \r
 Copyright (c) 2004 - 2007, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
@@ -14,11 +15,29 @@ Module Name:
   IScsiExtScsiPassThru.c\r
 \r
 Abstract:\r
+  The IScsi's EFI_EXT_SCSI_PASS_THRU_PROTOCOL driver\r
 \r
---*/\r
+**/\r
 \r
 #include "IScsiImpl.h"\r
 \r
+/**\r
+  This function sends out the SCSI command via iSCSI transport layer and returned\r
+  back the data received from the iSCSI target. \r
+\r
+  @param  This[in]        The EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.\r
+\r
+  @param  Target[in]      The Target ID of device to send the SCSI Request Packet. \r
+\r
+  @param  Lun[in]         The LUN of the device to send the SCSI Request Packet.\r
+\r
+  @param  Packet[in][out] The SCSI Request Packet to send to the device.\r
+\r
+  @param  Event[in]       The event used in non-blocking mode, it should be always NULL.\r
+\r
+  @retval EFI_STATUS\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IScsiExtScsiPassThruFunction (\r
@@ -28,26 +47,6 @@ IScsiExtScsiPassThruFunction (
   IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET           *Packet,\r
   IN EFI_EVENT                                                Event     OPTIONAL\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  This function sends out the SCSI command via iSCSI transport layer and returned\r
-  back the data received from the iSCSI target. \r
-\r
-Arguments:\r
-\r
-  This   - The EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.\r
-  Target - The Target ID of device to send the SCSI Request Packet. \r
-  Lun    - The LUN of the device to send the SCSI Request Packet.\r
-  Packet - The SCSI Request Packet to send to the device.\r
-  Event  - The event used in non-blocking mode, it should be always NULL.\r
-\r
-Returns:\r
-\r
-  EFI_STATUS\r
-\r
---*/\r
 {\r
   if (Target[0] != 0) {\r
     return EFI_INVALID_PARAMETER;\r
@@ -60,39 +59,36 @@ Returns:
   return IScsiExecuteScsiCommand (This, Target, Lun, Packet);\r
 }\r
 \r
-EFI_STATUS\r
-EFIAPI\r
-IScsiExtScsiPassThruGetNextTargetLun (\r
-  IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL  *This,\r
-  IN OUT UINT8                        **Target,\r
-  IN OUT UINT64                       *Lun\r
-  )\r
-/*++\r
+/**\r
+  Retrieve the list of legal Target IDs for SCSI devices on a SCSI channel.\r
 \r
-Routine Description:\r
+  @param  This[in]              The EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance.\r
 \r
-  Retrieve the list of legal Target IDs for SCSI devices on a SCSI channel.\r
+  @param  Target[in][out]       On input, a pointer to the Target ID of a SCSI device present on the\r
+                                SCSI channel. On output, a pointer to the Target ID of the next SCSI\r
+                                device present on a SCSI channel. An input value of 0xFFFFFFFF retrieves\r
+                                the Target ID of the first SCSI device present on a SCSI channel.\r
 \r
-Arguments:\r
+  @param  Lun[in][out]          On input, a pointer to the LUN of a SCSI device present on the SCSI\r
+                                channel. On output, a pointer to the LUN of the next SCSI device\r
+                                present on a SCSI channel.\r
 \r
-  This   - The EFI_EXT_SCSI_PASS_THRU_PROTOCOL instance..\r
-  Target - On input, a pointer to the Target ID of a SCSI device present on the\r
-           SCSI channel.  On output, a pointer to the Target ID of the next SCSI\r
-           device present on a SCSI channel.  An input value of 0xFFFFFFFF\r
-           retrieves the Target ID of the first SCSI device present on a SCSI channel.\r
-  Lun    - On input, a pointer to the LUN of a SCSI device present on the SCSI\r
-           channel. On output, a pointer to the LUN of the next SCSI device present on \r
-           a SCSI channel.\r
+  @retval EFI_SUCCESS           The Target ID and Lun of the next SCSI device \r
+                                on the SCSI channel was returned in Target and Lun.\r
 \r
-Returns:\r
+  @retval EFI_NOT_FOUND         There are no more SCSI devices on this SCSI channel.\r
 \r
-  EFI_SUCCESS           - The Target ID and Lun of the next SCSI device \r
-                          on the SCSI channel was returned in Target and Lun.\r
-  EFI_NOT_FOUND         - There are no more SCSI devices on this SCSI channel.\r
-  EFI_INVALID_PARAMETER - Target is not 0xFFFFFFFF,and Target and Lun were not\r
-                           returned on a previous call to GetNextDevice().\r
+  @retval EFI_INVALID_PARAMETER Target is not 0xFFFFFFFF,and Target and Lun were not\r
+                                returned on a previous call to GetNextDevice().\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+IScsiExtScsiPassThruGetNextTargetLun (\r
+  IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL  *This,\r
+  IN OUT UINT8                        **Target,\r
+  IN OUT UINT64                       *Lun\r
+  )\r
 {\r
   ISCSI_DRIVER_DATA           *Private;\r
   ISCSI_SESSION_CONFIG_NVDATA *ConfigNvData;\r
@@ -119,6 +115,38 @@ Returns:
   return EFI_INVALID_PARAMETER;\r
 }\r
 \r
+/**\r
+  Allocate and build a device path node for a SCSI device on a SCSI channel.\r
+\r
+  @param  This[in]              Protocol instance pointer.\r
+\r
+  @param  Target[in]            The Target ID of the SCSI device for which\r
+                                a device path node is to be allocated and built.\r
+\r
+  @param  Lun[in]               The LUN of the SCSI device for which a device \r
+                                path node is to be allocated and built.\r
+\r
+  @param  DevicePath[in][out]   A pointer to a single device path node that \r
+                                describes the SCSI device specified by \r
+                                Target and Lun. This function is responsible \r
+                                for allocating the buffer DevicePath with the boot\r
+                                service AllocatePool().  It is the caller's \r
+                                responsibility to free DevicePath when the caller\r
+                                is finished with DevicePath.    \r
+\r
+  @retval EFI_SUCCESS           The device path node that describes the SCSI device\r
+                                specified by Target and Lun was allocated and \r
+                                returned in DevicePath.\r
+\r
+  @retval EFI_NOT_FOUND         The SCSI devices specified by Target and Lun does\r
+                                not exist on the SCSI channel.\r
+\r
+  @retval EFI_INVALID_PARAMETER DevicePath is NULL.\r
+\r
+  @retval EFI_OUT_OF_RESOURCES  There are not enough resources to allocate \r
+                                DevicePath.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IScsiExtScsiPassThruBuildDevicePath (\r
@@ -127,39 +155,6 @@ IScsiExtScsiPassThruBuildDevicePath (
   IN UINT64                           Lun,\r
   IN OUT EFI_DEVICE_PATH_PROTOCOL     **DevicePath\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Allocate and build a device path node for a SCSI device on a SCSI channel.\r
-\r
-Arguments:\r
-\r
-  This                  - Protocol instance pointer.\r
-  Target                - The Target ID of the SCSI device for which\r
-                          a device path node is to be allocated and built.\r
-  Lun                   - The LUN of the SCSI device for which a device \r
-                          path node is to be allocated and built.\r
-  DevicePath            - A pointer to a single device path node that \r
-                          describes the SCSI device specified by \r
-                          Target and Lun. This function is responsible \r
-                          for allocating the buffer DevicePath with the boot\r
-                          service AllocatePool().  It is the caller's \r
-                          responsibility to free DevicePath when the caller\r
-                          is finished with DevicePath.    \r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - The device path node that describes the SCSI device\r
-                          specified by Target and Lun was allocated and \r
-                          returned in DevicePath.\r
-  EFI_NOT_FOUND         - The SCSI devices specified by Target and Lun does\r
-                          not exist on the SCSI channel.\r
-  EFI_INVALID_PARAMETER - DevicePath is NULL.\r
-  EFI_OUT_OF_RESOURCES  - There are not enough resources to allocate \r
-                          DevicePath.\r
-\r
---*/\r
 {\r
   ISCSI_DRIVER_DATA             *Private;\r
   ISCSI_SESSION                 *Session;\r
@@ -223,6 +218,33 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Translate a device path node to a Target ID and LUN.\r
+\r
+  @param  This[in]              Protocol instance pointer.\r
+\r
+  @param  DevicePath[in]        A pointer to the device path node that \r
+                                describes a SCSI device on the SCSI channel.\r
+\r
+  @param  Target[out]           A pointer to the Target ID of a SCSI device \r
+                                on the SCSI channel. \r
+\r
+  @param  Lun[out]              A pointer to the LUN of a SCSI device on \r
+                                the SCSI channel.    \r
+\r
+  @retval EFI_SUCCESS           DevicePath was successfully translated to a \r
+                                Target ID and LUN, and they were returned \r
+                                in Target and Lun.\r
+\r
+  @retval EFI_INVALID_PARAMETER DevicePath/Target/Lun is NULL.\r
+\r
+  @retval EFI_UNSUPPORTED       This driver does not support the device path \r
+                                node type in DevicePath.\r
+\r
+  @retval EFI_NOT_FOUND         A valid translation from DevicePath to a \r
+                                Target ID and LUN does not exist.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IScsiExtScsiPassThruGetTargetLun (\r
@@ -231,33 +253,6 @@ IScsiExtScsiPassThruGetTargetLun (
   OUT UINT8                           **Target,\r
   OUT UINT64                          *Lun\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Translate a device path node to a Target ID and LUN.\r
-\r
-Arguments:\r
-\r
-  This                  - Protocol instance pointer.\r
-  DevicePath            - A pointer to the device path node that \r
-                          describes a SCSI device on the SCSI channel.\r
-  Target                - A pointer to the Target ID of a SCSI device \r
-                          on the SCSI channel. \r
-  Lun                   - A pointer to the LUN of a SCSI device on \r
-                          the SCSI channel.    \r
-Returns:\r
-\r
-  EFI_SUCCESS           - DevicePath was successfully translated to a \r
-                          Target ID and LUN, and they were returned \r
-                          in Target and Lun.\r
-  EFI_INVALID_PARAMETER - DevicePath/Target/Lun is NULL.\r
-  EFI_UNSUPPORTED       - This driver does not support the device path \r
-                          node type in DevicePath.\r
-  EFI_NOT_FOUND         - A valid translation from DevicePath to a \r
-                          Target ID and LUN does not exist.\r
-\r
---*/\r
 {\r
   ISCSI_DRIVER_DATA           *Private;\r
   ISCSI_SESSION_CONFIG_NVDATA *ConfigNvData;\r
@@ -287,31 +282,36 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  Resets a SCSI channel.This operation resets all the SCSI devices connected to\r
+  the SCSI channel.\r
+\r
+  @param  This[in]        Protocol instance pointer.\r
+\r
+  @retval EFI_UNSUPPORTED It's not supported.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IScsiExtScsiPassThruResetChannel (\r
   IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL  *This\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Resets a SCSI channel.This operation resets all the SCSI devices connected to\r
-  the SCSI channel.\r
+{\r
+  return EFI_UNSUPPORTED;\r
+}\r
 \r
-Arguments:\r
+/**\r
+  Resets a SCSI device that is connected to a SCSI channel.\r
 \r
-  This            - Protocol instance pointer.\r
+  @param  This[in]        Protocol instance pointer.\r
 \r
-Returns:\r
+  @param  Target[in]      The Target ID of the SCSI device to reset.\r
 \r
-  EFI_UNSUPPORTED - It's not supported.\r
+  @param  Lun[in]         The LUN of the SCSI device to reset.\r
 \r
---*/\r
-{\r
-  return EFI_UNSUPPORTED;\r
-}\r
+  @retval EFI_UNSUPPORTED It's not supported.\r
 \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IScsiExtScsiPassThruResetTargetLun (\r
@@ -319,61 +319,37 @@ IScsiExtScsiPassThruResetTargetLun (
   IN UINT8                            *Target,\r
   IN UINT64                           Lun\r
   )\r
-/*++\r
+{\r
+  return EFI_UNSUPPORTED;\r
+}\r
 \r
-Routine Description:\r
+/**\r
+  Retrieve the list of legal Target IDs for SCSI devices on a SCSI channel.\r
 \r
-  Resets a SCSI device that is connected to a SCSI channel.\r
+  @param  This[in]              Protocol instance pointer.\r
 \r
-Arguments:\r
+  @param  Target[in]            On input, a pointer to the Target ID of a SCSI \r
+                                device present on the SCSI channel.  On output, \r
+                                a pointer to the Target ID of the next SCSI device\r
+                                present on a SCSI channel.  An input value of \r
+                                0xFFFFFFFF retrieves the Target ID of the first \r
+                                SCSI device present on a SCSI channel.\r
 \r
-  This            - Protocol instance pointer.\r
-  Target          - The Target ID of the SCSI device to reset. \r
-  Lun             - The LUN of the SCSI device to reset.\r
-    \r
-Returns:\r
+  @retval EFI_SUCCESS           The Target ID and Lun of the next SCSI device \r
+                                on the SCSI channel was returned in Target and Lun.\r
 \r
-  EFI_UNSUPPORTED - It's not supported.\r
+  @retval EFI_NOT_FOUND         There are no more SCSI devices on this SCSI channel.\r
 \r
---*/\r
-{\r
-  return EFI_UNSUPPORTED;\r
-}\r
+  @retval EFI_INVALID_PARAMETER Target is not 0xFFFFFFFF,and Target and Lun were not\r
+                                returned on a previous call to GetNextDevice().\r
 \r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IScsiExtScsiPassThruGetNextTarget (\r
   IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL  *This,\r
   IN OUT UINT8                        **Target\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Retrieve the list of legal Target IDs for SCSI devices on a SCSI channel.\r
-\r
-Arguments:\r
-  This                  - Protocol instance pointer.\r
-  Target                - On input, a pointer to the Target ID of a SCSI \r
-                          device present on the SCSI channel.  On output, \r
-                          a pointer to the Target ID of the next SCSI device\r
-                           present on a SCSI channel.  An input value of \r
-                           0xFFFFFFFF retrieves the Target ID of the first \r
-                           SCSI device present on a SCSI channel.\r
-  Lun                   - On input, a pointer to the LUN of a SCSI device\r
-                          present on the SCSI channel. On output, a pointer\r
-                          to the LUN of the next SCSI device present on \r
-                          a SCSI channel.\r
-    \r
-Returns:\r
-\r
-  EFI_SUCCESS           - The Target ID and Lun of the next SCSI device \r
-                          on the SCSI channel was returned in Target and Lun.\r
-  EFI_NOT_FOUND         - There are no more SCSI devices on this SCSI channel.\r
-  EFI_INVALID_PARAMETER - Target is not 0xFFFFFFFF,and Target and Lun were not\r
-                          returned on a previous call to GetNextDevice().\r
-\r
---*/\r
 {\r
   UINT8 TargetId[TARGET_MAX_BYTES];\r
 \r
index 26f59a2f9eea27bee15d7a5156b4c3e056b38245..1f3c84f096facad65ef33eca79d1052fcbb0a3e7 100644 (file)
@@ -1,4 +1,5 @@
-/*++\r
+/** @file\r
+  The header file of IScsiExtScsiPassThru.c\r
 \r
 Copyright (c) 2004 - 2008, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
@@ -14,8 +15,9 @@ Module Name:
   IScsiExtScsiPassThru.h\r
 \r
 Abstract:\r
+  The header file of IScsiExtScsiPassThru.c\r
 \r
---*/\r
+**/\r
 \r
 #ifndef _ISCSI_EXT_SCSI_PASS_THRU_H_\r
 #define _ISCSI_EXT_SCSI_PASS_THRU_H_\r
index cd4be8b3c93df622d4b410559df855035f26e062..3c8dac371cf76bf014f9abd4581e56f9e6a13f93 100644 (file)
@@ -1,6 +1,7 @@
-/*++\r
+/** @file\r
+  Implementation for iSCSI Boot Firmware Table publication.\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
@@ -17,30 +18,23 @@ Abstract:
 \r
   Implementation for iSCSI Boot Firmware Table publication.\r
 \r
---*/\r
+**/\r
 \r
 #include "IScsiImpl.h"\r
 \r
+/**\r
+  Initialize the header of the iSCSI Boot Firmware Table.\r
+  \r
+  @param  Header[in] The header of the iSCSI Boot Firmware Table.\r
+\r
+  @retval None.\r
+\r
+**/\r
 STATIC\r
 VOID\r
 IScsiInitIbfTableHeader (\r
   IN EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_HEADER  *Header\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Initialize the header of the iSCSI Boot Firmware Table.\r
-  \r
-Arguments:\r
-\r
-  Header - The header of the iSCSI Boot Firmware Table.\r
-\r
-Returns:\r
-\r
-  None.\r
-\r
---*/\r
 {\r
   ZeroMem (Header, sizeof (EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_HEADER));\r
 \r
@@ -56,29 +50,23 @@ Returns:
   Header->OemId[4]  = 'L';\r
 }\r
 \r
+/**\r
+  Initialize the control section of the iSCSI Boot Firmware Table.\r
+  \r
+  @param  Table[in]       The ACPI table.\r
+\r
+  @param  HandleCount[in] The number of the handles associated with iSCSI sessions, it's\r
+                          equal to the number of iSCSI sessions.\r
+\r
+  @retval None.\r
+\r
+**/\r
 STATIC\r
 VOID\r
 IScsiInitControlSection (\r
   IN EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_HEADER  *Table,\r
   IN UINTN                                      HandleCount\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Initialize the control section of the iSCSI Boot Firmware Table.\r
-  \r
-Arguments:\r
-\r
-  Table       - The ACPI table.\r
-  HandleCount - The number of the handles associated with iSCSI sessions, it's\r
-                equal to the number of iSCSI sessions.\r
-\r
-Returns:\r
-\r
-  None.\r
-\r
---*/\r
 {\r
   EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_CONTROL_STRUCTURE  *Control;\r
   UINTN                                                 NumOffset;\r
@@ -105,6 +93,19 @@ Returns:
   }\r
 }\r
 \r
+/**\r
+  Add one item into the heap.\r
+\r
+  @param  Heap[in][out] On input, the current address of the heap; On output, the address of\r
+                        the heap after the item is added.\r
+\r
+  @param  Data[in]      The data to add into the heap.\r
+\r
+  @param  Len[in]       Length of the Data in byte.\r
+\r
+  @retval None.\r
+\r
+**/\r
 STATIC\r
 VOID\r
 IScsiAddHeapItem (\r
@@ -112,24 +113,6 @@ IScsiAddHeapItem (
   IN     VOID   *Data,\r
   IN     UINTN  Len\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Add one item into the heap.\r
-  \r
-Arguments:\r
-\r
-  Heap - On input, the current address of the heap; On output, the address of\r
-         the heap after the item is added.\r
-  Data - The data to add into the heap.\r
-  Len  - Length of the Data in byte.\r
-\r
-Returns:\r
-\r
-  None.\r
-\r
---*/\r
 {\r
   //\r
   // Add one byte for the NULL delimiter.\r
@@ -140,6 +123,18 @@ Returns:
   *(*Heap + Len) = 0;\r
 }\r
 \r
+/**\r
+  Fill the Initiator section of the iSCSI Boot Firmware Table.\r
+\r
+  @param  Table[in]     The ACPI table.\r
+\r
+  @param  Heap[in][out] The heap.\r
+\r
+  @param  Handle[in]    The handle associated with the iSCSI session.\r
+\r
+  @retval None.\r
+\r
+**/\r
 STATIC\r
 VOID\r
 IScsiFillInitiatorSection (\r
@@ -147,23 +142,6 @@ IScsiFillInitiatorSection (
   IN OUT UINT8                                      **Heap,\r
   IN     EFI_HANDLE                                 Handle\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Fill the Initiator section of the iSCSI Boot Firmware Table.\r
-  \r
-Arguments:\r
-\r
-  Table  - The ACPI table.\r
-  Heap   - The heap.\r
-  Handle - The handle associated with the iSCSI session.\r
-\r
-Returns:\r
-\r
-  None.\r
-\r
---*/\r
 {\r
   EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_CONTROL_STRUCTURE    *Control;\r
   EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_INITIATOR_STRUCTURE  *Initiator;\r
@@ -209,28 +187,22 @@ Returns:
   Initiator->IScsiNameOffset  = (UINT16) ((UINTN) *Heap - (UINTN) Table);\r
 }\r
 \r
+/**\r
+  Map the v4 IP address into v6 IP address.\r
+\r
+  @param  V4 The v4 IP address.\r
+\r
+  @param  V6 The v6 IP address.\r
+\r
+  @retval None.\r
+\r
+**/\r
 STATIC\r
 VOID\r
 IScsiMapV4ToV6Addr (\r
   IN  EFI_IPv4_ADDRESS *V4,\r
   OUT EFI_IPv6_ADDRESS *V6\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Map the v4 IP address into v6 IP address.\r
-  \r
-Arguments:\r
-\r
-  V4 - The v4 IP address.\r
-  V6 - The v6 IP address.\r
-\r
-Returns:\r
-\r
-  None.\r
-\r
---*/\r
 {\r
   UINTN Index;\r
 \r
@@ -244,27 +216,20 @@ Returns:
   }\r
 }\r
 \r
-STATIC\r
-UINT16\r
-IScsiGetNICPciLocation (\r
-  IN EFI_HANDLE  Controller\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Get the NIC's PCI location and return it accroding to the composited\r
   format defined in iSCSI Boot Firmware Table.\r
-  \r
-Arguments:\r
 \r
-  Controller - The handle of the controller.\r
+  @param  Controller[in]  The handle of the controller.\r
 \r
-Returns:\r
+  @retval UINT16          The composited representation of the NIC PCI location.\r
 \r
-  UINT16 - The composited representation of the NIC PCI location.\r
-\r
---*/\r
+**/\r
+STATIC\r
+UINT16\r
+IScsiGetNICPciLocation (\r
+  IN EFI_HANDLE  Controller\r
+  )\r
 {\r
   EFI_STATUS                Status;\r
   EFI_DEVICE_PATH_PROTOCOL  *DevicePath;\r
@@ -306,26 +271,19 @@ Returns:
   return (UINT16) ((Bus << 8) | (Device << 3) | Function);\r
 }\r
 \r
+/**\r
+  Get the MAC address of the controller.\r
+  \r
+  @param  Controller[in]    The handle of the controller.\r
+\r
+  @retval EFI_MAC_ADDRESS * The mac address.\r
+\r
+**/\r
 STATIC\r
 EFI_MAC_ADDRESS *\r
 IScsiGetMacAddress (\r
   IN EFI_HANDLE  Controller\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Get the MAC address of the controller.\r
-  \r
-Arguments:\r
-\r
-  Controller - The handle of the controller.\r
-\r
-Returns:\r
-\r
-  EFI_MAC_ADDRESS * - The mac address.\r
-\r
---*/\r
 {\r
   EFI_STATUS                  Status;\r
   EFI_SIMPLE_NETWORK_PROTOCOL *Snp;\r
@@ -340,6 +298,20 @@ Returns:
   return &Snp->Mode->PermanentAddress;\r
 }\r
 \r
+/**\r
+  Fill the NIC and target sections in iSCSI Boot Firmware Table.\r
+\r
+  @param  Table[in]       The buffer of the ACPI table.\r
+\r
+  @param  Heap[in][out]   The heap buffer used to store the variable length parameters such as iSCSI name.\r
+\r
+  @param  HandleCount[in] The number of handles having iSCSI private protocol installed.\r
+\r
+  @param  Handles[in]     The handle buffer.\r
+\r
+  @retval None.\r
+\r
+**/\r
 STATIC\r
 VOID\r
 IScsiFillNICAndTargetSections (\r
@@ -348,24 +320,6 @@ IScsiFillNICAndTargetSections (
   IN     UINTN                                      HandleCount,\r
   IN     EFI_HANDLE                                 *Handles\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Fill the NIC and target sections in iSCSI Boot Firmware Table.\r
-\r
-Arguments:\r
-\r
-  Table       - The buffer of the ACPI table.\r
-  Heap        - The heap buffer used to store the variable length parameters such as iSCSI name.\r
-  HandleCount - The number of handles having iSCSI private protocol installed.\r
-  Handles     - The handle buffer.\r
-\r
-Returns:\r
-\r
-  None.\r
-\r
---*/\r
 {\r
   EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_CONTROL_STRUCTURE  *Control;\r
   EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_NIC_STRUCTURE      *Nic;\r
@@ -520,26 +474,19 @@ Returns:
   }\r
 }\r
 \r
-VOID\r
-IScsiPublishIbft (\r
-  IN VOID\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Publish and remove the iSCSI Boot Firmware Table according to the iSCSI\r
   session status.\r
 \r
-Arguments:\r
-\r
-  None.\r
+  @param  None.\r
 \r
-Returns:\r
+  @retval None.\r
 \r
-  None.\r
-\r
---*/\r
+**/\r
+VOID\r
+IScsiPublishIbft (\r
+  IN VOID\r
+  )\r
 {\r
   EFI_STATUS                                Status;\r
   UINTN                                     TableHandle;\r
index 40097c944c9f8f49d7a057e7e306a3c830f4b014..b426b064a724f83f590e2ceb31291017743525c3 100644 (file)
@@ -1,4 +1,5 @@
-/*++\r
+/** @file\r
+  Some extra definitions for iBFT\r
 \r
 Copyright (c) 2004 - 2008, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
@@ -17,7 +18,7 @@ Abstract:
 \r
   Some extra definitions for iBFT.\r
 \r
---*/\r
+**/\r
 \r
 #ifndef _ISCSI_IBFT_H_\r
 #define _ISCSI_IBFT_H_\r
@@ -32,6 +33,15 @@ Abstract:
 \r
 #define IBFT_ROUNDUP(size)  NET_ROUNDUP ((size), EFI_ACPI_ISCSI_BOOT_FIRMWARE_TABLE_STRUCTURE_ALIGNMENT)\r
 \r
+/**\r
+  Publish and remove the iSCSI Boot Firmware Table according to the iSCSI\r
+  session status.\r
+\r
+  @param  None.\r
+\r
+  @retval None.\r
+\r
+**/\r
 VOID\r
 IScsiPublishIbft (\r
   IN VOID\r
index 1eb4b4b91b74896bee08c0751d513211c094570e..743857cfefd074875b6e1617933c3ccd4abbbcbe 100644 (file)
@@ -1,6 +1,7 @@
-/*++\r
+/** @file\r
+  The header file of IScsiImpl.c\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
@@ -14,8 +15,9 @@ Module Name:
   IScsiImpl.h\r
 \r
 Abstract:\r
+  The header file of IScsiImpl.c\r
 \r
---*/\r
+**/\r
 \r
 #ifndef _ISCSI_IMPL_H_\r
 #define _ISCSI_IMPL_H_\r
index f93594fdcdbfa75793dd02fa3bd46bc1e6f9e252..3a8bd3a2ffb8405a8b34a292132616c8db4c874a 100644 (file)
@@ -1,6 +1,7 @@
-/*++\r
+/** @file\r
+  Implementation for EFI iSCSI Initiator Name Protocol.\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
@@ -17,7 +18,7 @@ Abstract:
 \r
   Implementation for EFI iSCSI Initiator Name Protocol.\r
 \r
---*/\r
+**/\r
 \r
 #include "IScsiImpl.h"\r
 \r
@@ -26,6 +27,33 @@ EFI_ISCSI_INITIATOR_NAME_PROTOCOL gIScsiInitiatorName = {
   IScsiSetInitiatorName\r
 };\r
 \r
+/**\r
+  Retrieves the current set value of iSCSI Initiator Name. \r
+\r
+  @param  This[in]              Pointer to the EFI_ISCSI_INITIATOR_NAME_PROTOCOL instance.\r
+\r
+  @param  BufferSize[in][out]   Size of the buffer in bytes pointed to by Buffer / Actual\r
+                                size of the variable data buffer.\r
+\r
+  @param  Buffer[out]           Pointer to the buffer for data to be read.\r
+\r
+  @retval EFI_SUCCESS           Data was successfully retrieved into the provided \r
+                                buffer and the BufferSize was sufficient to handle the\r
+                                iSCSI initiator name.\r
+  @retval EFI_BUFFER_TOO_SMALL  BufferSize is too small for the result. BufferSize will\r
+                                be updated with the size required to complete the request.\r
+                                Buffer will not be affected.\r
+\r
+  @retval EFI_INVALID_PARAMETER BufferSize is NULL. BufferSize and Buffer will not be\r
+                                affected.\r
+\r
+  @retval EFI_INVALID_PARAMETER Buffer is NULL. BufferSize and Buffer will not be\r
+                                affected.\r
+\r
+  @retval EFI_DEVICE_ERROR      The iSCSI initiator name could not be retrieved due to\r
+                                a hardware error.\r
+\r
+**/\r
 EFI_STATUS\r
 EFIAPI\r
 IScsiGetInitiatorName (\r
@@ -33,35 +61,6 @@ IScsiGetInitiatorName (
   IN OUT UINTN                              *BufferSize,\r
   OUT    VOID                               *Buffer\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Retrieves the current set value of iSCSI Initiator Name. \r
-\r
-Arguments:\r
-\r
-  This       - Pointer to the EFI_ISCSI_INITIATOR_NAME_PROTOCOL instance.\r
-  BufferSize - Size of the buffer in bytes pointed to by Buffer / Actual size of\r
-               the variable data buffer.\r
-  Buffer     - Pointer to the buffer for data to be read.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS           - Data was successfully retrieved into the provided \r
-                          buffer and the BufferSize was sufficient to handle the\r
-                          iSCSI initiator name.\r
-  EFI_BUFFER_TOO_SMALL  - BufferSize is too small for the result. BufferSize will\r
-                          be updated with the size required to complete the request.\r
-                          Buffer will not be affected.\r
-  EFI_INVALID_PARAMETER - BufferSize is NULL. BufferSize and Buffer will not be\r
-                          affected.\r
-  EFI_INVALID_PARAMETER - Buffer is NULL. BufferSize and Buffer will not be\r
-                          affected.\r
-  EFI_DEVICE_ERROR      - The iSCSI initiator name could not be retrieved due to\r
-                          a hardware error.\r
-\r
---*/\r
 {\r
   EFI_STATUS  Status;\r
 \r
@@ -80,40 +79,42 @@ Returns:
   return Status;\r
 }\r
 \r
-EFI_STATUS\r
-EFIAPI\r
-IScsiSetInitiatorName (\r
-  IN     EFI_ISCSI_INITIATOR_NAME_PROTOCOL  *This,\r
-  IN OUT UINTN                              *BufferSize,\r
-  OUT    VOID                               *Buffer\r
-  )\r
-/*++\r
+/**\r
+  Sets the iSCSI Initiator Name. \r
+\r
+  @param  This[in]              Pointer to the EFI_ISCSI_INITIATOR_NAME_PROTOCOL instance.\r
+\r
+  @param  BufferSize[in][out]   Size of the buffer in bytes pointed to by Buffer.\r
+\r
+  @param  Buffer[out]           Pointer to the buffer for data to be written.\r
+  \r
+  @retval EFI_SUCCESS           Data was successfully stored by the protocol.\r
 \r
-Routine Description:\r
+  @retval EFI_UNSUPPORTED       Platform policies do not allow for data to be written.\r
 \r
-  Sets the iSSI Initiator Name. \r
+  @retval EFI_INVALID_PARAMETER BufferSize exceeds the maximum allowed limit.\r
+                                BufferSize will be updated with the maximum size\r
+                                required to complete the request.\r
 \r
-Arguments:\r
+  @retval EFI_INVALID_PARAMETER Buffersize is NULL. BufferSize and Buffer will not be\r
+                                affected.\r
 \r
-  This       - Pointer to the EFI_ISCSI_INITIATOR_NAME_PROTOCOL instance.\r
-  BufferSize - Size of the buffer in bytes pointed to by Buffer.\r
-  Buffer     - Pointer to the buffer for data to be written.\r
+  @retval EFI_INVALID_PARAMETER Buffer is NULL. BufferSize and Buffer will not be affected.\r
 \r
-Returns:\r
+  @retval EFI_DEVICE_ERROR      The data could not be stored due to a hardware error.\r
 \r
-  EFI_SUCCESS           - Data was successfully stored by the protocol.\r
-  EFI_UNSUPPORTED       - Platform policies do not allow for data to be written.\r
-  EFI_INVALID_PARAMETER - BufferSize exceeds the maximum allowed limit.\r
-                          BufferSize will be updated with the maximum size\r
-                          required to complete the request.\r
-  EFI_INVALID_PARAMETER - Buffersize is NULL. BufferSize and Buffer will not be\r
-                          affected.\r
-  EFI_INVALID_PARAMETER - Buffer is NULL. BufferSize and Buffer will not be affected.\r
-  EFI_DEVICE_ERROR      - The data could not be stored due to a hardware error.\r
-  EFI_OUT_OF_RESOURCES  - Not enough storage is available to hold the data\r
-  EFI_PROTOCOL_ERROR    - Input iSCSI initiator name does not adhere to RFC 3720\r
+  @retval EFI_OUT_OF_RESOURCES  Not enough storage is available to hold the data.\r
 \r
---*/\r
+  @retval EFI_PROTOCOL_ERROR    Input iSCSI initiator name does not adhere to RFC 3720.\r
+\r
+**/\r
+EFI_STATUS\r
+EFIAPI\r
+IScsiSetInitiatorName (\r
+  IN     EFI_ISCSI_INITIATOR_NAME_PROTOCOL  *This,\r
+  IN OUT UINTN                              *BufferSize,\r
+  OUT    VOID                               *Buffer\r
+  )\r
 {\r
   EFI_STATUS  Status;\r
 \r
index 985f02e94012edaec18d9cfca08f8030e85d2eb4..1699bfb709153c42287040ec4fb0dc6b12f382b7 100644 (file)
@@ -1,6 +1,7 @@
-/*++\r
+/** @file\r
+  Miscellaneous routines 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,35 +16,33 @@ Module Name:
 \r
 Abstract:\r
 \r
-  Miscellaneous routines for iSCSI driver.\r
+  Miscellaneous routines for IScsi driver.\r
 \r
---*/\r
+**/\r
 \r
 #include "IScsiImpl.h"\r
 \r
 STATIC CONST CHAR8  IScsiHexString[] = "0123456789ABCDEFabcdef";\r
 \r
+/**\r
+  Determines if a Unicode character is a hexadecimal digit.\r
+  The test is case insensitive.\r
+  \r
+  @param  Digit[out] Pointer to byte that receives the value of the hex character.\r
+\r
+  @param  Char[in]   Unicode character to test.\r
+\r
+  @retval TRUE       If the character is a hexadecimal digit.\r
+\r
+  @retval FALSE      Otherwise.\r
+\r
+**/\r
 static\r
 BOOLEAN\r
 IsHexDigit (\r
   OUT UINT8      *Digit,\r
   IN  CHAR16      Char\r
   )\r
-/*++\r
-\r
-  Routine Description:\r
-    Determines if a Unicode character is a hexadecimal digit.\r
-    The test is case insensitive.\r
-\r
-  Arguments:\r
-    Digit - Pointer to byte that receives the value of the hex character.\r
-    Char  - Unicode character to test.\r
-\r
-  Returns:\r
-    TRUE  - If the character is a hexadecimal digit.\r
-    FALSE - Otherwise.\r
-\r
---*/\r
 {\r
   if ((Char >= L'0') && (Char <= L'9')) {\r
     *Digit = (UINT8) (Char - L'0');\r
@@ -63,27 +62,23 @@ IsHexDigit (
   return FALSE;\r
 }\r
 \r
+/**\r
+  Removes (trims) specified leading and trailing characters from a string.\r
+\r
+  @param  str[in][out] Pointer to the null-terminated string to be trimmed. On return, \r
+                       str will hold the trimmed string. \r
+\r
+  @param  CharC[in]    Character will be trimmed from str.\r
+\r
+  @retval NONE.\r
+\r
+**/\r
 static\r
 VOID\r
 StrTrim (\r
   IN OUT CHAR16   *str,\r
   IN     CHAR16   CharC\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-  \r
-  Removes (trims) specified leading and trailing characters from a string.\r
-  \r
-Arguments: \r
-  \r
-  str     - Pointer to the null-terminated string to be trimmed. On return, \r
-            str will hold the trimmed string. \r
-  CharC       - Character will be trimmed from str.\r
-  \r
-Returns:\r
-\r
---*/\r
 {\r
   CHAR16  *p1;\r
   CHAR16  *p2;\r
@@ -123,25 +118,18 @@ Returns:
   }\r
 }\r
 \r
-UINT8\r
-IScsiGetSubnetMaskPrefixLength (\r
-  IN EFI_IPv4_ADDRESS  *SubnetMask\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Calculate the prefix length of the IPv4 subnet mask.\r
 \r
-Arguments:\r
+  @param  SubnetMask[in] The IPv4 subnet mask.\r
 \r
-  SubnetMask - The IPv4 subnet mask.\r
+  @retval The prefix length of the subnet mask.\r
 \r
-Returns:\r
-\r
-  The prefix length of the subnet mask.\r
-\r
---*/\r
+**/\r
+UINT8\r
+IScsiGetSubnetMaskPrefixLength (\r
+  IN EFI_IPv4_ADDRESS  *SubnetMask\r
+  )\r
 {\r
   UINT8   Len;\r
   UINT32  ReverseMask;\r
@@ -170,28 +158,23 @@ Returns:
   return (UINT8) (32 - Len);\r
 }\r
 \r
-EFI_STATUS\r
-IScsiAsciiStrToLun (\r
-  IN  CHAR8  *Str,\r
-  OUT UINT8  *Lun\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Convert the hexadecimal encoded LUN string into the 64-bit LUN. \r
 \r
-Arguments:\r
+  @param  Str[in]               The hexadecimal encoded LUN string.\r
 \r
-  Str - The hexadecimal encoded LUN string.\r
-  Lun - Storage to return the 64-bit LUN.\r
+  @param  Lun[out]              Storage to return the 64-bit LUN.\r
 \r
-Returns:\r
+  @retval EFI_SUCCESS           The 64-bit LUN is stored in Lun.\r
 \r
-  EFI_SUCCESS           - The 64-bit LUN is stored in Lun.\r
-  EFI_INVALID_PARAMETER - The string is malformatted.\r
+  @retval EFI_INVALID_PARAMETER The string is malformatted.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+IScsiAsciiStrToLun (\r
+  IN  CHAR8  *Str,\r
+  OUT UINT8  *Lun\r
+  )\r
 {\r
   UINT32  Index;\r
   CHAR8   *LunUnitStr[4];\r
@@ -245,27 +228,21 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
-VOID\r
-IScsiLunToUnicodeStr (\r
-  IN UINT8    *Lun,\r
-  OUT CHAR16  *Str\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Convert the 64-bit LUN into the hexadecimal encoded LUN string.\r
 \r
-Arguments:\r
-\r
-  Lun - The 64-bit LUN.\r
-  Str - The storage to return the hexadecimal encoded LUN string.\r
+  @param  Lun[in]  The 64-bit LUN.\r
 \r
-Returns:\r
+  @param  Str[out] The storage to return the hexadecimal encoded LUN string.\r
 \r
-  None.\r
+  @retval None.\r
 \r
---*/\r
+**/\r
+VOID\r
+IScsiLunToUnicodeStr (\r
+  IN UINT8    *Lun,\r
+  OUT CHAR16  *Str\r
+  )\r
 {\r
   UINTN   Index;\r
   CHAR16  *TempStr;\r
@@ -301,27 +278,21 @@ Returns:
   }\r
 }\r
 \r
-CHAR16 *\r
-IScsiAsciiStrToUnicodeStr (\r
-  IN  CHAR8   *Source,\r
-  OUT CHAR16  *Destination\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Convert the ASCII string into a UNICODE string.\r
 \r
-Arguments:\r
+  @param  Source[out]      The ASCII string.\r
 \r
-  Source      - The ASCII string.\r
-  Destination - The storage to return the UNICODE string.\r
+  @param  Destination[out] The storage to return the UNICODE string.\r
 \r
-Returns:\r
+  @retval CHAR16 *         Pointer to the UNICODE string.\r
 \r
-  Pointer to the UNICODE string.\r
-\r
---*/\r
+**/\r
+CHAR16 *\r
+IScsiAsciiStrToUnicodeStr (\r
+  IN  CHAR8   *Source,\r
+  OUT CHAR16  *Destination\r
+  )\r
 {\r
   ASSERT (Destination != NULL);\r
   ASSERT (Source != NULL);\r
@@ -335,27 +306,21 @@ Returns:
   return Destination;\r
 }\r
 \r
-CHAR8 *\r
-IScsiUnicodeStrToAsciiStr (\r
-  IN  CHAR16  *Source,\r
-  OUT CHAR8   *Destination\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Convert the UNICODE string into an ASCII string.\r
 \r
-Arguments:\r
+  @param  Source[in]       The UNICODE string.\r
 \r
-  Source      - The UNICODE string.\r
-  Destination - The storage to return the ASCII string.\r
+  @param  Destination[out] The storage to return the ASCII string.\r
 \r
-Returns:\r
+  @retval CHAR8 *          Pointer to the ASCII string.\r
 \r
-  Pointer to the ASCII string.\r
-\r
---*/\r
+**/\r
+CHAR8 *\r
+IScsiUnicodeStrToAsciiStr (\r
+  IN  CHAR16  *Source,\r
+  OUT CHAR8   *Destination\r
+  )\r
 {\r
   ASSERT (Destination != NULL);\r
   ASSERT (Source != NULL);\r
@@ -374,28 +339,23 @@ Returns:
   return Destination;\r
 }\r
 \r
-EFI_STATUS\r
-IScsiAsciiStrToIp (\r
-  IN  CHAR8             *Str,\r
-  OUT EFI_IPv4_ADDRESS  *Ip\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Convert the decimal dotted IPv4 address into the binary IPv4 address.\r
 \r
-Arguments:\r
+  @param  Str[in]               The UNICODE string.\r
 \r
-  Str - The UNICODE string.\r
-  Ip  - The storage to return the ASCII string.\r
+  @param  Ip[out]               The storage to return the ASCII string.\r
 \r
-Returns:\r
+  @retval EFI_SUCCESS           The binary IP address is returned in Ip.\r
 \r
-  EFI_SUCCESS           - The binary IP address is returned in Ip.\r
-  EFI_INVALID_PARAMETER - The IP string is malformatted.\r
+  @retval EFI_INVALID_PARAMETER The IP string is malformatted.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+IScsiAsciiStrToIp (\r
+  IN  CHAR8             *Str,\r
+  OUT EFI_IPv4_ADDRESS  *Ip\r
+  )\r
 {\r
   UINTN Index;\r
   UINTN Number;\r
@@ -445,29 +405,24 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
-VOID\r
-IScsiMacAddrToStr (\r
-  IN  EFI_MAC_ADDRESS  *Mac,\r
-  IN  UINT32           Len,\r
-  OUT CHAR16           *Str\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Convert the mac address into a hexadecimal encoded "-" seperated string.\r
 \r
-Arguments:\r
+  @param  Mac[in]  The mac address.\r
 \r
-  Mac - The mac address.\r
-  Len - Length in bytes of the mac address.\r
-  Str - The storage to return the mac string.\r
+  @param  Len[in]  Length in bytes of the mac address.\r
 \r
-Returns:\r
+  @param  Str[out] The storage to return the mac string.\r
 \r
-  None.\r
+  @retval None.\r
 \r
---*/\r
+**/\r
+VOID\r
+IScsiMacAddrToStr (\r
+  IN  EFI_MAC_ADDRESS  *Mac,\r
+  IN  UINT32           Len,\r
+  OUT CHAR16           *Str\r
+  )\r
 {\r
   UINT32  Index;\r
 \r
@@ -480,33 +435,30 @@ Returns:
   Str[3 * Index - 1] = L'\0';\r
 }\r
 \r
-EFI_STATUS\r
-IScsiBinToHex (\r
-  IN     UINT8  *BinBuffer,\r
-  IN     UINT32 BinLength,\r
-  IN OUT CHAR8  *HexStr,\r
-  IN OUT UINT32 *HexLength\r
-  )\r
-/*++\r
+/**\r
+  Convert the binary encoded buffer into a hexadecimal encoded string.\r
 \r
-Routine Description:\r
+  @param  BinBuffer[in]        The buffer containing the binary data.\r
 \r
-  Convert the binary encoded buffer into a hexadecimal encoded string.\r
+  @param  BinLength[in]        Length of the binary buffer.\r
 \r
-Arguments:\r
+  @param  HexStr[in][out]      Pointer to the string.\r
 \r
-  BinBuffer - The buffer containing the binary data.\r
-  BinLength - Length of the binary buffer.\r
-  HexStr    - Pointer to the string.\r
-  HexLength - The length of the string.\r
+  @param  HexLength[in][out]   The length of the string.\r
 \r
-Returns:\r
+  @retval EFI_SUCCESS          The binary data is converted to the hexadecimal string \r
+                               and the length of the string is updated.\r
 \r
-  EFI_SUCCESS          - The binary data is converted to the hexadecimal string \r
-                         and the length of the string is updated.\r
-  EFI_BUFFER_TOO_SMALL - The string is too small.\r
+  @retval EFI_BUFFER_TOO_SMALL The string is too small.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+IScsiBinToHex (\r
+  IN     UINT8  *BinBuffer,\r
+  IN     UINT32 BinLength,\r
+  IN OUT CHAR8  *HexStr,\r
+  IN OUT UINT32 *HexLength\r
+  )\r
 {\r
   UINTN Index;\r
 \r
@@ -536,31 +488,27 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
-EFI_STATUS\r
-IScsiHexToBin (\r
-  IN OUT UINT8  *BinBuffer,\r
-  IN OUT UINT32 *BinLength,\r
-  IN     CHAR8  *HexStr\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Convert the hexadecimal string into a binary encoded buffer.\r
 \r
-Arguments:\r
+  @param  BinBuffer[in][out]   The binary buffer.\r
 \r
-  BinBuffer - The binary buffer.\r
-  BinLength - Length of the binary buffer.\r
-  HexStr    - The hexadecimal string.\r
+  @param  BinLength[in][out]   Length of the binary buffer.\r
 \r
-Returns:\r
+  @param  HexStr[in]           The hexadecimal string.\r
 \r
-  EFI_SUCCESS          - The hexadecimal string is converted into a binary \r
-                         encoded buffer.\r
-  EFI_BUFFER_TOO_SMALL - The binary buffer is too small to hold the converted data.s\r
+  @retval EFI_SUCCESS          The hexadecimal string is converted into a binary\r
+                               encoded buffer.\r
 \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
+  IN OUT UINT32 *BinLength,\r
+  IN     CHAR8  *HexStr\r
+  )\r
 {\r
   UINTN   Index;\r
   UINT32  HexCount;\r
@@ -613,27 +561,21 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
-VOID\r
-IScsiGenRandom (\r
-  IN OUT UINT8  *Rand,\r
-  IN     UINTN  RandLength\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Generate random numbers.\r
 \r
-Arguments:\r
+  @param  Rand[in][out]  The buffer to contain random numbers.\r
 \r
-  Rand       - The buffer to contain random numbers.\r
-  RandLength - The length of the Rand buffer.\r
+  @param  RandLength[in] The length of the Rand buffer.\r
 \r
-Returns:\r
+  @retval None.\r
 \r
-  None.\r
-\r
---*/\r
+**/\r
+VOID\r
+IScsiGenRandom (\r
+  IN OUT UINT8  *Rand,\r
+  IN     UINTN  RandLength\r
+  )\r
 {\r
   UINT32  Random;\r
 \r
@@ -644,27 +586,21 @@ Returns:
   }\r
 }\r
 \r
-ISCSI_DRIVER_DATA *\r
-IScsiCreateDriverData (\r
-  IN EFI_HANDLE  Image,\r
-  IN EFI_HANDLE  Controller\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Create the iSCSI driver data..\r
 \r
-Arguments:\r
+  @param  Image[in]      The handle of the driver image.\r
 \r
-  Image      - The handle of the driver image.\r
-  Controller - The handle of the controller.\r
+  @param  Controller[in] The handle of the controller.\r
 \r
-Returns:\r
+  @retval The iSCSI driver data created.\r
 \r
-  The iSCSI driver data created.\r
-\r
---*/\r
+**/\r
+ISCSI_DRIVER_DATA *\r
+IScsiCreateDriverData (\r
+  IN EFI_HANDLE  Image,\r
+  IN EFI_HANDLE  Controller\r
+  )\r
 {\r
   ISCSI_DRIVER_DATA *Private;\r
   EFI_STATUS        Status;\r
@@ -725,25 +661,18 @@ Returns:
   return Private;\r
 }\r
 \r
-VOID\r
-IScsiCleanDriverData (\r
-  IN ISCSI_DRIVER_DATA  *Private\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Clean the iSCSI driver data.\r
 \r
-Arguments:\r
-\r
-  Private - The iSCSI driver data.\r
-\r
-Returns:\r
+  @param  Private[in] The iSCSI driver data.\r
 \r
- None.\r
 @retval None.\r
 \r
---*/\r
+**/\r
+VOID\r
+IScsiCleanDriverData (\r
+  IN ISCSI_DRIVER_DATA  *Private\r
+  )\r
 {\r
   if (Private->DevicePath != NULL) {\r
     gBS->UninstallProtocolInterface (\r
@@ -768,26 +697,21 @@ Returns:
   gBS->FreePool (Private);\r
 }\r
 \r
-EFI_STATUS\r
-IScsiGetConfigData (\r
-  IN ISCSI_DRIVER_DATA  *Private\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
+/**\r
 \r
   Get the various configuration data of this iSCSI instance.\r
 \r
-Arguments:\r
-\r
-  Private - The iSCSI driver data.\r
+  @param  Private[in]   The iSCSI driver data.\r
 \r
-Returns:\r
+  @retval EFI_SUCCESS   The configuration of this instance is got.\r
 \r
-  EFI_SUCCESS   - The configuration of this instance is got.\r
-  EFI_NOT_FOUND - This iSCSI instance is not configured yet.\r
+  @retval EFI_NOT_FOUND This iSCSI instance is not configured yet.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+IScsiGetConfigData (\r
+  IN ISCSI_DRIVER_DATA  *Private\r
+  )\r
 {\r
   EFI_STATUS                  Status;\r
   ISCSI_SESSION               *Session;\r
@@ -866,25 +790,18 @@ Returns:
   return Status;\r
 }\r
 \r
-EFI_DEVICE_PATH_PROTOCOL *\r
-IScsiGetTcpConnDevicePath (\r
-  IN ISCSI_DRIVER_DATA  *Private\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Get the device path of the iSCSI tcp connection and update it.\r
 \r
-Arguments:\r
+  @param  Private[in] The iSCSI driver data.\r
 \r
-  Private - The iSCSI driver data.\r
+  @retval The updated device path.\r
 \r
-Returns:\r
-\r
-  The updated device path.\r
-\r
---*/\r
+**/\r
+EFI_DEVICE_PATH_PROTOCOL *\r
+IScsiGetTcpConnDevicePath (\r
+  IN ISCSI_DRIVER_DATA  *Private\r
+  )\r
 {\r
   ISCSI_SESSION             *Session;\r
   ISCSI_CONNECTION          *Conn;\r
@@ -937,28 +854,22 @@ Returns:
   return DevicePath;\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
   IN EFI_EVENT  Event,\r
   IN VOID       *Context\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Abort the session when the transition from BS to RT is initiated.\r
-\r
-Arguments:\r
-\r
-  Event   - The event signaled.\r
-  Context - The iSCSI driver data.\r
-\r
-Returns:\r
-\r
-  None.\r
-\r
---*/\r
 {\r
   ISCSI_DRIVER_DATA *Private;\r
 \r
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
index 93b7f715e196404698a3c4659098e1d65484adfa..d87b5d6cad0cb990a14ed2fed5a406d1fed874ca 100644 (file)
@@ -1,6 +1,7 @@
-/*++\r
+/** @file\r
+  The implementation of IScsi protocol based on RFC3720\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
@@ -14,86 +15,68 @@ Module Name:
   IScsiProto.c\r
 \r
 Abstract:\r
+  The implementation of IScsi protocol based on RFC3720\r
 \r
---*/\r
+**/\r
 \r
 #include "IScsiImpl.h"\r
 \r
 static UINT32 mDataSegPad = 0;\r
 \r
-VOID\r
-IScsiAttatchConnection (\r
-  IN ISCSI_SESSION     *Session,\r
-  IN ISCSI_CONNECTION  *Conn\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Attach the iSCSI connection to the iSCSI session. \r
 \r
-Arguments:\r
-\r
-  Session - The iSCSI session.\r
-  Conn    - The iSCSI connection.\r
+  @param  Session[in] The iSCSI session.\r
 \r
-Returns:\r
+  @param  Conn[in]    The iSCSI connection.\r
 \r
-  None.\r
+  @retval None.\r
 \r
---*/\r
+**/\r
+VOID\r
+IScsiAttatchConnection (\r
+  IN ISCSI_SESSION     *Session,\r
+  IN ISCSI_CONNECTION  *Conn\r
+  )\r
 {\r
   InsertTailList (&Session->Conns, &Conn->Link);\r
   Conn->Session = Session;\r
   Session->NumConns++;\r
 }\r
 \r
-VOID\r
-IScsiDetatchConnection (\r
-  IN ISCSI_CONNECTION  *Conn\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Detach the iSCSI connection from the session it belongs to. \r
 \r
-Arguments:\r
-\r
-  Conn - The iSCSI connection.\r
+  @param  Conn[in] The iSCSI connection.\r
 \r
-Returns:\r
+  @retval None.\r
 \r
-  None.\r
-\r
---*/\r
+**/\r
+VOID\r
+IScsiDetatchConnection (\r
+  IN ISCSI_CONNECTION  *Conn\r
+  )\r
 {\r
   RemoveEntryList (&Conn->Link);\r
   Conn->Session->NumConns--;\r
   Conn->Session = NULL;\r
 }\r
 \r
-EFI_STATUS\r
-IScsiCheckSN (\r
-  IN UINT32  *ExpSN,\r
-  IN UINT32  NewSN\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Check the sequence number according to RFC3720. \r
 \r
-Arguments:\r
+  @param  ExpSN[in]   The currently expected sequence number.\r
 \r
-  ExpSN - The currently expected sequence number.\r
-  NewSN - The sequence number to check.\r
+  @param  NewSN[in]   The sequence number to check.\r
 \r
-Returns:\r
+  @retval EFI_SUCCESS The check passed and the ExpSN is increased.\r
 \r
-  EFI_SUCCESS - The check passed and the ExpSN is increased.\r
-\r
---*/\r
+**/\r
+EFI_STATUS\r
+IScsiCheckSN (\r
+  IN UINT32  *ExpSN,\r
+  IN UINT32  NewSN\r
+  )\r
 {\r
   if (!ISCSI_SEQ_EQ (NewSN, *ExpSN)) {\r
     if (ISCSI_SEQ_LT (NewSN, *ExpSN)) {\r
@@ -113,29 +96,24 @@ Returns:
   }\r
 }\r
 \r
-VOID\r
-IScsiUpdateCmdSN (\r
-  IN ISCSI_SESSION  *Session,\r
-  IN UINT32         MaxCmdSN,\r
-  IN UINT32         ExpCmdSN\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Update the sequence numbers for the iSCSI command.\r
 \r
-Arguments:\r
+  @param  Session[in]  The iSCSI session.\r
 \r
-  Session  - The iSCSI session.\r
-  MaxCmdSN - Maximum CmdSN from the target.\r
-  ExpCmdSN - Next expected CmdSN from the target.\r
+  @param  MaxCmdSN[in] Maximum CmdSN from the target.\r
 \r
-Returns:\r
+  @param  ExpCmdSN[in] Next expected CmdSN from the target.\r
 \r
-  None.\r
+  @retval None.\r
 \r
---*/\r
+**/\r
+VOID\r
+IScsiUpdateCmdSN (\r
+  IN ISCSI_SESSION  *Session,\r
+  IN UINT32         MaxCmdSN,\r
+  IN UINT32         ExpCmdSN\r
+  )\r
 {\r
   if (ISCSI_SEQ_LT (MaxCmdSN, ExpCmdSN - 1)) {\r
     return ;\r
@@ -150,27 +128,22 @@ Returns:
   }\r
 }\r
 \r
-EFI_STATUS\r
-IScsiConnLogin (\r
-  IN ISCSI_CONNECTION  *Conn\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   This function does the iSCSI connection login.\r
 \r
-Arguments:\r
+  @param  Conn[in]           The iSCSI connection to login.\r
 \r
-  Conn - The iSCSI connection to login.\r
+  @retval EFI_SUCCESS        The iSCSI connection is logged into the iSCSI target.\r
 \r
-Returns:\r
+  @retval EFI_TIMEOUT        Timeout happened during the login procedure.\r
 \r
-  EFI_SUCCESS        - The iSCSI connection is logged into the iSCSI target.\r
-  EFI_TIMEOUT        - Timeout happened during the login procedure.\r
-  EFI_PROTOCOL_ERROR - Some kind of iSCSI protocol error happened.\r
+  @retval EFI_PROTOCOL_ERROR Some kind of iSCSI protocol error happened.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+IScsiConnLogin (\r
+  IN ISCSI_CONNECTION  *Conn\r
+  )\r
 {\r
   EFI_STATUS  Status;\r
 \r
@@ -210,50 +183,37 @@ Returns:
   return Status;\r
 }\r
 \r
+/**\r
+  Reset the iSCSI connection.\r
+\r
+  @param  Conn[in] The iSCSI connection to reset.\r
+\r
+  @retval None.\r
+\r
+**/\r
 VOID\r
 IScsiConnReset (\r
   IN ISCSI_CONNECTION  *Conn\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Reset the iSCSI connection.\r
-\r
-Arguments:\r
+{\r
+  Tcp4IoReset (&Conn->Tcp4Io);\r
+}\r
 \r
-  Conn - The iSCSI connection to reset.\r
+/**\r
+  Create a TCP connection for the iSCSI session.\r
 \r
-Returns:\r
+  @param  Private[in] The iSCSI driver data.\r
 \r
-  None.\r
+  @param  Session[in] Maximum CmdSN from the target.\r
 \r
---*/\r
-{\r
-  Tcp4IoReset (&Conn->Tcp4Io);\r
-}\r
+  @retval The newly created iSCSI connection.\r
 \r
+**/\r
 ISCSI_CONNECTION *\r
 IScsiCreateConnection (\r
   IN ISCSI_DRIVER_DATA  *Private,\r
   IN ISCSI_SESSION      *Session\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a TCP connection for the iSCSI session.\r
-\r
-Arguments:\r
-\r
-  Private - The iSCSI driver data.\r
-  Session - Maximum CmdSN from the target.\r
-\r
-Returns:\r
-\r
-  The newly created iSCSI connection.\r
-\r
---*/\r
 {\r
   ISCSI_CONNECTION    *Conn;\r
   TCP4_IO_CONFIG_DATA Tcp4IoConfig;\r
@@ -320,25 +280,18 @@ Returns:
   return Conn;\r
 }\r
 \r
-VOID\r
-IScsiDestroyConnection (\r
-  IN ISCSI_CONNECTION  *Conn\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Destroy an iSCSI connection.\r
 \r
-Arguments:\r
-\r
-  Conn - The connection to destroy.\r
+  @param  Conn[in] The connection to destroy.\r
 \r
-Returns:\r
+  @retval None.\r
 \r
-  None.\r
-\r
---*/\r
+**/\r
+VOID\r
+IScsiDestroyConnection (\r
+  IN ISCSI_CONNECTION  *Conn\r
+  )\r
 {\r
   Tcp4IoDestroySocket (&Conn->Tcp4Io);\r
   NetbufQueFlush (&Conn->RspQue);\r
@@ -346,27 +299,22 @@ Returns:
   gBS->FreePool (Conn);\r
 }\r
 \r
-EFI_STATUS\r
-IScsiSessionLogin (\r
-  IN ISCSI_DRIVER_DATA  *Private\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Login the iSCSI session.\r
 \r
-Arguments:\r
+  @param  Private[in]          The iSCSI driver data.\r
 \r
-  Private - The iSCSI driver data.\r
+  @retval EFI_SUCCESS          The iSCSI session login procedure finished.\r
 \r
-Returns:\r
+  @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r
 \r
-  EFI_SUCCESS          - The iSCSI session login procedure finished.\r
-  EFI_OUT_OF_RESOURCES - Failed to allocate memory.\r
-  EFI_PROTOCOL_ERROR   - Some kind of iSCSI protocol error happened.\r
+  @retval EFI_PROTOCOL_ERROR   Some kind of iSCSI protocol error happened.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+IScsiSessionLogin (\r
+  IN ISCSI_DRIVER_DATA  *Private\r
+  )\r
 {\r
   EFI_STATUS        Status;\r
   ISCSI_SESSION     *Session;\r
@@ -409,29 +357,24 @@ Returns:
   return Status;\r
 }\r
 \r
-EFI_STATUS\r
-IScsiSendLoginReq (\r
-  IN ISCSI_CONNECTION  *Conn\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Build and send the iSCSI login request to the iSCSI target according to\r
   the current login stage.\r
 \r
-Arguments:\r
+  @param  Conn[in]             The connection in the iSCSI login phase.\r
 \r
-  Conn - The connection in the iSCSI login phase.\r
+  @retval EFI_SUCCESS          The iSCSI login request PDU is built and sent on this\r
+                               connection.\r
 \r
-Returns:\r
+  @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r
 \r
-  EFI_SUCCESS          - The iSCSI login request PDU is built and sent on this\r
-                         connection.\r
-  EFI_OUT_OF_RESOURCES - Failed to allocate memory.\r
-  EFI_PROTOCOL_ERROR   - Some kind of iSCSI protocol error happened.\r
+  @retval EFI_PROTOCOL_ERROR   Some kind of iSCSI protocol error happened.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+IScsiSendLoginReq (\r
+  IN ISCSI_CONNECTION  *Conn\r
+  )\r
 {\r
   NET_BUF     *Pdu;\r
   EFI_STATUS  Status;\r
@@ -453,27 +396,22 @@ Returns:
   return Status;\r
 }\r
 \r
-EFI_STATUS\r
-IScsiReceiveLoginRsp (\r
-  IN ISCSI_CONNECTION  *Conn\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Receive and process the iSCSI login response.\r
 \r
-Arguments:\r
+  @param  Conn[in]             The connection in the iSCSI login phase.\r
 \r
-  Conn - The connection in the iSCSI login phase.\r
+  @retval EFI_SUCCESS          The iSCSI login response PDU is received and processed.\r
 \r
-Returns:\r
+  @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r
 \r
-  EFI_SUCCESS          - The iSCSI login response PDU is received and processed.\r
-  EFI_OUT_OF_RESOURCES - Failed to allocate memory.\r
-  EFI_PROTOCOL_ERROR   - Some kind of iSCSI protocol error happened.\r
+  @retval EFI_PROTOCOL_ERROR   Some kind of iSCSI protocol error happened.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+IScsiReceiveLoginRsp (\r
+  IN ISCSI_CONNECTION  *Conn\r
+  )\r
 {\r
   EFI_STATUS  Status;\r
   NET_BUF     *Pdu;\r
@@ -495,34 +433,31 @@ Returns:
   return Status;\r
 }\r
 \r
-EFI_STATUS\r
-IScsiAddKeyValuePair (\r
-  IN NET_BUF          *Pdu,\r
-  IN CHAR8            *Key,\r
-  IN CHAR8            *Value\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Add an iSCSI key-value pair as a string into the data segment of the Login Request PDU.\r
   The DataSegmentLength and the actual size of the net buffer containing this PDU will be\r
   updated.\r
 \r
-Arguments:\r
+  @param  Pdu[in]              The iSCSI PDU whose data segment the key-value pair will\r
+                               be added to.\r
+\r
+  @param  Key[in]              The key name string.\r
 \r
-  Pdu   - The iSCSI PDU whose data segment the key-value pair will be added to.\r
-  Key   - The key name string.\r
-  Value - The value string.\r
+  @param  Value[in]            The value string.\r
 \r
-Returns:\r
+  @retval EFI_SUCCESS          The key-valu pair is added to the PDU's datasegment and\r
+                               the correspondence length fields are updated.\r
 \r
-  EFI_SUCCESS          - The key-valu pair is added to the PDU's datasegment and\r
-                         the correspondence length fields are updated.\r
-  EFI_OUT_OF_RESOURCES - There is not enough space in the PDU to add the key-value\r
-                         pair.\r
+  @retval EFI_OUT_OF_RESOURCES There is not enough space in the PDU to add the key-value\r
+                               pair.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+IScsiAddKeyValuePair (\r
+  IN NET_BUF          *Pdu,\r
+  IN CHAR8            *Key,\r
+  IN CHAR8            *Value\r
+  )\r
 {\r
   UINT32              DataSegLen;\r
   UINT32              KeyLen;\r
@@ -575,25 +510,18 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
-NET_BUF *\r
-IScsiPrepareLoginReq (\r
-  IN ISCSI_CONNECTION  *Conn\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Prepare the iSCSI login request to be sent according to the current login status.\r
 \r
-Arguments:\r
+  @param  Conn[in] The connection in the iSCSI login phase.\r
 \r
-  Conn - The connection in the iSCSI login phase.\r
+  @retval The pointer to the net buffer containing the iSCSI login request built.\r
 \r
-Returns:\r
-\r
-  The pointer to the net buffer containing the iSCSI login request built.\r
-\r
---*/\r
+**/\r
+NET_BUF *\r
+IScsiPrepareLoginReq (\r
+  IN ISCSI_CONNECTION  *Conn\r
+  )\r
 {\r
   ISCSI_SESSION       *Session;\r
   NET_BUF             *Nbuf;\r
@@ -674,28 +602,23 @@ Returns:
   return Nbuf;\r
 }\r
 \r
-EFI_STATUS\r
-IScsiProcessLoginRsp (\r
-  IN ISCSI_CONNECTION  *Conn,\r
-  IN NET_BUF           *Pdu\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Process the iSCSI Login Response.\r
 \r
-Arguments:\r
+  @param  Conn[in] The connection on which the iSCSI login response is received.\r
 \r
-  Conn - The connection on which the iSCSI login response is received.\r
-  Pdu  - The iSCSI login response PDU.\r
+  @param  Pdu[in]  The iSCSI login response PDU.\r
 \r
-Returns:\r
+  @retval EFI_SUCCESS        The iSCSI login response PDU is processed and all check are passed.\r
 \r
-  EFI_SUCCESS        - The iSCSI login response PDU is processed and all check are passed.\r
-  EFI_PROTOCOL_ERROR - Some kind of iSCSI protocol error happened.\r
+  @retval EFI_PROTOCOL_ERROR Some kind of iSCSI protocol error happened.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+IScsiProcessLoginRsp (\r
+  IN ISCSI_CONNECTION  *Conn,\r
+  IN NET_BUF           *Pdu\r
+  )\r
 {\r
   EFI_STATUS            Status;\r
   ISCSI_SESSION         *Session;\r
@@ -886,32 +809,30 @@ Returns:
   return Status;\r
 }\r
 \r
-EFI_STATUS\r
-IScsiUpdateTargetAddress (\r
-  IN ISCSI_SESSION  *Session,\r
-  IN CHAR8          *Data,\r
-  IN UINT32         Len\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Updated the target information according the data received in the iSCSI\r
   login response with an target redirection status.\r
 \r
-Arguments:\r
+  @param  Session[in]          The iSCSI session.\r
+\r
+  @param  Data[in]             The data segment which should contain the\r
+                               TargetAddress key-value list.\r
+\r
+  @param  Len[in]              Length of the data.\r
 \r
-  Session - The iSCSI session.\r
-  Data    - The data segment which should contain the TargetAddress key-value list.\r
-  Len     - Length of the data.\r
+  @retval EFI_SUCCESS          The target address is updated.\r
 \r
-Returns:\r
+  @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r
 \r
-  EFI_SUCCESS          - The target address is updated.\r
-  EFI_OUT_OF_RESOURCES - Failed to allocate memory.\r
-  EFI_NOT_FOUND        - The TargetAddress key is not found.\r
+  @retval EFI_NOT_FOUND        The TargetAddress key is not found.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+IScsiUpdateTargetAddress (\r
+  IN ISCSI_SESSION  *Session,\r
+  IN CHAR8          *Data,\r
+  IN UINT32         Len\r
+  )\r
 {\r
   LIST_ENTRY      *KeyValueList;\r
   CHAR8           *TargetAddress;\r
@@ -989,25 +910,18 @@ Returns:
   return Status;\r
 }\r
 \r
-VOID\r
-IScsiFreeNbufList (\r
-  VOID *Arg\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   The callback function to free the net buffer list.\r
 \r
-Arguments:\r
+  @param  Arg[in] The opaque parameter.\r
 \r
-  Arg - The opaque parameter.\r
+  @retval None.\r
 \r
-Returns:\r
-\r
-  None.\r
-\r
---*/\r
+**/\r
+VOID\r
+IScsiFreeNbufList (\r
+  VOID *Arg\r
+  )\r
 {\r
   ASSERT (Arg != NULL);\r
 \r
@@ -1015,28 +929,45 @@ Returns:
   gBS->FreePool (Arg);\r
 }\r
 \r
+/**\r
+  The callback function called in NetBufFree, it does nothing.\r
+\r
+  @param  Arg[in] The opaque parameter.\r
+\r
+  @retval None.\r
+\r
+**/\r
 VOID\r
 IScsiNbufExtFree (\r
   VOID *Arg\r
   )\r
-/*++\r
+{\r
+}\r
 \r
-Routine Description:\r
+/**\r
+  Receive an iSCSI response PDU. An iSCSI response PDU contains an iSCSI PDU header and\r
+  an optional data segment. The two parts will be put into two blocks of buffers in the\r
+  net buffer. The digest check will be conducted in this function if needed and the digests\r
+  will be trimmed from the PDU buffer.\r
 \r
-  The callback function called in NetBufFree, it does nothing.\r
+  @param  Conn[in]         The iSCSI connection to receive data from.\r
 \r
-Arguments:\r
+  @param  Pdu[out]         The received iSCSI pdu.\r
 \r
-  Arg - The opaque parameter.\r
+  @param  Context[in]      The context used to describe information on the caller provided\r
+                           buffer to receive data segment of the iSCSI pdu, it's optional.\r
 \r
-Returns:\r
+  @param  HeaderDigest[in] Whether there will be header digest received.\r
 \r
-  None.\r
+  @param  DataDigest[in]   Whether there will be data digest.\r
 \r
---*/\r
-{\r
-}\r
+  @param  TimeoutEvent[in] The timeout event, it's optional.\r
+\r
+  @retval EFI_SUCCESS      An iSCSI pdu is received.\r
 \r
+  @retval EFI_TIMEOUT      Timeout happenend.\r
+\r
+**/\r
 EFI_STATUS\r
 IScsiReceivePdu (\r
   IN ISCSI_CONNECTION                      *Conn,\r
@@ -1046,31 +977,6 @@ IScsiReceivePdu (
   IN BOOLEAN                               DataDigest,\r
   IN EFI_EVENT                             TimeoutEvent OPTIONAL\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Receive an iSCSI response PDU. An iSCSI response PDU contains an iSCSI PDU header and\r
-  an optional data segment. The two parts will be put into two blocks of buffers in the\r
-  net buffer. The digest check will be conducted in this function if needed and the digests\r
-  will be trimmed from the PDU buffer.\r
-\r
-Arguments:\r
-\r
-  Conn         - The iSCSI connection to receive data from.\r
-  Pdu          - The received iSCSI pdu.\r
-  Context      - The context used to describe information on the caller provided\r
-                 buffer to receive data segment of the iSCSI pdu, it's optional.\r
-  HeaderDigest - Whether there will be header digest received.\r
-  DataDigest   - Whether there will be data digest.\r
-  TimeoutEvent - The timeout event, it's optional.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS - An iSCSI pdu is received.\r
-  EFI_TIMEOUT - Timeout happenend.\r
-\r
---*/\r
 {\r
   LIST_ENTRY      *NbufList;\r
   UINT32          Len;\r
@@ -1242,28 +1148,23 @@ ON_EXIT:
   return Status;\r
 }\r
 \r
-EFI_STATUS\r
-IScsiCheckOpParams (\r
-  IN ISCSI_CONNECTION  *Conn,\r
-  IN BOOLEAN           Transit\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Check and get the result of the prameter negotiation.\r
 \r
-Arguments:\r
+  @param  Conn[in]           The connection in iSCSI login.\r
 \r
-  Conn - The connection in iSCSI login.\r
-  Pdu  - The iSCSI response PDU containing the parameter list.\r
+  @param  Pdu[in]            The iSCSI response PDU containing the parameter list.\r
 \r
-Returns:\r
+  @retval EFI_SUCCESS        The parmeter check is passed and negotiation is finished.\r
 \r
-  EFI_SUCCESS        - The parmeter check is passed and negotiation is finished.\r
-  EFI_PROTOCOL_ERROR - Some kind of iSCSI protocol error happened.\r
+  @retval EFI_PROTOCOL_ERROR Some kind of iSCSI protocol error happened.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+IScsiCheckOpParams (\r
+  IN ISCSI_CONNECTION  *Conn,\r
+  IN BOOLEAN           Transit\r
+  )\r
 {\r
   EFI_STATUS      Status;\r
   LIST_ENTRY      *KeyValueList;\r
@@ -1504,28 +1405,23 @@ ON_ERROR:
   return Status;\r
 }\r
 \r
-EFI_STATUS\r
-IScsiFillOpParams (\r
-  IN ISCSI_CONNECTION  *Conn,\r
-  IN NET_BUF           *Pdu\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Fill the oprational prameters.\r
 \r
-Arguments:\r
+  @param  Conn[in]             The connection in iSCSI login.\r
 \r
-  Conn - The connection in iSCSI login.\r
-  Pdu  - The iSCSI login request PDU to fill the parameters.\r
+  @param  Pdu[in]              The iSCSI login request PDU to fill the parameters.\r
 \r
-Returns:\r
+  @retval EFI_SUCCESS          The parmeters are filled into the iSCSI login request PDU.\r
 \r
-  EFI_SUCCESS          - The parmeters are filled into the iSCSI login request PDU.\r
-  EFI_OUT_OF_RESOURCES - There is not enough space in the PDU to hold the parameters.\r
+  @retval EFI_OUT_OF_RESOURCES There is not enough space in the PDU to hold the parameters.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+IScsiFillOpParams (\r
+  IN ISCSI_CONNECTION  *Conn,\r
+  IN NET_BUF           *Pdu\r
+  )\r
 {\r
   ISCSI_SESSION *Session;\r
   CHAR8         Value[256];\r
@@ -1577,29 +1473,24 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
-EFI_STATUS\r
-IScsiPadSegment (\r
-  IN NET_BUF  *Pdu,\r
-  IN UINT32   Len\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Pad the iSCSI AHS or data segment to an integer number of 4 byte words.\r
 \r
-Arguments:\r
+  @param  Pdu[in]              The iSCSI pdu which contains segments to pad.\r
 \r
-  Pdu - The iSCSI pdu which contains segments to pad.\r
-  Len - The length of the last semgnet in the PDU.\r
+  @param  Len[in]              The length of the last semgnet in the PDU.\r
 \r
-Returns:\r
+  @retval EFI_SUCCESS          The segment is padded or no need to pad it.\r
 \r
-  EFI_SUCCESS          - The segment is padded or no need to pad it.\r
-  EFI_OUT_OF_RESOURCES - There is not enough remaining free space to add the\r
-                         padding bytes.\r
+  @retval EFI_OUT_OF_RESOURCES There is not enough remaining free space to add the\r
+                               padding bytes.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+IScsiPadSegment (\r
+  IN NET_BUF  *Pdu,\r
+  IN UINT32   Len\r
+  )\r
 {\r
   UINT32  PadLen;\r
   UINT8   *Data;\r
@@ -1618,27 +1509,21 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
-LIST_ENTRY     *\r
-IScsiBuildKeyValueList (\r
-  IN CHAR8  *Data,\r
-  IN UINT32 Len\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Build a key-value list from the data segment.\r
 \r
-Arguments:\r
-\r
-  Data - The data segment containing the key-value pairs.\r
-  Len  - Length of the data segment.\r
+  @param  Data[in] The data segment containing the key-value pairs.\r
 \r
-Returns:\r
+  @param  Len[in]  Length of the data segment.\r
 \r
-  The key-value list.\r
+  @retval The key-value list.\r
 \r
---*/\r
+**/\r
+LIST_ENTRY *\r
+IScsiBuildKeyValueList (\r
+  IN CHAR8  *Data,\r
+  IN UINT32 Len\r
+  )\r
 {\r
   LIST_ENTRY            *ListHead;\r
   ISCSI_KEY_VALUE_PAIR  *KeyValuePair;\r
@@ -1692,28 +1577,22 @@ ON_ERROR:
   return NULL;\r
 }\r
 \r
-CHAR8 *\r
-IScsiGetValueByKeyFromList (\r
-  IN LIST_ENTRY      *KeyValueList,\r
-  IN CHAR8           *Key\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Get the value string by the key name from the key-value list. If found,\r
   the key-value entry will be removed from the list.\r
 \r
-Arguments:\r
-\r
-  KeyValueList - The key-value list.\r
-  Key          - The key name to find.\r
+  @param  KeyValueList[in] The key-value list.\r
 \r
-Returns:\r
+  @param  Key[in]          The key name to find.\r
 \r
-  The value string.\r
+  @retval The value string.\r
 \r
---*/\r
+**/\r
+CHAR8 *\r
+IScsiGetValueByKeyFromList (\r
+  IN LIST_ENTRY      *KeyValueList,\r
+  IN CHAR8           *Key\r
+  )\r
 {\r
   LIST_ENTRY            *Entry;\r
   ISCSI_KEY_VALUE_PAIR  *KeyValuePair;\r
@@ -1736,25 +1615,18 @@ Returns:
   return Value;\r
 }\r
 \r
+/**\r
+  Free the key-value list.\r
+\r
+  @param  KeyValueList[in] The key-value list.\r
+  \r
+  @retval None.\r
+\r
+**/\r
 VOID\r
 IScsiFreeKeyValueList (\r
   IN LIST_ENTRY      *KeyValueList\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Free the key-value list.\r
-\r
-Arguments:\r
-\r
-  KeyValueList - The key-value list.\r
-\r
-Returns:\r
-\r
-  None.\r
-\r
---*/\r
 {\r
   LIST_ENTRY            *Entry;\r
   ISCSI_KEY_VALUE_PAIR  *KeyValuePair;\r
@@ -1769,28 +1641,23 @@ Returns:
   gBS->FreePool (KeyValueList);\r
 }\r
 \r
-EFI_STATUS\r
-IScsiNormalizeName (\r
-  IN CHAR8  *Name,\r
-  IN UINTN  Len\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Normalize the iSCSI name according to RFC.\r
 \r
-Arguments:\r
+  @param  Name[in]           The iSCSI name.\r
 \r
-  Name - The iSCSI name.\r
-  Len  - length of the iSCSI name.\r
+  @param  Len[in]            length of the iSCSI name.\r
 \r
-Returns:\r
+  @retval EFI_SUCCESS        The iSCSI name is valid and normalized.\r
 \r
-  EFI_SUCCESS        - The iSCSI name is valid and normalized.\r
-  EFI_PROTOCOL_ERROR - The iSCSI name is mal-formatted or not in the IQN format.\r
+  @retval EFI_PROTOCOL_ERROR The iSCSI name is mal-formatted or not in the IQN format.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+IScsiNormalizeName (\r
+  IN CHAR8  *Name,\r
+  IN UINTN  Len\r
+  )\r
 {\r
   UINTN Index;\r
 \r
@@ -1826,28 +1693,23 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
-EFI_STATUS\r
-IScsiNewTcb (\r
-  IN  ISCSI_CONNECTION  *Conn,\r
-  OUT ISCSI_TCB         **Tcb\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Create an iSCSI task control block.\r
 \r
-Arguments:\r
+  @param  Conn[in]             The connection on which the task control block will be created.\r
 \r
-  Conn - The connection on which the task control block will be created.\r
-  Tcb  - The newly created task control block.\r
+  @param  Tcb[out]             The newly created task control block.\r
 \r
-Returns:\r
+  @retval EFI_SUCCESS          The task control block is created.\r
 \r
-  EFI_SUCCESS          - The task control block is created.\r
-  EFI_OUT_OF_RESOURCES - Failed to allocate memory.\r
+  @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+IScsiNewTcb (\r
+  IN  ISCSI_CONNECTION  *Conn,\r
+  OUT ISCSI_TCB         **Tcb\r
+  )\r
 {\r
   ISCSI_SESSION *Session;\r
   ISCSI_TCB     *NewTcb;\r
@@ -1885,52 +1747,39 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
-VOID\r
-IScsiDelTcb (\r
-  IN ISCSI_TCB  *Tcb\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Delete the tcb from the connection and destroy it.\r
 \r
-Arguments:\r
-\r
-  Tcb - The tcb to delete.\r
-\r
-Returns:\r
+  @param  Tcb The tcb to delete.\r
 \r
-  None.\r
+  @retval None.\r
 \r
---*/\r
+**/\r
+VOID\r
+IScsiDelTcb (\r
+  IN ISCSI_TCB  *Tcb\r
+  )\r
 {\r
   RemoveEntryList (&Tcb->Link);\r
 \r
   gBS->FreePool (Tcb);\r
 }\r
 \r
-ISCSI_TCB *\r
-IScsiFindTcbByITT (\r
-  IN LIST_ENTRY      *TcbList,\r
-  IN UINT32          InitiatorTaskTag\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Find the task control block by the initator task tag.\r
 \r
-Arguments:\r
+  @param  TcbList[in]          The tcb list.\r
 \r
-  TcbList          - The tcb list.\r
-  InitiatorTaskTag - The initiator task tag.\r
+  @param  InitiatorTaskTag[in] The initiator task tag.\r
 \r
-Returns:\r
+  @retval The task control block found.\r
 \r
-  The task control block found.\r
-\r
---*/\r
+**/\r
+ISCSI_TCB *\r
+IScsiFindTcbByITT (\r
+  IN LIST_ENTRY      *TcbList,\r
+  IN UINT32          InitiatorTaskTag\r
+  )\r
 {\r
   ISCSI_TCB       *Tcb;\r
   LIST_ENTRY      *Entry;\r
@@ -1950,29 +1799,24 @@ Returns:
   return Tcb;\r
 }\r
 \r
-NET_BUF *\r
-IScsiNewDataSegment (\r
-  IN UINT8    *Data,\r
-  IN UINT32   Len,\r
-  IN BOOLEAN  DataDigest\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Create a data segment, pad it and calculate the CRC if needed.\r
 \r
-Arguments:\r
+  @param  Data[in]       The data to fill into the data segment.\r
 \r
-  Data       - The data to fill into the data segment.\r
-  Len        - Length of the data.\r
-  DataDigest - Whether to calculate CRC for this data segment.\r
+  @param  Len[in]        Length of the data.\r
 \r
-Returns:\r
+  @param  DataDigest[in] Whether to calculate CRC for this data segment.\r
 \r
-  The net buffer wrapping the data segment.\r
+  @retval The net buffer wrapping the data segment.\r
 \r
---*/\r
+**/\r
+NET_BUF *\r
+IScsiNewDataSegment (\r
+  IN UINT8    *Data,\r
+  IN UINT32   Len,\r
+  IN BOOLEAN  DataDigest\r
+  )\r
 {\r
   NET_FRAGMENT  Fragment[2];\r
   UINT32        FragmentCount;\r
@@ -1997,30 +1841,25 @@ Returns:
   return DataSeg;\r
 }\r
 \r
-NET_BUF *\r
-IScsiNewScsiCmdPdu (\r
-  IN EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet,\r
-  IN UINT64                                     Lun,\r
-  IN ISCSI_TCB                                  *Tcb\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Create a iSCSI SCSI command PDU to encapsulate the command issued\r
   by SCSI through the EXT SCSI PASS THRU Protocol.\r
 \r
-Arguments:\r
+  @param  Packet[in] The EXT SCSI PASS THRU request packet containing the SCSI command.\r
 \r
-  Packet - The EXT SCSI PASS THRU request packet containing the SCSI command.\r
-  Lun    - The LUN.\r
-  Tcb    - The tcb assocated with this SCSI command.\r
+  @param  Lun[in]    The LUN.\r
 \r
-Returns:\r
+  @param  Tcb[in]    The tcb assocated with this SCSI command.\r
 \r
-  The created iSCSI SCSI command PDU.\r
+  @retval The created iSCSI SCSI command PDU.\r
 \r
---*/\r
+**/\r
+NET_BUF *\r
+IScsiNewScsiCmdPdu (\r
+  IN EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET *Packet,\r
+  IN UINT64                                     Lun,\r
+  IN ISCSI_TCB                                  *Tcb\r
+  )\r
 {\r
   LIST_ENTRY                      *NbufList;\r
   NET_BUF                         *Pdu;\r
@@ -2177,6 +2016,22 @@ ON_EXIT:
   return Pdu;\r
 }\r
 \r
+/**\r
+  Create a new iSCSI SCSI Data Out PDU.\r
+\r
+  @param  Data[in]   The data to put into the Data Out PDU.\r
+\r
+  @param  Len[in]    Length of the data.\r
+\r
+  @param  DataSN[in] The DataSN of the Data Out PDU.\r
+\r
+  @param  Tcb[in]    The task control block of this Data Out PDU.\r
+\r
+  @param  Lun[in]    The LUN.\r
+\r
+  @retval The net buffer wrapping the Data Out PDU.\r
+\r
+**/\r
 NET_BUF *\r
 IScsiNewDataOutPdu (\r
   IN UINT8      *Data,\r
@@ -2185,25 +2040,6 @@ IScsiNewDataOutPdu (
   IN ISCSI_TCB  *Tcb,\r
   IN UINT64     Lun\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a new iSCSI SCSI Data Out PDU.\r
-\r
-Arguments:\r
-\r
-  Data   - The data to put into the Data Out PDU.\r
-  Len    - Length of the data.\r
-  DataSN - The DataSN of the Data Out PDU.\r
-  Tcb    - The task control block of this Data Out PDU.\r
-  Lun    - The LUN.\r
-\r
-Returns:\r
-\r
-  The net buffer wrapping the Data Out PDU.\r
-\r
---*/\r
 {\r
   LIST_ENTRY          *NbufList;\r
   NET_BUF             *PduHdr;\r
@@ -2273,29 +2109,24 @@ Returns:
   return Pdu;\r
 }\r
 \r
-LIST_ENTRY     *\r
-IScsiGenerateDataOutPduSequence (\r
-  IN UINT8      *Data,\r
-  IN ISCSI_TCB  *Tcb,\r
-  IN UINT64     Lun\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Generate a consecutive sequence of iSCSI SCSI Data Out PDUs.\r
 \r
-Arguments:\r
+  @param  Data[in] The data  which will be carried by the sequence of iSCSI SCSI Data Out PDUs.\r
 \r
-  Data - The data  which will be carried by the sequence of iSCSI SCSI Data Out PDUs.\r
-  Tcb  - The task control block of the data to send out.\r
-  Lun  - The LUN the data will be sent to.\r
+  @param  Tcb[in]  The task control block of the data to send out.\r
 \r
-Returns:\r
+  @param  Lun[in]  The LUN the data will be sent to.\r
 \r
-  A list of net buffers with each of them wraps an iSCSI SCSI Data Out PDU.\r
+  @retval A list of net buffers with each of them wraps an iSCSI SCSI Data Out PDU.\r
 \r
---*/\r
+**/\r
+LIST_ENTRY *\r
+IScsiGenerateDataOutPduSequence (\r
+  IN UINT8      *Data,\r
+  IN ISCSI_TCB  *Tcb,\r
+  IN UINT64     Lun\r
+  )\r
 {\r
   LIST_ENTRY          *PduList;\r
   UINT32              DataSN;\r
@@ -2353,30 +2184,26 @@ ON_EXIT:
   return PduList;\r
 }\r
 \r
-EFI_STATUS\r
-IScsiSendDataOutPduSequence (\r
-  IN UINT8      *Data,\r
-  IN UINT64     Lun,\r
-  IN ISCSI_TCB  *Tcb\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Send the Data in a sequence of Data Out PDUs one by one.\r
 \r
-Arguments:\r
+  @param  Data[in]             The data to carry by Data Out PDUs.\r
 \r
-  Data - The data to carry by Data Out PDUs.\r
-  Lun  - The LUN the data will be sent to.\r
-  Tcb  - The task control block.\r
+  @param  Lun[in]              The LUN the data will be sent to.\r
 \r
-Returns:\r
+  @param  Tcb[in]              The task control block.\r
 \r
-  EFI_SUCCES           - The data is sent out to the LUN.\r
-  EFI_OUT_OF_RESOURCES - Failed to allocate memory.\r
+  @retval EFI_SUCCES           The data is sent out to the LUN.\r
 \r
---*/\r
+  @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r
+\r
+**/\r
+EFI_STATUS\r
+IScsiSendDataOutPduSequence (\r
+  IN UINT8      *Data,\r
+  IN UINT64     Lun,\r
+  IN ISCSI_TCB  *Tcb\r
+  )\r
 {\r
   LIST_ENTRY      *DataOutPduList;\r
   LIST_ENTRY      *Entry;\r
@@ -2410,31 +2237,27 @@ Returns:
   return Status;\r
 }\r
 \r
-EFI_STATUS\r
-IScsiOnDataInRcvd (\r
-  IN NET_BUF                                         *Pdu,\r
-  IN ISCSI_TCB                                       *Tcb,\r
-  IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET  *Packet\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Process the received iSCSI SCSI Data In PDU.\r
 \r
-Arguments:\r
+  @param  Pdu[in]            The Data In PDU received.\r
+\r
+  @param  Tcb[in]            The task control block.\r
 \r
-  Pdu    - The Data In PDU received.\r
-  Tcb    - The task control block.\r
-  Packet - The EXT SCSI PASS THRU request packet.\r
+  @param  Packet[in][out]    The EXT SCSI PASS THRU request packet.\r
 \r
-Returns:\r
+  @retval EFI_SUCCES         The check on the Data IN PDU is passed and some update\r
+                             actions are taken.\r
 \r
-  EFI_SUCCES          - The check on the Data IN PDU is passed and some update\r
-                        actions are taken.\r
-  EFI_PROTOCOL_ERROR  - Some kind of iSCSI protocol errror happened.\r
+  @retval EFI_PROTOCOL_ERROR Some kind of iSCSI protocol errror happened.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+IScsiOnDataInRcvd (\r
+  IN NET_BUF                                         *Pdu,\r
+  IN ISCSI_TCB                                       *Tcb,\r
+  IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET  *Packet\r
+  )\r
 {\r
   ISCSI_SCSI_DATA_IN  *DataInHdr;\r
   EFI_STATUS          Status;\r
@@ -2502,32 +2325,29 @@ Returns:
   return Status;\r
 }\r
 \r
-EFI_STATUS\r
-IScsiOnR2TRcvd (\r
-  IN NET_BUF                                         *Pdu,\r
-  IN ISCSI_TCB                                       *Tcb,\r
-  IN UINT64                                          Lun,\r
-  IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET  *Packet\r
-  )\r
-/*++\r
+/**\r
+  Process the received iSCSI R2T PDU.\r
 \r
-Routine Description:\r
+  @param  Pdu[in]            The R2T PDU received.\r
 \r
-  Process the received iSCSI R2T PDU.\r
+  @param  Tcb[in]            The task control block.\r
 \r
-Arguments:\r
+  @param  Lun[in]            The Lun.\r
 \r
-  Pdu    - The R2T PDU received.\r
-  Tcb    - The task control block.\r
-  Lun    - The Lun.\r
-  Packet - The EXT SCSI PASS THRU request packet.\r
+  @param  Packet[in][out]    The EXT SCSI PASS THRU request packet.\r
 \r
-Returns:\r
+  @retval EFI_SUCCES         The R2T PDU is valid and the solicited data is sent out.\r
 \r
-  EFI_SUCCES          - The R2T PDU is valid and the solicited data is sent out.\r
-  EFI_PROTOCOL_ERROR  - Some kind of iSCSI protocol errror happened.\r
+  @retval EFI_PROTOCOL_ERROR Some kind of iSCSI protocol errror happened.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+IScsiOnR2TRcvd (\r
+  IN NET_BUF                                         *Pdu,\r
+  IN ISCSI_TCB                                       *Tcb,\r
+  IN UINT64                                          Lun,\r
+  IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET  *Packet\r
+  )\r
 {\r
   ISCSI_READY_TO_TRANSFER *R2THdr;\r
   EFI_STATUS              Status;\r
@@ -2573,30 +2393,26 @@ Returns:
   return Status;\r
 }\r
 \r
-EFI_STATUS\r
-IScsiOnScsiRspRcvd (\r
-  IN NET_BUF                                         *Pdu,\r
-  IN ISCSI_TCB                                       *Tcb,\r
-  IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET  *Packet\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Process the received iSCSI SCSI Response PDU.\r
 \r
-Arguments:\r
+  @param  Pdu[in]            The Response PDU received.\r
+\r
+  @param  Tcb[in]            The task control block.\r
 \r
-  Pdu    - The Response PDU received.\r
-  Tcb    - The task control block.\r
-  Packet - The EXT SCSI PASS THRU request packet.\r
+  @param  Packet[in][out]    The EXT SCSI PASS THRU request packet.\r
 \r
-Returns:\r
+  @retval EFI_SUCCES         The Response PDU is processed.\r
 \r
-  EFI_SUCCES         - The Response PDU is processed.\r
-  EFI_PROTOCOL_ERROR - Some kind of iSCSI protocol errror happened.\r
+  @retval EFI_PROTOCOL_ERROR Some kind of iSCSI protocol errror happened.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+IScsiOnScsiRspRcvd (\r
+  IN NET_BUF                                         *Pdu,\r
+  IN ISCSI_TCB                                       *Tcb,\r
+  IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET  *Packet\r
+  )\r
 {\r
   SCSI_RESPONSE     *ScsiRspHdr;\r
   ISCSI_SENSE_DATA  *SenseData;\r
@@ -2680,29 +2496,24 @@ Returns:
   return Status;\r
 }\r
 \r
-EFI_STATUS\r
-IScsiOnNopInRcvd (\r
-  IN NET_BUF    *Pdu,\r
-  IN ISCSI_TCB  *Tcb\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Process the received NOP In PDU.\r
 \r
-Arguments:\r
+  @param  Pdu[in]            The NOP In PDU received.\r
 \r
-  Pdu    - The NOP In PDU received.\r
-  Tcb    - The task control block.\r
+  @param  Tcb[in]            The task control block.\r
 \r
-Returns:\r
+  @retval EFI_SUCCES         The NOP In PDU is processed and the related sequence\r
+                             numbers are updated.\r
 \r
-  EFI_SUCCES          - The NOP In PDU is processed and the related sequence\r
-                        numbers are updated.\r
-  EFI_PROTOCOL_ERROR  - Some kind of iSCSI protocol errror happened.\r
+  @retval EFI_PROTOCOL_ERROR Some kind of iSCSI protocol errror happened.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+IScsiOnNopInRcvd (\r
+  IN NET_BUF    *Pdu,\r
+  IN ISCSI_TCB  *Tcb\r
+  )\r
 {\r
   ISCSI_NOP_IN  *NopInHdr;\r
   EFI_STATUS    Status;\r
@@ -2729,34 +2540,31 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
-EFI_STATUS\r
-IScsiExecuteScsiCommand (\r
-  IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL                 *PassThru,\r
-  IN UINT8                                           *Target,\r
-  IN UINT64                                          Lun,\r
-  IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET  *Packet\r
-  )\r
-/*++\r
+/**\r
+  Execute the SCSI command issued through the EXT SCSI PASS THRU protocol.\r
 \r
-Routine Description:\r
+  @param  PassThru[in]     The EXT SCSI PASS THRU protocol.\r
 \r
-  Execute the SCSI command issued through the EXT SCSI PASS THRU protocol.\r
+  @param  Target[in]       The target ID.\r
 \r
-Arguments:\r
+  @param  Lun[in]          The LUN.\r
 \r
-  PassThru - The EXT SCSI PASS THRU protocol.\r
-  Target   - The target ID.\r
-  Lun      - The LUN.\r
-  Packet   - The request packet containing IO request, SCSI command buffer and\r
-             buffers to read/write.\r
+  @param  Packet[in][out]  The request packet containing IO request, SCSI command\r
+                           buffer and buffers to read/write.\r
 \r
-Returns:\r
+  @retval EFI_SUCCES       The SCSI command is executed and the result is updated to \r
+                           the Packet.\r
 \r
-  EFI_SUCCES       - The SCSI command is executed and the result is updated to \r
-                     the Packet.\r
-  EFI_DEVICE_ERROR - Some unexpected error happened.\r
+  @retval EFI_DEVICE_ERROR Some unexpected error happened.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+IScsiExecuteScsiCommand (\r
+  IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL                 *PassThru,\r
+  IN UINT8                                           *Target,\r
+  IN UINT64                                          Lun,\r
+  IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET  *Packet\r
+  )\r
 {\r
   EFI_STATUS              Status;\r
   ISCSI_DRIVER_DATA       *Private;\r
@@ -2923,26 +2731,20 @@ ON_EXIT:
   return Status;\r
 }\r
 \r
-EFI_STATUS\r
-IScsiSessionReinstatement (\r
-  IN ISCSI_DRIVER_DATA  *Private\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Reinstate the session on some error.\r
 \r
-Arguments:\r
+  @param  Private[in] The iSCSI driver data.\r
 \r
-  Private - The iSCSI driver data.\r
+  @retval EFI_SUCCES  The session is reinstated from some error.\r
 \r
-Returns:\r
+  @retval other       Reinstatement failed.\r
 \r
-  EFI_SUCCES - The session is reinstated from some error.\r
-  other      - Reinstatement failed.\r
-\r
---*/\r
+**/\r
+EFI_STATUS\r
+IScsiSessionReinstatement (\r
+  IN ISCSI_DRIVER_DATA  *Private\r
+  )\r
 {\r
   ISCSI_SESSION *Session;\r
   EFI_STATUS    Status;\r
@@ -2964,27 +2766,21 @@ Returns:
   return Status;\r
 }\r
 \r
-VOID\r
-IScsiSessionInit (\r
-  IN ISCSI_SESSION  *Session,\r
-  IN BOOLEAN        Recovery\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Initialize some session parameters before login.\r
 \r
-Arguments:\r
+  @param  Session[in]  The iSCSI session.\r
 \r
-  Session  - The iSCSI session.\r
-  Recovery - Whether the request is from a fresh new start or recovery.\r
+  @param  Recovery[in] Whether the request is from a fresh new start or recovery.\r
 \r
-Returns:\r
+  @retval None.\r
 \r
-  None.\r
-\r
---*/\r
+**/\r
+VOID\r
+IScsiSessionInit (\r
+  IN ISCSI_SESSION  *Session,\r
+  IN BOOLEAN        Recovery\r
+  )\r
 {\r
   UINT32  Random;\r
 \r
@@ -3025,26 +2821,19 @@ Returns:
   Session->ErrorRecoveryLevel   = 0;\r
 }\r
 \r
-EFI_STATUS\r
-IScsiSessionAbort (\r
-  IN ISCSI_SESSION  *Session\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Abort the iSCSI session, that is, reset all the connection and free the\r
   resources.\r
 \r
-Arguments:\r
-\r
-  Session - The iSCSI session.\r
-\r
-Returns:\r
+  @param  Session[in] The iSCSI session.\r
 \r
-  EFI_SUCCES - The session is aborted.\r
+  @retval EFI_SUCCES  The session is aborted.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+IScsiSessionAbort (\r
+  IN ISCSI_SESSION  *Session\r
+  )\r
 {\r
   ISCSI_DRIVER_DATA *Private;\r
   ISCSI_CONNECTION  *Conn;\r
index 43a8c25f96a211803b52c106f6e820fad57e75be..794ac40c3f9e8352fb377bc70a1c63d24dace05f 100644 (file)
@@ -1,4 +1,5 @@
-/*++\r
+/** @file\r
+  The header file of IScsi Protocol that defines many specific data structures.\r
 \r
 Copyright (c) 2004 - 2008, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
@@ -15,9 +16,9 @@ Module Name:
 \r
 Abstract:\r
 \r
-  Protocol definitions for iSCSI driver, mainly from RFC3720.\r
+  Protocol definitions for IScsi driver, mainly from RFC3720.\r
 \r
---*/\r
+**/\r
 \r
 #ifndef _ISCSI_PROTO_H_\r
 #define _ISCSI_PROTO_H_\r
@@ -636,48 +637,153 @@ typedef struct _ISCSI_KEY_VALUE_PAIR {
 //\r
 // function prototypes.\r
 //\r
+/**\r
+  Attach the iSCSI connection to the iSCSI session. \r
+\r
+  @param  Session[in] The iSCSI session.\r
+\r
+  @param  Conn[in]    The iSCSI connection.\r
+\r
+  @retval None.\r
+\r
+**/\r
 VOID\r
 IScsiAttatchConnection (\r
   IN ISCSI_SESSION     *Session,\r
   IN ISCSI_CONNECTION  *Conn\r
   );\r
 \r
+/**\r
+  Detach the iSCSI connection from the session it belongs to. \r
+\r
+  @param  Conn[in] The iSCSI connection.\r
+\r
+  @retval None.\r
+\r
+**/\r
 VOID\r
 IScsiDetatchConnection (\r
   IN ISCSI_CONNECTION  *Conn\r
   );\r
 \r
+/**\r
+  This function does the iSCSI connection login.\r
+\r
+  @param  Conn[in]           The iSCSI connection to login.\r
+\r
+  @retval EFI_SUCCESS        The iSCSI connection is logged into the iSCSI target.\r
+\r
+  @retval EFI_TIMEOUT        Timeout happened during the login procedure.\r
+\r
+  @retval EFI_PROTOCOL_ERROR Some kind of iSCSI protocol error happened.\r
+\r
+**/\r
 EFI_STATUS\r
 IScsiConnLogin (\r
   IN ISCSI_CONNECTION  *Conn\r
   );\r
 \r
+/**\r
+  Create a TCP connection for the iSCSI session.\r
+\r
+  @param  Private[in] The iSCSI driver data.\r
+\r
+  @param  Session[in] Maximum CmdSN from the target.\r
+\r
+  @retval The newly created iSCSI connection.\r
+\r
+**/\r
 ISCSI_CONNECTION  *\r
 IScsiCreateConnection (\r
   IN ISCSI_DRIVER_DATA  *Private,\r
   IN ISCSI_SESSION      *Session\r
   );\r
 \r
+/**\r
+  Destroy an iSCSI connection.\r
+\r
+  @param  Conn[in] The connection to destroy.\r
+\r
+  @retval None.\r
+\r
+**/\r
 VOID\r
 IScsiDestroyConnection (\r
   IN ISCSI_CONNECTION  *Conn\r
   );\r
 \r
+/**\r
+  Login the iSCSI session.\r
+\r
+  @param  Private[in]          The iSCSI driver data.\r
+\r
+  @retval EFI_SUCCESS          The iSCSI session login procedure finished.\r
+\r
+  @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r
+\r
+  @retval EFI_PROTOCOL_ERROR   Some kind of iSCSI protocol error happened.\r
+\r
+**/\r
 EFI_STATUS\r
 IScsiSessionLogin (\r
   IN ISCSI_DRIVER_DATA  *Private\r
   );\r
 \r
+/**\r
+  Build and send the iSCSI login request to the iSCSI target according to\r
+  the current login stage.\r
+\r
+  @param  Conn[in]             The connection in the iSCSI login phase.\r
+\r
+  @retval EFI_SUCCESS          The iSCSI login request PDU is built and sent on this\r
+                               connection.\r
+\r
+  @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r
+\r
+  @retval EFI_PROTOCOL_ERROR   Some kind of iSCSI protocol error happened.\r
+\r
+**/\r
 EFI_STATUS\r
 IScsiSendLoginReq (\r
   IN ISCSI_CONNECTION  *Conn\r
   );\r
 \r
+/**\r
+  Receive and process the iSCSI login response.\r
+\r
+  @param  Conn[in]             The connection in the iSCSI login phase.\r
+\r
+  @retval EFI_SUCCESS          The iSCSI login response PDU is received and processed.\r
+\r
+  @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r
+\r
+  @retval EFI_PROTOCOL_ERROR   Some kind of iSCSI protocol error happened.\r
+\r
+**/\r
 EFI_STATUS\r
 IScsiReceiveLoginRsp (\r
   IN ISCSI_CONNECTION  *Conn\r
   );\r
 \r
+/**\r
+  Add an iSCSI key-value pair as a string into the data segment of the Login Request PDU.\r
+  The DataSegmentLength and the actual size of the net buffer containing this PDU will be\r
+  updated.\r
+\r
+  @param  Pdu[in]              The iSCSI PDU whose data segment the key-value pair will\r
+                               be added to.\r
+\r
+  @param  Key[in]              The key name string.\r
+\r
+  @param  Value[in]            The value string.\r
+\r
+  @retval EFI_SUCCESS          The key-valu pair is added to the PDU's datasegment and\r
+                               the correspondence length fields are updated.\r
+\r
+  @retval EFI_OUT_OF_RESOURCES There is not enough space in the PDU to add the key-value\r
+                               pair.\r
+\r
+**/\r
 EFI_STATUS\r
 IScsiAddKeyValuePair (\r
   IN NET_BUF          *Pdu,\r
@@ -685,17 +791,55 @@ IScsiAddKeyValuePair (
   IN CHAR8            *Value\r
   );\r
 \r
-NET_BUF           *\r
+/**\r
+  Prepare the iSCSI login request to be sent according to the current login status.\r
+\r
+  @param  Conn[in] The connection in the iSCSI login phase.\r
+\r
+  @retval The pointer to the net buffer containing the iSCSI login request built.\r
+\r
+**/\r
+NET_BUF *\r
 IScsiPrepareLoginReq (\r
   IN ISCSI_CONNECTION  *Conn\r
   );\r
 \r
+/**\r
+  Process the iSCSI Login Response.\r
+\r
+  @param  Conn[in] The connection on which the iSCSI login response is received.\r
+\r
+  @param  Pdu[in]  The iSCSI login response PDU.\r
+\r
+  @retval EFI_SUCCESS        The iSCSI login response PDU is processed and all check are passed.\r
+\r
+  @retval EFI_PROTOCOL_ERROR Some kind of iSCSI protocol error happened.\r
+\r
+**/\r
 EFI_STATUS\r
 IScsiProcessLoginRsp (\r
   IN ISCSI_CONNECTION  *Conn,\r
   IN NET_BUF           *Pdu\r
   );\r
 \r
+/**\r
+  Updated the target information according the data received in the iSCSI\r
+  login response with an target redirection status.\r
+\r
+  @param  Session[in]          The iSCSI session.\r
+\r
+  @param  Data[in]             The data segment which should contain the\r
+                               TargetAddress key-value list.\r
+\r
+  @param  Len[in]              Length of the data.\r
+\r
+  @retval EFI_SUCCESS          The target address is updated.\r
+\r
+  @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r
+\r
+  @retval EFI_NOT_FOUND        The TargetAddress key is not found.\r
+\r
+**/\r
 EFI_STATUS\r
 IScsiUpdateTargetAddress (\r
   IN ISCSI_SESSION  *Session,\r
@@ -703,11 +847,43 @@ IScsiUpdateTargetAddress (
   IN UINT32         Len\r
   );\r
 \r
+/**\r
+  The callback function to free the net buffer list.\r
+\r
+  @param  Arg[in] The opaque parameter.\r
+\r
+  @retval None.\r
+\r
+**/\r
 VOID\r
 IScsiFreeNbufList (\r
   VOID *Arg\r
   );\r
 \r
+/**\r
+  Receive an iSCSI response PDU. An iSCSI response PDU contains an iSCSI PDU header and\r
+  an optional data segment. The two parts will be put into two blocks of buffers in the\r
+  net buffer. The digest check will be conducted in this function if needed and the digests\r
+  will be trimmed from the PDU buffer.\r
+\r
+  @param  Conn[in]         The iSCSI connection to receive data from.\r
+\r
+  @param  Pdu[out]         The received iSCSI pdu.\r
+\r
+  @param  Context[in]      The context used to describe information on the caller provided\r
+                           buffer to receive data segment of the iSCSI pdu, it's optional.\r
+\r
+  @param  HeaderDigest[in] Whether there will be header digest received.\r
+\r
+  @param  DataDigest[in]   Whether there will be data digest.\r
+\r
+  @param  TimeoutEvent[in] The timeout event, it's optional.\r
+\r
+  @retval EFI_SUCCESS      An iSCSI pdu is received.\r
+\r
+  @retval EFI_TIMEOUT      Timeout happenend.\r
+\r
+**/\r
 EFI_STATUS\r
 IScsiReceivePdu (\r
   IN ISCSI_CONNECTION                      *Conn,\r
@@ -718,47 +894,143 @@ IScsiReceivePdu (
   IN EFI_EVENT                             TimeoutEvent OPTIONAL\r
   );\r
 \r
+/**\r
+  Check and get the result of the prameter negotiation.\r
+\r
+  @param  Conn[in]           The connection in iSCSI login.\r
+\r
+  @param  Pdu[in]            The iSCSI response PDU containing the parameter list.\r
+\r
+  @retval EFI_SUCCESS        The parmeter check is passed and negotiation is finished.\r
+\r
+  @retval EFI_PROTOCOL_ERROR Some kind of iSCSI protocol error happened.\r
+\r
+**/\r
 EFI_STATUS\r
 IScsiCheckOpParams (\r
   IN ISCSI_CONNECTION  *Conn,\r
   IN BOOLEAN           Transit\r
   );\r
 \r
+/**\r
+  Fill the oprational prameters.\r
+\r
+  @param  Conn[in]             The connection in iSCSI login.\r
+\r
+  @param  Pdu[in]              The iSCSI login request PDU to fill the parameters.\r
+\r
+  @retval EFI_SUCCESS          The parmeters are filled into the iSCSI login request PDU.\r
+\r
+  @retval EFI_OUT_OF_RESOURCES There is not enough space in the PDU to hold the parameters.\r
+\r
+**/\r
 EFI_STATUS\r
 IScsiFillOpParams (\r
   IN ISCSI_CONNECTION  *Conn,\r
   IN NET_BUF           *Pdu\r
   );\r
 \r
+/**\r
+  Pad the iSCSI AHS or data segment to an integer number of 4 byte words.\r
+\r
+  @param  Pdu[in]              The iSCSI pdu which contains segments to pad.\r
+\r
+  @param  Len[in]              The length of the last semgnet in the PDU.\r
+\r
+  @retval EFI_SUCCESS          The segment is padded or no need to pad it.\r
+\r
+  @retval EFI_OUT_OF_RESOURCES There is not enough remaining free space to add the\r
+                               padding bytes.\r
+\r
+**/\r
 EFI_STATUS\r
 IScsiPadSegment (\r
   IN NET_BUF  *Pdu,\r
   IN UINT32   Len\r
   );\r
 \r
-LIST_ENTRY        *\r
+/**\r
+  Build a key-value list from the data segment.\r
+\r
+  @param  Data[in] The data segment containing the key-value pairs.\r
+\r
+  @param  Len[in]  Length of the data segment.\r
+\r
+  @retval The key-value list.\r
+\r
+**/\r
+LIST_ENTRY *\r
 IScsiBuildKeyValueList (\r
   IN CHAR8  *Data,\r
   IN UINT32 Len\r
   );\r
 \r
-CHAR8             *\r
+/**\r
+  Get the value string by the key name from the key-value list. If found,\r
+  the key-value entry will be removed from the list.\r
+\r
+  @param  KeyValueList[in] The key-value list.\r
+\r
+  @param  Key[in]          The key name to find.\r
+\r
+  @retval The value string.\r
+\r
+**/\r
+CHAR8 *\r
 IScsiGetValueByKeyFromList (\r
   IN LIST_ENTRY      *KeyValueList,\r
   IN CHAR8           *Key\r
   );\r
 \r
+/**\r
+  Free the key-value list.\r
+\r
+  @param  KeyValueList[in] The key-value list.\r
+  \r
+  @retval None.\r
+\r
+**/\r
 VOID\r
 IScsiFreeKeyValueList (\r
   IN LIST_ENTRY      *KeyValueList\r
   );\r
 \r
+/**\r
+  Normalize the iSCSI name according to RFC.\r
+\r
+  @param  Name[in]           The iSCSI name.\r
+\r
+  @param  Len[in]            length of the iSCSI name.\r
+\r
+  @retval EFI_SUCCESS        The iSCSI name is valid and normalized.\r
+\r
+  @retval EFI_PROTOCOL_ERROR The iSCSI name is mal-formatted or not in the IQN format.\r
+\r
+**/\r
 EFI_STATUS\r
 IScsiNormalizeName (\r
   IN CHAR8  *Name,\r
   IN UINTN  Len\r
   );\r
 \r
+/**\r
+  Execute the SCSI command issued through the EXT SCSI PASS THRU protocol.\r
+\r
+  @param  PassThru[in]     The EXT SCSI PASS THRU protocol.\r
+\r
+  @param  Target[in]       The target ID.\r
+\r
+  @param  Lun[in]          The LUN.\r
+\r
+  @param  Packet[in][out]  The request packet containing IO request, SCSI command\r
+                           buffer and buffers to read/write.\r
+\r
+  @retval EFI_SUCCES       The SCSI command is executed and the result is updated to \r
+                           the Packet.\r
+\r
+  @retval EFI_DEVICE_ERROR Some unexpected error happened.\r
+\r
+**/\r
 EFI_STATUS\r
 IScsiExecuteScsiCommand (\r
   IN EFI_EXT_SCSI_PASS_THRU_PROTOCOL                 *PassThru,\r
@@ -767,17 +1039,46 @@ IScsiExecuteScsiCommand (
   IN OUT EFI_EXT_SCSI_PASS_THRU_SCSI_REQUEST_PACKET  *Packet\r
   );\r
 \r
+/**\r
+  Reinstate the session on some error.\r
+\r
+  @param  Private[in] The iSCSI driver data.\r
+\r
+  @retval EFI_SUCCES  The session is reinstated from some error.\r
+\r
+  @retval other       Reinstatement failed.\r
+\r
+**/\r
 EFI_STATUS\r
 IScsiSessionReinstatement (\r
   IN ISCSI_DRIVER_DATA  *Private\r
   );\r
 \r
+/**\r
+  Initialize some session parameters before login.\r
+\r
+  @param  Session[in]  The iSCSI session.\r
+\r
+  @param  Recovery[in] Whether the request is from a fresh new start or recovery.\r
+\r
+  @retval None.\r
+\r
+**/\r
 VOID\r
 IScsiSessionInit (\r
   IN ISCSI_SESSION  *Session,\r
   IN BOOLEAN        Recovery\r
   );\r
 \r
+/**\r
+  Abort the iSCSI session, that is, reset all the connection and free the\r
+  resources.\r
+\r
+  @param  Session[in] The iSCSI session.\r
+\r
+  @retval EFI_SUCCES  The session is aborted.\r
+\r
+**/\r
 EFI_STATUS\r
 IScsiSessionAbort (\r
   IN ISCSI_SESSION  *Session\r
index 06caf72166749d20e32296b64ca1979732a1cac3..02f561e15710efe3e55f17041ed6e5439fc28f25 100644 (file)
@@ -1,4 +1,5 @@
-/*++\r
+/** @file\r
+  The wrap of TCP/IP Socket interface\r
 \r
 Copyright (c) 2004 - 2007, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
@@ -14,37 +15,48 @@ Module Name:
   IScsiTcp4Io.c\r
 \r
 Abstract:\r
+  The wrap of TCP/IP Socket interface\r
 \r
---*/\r
+**/\r
 \r
 #include "IScsiImpl.h"\r
 \r
+/**\r
+  The common notify function associated with various Tcp4Io events. \r
+\r
+  @param  Event[in]   The event signaled.\r
+\r
+  @param  Contect[in] The context.\r
+\r
+  @retval None.\r
+\r
+**/\r
 VOID\r
 EFIAPI\r
 Tcp4IoCommonNotify (\r
   IN EFI_EVENT  Event,\r
   IN VOID       *Context\r
   )\r
-/*++\r
-\r
-Routine Description:\r
+{\r
+  *((BOOLEAN *) Context) = TRUE;\r
+}\r
 \r
-  The common notify function associated with various Tcp4Io events. \r
+/**\r
+  Create a TCP socket with the specified configuration data. \r
 \r
-Arguments:\r
+  @param  Image[in]      The handle of the driver image.\r
 \r
-  Event   - The event signaled.\r
-  Contect - The context.\r
+  @param  Controller[in] The handle of the controller.\r
 \r
-Returns:\r
+  @param  ConfigData[in] The Tcp4 configuration data.\r
 \r
-  None.\r
+  @param  Tcp4Io[in]     The Tcp4Io.\r
+  \r
+  @retval EFI_SUCCESS    The TCP socket is created and configured.\r
 \r
---*/\r
-{\r
-  *((BOOLEAN *) Context) = TRUE;\r
-}\r
+  @retval Other          Failed to create the TCP socket or configure it.\r
 \r
+**/\r
 EFI_STATUS\r
 Tcp4IoCreateSocket (\r
   IN EFI_HANDLE           Image,\r
@@ -52,25 +64,6 @@ Tcp4IoCreateSocket (
   IN TCP4_IO_CONFIG_DATA  *ConfigData,\r
   IN TCP4_IO              *Tcp4Io\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  Create a TCP socket with the specified configuration data. \r
-\r
-Arguments:\r
-\r
-  Image      - The handle of the driver image.\r
-  Controller - The handle of the controller.\r
-  ConfigData - The Tcp4 configuration data.\r
-  Tcp4Io     - The Tcp4Io.\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS - The TCP socket is created and configured.\r
-  other       - Failed to create the TCP socket or configure it.\r
-\r
---*/\r
 {\r
   EFI_STATUS            Status;\r
   EFI_TCP4_PROTOCOL     *Tcp4;\r
@@ -252,25 +245,18 @@ ON_ERROR:
   return Status;\r
 }\r
 \r
-VOID\r
-Tcp4IoDestroySocket (\r
-  IN TCP4_IO  *Tcp4Io\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Destroy the socket. \r
 \r
-Arguments:\r
+  @param[in]  Tcp4Io The Tcp4Io which wraps the socket to be destroyeds.\r
 \r
-  Tcp4Io - The Tcp4Io which wraps the socket to be destroyeds.\r
+  @retval     None.\r
 \r
-Returns:\r
-\r
-  None.\r
-\r
---*/\r
+**/\r
+VOID\r
+Tcp4IoDestroySocket (\r
+  IN TCP4_IO  *Tcp4Io\r
+  )\r
 {\r
   EFI_TCP4_PROTOCOL *Tcp4;\r
 \r
@@ -297,27 +283,21 @@ Returns:
     );\r
 }\r
 \r
-EFI_STATUS\r
-Tcp4IoConnect (\r
-  IN TCP4_IO    *Tcp4Io,\r
-  IN EFI_EVENT  Timeout\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Connect to the other endpoint of the TCP socket.\r
 \r
-Arguments:\r
-\r
-  Tcp4Io  - The Tcp4Io wrapping the TCP socket.\r
-  Timeout - The time to wait for connection done.\r
+  @param  Tcp4Io[in]  The Tcp4Io wrapping the TCP socket.\r
 \r
-Returns:\r
+  @param  Timeout[in] The time to wait for connection done.\r
 \r
-  None.\r
+  @retval None.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+Tcp4IoConnect (\r
+  IN TCP4_IO    *Tcp4Io,\r
+  IN EFI_EVENT  Timeout\r
+  )\r
 {\r
   EFI_TCP4_PROTOCOL *Tcp4;\r
   EFI_STATUS        Status;\r
@@ -342,25 +322,18 @@ Returns:
   return Status;\r
 }\r
 \r
-VOID\r
-Tcp4IoReset (\r
-  IN TCP4_IO  *Tcp4Io\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Reset the socket.\r
 \r
-Arguments:\r
-\r
-  Tcp4Io - The Tcp4Io wrapping the TCP socket.\r
-\r
-Returns:\r
+  @param  Tcp4Io[in] The Tcp4Io wrapping the TCP socket.\r
 \r
-  None.\r
+  @retval None.\r
 \r
---*/\r
+**/\r
+VOID\r
+Tcp4IoReset (\r
+  IN TCP4_IO  *Tcp4Io\r
+  )\r
 {\r
   EFI_STATUS        Status;\r
   EFI_TCP4_PROTOCOL *Tcp4;\r
@@ -379,28 +352,23 @@ Returns:
   }\r
 }\r
 \r
-EFI_STATUS\r
-Tcp4IoTransmit (\r
-  IN TCP4_IO  *Tcp4Io,\r
-  IN NET_BUF  *Packet\r
-  )\r
-/*++\r
-\r
-Routine Description:\r
-\r
+/**\r
   Transmit the Packet to the other endpoint of the socket.\r
 \r
-Arguments:\r
+  @param  Tcp4Io[in]           The Tcp4Io wrapping the TCP socket.\r
 \r
-  Tcp4Io - The Tcp4Io wrapping the TCP socket.\r
-  Packet - The packet to transmit\r
+  @param  Packet[in]           The packet to transmit\r
 \r
-Returns:\r
+  @retval EFI_SUCCESS          The packet is trasmitted.\r
 \r
-  EFI_SUCCESS          - The packet is trasmitted.\r
-  EFI_OUT_OF_RESOURCES - Failed to allocate memory.\r
+  @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r
 \r
---*/\r
+**/\r
+EFI_STATUS\r
+Tcp4IoTransmit (\r
+  IN TCP4_IO  *Tcp4Io,\r
+  IN NET_BUF  *Packet\r
+  )\r
 {\r
   EFI_TCP4_TRANSMIT_DATA  *TxData;\r
   EFI_TCP4_PROTOCOL       *Tcp4;\r
@@ -447,35 +415,33 @@ ON_EXIT:
   return Status;\r
 }\r
 \r
-EFI_STATUS\r
-Tcp4IoReceive (\r
-  IN TCP4_IO    *Tcp4Io,\r
-  IN NET_BUF    *Packet,\r
-  IN BOOLEAN    AsyncMode,\r
-  IN EFI_EVENT  Timeout\r
-  )\r
-/*++\r
+/**\r
+  Receive data from the socket.\r
 \r
-Routine Description:\r
+  @param  Tcp4Io[in]           The Tcp4Io which wraps the socket to be destroyeds.\r
 \r
-  Receive data from the socket.\r
+  @param  Packet[in]           The buffer to hold the data copy from the soket rx buffer.\r
 \r
-Arguments:\r
+  @param  AsyncMode[in]        Is this receive asyncronous or not.\r
 \r
-  Tcp4Io    - The Tcp4Io which wraps the socket to be destroyeds.\r
-  Packet    - The buffer to hold the data copy from the soket rx buffer.\r
-  AsyncMode - Is this receive asyncronous or not.\r
-  Timeout   - The time to wait for receiving the amount of data the Packet\r
-              can hold.\r
+  @param  Timeout[in]          The time to wait for receiving the amount of data the Packet\r
+                               can hold.\r
 \r
-Returns:\r
+  @retval EFI_SUCCESS          The required amount of data is received from the socket.\r
 \r
-  EFI_SUCCESS          - The required amount of data is received from the socket.\r
-  EFI_OUT_OF_RESOURCES - Failed to allocate momery.\r
-  EFI_TIMEOUT          - Failed to receive the required amount of data in the\r
-                         specified time period.\r
+  @retval EFI_OUT_OF_RESOURCES Failed to allocate momery.\r
 \r
---*/\r
+  @retval EFI_TIMEOUT          Failed to receive the required amount of data in the\r
+                               specified time period.\r
+\r
+**/\r
+EFI_STATUS\r
+Tcp4IoReceive (\r
+  IN TCP4_IO    *Tcp4Io,\r
+  IN NET_BUF    *Packet,\r
+  IN BOOLEAN    AsyncMode,\r
+  IN EFI_EVENT  Timeout\r
+  )\r
 {\r
   EFI_TCP4_PROTOCOL     *Tcp4;\r
   EFI_TCP4_RECEIVE_DATA RxData;\r
index 2a70a6bd407acd5916f7f55e7486ae0ca88a591a..f46e8df8b33f16edd6d9c4ff64dcf4751661ced0 100644 (file)
@@ -1,4 +1,5 @@
-/*++\r
+/**\r
+  IScsi Tcp4 IO related definitions.\r
 \r
 Copyright (c) 2004 - 2008, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
@@ -15,9 +16,9 @@ Module Name:
 \r
 Abstract:\r
 \r
-  iSCSI Tcp4 IO related definitions.\r
+  IScsi Tcp4 IO related definitions.\r
 \r
---*/\r
+**/\r
 \r
 #ifndef _ISCSI_TCP4_IO_H_\r
 #define _ISCSI_TCP4_IO_H_\r
@@ -52,6 +53,22 @@ typedef struct _TCP4_IO {
   BOOLEAN                   IsCloseDone;\r
 } TCP4_IO;\r
 \r
+/**\r
+  Create a TCP socket with the specified configuration data. \r
+\r
+  @param  Image[in]      The handle of the driver image.\r
+\r
+  @param  Controller[in] The handle of the controller.\r
+\r
+  @param  ConfigData[in] The Tcp4 configuration data.\r
+\r
+  @param  Tcp4Io[in]     The Tcp4Io.\r
+  \r
+  @retval EFI_SUCCESS    The TCP socket is created and configured.\r
+\r
+  @retval Other          Failed to create the TCP socket or configure it.\r
+\r
+**/\r
 EFI_STATUS\r
 Tcp4IoCreateSocket (\r
   IN EFI_HANDLE           Image,\r
@@ -60,28 +77,86 @@ Tcp4IoCreateSocket (
   IN TCP4_IO              *Tcp4Io\r
   );\r
 \r
+/**\r
+  Destroy the socket. \r
+\r
+  @param[in]  Tcp4Io The Tcp4Io which wraps the socket to be destroyeds.\r
+\r
+  @retval     None.\r
+\r
+**/\r
 VOID\r
 Tcp4IoDestroySocket (\r
   IN TCP4_IO  *Tcp4Io\r
   );\r
 \r
+/**\r
+  Connect to the other endpoint of the TCP socket.\r
+\r
+  @param  Tcp4Io[in]  The Tcp4Io wrapping the TCP socket.\r
+\r
+  @param  Timeout[in] The time to wait for connection done.\r
+\r
+  @retval None.\r
+\r
+**/\r
 EFI_STATUS\r
 Tcp4IoConnect (\r
   IN TCP4_IO    *Tcp4Io,\r
   IN EFI_EVENT  Timeout\r
   );\r
 \r
+/**\r
+  Reset the socket.\r
+\r
+  @param  Tcp4Io[in] The Tcp4Io wrapping the TCP socket.\r
+\r
+  @retval None.\r
+\r
+**/\r
 VOID\r
 Tcp4IoReset (\r
   IN TCP4_IO  *Tcp4Io\r
   );\r
 \r
+/**\r
+  Transmit the Packet to the other endpoint of the socket.\r
+\r
+  @param  Tcp4Io[in]           The Tcp4Io wrapping the TCP socket.\r
+\r
+  @param  Packet[in]           The packet to transmit\r
+\r
+  @retval EFI_SUCCESS          The packet is trasmitted.\r
+\r
+  @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r
+\r
+**/\r
 EFI_STATUS\r
 Tcp4IoTransmit (\r
   IN TCP4_IO  *Tcp4Io,\r
   IN NET_BUF  *Packet\r
   );\r
 \r
+/**\r
+  Receive data from the socket.\r
+\r
+  @param  Tcp4Io[in]           The Tcp4Io which wraps the socket to be destroyeds.\r
+\r
+  @param  Packet[in]           The buffer to hold the data copy from the soket rx buffer.\r
+\r
+  @param  AsyncMode[in]        Is this receive asyncronous or not.\r
+\r
+  @param  Timeout[in]          The time to wait for receiving the amount of data the Packet\r
+                               can hold.\r
+\r
+  @retval EFI_SUCCESS          The required amount of data is received from the socket.\r
+\r
+  @retval EFI_OUT_OF_RESOURCES Failed to allocate momery.\r
+\r
+  @retval EFI_TIMEOUT          Failed to receive the required amount of data in the\r
+                               specified time period.\r
+\r
+**/\r
 EFI_STATUS\r
 Tcp4IoReceive (\r
   IN TCP4_IO    *Tcp4Io,\r
index a86144b207bca41a00372ed54f3a2aa61ea3c9e3..b1aa888e24c3aaac044c4074aa7cbc8f1cfa6fdb 100644 (file)
@@ -1,6 +1,7 @@
-/*++\r
+/** @file\r
+  Implementation of MD5 algorithm\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
@@ -17,7 +18,7 @@ Abstract:
 \r
   Implementation of MD5 algorithm\r
 \r
---*/\r
+**/\r
 \r
 #include "Md5.h"\r
 \r
@@ -122,26 +123,19 @@ STATIC CONST MD5_TRANSFORM_FUNC MD5_F[] = {
   TF4\r
 };\r
 \r
+/**\r
+  Perform the MD5 transform on 64 bytes data segment\r
+\r
+  @param  Md5Ctx[in]  it includes the data segment for Md5 transform\r
+\r
+  @retval NONE.\r
+\r
+**/\r
 STATIC\r
 VOID\r
 MD5Transform (\r
   IN MD5_CTX  *Md5Ctx\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Md5Ctx  - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
-  GC_TODO: add return values\r
-\r
---*/\r
 {\r
   UINT32  i;\r
   UINT32  j;\r
@@ -177,6 +171,23 @@ Returns:
   }\r
 }\r
 \r
+/**\r
+  Copy data segment into the M field of MD5_CTX structure for later transform.\r
+  If the length of data segment is larger than 64 bytes, then does the transform\r
+  immediately and the generated Md5 code is stored in the States field of MD5_CTX\r
+  data struct for later accumulation. \r
+  All of Md5 code generated for the sequential 64-bytes data segaments are be\r
+  accumulated in MD5Final() function.\r
+\r
+  @param  Md5Ctx[in]  the data structure of storing the original data\r
+                      segment and the final result.\r
+\r
+  @param  Data[in]    the data wanted to be transformed\r
+\r
+  @param  DataLen[in] the length of data\r
+\r
+  @retval NONE.\r
+**/\r
 STATIC\r
 VOID\r
 MD5UpdateBlock (\r
@@ -184,23 +195,6 @@ MD5UpdateBlock (
   IN CONST UINT8  *Data,\r
   IN       UINTN  DataLen\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Md5Ctx  - GC_TODO: add argument description\r
-  Data    - GC_TODO: add argument description\r
-  DataLen - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
-  GC_TODO: add return values\r
-\r
---*/\r
 {\r
   UINTN Limit;\r
 \r
@@ -217,25 +211,18 @@ Returns:
   Md5Ctx->Count += DataLen;\r
 }\r
 \r
+/**\r
+  Initialize four 32-bits chaining variables and use them to do the Md5 transform.\r
+\r
+  @param  Md5Ctx[in]  the data structure of Md5\r
+\r
+  @retval EFI_SUCCESS initialization is ok\r
+\r
+**/\r
 EFI_STATUS\r
 MD5Init (\r
   IN MD5_CTX  *Md5Ctx\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Md5Ctx  - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS - GC_TODO: Add description for return value\r
-\r
---*/\r
 {\r
   ZeroMem (Md5Ctx, sizeof (*Md5Ctx));\r
 \r
@@ -250,29 +237,25 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  the external interface of Md5 algorithm\r
+\r
+  @param  Md5Ctx[in]  the data structure of storing the original data\r
+                      segment and the final result.\r
+\r
+  @param  Data[in]    the data wanted to be transformed.\r
+\r
+  @param  DataLen[in] the length of data.\r
+\r
+  @retval EFI_SUCCESS the transform is ok.\r
+\r
+**/\r
 EFI_STATUS\r
 MD5Update (\r
   IN  MD5_CTX  *Md5Ctx,\r
   IN  VOID     *Data,\r
   IN  UINTN    DataLen\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Md5Ctx  - GC_TODO: add argument description\r
-  Data    - GC_TODO: add argument description\r
-  DataLen - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS - GC_TODO: Add description for return value\r
-\r
---*/\r
 {\r
   if (EFI_ERROR (Md5Ctx->Status)) {\r
     return Md5Ctx->Status;\r
@@ -283,27 +266,23 @@ Returns:
   return EFI_SUCCESS;\r
 }\r
 \r
+/**\r
+  accumulate the MD5 value of every data segment and generate the finial\r
+  result according to MD5 algorithm\r
+\r
+  @param  Md5Ctx[in]   the data structure of storing the original data\r
+                       segment and the final result.\r
+\r
+  @param  HashVal[out] the final 128-bits output.\r
+\r
+  @retval EFI_SUCCESS  the transform is ok.\r
+\r
+**/\r
 EFI_STATUS\r
 MD5Final (\r
   IN  MD5_CTX  *Md5Ctx,\r
   OUT UINT8    *HashVal\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Md5Ctx  - GC_TODO: add argument description\r
-  HashVal - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS - GC_TODO: Add description for return value\r
-\r
---*/\r
 {\r
   UINTN PadLength;\r
 \r
index 365b5cbbe6ff43e53eb482397433dc95ae46d742..dd59626f3731369d559a5ecacbf0d017c659c54b 100644 (file)
@@ -1,4 +1,5 @@
-/*++\r
+/** @file\r
+  Header file for Md5\r
 \r
 Copyright (c) 2004 - 2008, Intel Corporation\r
 All rights reserved. This program and the accompanying materials\r
@@ -17,7 +18,7 @@ Abstract:
 \r
   Header file for Md5\r
 \r
---*/\r
+**/\r
 \r
 #ifndef _MD5_H_\r
 #define _MD5_H_\r
@@ -36,73 +37,58 @@ typedef struct _MD5_CTX {
   UINTN       Count;\r
 } MD5_CTX;\r
 \r
+/**\r
+  Initialize four 32-bits chaining variables and use them to do the Md5 transform.\r
+\r
+  @param  Md5Ctx[in]  the data structure of Md5\r
+\r
+  @retval EFI_SUCCESS initialization is ok\r
+\r
+**/\r
 EFI_STATUS\r
 MD5Init (\r
   IN MD5_CTX  *Md5Ctx\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  GC_TODO: Add function description\r
+;\r
 \r
-Arguments:\r
+/**\r
+  the external interface of Md5 algorithm\r
 \r
-  Md5Ctx  - GC_TODO: add argument description\r
+  @param  Md5Ctx[in]  the data structure of storing the original data\r
+                      segment and the final result.\r
 \r
-Returns:\r
+  @param  Data[in]    the data wanted to be transformed.\r
 \r
-  EFI_SUCCESS - GC_TODO: Add description for return value\r
+  @param  DataLen[in] the length of data.\r
 \r
---*/\r
-;\r
+  @retval EFI_SUCCESS the transform is ok.\r
 \r
+**/\r
 EFI_STATUS\r
 MD5Update (\r
   IN MD5_CTX  *Md5Ctx,\r
   IN VOID     *Data,\r
   IN UINTN    DataLen\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  GC_TODO: Add function description\r
-\r
-Arguments:\r
+;\r
 \r
-  Md5Ctx  - GC_TODO: add argument description\r
-  Data    - GC_TODO: add argument description\r
-  DataLen - GC_TODO: add argument description\r
+/**\r
+  accumulate the MD5 value of every data segment and generate the finial\r
+  result according to MD5 algorithm\r
 \r
-Returns:\r
+  @param  Md5Ctx[in]   the data structure of storing the original data\r
+                       segment and the final result.\r
 \r
-  EFI_SUCCESS - GC_TODO: Add description for return value\r
+  @param  HashVal[out] the final 128-bits output.\r
 \r
---*/\r
-;\r
+  @retval EFI_SUCCESS  the transform is ok.\r
 \r
+**/\r
 EFI_STATUS\r
 MD5Final (\r
   IN  MD5_CTX  *Md5Ctx,\r
   OUT UINT8    *HashVal\r
   )\r
-/*++\r
-\r
-Routine Description:\r
-\r
-  GC_TODO: Add function description\r
-\r
-Arguments:\r
-\r
-  Md5Ctx  - GC_TODO: add argument description\r
-  HashVal - GC_TODO: add argument description\r
-\r
-Returns:\r
-\r
-  EFI_SUCCESS - GC_TODO: Add description for return value\r
-\r
---*/\r
 ;\r
 \r
 #endif // _MD5_H\r