mpi_lan.h
上传用户:lgb322
上传日期:2013-02-24
资源大小:30529k
文件大小:9k
源码类别:

嵌入式Linux

开发平台:

Unix_Linux

  1. /*
  2.  *  Copyright (c) 2000-2001 LSI Logic Corporation.
  3.  *
  4.  *
  5.  *           Name:  MPI_LAN.H
  6.  *          Title:  MPI LAN messages and structures
  7.  *  Creation Date:  June 30, 2000
  8.  *
  9.  *    MPI Version:  01.01.03
  10.  *
  11.  *  Version History
  12.  *  ---------------
  13.  *
  14.  *  Date      Version   Description
  15.  *  --------  --------  ------------------------------------------------------
  16.  *  05-08-00  00.10.01  Original release for 0.10 spec dated 4/26/2000.
  17.  *  05-24-00  00.10.02  Added LANStatus field to _MSG_LAN_SEND_REPLY.
  18.  *                      Added LANStatus field to _MSG_LAN_RECEIVE_POST_REPLY.
  19.  *                      Moved ListCount field in _MSG_LAN_RECEIVE_POST_REPLY.
  20.  *  06-06-00  01.00.01  Update version number for 1.0 release.
  21.  *  06-12-00  01.00.02  Added MPI_ to BUCKETSTATUS_ definitions.
  22.  *  06-22-00  01.00.03  Major changes to match new LAN definition in 1.0 spec.
  23.  *  06-30-00  01.00.04  Added Context Reply definitions per revised proposal.
  24.  *                      Changed transaction context usage to bucket/buffer.
  25.  *  07-05-00  01.00.05  Removed LAN_RECEIVE_POST_BUCKET_CONTEXT_MASK definition
  26.  *                      to lan private header file
  27.  *  11-02-00  01.01.01  Original release for post 1.0 work
  28.  *  02-20-01  01.01.02  Started using MPI_POINTER.
  29.  *  03-27-01  01.01.03  Added structure offset comments.
  30.  *  --------------------------------------------------------------------------
  31.  */
  32. #ifndef MPI_LAN_H
  33. #define MPI_LAN_H
  34. /******************************************************************************
  35. *
  36. *               L A N    M e s s a g e s
  37. *
  38. *******************************************************************************/
  39. /* LANSend messages */
  40. typedef struct _MSG_LAN_SEND_REQUEST
  41. {
  42.     U16                     Reserved;           /* 00h */
  43.     U8                      ChainOffset;        /* 02h */
  44.     U8                      Function;           /* 03h */
  45.     U16                     Reserved2;          /* 04h */
  46.     U8                      PortNumber;         /* 06h */
  47.     U8                      MsgFlags;           /* 07h */
  48.     U32                     MsgContext;         /* 08h */
  49.     SGE_MPI_UNION           SG_List[1];         /* 0Ch */
  50. } MSG_LAN_SEND_REQUEST, MPI_POINTER PTR_MSG_LAN_SEND_REQUEST,
  51.   LANSendRequest_t, MPI_POINTER pLANSendRequest_t;
  52. typedef struct _MSG_LAN_SEND_REPLY
  53. {
  54.     U16                     Reserved;           /* 00h */
  55.     U8                      MsgLength;          /* 02h */
  56.     U8                      Function;           /* 03h */
  57.     U8                      Reserved2;          /* 04h */
  58.     U8                      NumberOfContexts;   /* 05h */
  59.     U8                      PortNumber;         /* 06h */
  60.     U8                      MsgFlags;           /* 07h */
  61.     U32                     MsgContext;         /* 08h */
  62.     U16                     Reserved3;          /* 0Ch */
  63.     U16                     IOCStatus;          /* 0Eh */
  64.     U32                     IOCLogInfo;         /* 10h */
  65.     U32                     BufferContext;      /* 14h */
  66. } MSG_LAN_SEND_REPLY, MPI_POINTER PTR_MSG_LAN_SEND_REPLY,
  67.   LANSendReply_t, MPI_POINTER pLANSendReply_t;
  68. /* LANReceivePost */
  69. typedef struct _MSG_LAN_RECEIVE_POST_REQUEST
  70. {
  71.     U16                     Reserved;           /* 00h */
  72.     U8                      ChainOffset;        /* 02h */
  73.     U8                      Function;           /* 03h */
  74.     U16                     Reserved2;          /* 04h */
  75.     U8                      PortNumber;         /* 06h */
  76.     U8                      MsgFlags;           /* 07h */
  77.     U32                     MsgContext;         /* 08h */
  78.     U32                     BucketCount;        /* 0Ch */
  79.     SGE_MPI_UNION           SG_List[1];         /* 10h */
  80. } MSG_LAN_RECEIVE_POST_REQUEST, MPI_POINTER PTR_MSG_LAN_RECEIVE_POST_REQUEST,
  81.   LANReceivePostRequest_t, MPI_POINTER pLANReceivePostRequest_t;
  82. typedef struct _MSG_LAN_RECEIVE_POST_REPLY
  83. {
  84.     U16                     Reserved;           /* 00h */
  85.     U8                      MsgLength;          /* 02h */
  86.     U8                      Function;           /* 03h */
  87.     U8                      Reserved2;          /* 04h */
  88.     U8                      NumberOfContexts;   /* 05h */
  89.     U8                      PortNumber;         /* 06h */
  90.     U8                      MsgFlags;           /* 07h */
  91.     U32                     MsgContext;         /* 08h */
  92.     U16                     Reserved3;          /* 0Ch */
  93.     U16                     IOCStatus;          /* 0Eh */
  94.     U32                     IOCLogInfo;         /* 10h */
  95.     U32                     BucketsRemaining;   /* 14h */
  96.     U32                     PacketOffset;       /* 18h */
  97.     U32                     PacketLength;       /* 1Ch */
  98.     U32                     BucketContext[1];   /* 20h */
  99. } MSG_LAN_RECEIVE_POST_REPLY, MPI_POINTER PTR_MSG_LAN_RECEIVE_POST_REPLY,
  100.   LANReceivePostReply_t, MPI_POINTER pLANReceivePostReply_t;
  101. /* LANReset */
  102. typedef struct _MSG_LAN_RESET_REQUEST
  103. {
  104.     U16                     Reserved;           /* 00h */
  105.     U8                      ChainOffset;        /* 02h */
  106.     U8                      Function;           /* 03h */
  107.     U16                     Reserved2;          /* 04h */
  108.     U8                      PortNumber;         /* 05h */
  109.     U8                      MsgFlags;           /* 07h */
  110.     U32                     MsgContext;         /* 08h */
  111. } MSG_LAN_RESET_REQUEST, MPI_POINTER PTR_MSG_LAN_RESET_REQUEST,
  112.   LANResetRequest_t, MPI_POINTER pLANResetRequest_t;
  113. typedef struct _MSG_LAN_RESET_REPLY
  114. {
  115.     U16                     Reserved;           /* 00h */
  116.     U8                      MsgLength;          /* 02h */
  117.     U8                      Function;           /* 03h */
  118.     U16                     Reserved2;          /* 04h */
  119.     U8                      PortNumber;         /* 06h */
  120.     U8                      MsgFlags;           /* 07h */
  121.     U32                     MsgContext;         /* 08h */
  122.     U16                     Reserved3;          /* 0Ch */
  123.     U16                     IOCStatus;          /* 0Eh */
  124.     U32                     IOCLogInfo;         /* 10h */
  125. } MSG_LAN_RESET_REPLY, MPI_POINTER PTR_MSG_LAN_RESET_REPLY,
  126.   LANResetReply_t, MPI_POINTER pLANResetReply_t;
  127. /****************************************************************************/
  128. /* LAN Context Reply defines and macros                                     */
  129. /****************************************************************************/
  130. #define LAN_REPLY_PACKET_LENGTH_MASK            (0x0000FFFF)
  131. #define LAN_REPLY_PACKET_LENGTH_SHIFT           (0)
  132. #define LAN_REPLY_BUCKET_CONTEXT_MASK           (0x07FF0000)
  133. #define LAN_REPLY_BUCKET_CONTEXT_SHIFT          (16)
  134. #define LAN_REPLY_BUFFER_CONTEXT_MASK           (0x07FFFFFF)
  135. #define LAN_REPLY_BUFFER_CONTEXT_SHIFT          (0)
  136. #define LAN_REPLY_FORM_MASK                     (0x18000000)
  137. #define LAN_REPLY_FORM_RECEIVE_SINGLE           (0x00)
  138. #define LAN_REPLY_FORM_RECEIVE_MULTIPLE         (0x01)
  139. #define LAN_REPLY_FORM_SEND_SINGLE              (0x02)
  140. #define LAN_REPLY_FORM_MESSAGE_CONTEXT          (0x03)
  141. #define LAN_REPLY_FORM_SHIFT                    (27)
  142. #define GET_LAN_PACKET_LENGTH(x)    (((x) & LAN_REPLY_PACKET_LENGTH_MASK)   
  143.                                         >> LAN_REPLY_PACKET_LENGTH_SHIFT)
  144. #define SET_LAN_PACKET_LENGTH(x, lth)                                       
  145.             ((x) = ((x) & ~LAN_REPLY_PACKET_LENGTH_MASK) |                  
  146.                             (((lth) << LAN_REPLY_PACKET_LENGTH_SHIFT) &     
  147.                                         LAN_REPLY_PACKET_LENGTH_MASK))
  148. #define GET_LAN_BUCKET_CONTEXT(x)   (((x) & LAN_REPLY_BUCKET_CONTEXT_MASK)  
  149.                                         >> LAN_REPLY_BUCKET_CONTEXT_SHIFT)
  150. #define SET_LAN_BUCKET_CONTEXT(x, ctx)                                      
  151.             ((x) = ((x) & ~LAN_REPLY_BUCKET_CONTEXT_MASK) |                 
  152.                             (((ctx) << LAN_REPLY_BUCKET_CONTEXT_SHIFT) &    
  153.                                         LAN_REPLY_BUCKET_CONTEXT_MASK))
  154. #define GET_LAN_BUFFER_CONTEXT(x)   (((x) & LAN_REPLY_BUFFER_CONTEXT_MASK)  
  155.                                         >> LAN_REPLY_BUFFER_CONTEXT_SHIFT)
  156. #define SET_LAN_BUFFER_CONTEXT(x, ctx)                                      
  157.             ((x) = ((x) & ~LAN_REPLY_BUFFER_CONTEXT_MASK) |                 
  158.                             (((ctx) << LAN_REPLY_BUFFER_CONTEXT_SHIFT) &    
  159.                                         LAN_REPLY_BUFFER_CONTEXT_MASK))
  160. #define GET_LAN_FORM(x)             (((x) & LAN_REPLY_FORM_MASK)            
  161.                                         >> LAN_REPLY_FORM_SHIFT)
  162. #define SET_LAN_FORM(x, frm)                                                
  163.             ((x) = ((x) & ~LAN_REPLY_FORM_MASK) |                           
  164.                             (((frm) << LAN_REPLY_FORM_SHIFT) &              
  165.                                         LAN_REPLY_FORM_MASK))
  166. /****************************************************************************/
  167. /* LAN Current Device State defines                                         */
  168. /****************************************************************************/
  169. #define MPI_LAN_DEVICE_STATE_RESET                     (0x00)
  170. #define MPI_LAN_DEVICE_STATE_OPERATIONAL               (0x01)
  171. /****************************************************************************/
  172. /* LAN Loopback defines                                                     */
  173. /****************************************************************************/
  174. #define MPI_LAN_TX_MODES_ENABLE_LOOPBACK_SUPPRESSION   (0x01)
  175. #endif