Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 /*
0003  *  Copyright (c) 2000-2008 LSI Corporation.
0004  *
0005  *
0006  *           Name:  mpi_lan.h
0007  *          Title:  MPI LAN messages and structures
0008  *  Creation Date:  June 30, 2000
0009  *
0010  *    mpi_lan.h Version:  01.05.01
0011  *
0012  *  Version History
0013  *  ---------------
0014  *
0015  *  Date      Version   Description
0016  *  --------  --------  ------------------------------------------------------
0017  *  05-08-00  00.10.01  Original release for 0.10 spec dated 4/26/2000.
0018  *  05-24-00  00.10.02  Added LANStatus field to _MSG_LAN_SEND_REPLY.
0019  *                      Added LANStatus field to _MSG_LAN_RECEIVE_POST_REPLY.
0020  *                      Moved ListCount field in _MSG_LAN_RECEIVE_POST_REPLY.
0021  *  06-06-00  01.00.01  Update version number for 1.0 release.
0022  *  06-12-00  01.00.02  Added MPI_ to BUCKETSTATUS_ definitions.
0023  *  06-22-00  01.00.03  Major changes to match new LAN definition in 1.0 spec.
0024  *  06-30-00  01.00.04  Added Context Reply definitions per revised proposal.
0025  *                      Changed transaction context usage to bucket/buffer.
0026  *  07-05-00  01.00.05  Removed LAN_RECEIVE_POST_BUCKET_CONTEXT_MASK definition
0027  *                      to lan private header file
0028  *  11-02-00  01.01.01  Original release for post 1.0 work
0029  *  02-20-01  01.01.02  Started using MPI_POINTER.
0030  *  03-27-01  01.01.03  Added structure offset comments.
0031  *  08-08-01  01.02.01  Original release for v1.2 work.
0032  *  05-11-04  01.03.01  Original release for MPI v1.3.
0033  *  08-19-04  01.05.01  Original release for MPI v1.5.
0034  *  --------------------------------------------------------------------------
0035  */
0036 
0037 #ifndef MPI_LAN_H
0038 #define MPI_LAN_H
0039 
0040 
0041 /******************************************************************************
0042 *
0043 *               L A N    M e s s a g e s
0044 *
0045 *******************************************************************************/
0046 
0047 /* LANSend messages */
0048 
0049 typedef struct _MSG_LAN_SEND_REQUEST
0050 {
0051     U16                     Reserved;           /* 00h */
0052     U8                      ChainOffset;        /* 02h */
0053     U8                      Function;           /* 03h */
0054     U16                     Reserved2;          /* 04h */
0055     U8                      PortNumber;         /* 06h */
0056     U8                      MsgFlags;           /* 07h */
0057     U32                     MsgContext;         /* 08h */
0058     SGE_MPI_UNION           SG_List[1];         /* 0Ch */
0059 } MSG_LAN_SEND_REQUEST, MPI_POINTER PTR_MSG_LAN_SEND_REQUEST,
0060   LANSendRequest_t, MPI_POINTER pLANSendRequest_t;
0061 
0062 
0063 typedef struct _MSG_LAN_SEND_REPLY
0064 {
0065     U16                     Reserved;           /* 00h */
0066     U8                      MsgLength;          /* 02h */
0067     U8                      Function;           /* 03h */
0068     U8                      Reserved2;          /* 04h */
0069     U8                      NumberOfContexts;   /* 05h */
0070     U8                      PortNumber;         /* 06h */
0071     U8                      MsgFlags;           /* 07h */
0072     U32                     MsgContext;         /* 08h */
0073     U16                     Reserved3;          /* 0Ch */
0074     U16                     IOCStatus;          /* 0Eh */
0075     U32                     IOCLogInfo;         /* 10h */
0076     U32                     BufferContext;      /* 14h */
0077 } MSG_LAN_SEND_REPLY, MPI_POINTER PTR_MSG_LAN_SEND_REPLY,
0078   LANSendReply_t, MPI_POINTER pLANSendReply_t;
0079 
0080 
0081 /* LANReceivePost */
0082 
0083 typedef struct _MSG_LAN_RECEIVE_POST_REQUEST
0084 {
0085     U16                     Reserved;           /* 00h */
0086     U8                      ChainOffset;        /* 02h */
0087     U8                      Function;           /* 03h */
0088     U16                     Reserved2;          /* 04h */
0089     U8                      PortNumber;         /* 06h */
0090     U8                      MsgFlags;           /* 07h */
0091     U32                     MsgContext;         /* 08h */
0092     U32                     BucketCount;        /* 0Ch */
0093     SGE_MPI_UNION           SG_List[1];         /* 10h */
0094 } MSG_LAN_RECEIVE_POST_REQUEST, MPI_POINTER PTR_MSG_LAN_RECEIVE_POST_REQUEST,
0095   LANReceivePostRequest_t, MPI_POINTER pLANReceivePostRequest_t;
0096 
0097 
0098 typedef struct _MSG_LAN_RECEIVE_POST_REPLY
0099 {
0100     U16                     Reserved;           /* 00h */
0101     U8                      MsgLength;          /* 02h */
0102     U8                      Function;           /* 03h */
0103     U8                      Reserved2;          /* 04h */
0104     U8                      NumberOfContexts;   /* 05h */
0105     U8                      PortNumber;         /* 06h */
0106     U8                      MsgFlags;           /* 07h */
0107     U32                     MsgContext;         /* 08h */
0108     U16                     Reserved3;          /* 0Ch */
0109     U16                     IOCStatus;          /* 0Eh */
0110     U32                     IOCLogInfo;         /* 10h */
0111     U32                     BucketsRemaining;   /* 14h */
0112     U32                     PacketOffset;       /* 18h */
0113     U32                     PacketLength;       /* 1Ch */
0114     U32                     BucketContext[1];   /* 20h */
0115 } MSG_LAN_RECEIVE_POST_REPLY, MPI_POINTER PTR_MSG_LAN_RECEIVE_POST_REPLY,
0116   LANReceivePostReply_t, MPI_POINTER pLANReceivePostReply_t;
0117 
0118 
0119 /* LANReset */
0120 
0121 typedef struct _MSG_LAN_RESET_REQUEST
0122 {
0123     U16                     Reserved;           /* 00h */
0124     U8                      ChainOffset;        /* 02h */
0125     U8                      Function;           /* 03h */
0126     U16                     Reserved2;          /* 04h */
0127     U8                      PortNumber;         /* 05h */
0128     U8                      MsgFlags;           /* 07h */
0129     U32                     MsgContext;         /* 08h */
0130 } MSG_LAN_RESET_REQUEST, MPI_POINTER PTR_MSG_LAN_RESET_REQUEST,
0131   LANResetRequest_t, MPI_POINTER pLANResetRequest_t;
0132 
0133 
0134 typedef struct _MSG_LAN_RESET_REPLY
0135 {
0136     U16                     Reserved;           /* 00h */
0137     U8                      MsgLength;          /* 02h */
0138     U8                      Function;           /* 03h */
0139     U16                     Reserved2;          /* 04h */
0140     U8                      PortNumber;         /* 06h */
0141     U8                      MsgFlags;           /* 07h */
0142     U32                     MsgContext;         /* 08h */
0143     U16                     Reserved3;          /* 0Ch */
0144     U16                     IOCStatus;          /* 0Eh */
0145     U32                     IOCLogInfo;         /* 10h */
0146 } MSG_LAN_RESET_REPLY, MPI_POINTER PTR_MSG_LAN_RESET_REPLY,
0147   LANResetReply_t, MPI_POINTER pLANResetReply_t;
0148 
0149 
0150 /****************************************************************************/
0151 /* LAN Context Reply defines and macros                                     */
0152 /****************************************************************************/
0153 
0154 #define LAN_REPLY_PACKET_LENGTH_MASK            (0x0000FFFF)
0155 #define LAN_REPLY_PACKET_LENGTH_SHIFT           (0)
0156 #define LAN_REPLY_BUCKET_CONTEXT_MASK           (0x07FF0000)
0157 #define LAN_REPLY_BUCKET_CONTEXT_SHIFT          (16)
0158 #define LAN_REPLY_BUFFER_CONTEXT_MASK           (0x07FFFFFF)
0159 #define LAN_REPLY_BUFFER_CONTEXT_SHIFT          (0)
0160 #define LAN_REPLY_FORM_MASK                     (0x18000000)
0161 #define LAN_REPLY_FORM_RECEIVE_SINGLE           (0x00)
0162 #define LAN_REPLY_FORM_RECEIVE_MULTIPLE         (0x01)
0163 #define LAN_REPLY_FORM_SEND_SINGLE              (0x02)
0164 #define LAN_REPLY_FORM_MESSAGE_CONTEXT          (0x03)
0165 #define LAN_REPLY_FORM_SHIFT                    (27)
0166 
0167 #define GET_LAN_PACKET_LENGTH(x)    (((x) & LAN_REPLY_PACKET_LENGTH_MASK)   \
0168                                         >> LAN_REPLY_PACKET_LENGTH_SHIFT)
0169 
0170 #define SET_LAN_PACKET_LENGTH(x, lth)                                       \
0171             ((x) = ((x) & ~LAN_REPLY_PACKET_LENGTH_MASK) |                  \
0172                             (((lth) << LAN_REPLY_PACKET_LENGTH_SHIFT) &     \
0173                                         LAN_REPLY_PACKET_LENGTH_MASK))
0174 
0175 #define GET_LAN_BUCKET_CONTEXT(x)   (((x) & LAN_REPLY_BUCKET_CONTEXT_MASK)  \
0176                                         >> LAN_REPLY_BUCKET_CONTEXT_SHIFT)
0177 
0178 #define SET_LAN_BUCKET_CONTEXT(x, ctx)                                      \
0179             ((x) = ((x) & ~LAN_REPLY_BUCKET_CONTEXT_MASK) |                 \
0180                             (((ctx) << LAN_REPLY_BUCKET_CONTEXT_SHIFT) &    \
0181                                         LAN_REPLY_BUCKET_CONTEXT_MASK))
0182 
0183 #define GET_LAN_BUFFER_CONTEXT(x)   (((x) & LAN_REPLY_BUFFER_CONTEXT_MASK)  \
0184                                         >> LAN_REPLY_BUFFER_CONTEXT_SHIFT)
0185 
0186 #define SET_LAN_BUFFER_CONTEXT(x, ctx)                                      \
0187             ((x) = ((x) & ~LAN_REPLY_BUFFER_CONTEXT_MASK) |                 \
0188                             (((ctx) << LAN_REPLY_BUFFER_CONTEXT_SHIFT) &    \
0189                                         LAN_REPLY_BUFFER_CONTEXT_MASK))
0190 
0191 #define GET_LAN_FORM(x)             (((x) & LAN_REPLY_FORM_MASK)            \
0192                                         >> LAN_REPLY_FORM_SHIFT)
0193 
0194 #define SET_LAN_FORM(x, frm)                                                \
0195             ((x) = ((x) & ~LAN_REPLY_FORM_MASK) |                           \
0196                             (((frm) << LAN_REPLY_FORM_SHIFT) &              \
0197                                         LAN_REPLY_FORM_MASK))
0198 
0199 
0200 /****************************************************************************/
0201 /* LAN Current Device State defines                                         */
0202 /****************************************************************************/
0203 
0204 #define MPI_LAN_DEVICE_STATE_RESET                     (0x00)
0205 #define MPI_LAN_DEVICE_STATE_OPERATIONAL               (0x01)
0206 
0207 
0208 /****************************************************************************/
0209 /* LAN Loopback defines                                                     */
0210 /****************************************************************************/
0211 
0212 #define MPI_LAN_TX_MODES_ENABLE_LOOPBACK_SUPPRESSION   (0x01)
0213 
0214 #endif
0215