]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.c
Patch to remove STATIC modifier. This is on longer recommended by EFI Framework codin...
[mirror_edk2.git] / MdeModulePkg / Universal / Network / IScsiDxe / IScsiProto.c
index 93b7f715e196404698a3c4659098e1d65484adfa..7db57506b9ba28f89f4610c673c21bf4d1e44462 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
+UINT32 mDataSegPad = 0;\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
@@ -275,7 +235,7 @@ Returns:
   Conn->CID             = Session->NextCID++;\r
 \r
   Status = gBS->CreateEvent (\r
-                  EFI_EVENT_TIMER,\r
+                  EVT_TIMER,\r
                   TPL_CALLBACK,\r
                   NULL,\r
                   NULL,\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