mpi_lan.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:9k
源码类别:

Linux/Unix编程

开发平台:

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.02.01
  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.  *  08-08-01  01.02.01  Original release for v1.2 work.
  31.  *  --------------------------------------------------------------------------
  32.  */
  33. #ifndef MPI_LAN_H
  34. #define MPI_LAN_H
  35. /******************************************************************************
  36. *
  37. *               L A N    M e s s a g e s
  38. *
  39. *******************************************************************************/
  40. /* LANSend messages */
  41. typedef struct _MSG_LAN_SEND_REQUEST
  42. {
  43.     U16                     Reserved;           /* 00h */
  44.     U8                      ChainOffset;        /* 02h */
  45.     U8                      Function;           /* 03h */
  46.     U16                     Reserved2;          /* 04h */
  47.     U8                      PortNumber;         /* 06h */
  48.     U8                      MsgFlags;           /* 07h */
  49.     U32                     MsgContext;         /* 08h */
  50.     SGE_MPI_UNION           SG_List[1];         /* 0Ch */
  51. } MSG_LAN_SEND_REQUEST, MPI_POINTER PTR_MSG_LAN_SEND_REQUEST,
  52.   LANSendRequest_t, MPI_POINTER pLANSendRequest_t;
  53. typedef struct _MSG_LAN_SEND_REPLY
  54. {
  55.     U16                     Reserved;           /* 00h */
  56.     U8                      MsgLength;          /* 02h */
  57.     U8                      Function;           /* 03h */
  58.     U8                      Reserved2;          /* 04h */
  59.     U8                      NumberOfContexts;   /* 05h */
  60.     U8                      PortNumber;         /* 06h */
  61.     U8                      MsgFlags;           /* 07h */
  62.     U32                     MsgContext;         /* 08h */
  63.     U16                     Reserved3;          /* 0Ch */
  64.     U16                     IOCStatus;          /* 0Eh */
  65.     U32                     IOCLogInfo;         /* 10h */
  66.     U32                     BufferContext;      /* 14h */
  67. } MSG_LAN_SEND_REPLY, MPI_POINTER PTR_MSG_LAN_SEND_REPLY,
  68.   LANSendReply_t, MPI_POINTER pLANSendReply_t;
  69. /* LANReceivePost */
  70. typedef struct _MSG_LAN_RECEIVE_POST_REQUEST
  71. {
  72.     U16                     Reserved;           /* 00h */
  73.     U8                      ChainOffset;        /* 02h */
  74.     U8                      Function;           /* 03h */
  75.     U16                     Reserved2;          /* 04h */
  76.     U8                      PortNumber;         /* 06h */
  77.     U8                      MsgFlags;           /* 07h */
  78.     U32                     MsgContext;         /* 08h */
  79.     U32                     BucketCount;        /* 0Ch */
  80.     SGE_MPI_UNION           SG_List[1];         /* 10h */
  81. } MSG_LAN_RECEIVE_POST_REQUEST, MPI_POINTER PTR_MSG_LAN_RECEIVE_POST_REQUEST,
  82.   LANReceivePostRequest_t, MPI_POINTER pLANReceivePostRequest_t;
  83. typedef struct _MSG_LAN_RECEIVE_POST_REPLY
  84. {
  85.     U16                     Reserved;           /* 00h */
  86.     U8                      MsgLength;          /* 02h */
  87.     U8                      Function;           /* 03h */
  88.     U8                      Reserved2;          /* 04h */
  89.     U8                      NumberOfContexts;   /* 05h */
  90.     U8                      PortNumber;         /* 06h */
  91.     U8                      MsgFlags;           /* 07h */
  92.     U32                     MsgContext;         /* 08h */
  93.     U16                     Reserved3;          /* 0Ch */
  94.     U16                     IOCStatus;          /* 0Eh */
  95.     U32                     IOCLogInfo;         /* 10h */
  96.     U32                     BucketsRemaining;   /* 14h */
  97.     U32                     PacketOffset;       /* 18h */
  98.     U32                     PacketLength;       /* 1Ch */
  99.     U32                     BucketContext[1];   /* 20h */
  100. } MSG_LAN_RECEIVE_POST_REPLY, MPI_POINTER PTR_MSG_LAN_RECEIVE_POST_REPLY,
  101.   LANReceivePostReply_t, MPI_POINTER pLANReceivePostReply_t;
  102. /* LANReset */
  103. typedef struct _MSG_LAN_RESET_REQUEST
  104. {
  105.     U16                     Reserved;           /* 00h */
  106.     U8                      ChainOffset;        /* 02h */
  107.     U8                      Function;           /* 03h */
  108.     U16                     Reserved2;          /* 04h */
  109.     U8                      PortNumber;         /* 05h */
  110.     U8                      MsgFlags;           /* 07h */
  111.     U32                     MsgContext;         /* 08h */
  112. } MSG_LAN_RESET_REQUEST, MPI_POINTER PTR_MSG_LAN_RESET_REQUEST,
  113.   LANResetRequest_t, MPI_POINTER pLANResetRequest_t;
  114. typedef struct _MSG_LAN_RESET_REPLY
  115. {
  116.     U16                     Reserved;           /* 00h */
  117.     U8                      MsgLength;          /* 02h */
  118.     U8                      Function;           /* 03h */
  119.     U16                     Reserved2;          /* 04h */
  120.     U8                      PortNumber;         /* 06h */
  121.     U8                      MsgFlags;           /* 07h */
  122.     U32                     MsgContext;         /* 08h */
  123.     U16                     Reserved3;          /* 0Ch */
  124.     U16                     IOCStatus;          /* 0Eh */
  125.     U32                     IOCLogInfo;         /* 10h */
  126. } MSG_LAN_RESET_REPLY, MPI_POINTER PTR_MSG_LAN_RESET_REPLY,
  127.   LANResetReply_t, MPI_POINTER pLANResetReply_t;
  128. /****************************************************************************/
  129. /* LAN Context Reply defines and macros                                     */
  130. /****************************************************************************/
  131. #define LAN_REPLY_PACKET_LENGTH_MASK            (0x0000FFFF)
  132. #define LAN_REPLY_PACKET_LENGTH_SHIFT           (0)
  133. #define LAN_REPLY_BUCKET_CONTEXT_MASK           (0x07FF0000)
  134. #define LAN_REPLY_BUCKET_CONTEXT_SHIFT          (16)
  135. #define LAN_REPLY_BUFFER_CONTEXT_MASK           (0x07FFFFFF)
  136. #define LAN_REPLY_BUFFER_CONTEXT_SHIFT          (0)
  137. #define LAN_REPLY_FORM_MASK                     (0x18000000)
  138. #define LAN_REPLY_FORM_RECEIVE_SINGLE           (0x00)
  139. #define LAN_REPLY_FORM_RECEIVE_MULTIPLE         (0x01)
  140. #define LAN_REPLY_FORM_SEND_SINGLE              (0x02)
  141. #define LAN_REPLY_FORM_MESSAGE_CONTEXT          (0x03)
  142. #define LAN_REPLY_FORM_SHIFT                    (27)
  143. #define GET_LAN_PACKET_LENGTH(x)    (((x) & LAN_REPLY_PACKET_LENGTH_MASK)   
  144.                                         >> LAN_REPLY_PACKET_LENGTH_SHIFT)
  145. #define SET_LAN_PACKET_LENGTH(x, lth)                                       
  146.             ((x) = ((x) & ~LAN_REPLY_PACKET_LENGTH_MASK) |                  
  147.                             (((lth) << LAN_REPLY_PACKET_LENGTH_SHIFT) &     
  148.                                         LAN_REPLY_PACKET_LENGTH_MASK))
  149. #define GET_LAN_BUCKET_CONTEXT(x)   (((x) & LAN_REPLY_BUCKET_CONTEXT_MASK)  
  150.                                         >> LAN_REPLY_BUCKET_CONTEXT_SHIFT)
  151. #define SET_LAN_BUCKET_CONTEXT(x, ctx)                                      
  152.             ((x) = ((x) & ~LAN_REPLY_BUCKET_CONTEXT_MASK) |                 
  153.                             (((ctx) << LAN_REPLY_BUCKET_CONTEXT_SHIFT) &    
  154.                                         LAN_REPLY_BUCKET_CONTEXT_MASK))
  155. #define GET_LAN_BUFFER_CONTEXT(x)   (((x) & LAN_REPLY_BUFFER_CONTEXT_MASK)  
  156.                                         >> LAN_REPLY_BUFFER_CONTEXT_SHIFT)
  157. #define SET_LAN_BUFFER_CONTEXT(x, ctx)                                      
  158.             ((x) = ((x) & ~LAN_REPLY_BUFFER_CONTEXT_MASK) |                 
  159.                             (((ctx) << LAN_REPLY_BUFFER_CONTEXT_SHIFT) &    
  160.                                         LAN_REPLY_BUFFER_CONTEXT_MASK))
  161. #define GET_LAN_FORM(x)             (((x) & LAN_REPLY_FORM_MASK)            
  162.                                         >> LAN_REPLY_FORM_SHIFT)
  163. #define SET_LAN_FORM(x, frm)                                                
  164.             ((x) = ((x) & ~LAN_REPLY_FORM_MASK) |                           
  165.                             (((frm) << LAN_REPLY_FORM_SHIFT) &              
  166.                                         LAN_REPLY_FORM_MASK))
  167. /****************************************************************************/
  168. /* LAN Current Device State defines                                         */
  169. /****************************************************************************/
  170. #define MPI_LAN_DEVICE_STATE_RESET                     (0x00)
  171. #define MPI_LAN_DEVICE_STATE_OPERATIONAL               (0x01)
  172. /****************************************************************************/
  173. /* LAN Loopback defines                                                     */
  174. /****************************************************************************/
  175. #define MPI_LAN_TX_MODES_ENABLE_LOOPBACK_SUPPRESSION   (0x01)
  176. #endif