]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Universal/Network/IScsiDxe/IScsiProto.h
1)update function header coding style issue
[mirror_edk2.git] / MdeModulePkg / Universal / Network / IScsiDxe / IScsiProto.h
index 794ac40c3f9e8352fb377bc70a1c63d24dace05f..870e6ded449cd1e32031ecab5088f715b552f8c9 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   The header file of IScsi Protocol that defines many specific data structures.\r
 \r
-Copyright (c) 2004 - 2008, Intel Corporation\r
+Copyright (c) 2004 - 2008, Intel Corporation.<BR>\r
 All rights reserved. This program and the accompanying materials\r
 are licensed and made available under the terms and conditions of the BSD License\r
 which accompanies this distribution.  The full text of the license may be found at\r
@@ -10,14 +10,6 @@ http://opensource.org/licenses/bsd-license.php
 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 \r
-Module Name:\r
-\r
-  IScsiProto.h\r
-\r
-Abstract:\r
-\r
-  Protocol definitions for IScsi driver, mainly from RFC3720.\r
-\r
 **/\r
 \r
 #ifndef _ISCSI_PROTO_H_\r
@@ -31,13 +23,13 @@ Abstract:
 #define ISCSI_SEQ_EQ(s1, s2)  ((s1) == (s2))\r
 #define ISCSI_SEQ_LT(s1, s2) \\r
     ( \\r
-      (((INT32) (s1) < (INT32) (s2)) && (s2 - s1) < (1 << 31)) || \\r
-      (((INT32) (s1) > (INT32) (s2)) && (s1 - s2) > (1 << 31)) \\r
+      (((INT32) (s1) < (INT32) (s2)) && (s2 - s1) < ((UINT32) 1 << 31)) || \\r
+      (((INT32) (s1) > (INT32) (s2)) && (s1 - s2) > ((UINT32) 1 << 31)) \\r
     )\r
 #define ISCSI_SEQ_GT(s1, s2) \\r
     ( \\r
-      (((INT32) (s1) < (INT32) (s2)) && (s2 - s1) > (1 << 31)) || \\r
-      (((INT32) (s1) > (INT32) (s2)) && (s1 - s2) < (1 << 31)) \\r
+      (((INT32) (s1) < (INT32) (s2)) && (s2 - s1) > ((UINT32) 1 << 31)) || \\r
+      (((INT32) (s1) > (INT32) (s2)) && (s1 - s2) < ((UINT32) 1 << 31)) \\r
     )\r
 \r
 #define ISCSI_WELL_KNOWN_PORT                   3260\r
@@ -80,9 +72,9 @@ Abstract:
 \r
 #define ISCSI_KEY_VALUE_NONE                    "None"\r
 \r
-//\r
-// connection state for initiator\r
-//\r
+///\r
+/// connection state for initiator\r
+///\r
 typedef enum {\r
   CONN_STATE_FREE,\r
   CONN_STATE_XPT_WAIT,\r
@@ -94,9 +86,9 @@ typedef enum {
   CONN_STATE_IN_CLEANUP\r
 } CONNECTION_STATE;\r
 \r
-//\r
-// session state for initiator\r
-//\r
+///\r
+/// session state for initiator\r
+///\r
 typedef enum {\r
   SESSION_STATE_FREE,\r
   SESSION_STATE_LOGGED_IN,\r
@@ -174,9 +166,9 @@ typedef enum {
 \r
 #define ISCSI_BHS_FLAG_FINAL      0x80\r
 \r
-//\r
-// iSCSI Basic Header Segment\r
-//\r
+///\r
+/// iSCSI Basic Header Segment\r
+///\r
 typedef struct _ISCSI_BASIC_HEADER {\r
   UINT8   OpCode;\r
   UINT8   Flags;\r
@@ -221,9 +213,9 @@ typedef struct _ISCSI_BI_EXP_READ_DATA_LEN_AHS {
 #define ISCSI_TASK_ATTR_HOQ       0x03\r
 #define ISCSI_TASK_ATTR_ACA       0x04\r
 \r
-//\r
-// SCSI Command\r
-//\r
+///\r
+/// SCSI Command\r
+///\r
 typedef struct _SCSI_COMMAND {\r
   UINT8   OpCode;\r
   UINT8   Flags;\r
@@ -252,9 +244,9 @@ typedef struct _SCSI_COMMAND {
 #define ISCSI_SERVICE_RSP_COMMAND_COMPLETE_AT_TARGET  0x00\r
 #define ISCSI_SERVICE_RSP_TARGET_FAILURE              0x01\r
 \r
-//\r
-// SCSI Response\r
-//\r
+///\r
+/// SCSI Response\r
+///\r
 typedef struct _SCSI_RESPONSE {\r
   UINT8   OpCode;\r
   UINT8   Flags;\r
@@ -278,9 +270,9 @@ typedef struct _ISCSI_SENSE_DATA {
   UINT8   Data[2];\r
 } ISCSI_SENSE_DATA;\r
 \r
-//\r
-// iSCSI Task Managment Function Request\r
-//\r
+///\r
+/// iSCSI Task Managment Function Request\r
+///\r
 typedef struct _ISCSI_TMF_REQUEST {\r
   UINT8   OpCode;\r
   UINT8   Fuction;\r
@@ -306,9 +298,9 @@ typedef struct _ISCSI_TMF_REQUEST {
 #define ISCSI_TMF_RSP_PDU_RSP_FUNCTION_AHTH_FAILED        6\r
 #define ISCSI_TMF_RSP_PDU_RSP_FUNCTION_REJECTED           255\r
 \r
-//\r
-// iSCSI Task Management Function Response\r
-//\r
+///\r
+/// iSCSI Task Management Function Response\r
+///\r
 typedef struct _ISCSI_TMF_RESPONSE {\r
   UINT8   OpCode;\r
   UINT8   Reserved1;\r
@@ -325,9 +317,9 @@ typedef struct _ISCSI_TMF_RESPONSE {
   UINT32  Reserved[3];\r
 } ISCSI_TMF_RESPONSE;\r
 \r
-//\r
-// SCSI Data-Out\r
-//\r
+///\r
+/// SCSI Data-Out\r
+///\r
 typedef struct _ISCSI_SCSI_DATA_OUT {\r
   UINT8   OpCode;\r
   UINT8   Reserved1[3];\r
@@ -348,9 +340,10 @@ typedef struct _ISCSI_SCSI_DATA_OUT {
 #define SCSI_DATA_IN_PDU_FLAG_OVERFLOW      SCSI_RSP_PDU_FLAG_OVERFLOW\r
 #define SCSI_DATA_IN_PDU_FLAG_UNDERFLOW     SCSI_RSP_PDU_FLAG_UNDERFLOW\r
 #define SCSI_DATA_IN_PDU_FLAG_STATUS_VALID  0x01\r
-//\r
-// SCSI Data-In\r
-//\r
+\r
+///\r
+/// SCSI Data-In\r
+///\r
 typedef struct _ISCSI_SCSI_DATA_IN {\r
   UINT8   OpCode;\r
   UINT8   Flags;\r
@@ -370,9 +363,10 @@ typedef struct _ISCSI_SCSI_DATA_IN {
 } ISCSI_SCSI_DATA_IN;\r
 \r
 #define ISCSI_GET_BUFFER_OFFSET(PduHdr) NTOHL (((ISCSI_SCSI_DATA_IN *) (PduHdr))->BufferOffset)\r
-//\r
-// Ready To Transfer\r
-//\r
+\r
+///\r
+/// Ready To Transfer\r
+///\r
 typedef struct _ISCSI_READY_TO_TRANSFER {\r
   UINT8   OpCode;\r
   UINT8   Reserved1[3];\r
@@ -411,9 +405,9 @@ typedef struct _ISCSI_ASYNC_MESSAGE {
 #define ISCSI_LOGIN_REQ_PDU_FLAG_TRANSIT  0x80\r
 #define ISCSI_LOGIN_REQ_PDU_FLAG_CONTINUE 0x40\r
 \r
-//\r
-// Login Request\r
-//\r
+///\r
+/// Login Request\r
+///\r
 typedef struct _ISCSI_LOGIN_REQUEST {\r
   UINT8   OpCode;\r
   UINT8   Flags;\r
@@ -439,9 +433,9 @@ typedef struct _ISCSI_LOGIN_REQUEST {
 #define ISCSI_LOGIN_STATUS_INITIATOR_ERROR  2\r
 #define ISCSI_LOGIN_STATUS_TARGET_ERROR     3\r
 \r
-//\r
-// Login Response\r
-//\r
+///\r
+/// Login Response\r
+///\r
 typedef struct _ISCSI_LOGIN_RESPONSE {\r
   UINT8   OpCode;\r
   UINT8   Flags;\r
@@ -465,9 +459,9 @@ typedef struct _ISCSI_LOGIN_RESPONSE {
 #define ISCSI_LOGOUT_REASON_CLOSE_CONNECTION                1\r
 #define ISCSI_LOGOUT_REASON_REMOVE_CONNECTION_FOR_RECOVERY  2\r
 \r
-//\r
-// Logout Request\r
-//\r
+///\r
+/// Logout Request\r
+///\r
 typedef struct _ISCSI_LOGOUT_REQUEST {\r
   UINT8   OpCode;\r
   UINT8   ReasonCode;\r
@@ -488,9 +482,9 @@ typedef struct _ISCSI_LOGOUT_REQUEST {
 #define ISCSI_LOGOUT_RESPONSE_RECOVERY_NOT_SUPPORTED  2\r
 #define ISCSI_LOGOUT_RESPONSE_CLEANUP_FAILED          3\r
 \r
-//\r
-// Logout Response\r
-//\r
+///\r
+/// Logout Response\r
+///\r
 typedef struct _ISCSI_LOGOUT_RESPONSE {\r
   UINT8   OpCode;\r
   UINT8   Reserved1;\r
@@ -515,9 +509,9 @@ typedef struct _ISCSI_LOGOUT_RESPONSE {
 #define ISCSI_SNACK_REQUEST_TYPE_DATA_ACK     2\r
 #define ISCSI_SNACK_REQUEST_TYPE_RDATA        3\r
 \r
-//\r
-// SNACK Request\r
-//\r
+///\r
+/// SNACK Request\r
+///\r
 typedef struct _ISCSI_SNACK_REQUEST {\r
   UINT8   OpCode;\r
   UINT8   Type;\r
@@ -534,9 +528,9 @@ typedef struct _ISCSI_SNACK_REQUEST {
   UINT32  RunLength;\r
 } ISCSI_SNACK_REQUEST;\r
 \r
-//\r
-// Reject\r
-//\r
+///\r
+/// Reject\r
+///\r
 typedef struct _ISCSI_REJECT {\r
   UINT8   OpCode;\r
   UINT8   Reserved1;\r
@@ -554,9 +548,9 @@ typedef struct _ISCSI_REJECT {
   UINT32  Reserved5[2];\r
 } ISCSI_REJECT;\r
 \r
-//\r
-// NOP-Out\r
-//\r
+///\r
+/// NOP-Out\r
+///\r
 typedef struct _ISCSI_NOP_OUT {\r
   UINT8   OpCode;\r
   UINT8   Reserved1[3];\r
@@ -570,9 +564,9 @@ typedef struct _ISCSI_NOP_OUT {
   UINT32  Reserved2[4];\r
 } ISCSI_NOP_OUT;\r
 \r
-//\r
-// NOP-In\r
-//\r
+///\r
+/// NOP-In\r
+///\r
 typedef struct _ISCSI_NOP_IN {\r
   UINT8   OpCode;\r
   UINT8   Reserved1[3];\r
@@ -634,18 +628,11 @@ typedef struct _ISCSI_KEY_VALUE_PAIR {
   CHAR8           *Value;\r
 } ISCSI_KEY_VALUE_PAIR;\r
 \r
-//\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
+  @param[in]  Session The iSCSI session.\r
+  @param[in]  Conn    The iSCSI connection.\r
 **/\r
 VOID\r
 IScsiAttatchConnection (\r
@@ -656,10 +643,7 @@ IScsiAttatchConnection (
 /**\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
+  @param[in]  Conn The iSCSI connection.\r
 **/\r
 VOID\r
 IScsiDetatchConnection (\r
@@ -669,14 +653,11 @@ IScsiDetatchConnection (
 /**\r
   This function does the iSCSI connection login.\r
 \r
-  @param  Conn[in]           The iSCSI connection to login.\r
+  @param[in]  Conn           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
+  @retval Others             Other errors as indicated.  \r
 **/\r
 EFI_STATUS\r
 IScsiConnLogin (\r
@@ -686,14 +667,12 @@ IScsiConnLogin (
 /**\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
+  @param[in]  Private The iSCSI driver data.\r
+  @param[in]  Session Maximum CmdSN from the target.\r
 \r
+  @return The newly created iSCSI connection.\r
 **/\r
-ISCSI_CONNECTION  *\r
+ISCSI_CONNECTION *\r
 IScsiCreateConnection (\r
   IN ISCSI_DRIVER_DATA  *Private,\r
   IN ISCSI_SESSION      *Session\r
@@ -702,10 +681,7 @@ IScsiCreateConnection (
 /**\r
   Destroy an iSCSI connection.\r
 \r
-  @param  Conn[in] The connection to destroy.\r
-\r
-  @retval None.\r
-\r
+  @param[in]  Conn The connection to destroy.\r
 **/\r
 VOID\r
 IScsiDestroyConnection (\r
@@ -715,14 +691,11 @@ IScsiDestroyConnection (
 /**\r
   Login the iSCSI session.\r
 \r
-  @param  Private[in]          The iSCSI driver data.\r
+  @param[in]  Private          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
+  @retval Others               Other errors as indicated.\r
 **/\r
 EFI_STATUS\r
 IScsiSessionLogin (\r
@@ -733,15 +706,12 @@ IScsiSessionLogin (
   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
+  @param[in]  Conn             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
+  @retval EFI_DEVICE_ERROR     Some kind of device error happened.\r
 **/\r
 EFI_STATUS\r
 IScsiSendLoginReq (\r
@@ -751,14 +721,10 @@ IScsiSendLoginReq (
 /**\r
   Receive and process the iSCSI login response.\r
 \r
-  @param  Conn[in]             The connection in the iSCSI login phase.\r
-\r
+  @param[in]  Conn             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
+  @retval Others               Other errors as indicated.\r
 **/\r
 EFI_STATUS\r
 IScsiReceiveLoginRsp (\r
@@ -770,19 +736,15 @@ IScsiReceiveLoginRsp (
   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
+  @param[in]  Pdu              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
+  @param[in]  Key              The key name string.\r
+  @param[in]  Value            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
@@ -794,10 +756,10 @@ IScsiAddKeyValuePair (
 /**\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
+  @param[in]  Conn The connection in the iSCSI login phase.\r
 \r
+  @return The pointer to the net buffer containing the iSCSI login request built.\r
+  @retval Others    Other errors as indicated.\r
 **/\r
 NET_BUF *\r
 IScsiPrepareLoginReq (\r
@@ -807,14 +769,13 @@ IScsiPrepareLoginReq (
 /**\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
+  @param[in]  Conn The connection on which the iSCSI login response is received.\r
+  @param[in]  Pdu  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
+  @retval EFI_MEDIA_CHANGED  Target is redirected.\r
+  @retval Others             Other errors as indicated.\r
 **/\r
 EFI_STATUS\r
 IScsiProcessLoginRsp (\r
@@ -826,19 +787,15 @@ IScsiProcessLoginRsp (
   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
+  @param[in] Session          The iSCSI session.\r
+  @param[in] Data             The data segment which should contain the\r
+                              TargetAddress key-value list.\r
+  @param[in] Len              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
+  @retval Others               Other errors as indicated.\r
 **/\r
 EFI_STATUS\r
 IScsiUpdateTargetAddress (\r
@@ -850,10 +807,7 @@ IScsiUpdateTargetAddress (
 /**\r
   The callback function to free the net buffer list.\r
 \r
-  @param  Arg[in] The opaque parameter.\r
-\r
-  @retval None.\r
-\r
+  @param[in]  Arg The opaque parameter.\r
 **/\r
 VOID\r
 IScsiFreeNbufList (\r
@@ -866,23 +820,18 @@ IScsiFreeNbufList (
   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
+  @param[in]   Conn        The iSCSI connection to receive data from.\r
+  @param[out]  Pdu         The received iSCSI pdu.\r
+  @param[in]   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
+  @param[in]  HeaderDigest Whether there will be header digest received.\r
+  @param[in]  DataDigest   Whether there will be data digest.\r
+  @param[in]  TimeoutEvent The timeout event, 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
+  @retval EFI_SUCCESS          An iSCSI pdu is received.\r
+  @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r
+  @retval EFI_PROTOCOL_ERROR   Some kind of iSCSI protocol error happened.\r
+  @retval Others               Other errors as indicated.\r
 **/\r
 EFI_STATUS\r
 IScsiReceivePdu (\r
@@ -897,14 +846,12 @@ IScsiReceivePdu (
 /**\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
+  @param[in]  Conn          The connection in iSCSI login.\r
+  @param[in]  Transit       Whether need transit.\r
 \r
+  @retval EFI_SUCCESS          The parmeter check is passed and negotiation is finished.\r
+  @retval EFI_PROTOCOL_ERROR   Some kind of iSCSI protocol error happened.\r
+  @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r
 **/\r
 EFI_STATUS\r
 IScsiCheckOpParams (\r
@@ -915,14 +862,10 @@ IScsiCheckOpParams (
 /**\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
+  @param[in]  Conn            The connection in iSCSI login.\r
+  @param[in]  Pdu             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
@@ -933,15 +876,12 @@ IScsiFillOpParams (
 /**\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
+  @param[in]   Pdu             The iSCSI pdu which contains segments to pad.\r
+  @param[in]   Len             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
@@ -952,12 +892,11 @@ IScsiPadSegment (
 /**\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
+  @param[in]  Data The data segment containing the key-value pairs.\r
+  @param[in]  Len  Length of the data segment.\r
 \r
+  @return The key-value list.\r
+  @retval NULL Other errors as indicated.\r
 **/\r
 LIST_ENTRY *\r
 IScsiBuildKeyValueList (\r
@@ -969,12 +908,10 @@ IScsiBuildKeyValueList (
   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
+  @param[in]  KeyValueList The key-value list.\r
+  @param[in]  Key          The key name to find.\r
 \r
+  @return The value string.\r
 **/\r
 CHAR8 *\r
 IScsiGetValueByKeyFromList (\r
@@ -985,10 +922,7 @@ IScsiGetValueByKeyFromList (
 /**\r
   Free the key-value list.\r
 \r
-  @param  KeyValueList[in] The key-value list.\r
-  \r
-  @retval None.\r
-\r
+  @param[in]  KeyValueList The key-value list.\r
 **/\r
 VOID\r
 IScsiFreeKeyValueList (\r
@@ -998,14 +932,11 @@ IScsiFreeKeyValueList (
 /**\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
+  @param[in]  Name          The iSCSI name.\r
+  @param[in]  Len           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
@@ -1016,20 +947,17 @@ IScsiNormalizeName (
 /**\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
+  @param[in]       PassThru  The EXT SCSI PASS THRU protocol.\r
+  @param[in]       Target    The target ID.\r
+  @param[in]       Lun       The LUN.\r
+  @param[in, out]  Packet    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
+  @retval EFI_DEVICE_ERROR     Other errors as indicated.\r
+  @retval EFI_OUT_OF_RESOURCES Failed to allocate memory.\r
+  @retval Others               Other errors as indicated.\r
 **/\r
 EFI_STATUS\r
 IScsiExecuteScsiCommand (\r
@@ -1042,12 +970,10 @@ IScsiExecuteScsiCommand (
 /**\r
   Reinstate the session on some error.\r
 \r
-  @param  Private[in] The iSCSI driver data.\r
+  @param[in]  Private The iSCSI driver data.\r
 \r
   @retval EFI_SUCCES  The session is reinstated from some error.\r
-\r
-  @retval other       Reinstatement failed.\r
-\r
+  @retval Other       Reinstatement failed.\r
 **/\r
 EFI_STATUS\r
 IScsiSessionReinstatement (\r
@@ -1057,27 +983,22 @@ IScsiSessionReinstatement (
 /**\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
+  @param[in, out]  Session  The iSCSI session.\r
+  @param[in]       Recovery Whether the request is from a fresh new start or recovery.\r
 **/\r
 VOID\r
 IScsiSessionInit (\r
-  IN ISCSI_SESSION  *Session,\r
-  IN BOOLEAN        Recovery\r
+  IN OUT ISCSI_SESSION  *Session,\r
+  IN BOOLEAN            Recovery\r
   );\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
+  @param[in]  Session The iSCSI session.\r
 \r
   @retval EFI_SUCCES  The session is aborted.\r
-\r
 **/\r
 EFI_STATUS\r
 IScsiSessionAbort (\r