18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0 */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci *  Copyright (c) 2000-2008 LSI Corporation.
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci *
68c2ecf20Sopenharmony_ci *           Name:  mpi_lan.h
78c2ecf20Sopenharmony_ci *          Title:  MPI LAN messages and structures
88c2ecf20Sopenharmony_ci *  Creation Date:  June 30, 2000
98c2ecf20Sopenharmony_ci *
108c2ecf20Sopenharmony_ci *    mpi_lan.h Version:  01.05.01
118c2ecf20Sopenharmony_ci *
128c2ecf20Sopenharmony_ci *  Version History
138c2ecf20Sopenharmony_ci *  ---------------
148c2ecf20Sopenharmony_ci *
158c2ecf20Sopenharmony_ci *  Date      Version   Description
168c2ecf20Sopenharmony_ci *  --------  --------  ------------------------------------------------------
178c2ecf20Sopenharmony_ci *  05-08-00  00.10.01  Original release for 0.10 spec dated 4/26/2000.
188c2ecf20Sopenharmony_ci *  05-24-00  00.10.02  Added LANStatus field to _MSG_LAN_SEND_REPLY.
198c2ecf20Sopenharmony_ci *                      Added LANStatus field to _MSG_LAN_RECEIVE_POST_REPLY.
208c2ecf20Sopenharmony_ci *                      Moved ListCount field in _MSG_LAN_RECEIVE_POST_REPLY.
218c2ecf20Sopenharmony_ci *  06-06-00  01.00.01  Update version number for 1.0 release.
228c2ecf20Sopenharmony_ci *  06-12-00  01.00.02  Added MPI_ to BUCKETSTATUS_ definitions.
238c2ecf20Sopenharmony_ci *  06-22-00  01.00.03  Major changes to match new LAN definition in 1.0 spec.
248c2ecf20Sopenharmony_ci *  06-30-00  01.00.04  Added Context Reply definitions per revised proposal.
258c2ecf20Sopenharmony_ci *                      Changed transaction context usage to bucket/buffer.
268c2ecf20Sopenharmony_ci *  07-05-00  01.00.05  Removed LAN_RECEIVE_POST_BUCKET_CONTEXT_MASK definition
278c2ecf20Sopenharmony_ci *                      to lan private header file
288c2ecf20Sopenharmony_ci *  11-02-00  01.01.01  Original release for post 1.0 work
298c2ecf20Sopenharmony_ci *  02-20-01  01.01.02  Started using MPI_POINTER.
308c2ecf20Sopenharmony_ci *  03-27-01  01.01.03  Added structure offset comments.
318c2ecf20Sopenharmony_ci *  08-08-01  01.02.01  Original release for v1.2 work.
328c2ecf20Sopenharmony_ci *  05-11-04  01.03.01  Original release for MPI v1.3.
338c2ecf20Sopenharmony_ci *  08-19-04  01.05.01  Original release for MPI v1.5.
348c2ecf20Sopenharmony_ci *  --------------------------------------------------------------------------
358c2ecf20Sopenharmony_ci */
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci#ifndef MPI_LAN_H
388c2ecf20Sopenharmony_ci#define MPI_LAN_H
398c2ecf20Sopenharmony_ci
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ci/******************************************************************************
428c2ecf20Sopenharmony_ci*
438c2ecf20Sopenharmony_ci*               L A N    M e s s a g e s
448c2ecf20Sopenharmony_ci*
458c2ecf20Sopenharmony_ci*******************************************************************************/
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci/* LANSend messages */
488c2ecf20Sopenharmony_ci
498c2ecf20Sopenharmony_citypedef struct _MSG_LAN_SEND_REQUEST
508c2ecf20Sopenharmony_ci{
518c2ecf20Sopenharmony_ci    U16                     Reserved;           /* 00h */
528c2ecf20Sopenharmony_ci    U8                      ChainOffset;        /* 02h */
538c2ecf20Sopenharmony_ci    U8                      Function;           /* 03h */
548c2ecf20Sopenharmony_ci    U16                     Reserved2;          /* 04h */
558c2ecf20Sopenharmony_ci    U8                      PortNumber;         /* 06h */
568c2ecf20Sopenharmony_ci    U8                      MsgFlags;           /* 07h */
578c2ecf20Sopenharmony_ci    U32                     MsgContext;         /* 08h */
588c2ecf20Sopenharmony_ci    SGE_MPI_UNION           SG_List[1];         /* 0Ch */
598c2ecf20Sopenharmony_ci} MSG_LAN_SEND_REQUEST, MPI_POINTER PTR_MSG_LAN_SEND_REQUEST,
608c2ecf20Sopenharmony_ci  LANSendRequest_t, MPI_POINTER pLANSendRequest_t;
618c2ecf20Sopenharmony_ci
628c2ecf20Sopenharmony_ci
638c2ecf20Sopenharmony_citypedef struct _MSG_LAN_SEND_REPLY
648c2ecf20Sopenharmony_ci{
658c2ecf20Sopenharmony_ci    U16                     Reserved;           /* 00h */
668c2ecf20Sopenharmony_ci    U8                      MsgLength;          /* 02h */
678c2ecf20Sopenharmony_ci    U8                      Function;           /* 03h */
688c2ecf20Sopenharmony_ci    U8                      Reserved2;          /* 04h */
698c2ecf20Sopenharmony_ci    U8                      NumberOfContexts;   /* 05h */
708c2ecf20Sopenharmony_ci    U8                      PortNumber;         /* 06h */
718c2ecf20Sopenharmony_ci    U8                      MsgFlags;           /* 07h */
728c2ecf20Sopenharmony_ci    U32                     MsgContext;         /* 08h */
738c2ecf20Sopenharmony_ci    U16                     Reserved3;          /* 0Ch */
748c2ecf20Sopenharmony_ci    U16                     IOCStatus;          /* 0Eh */
758c2ecf20Sopenharmony_ci    U32                     IOCLogInfo;         /* 10h */
768c2ecf20Sopenharmony_ci    U32                     BufferContext;      /* 14h */
778c2ecf20Sopenharmony_ci} MSG_LAN_SEND_REPLY, MPI_POINTER PTR_MSG_LAN_SEND_REPLY,
788c2ecf20Sopenharmony_ci  LANSendReply_t, MPI_POINTER pLANSendReply_t;
798c2ecf20Sopenharmony_ci
808c2ecf20Sopenharmony_ci
818c2ecf20Sopenharmony_ci/* LANReceivePost */
828c2ecf20Sopenharmony_ci
838c2ecf20Sopenharmony_citypedef struct _MSG_LAN_RECEIVE_POST_REQUEST
848c2ecf20Sopenharmony_ci{
858c2ecf20Sopenharmony_ci    U16                     Reserved;           /* 00h */
868c2ecf20Sopenharmony_ci    U8                      ChainOffset;        /* 02h */
878c2ecf20Sopenharmony_ci    U8                      Function;           /* 03h */
888c2ecf20Sopenharmony_ci    U16                     Reserved2;          /* 04h */
898c2ecf20Sopenharmony_ci    U8                      PortNumber;         /* 06h */
908c2ecf20Sopenharmony_ci    U8                      MsgFlags;           /* 07h */
918c2ecf20Sopenharmony_ci    U32                     MsgContext;         /* 08h */
928c2ecf20Sopenharmony_ci    U32                     BucketCount;        /* 0Ch */
938c2ecf20Sopenharmony_ci    SGE_MPI_UNION           SG_List[1];         /* 10h */
948c2ecf20Sopenharmony_ci} MSG_LAN_RECEIVE_POST_REQUEST, MPI_POINTER PTR_MSG_LAN_RECEIVE_POST_REQUEST,
958c2ecf20Sopenharmony_ci  LANReceivePostRequest_t, MPI_POINTER pLANReceivePostRequest_t;
968c2ecf20Sopenharmony_ci
978c2ecf20Sopenharmony_ci
988c2ecf20Sopenharmony_citypedef struct _MSG_LAN_RECEIVE_POST_REPLY
998c2ecf20Sopenharmony_ci{
1008c2ecf20Sopenharmony_ci    U16                     Reserved;           /* 00h */
1018c2ecf20Sopenharmony_ci    U8                      MsgLength;          /* 02h */
1028c2ecf20Sopenharmony_ci    U8                      Function;           /* 03h */
1038c2ecf20Sopenharmony_ci    U8                      Reserved2;          /* 04h */
1048c2ecf20Sopenharmony_ci    U8                      NumberOfContexts;   /* 05h */
1058c2ecf20Sopenharmony_ci    U8                      PortNumber;         /* 06h */
1068c2ecf20Sopenharmony_ci    U8                      MsgFlags;           /* 07h */
1078c2ecf20Sopenharmony_ci    U32                     MsgContext;         /* 08h */
1088c2ecf20Sopenharmony_ci    U16                     Reserved3;          /* 0Ch */
1098c2ecf20Sopenharmony_ci    U16                     IOCStatus;          /* 0Eh */
1108c2ecf20Sopenharmony_ci    U32                     IOCLogInfo;         /* 10h */
1118c2ecf20Sopenharmony_ci    U32                     BucketsRemaining;   /* 14h */
1128c2ecf20Sopenharmony_ci    U32                     PacketOffset;       /* 18h */
1138c2ecf20Sopenharmony_ci    U32                     PacketLength;       /* 1Ch */
1148c2ecf20Sopenharmony_ci    U32                     BucketContext[1];   /* 20h */
1158c2ecf20Sopenharmony_ci} MSG_LAN_RECEIVE_POST_REPLY, MPI_POINTER PTR_MSG_LAN_RECEIVE_POST_REPLY,
1168c2ecf20Sopenharmony_ci  LANReceivePostReply_t, MPI_POINTER pLANReceivePostReply_t;
1178c2ecf20Sopenharmony_ci
1188c2ecf20Sopenharmony_ci
1198c2ecf20Sopenharmony_ci/* LANReset */
1208c2ecf20Sopenharmony_ci
1218c2ecf20Sopenharmony_citypedef struct _MSG_LAN_RESET_REQUEST
1228c2ecf20Sopenharmony_ci{
1238c2ecf20Sopenharmony_ci    U16                     Reserved;           /* 00h */
1248c2ecf20Sopenharmony_ci    U8                      ChainOffset;        /* 02h */
1258c2ecf20Sopenharmony_ci    U8                      Function;           /* 03h */
1268c2ecf20Sopenharmony_ci    U16                     Reserved2;          /* 04h */
1278c2ecf20Sopenharmony_ci    U8                      PortNumber;         /* 05h */
1288c2ecf20Sopenharmony_ci    U8                      MsgFlags;           /* 07h */
1298c2ecf20Sopenharmony_ci    U32                     MsgContext;         /* 08h */
1308c2ecf20Sopenharmony_ci} MSG_LAN_RESET_REQUEST, MPI_POINTER PTR_MSG_LAN_RESET_REQUEST,
1318c2ecf20Sopenharmony_ci  LANResetRequest_t, MPI_POINTER pLANResetRequest_t;
1328c2ecf20Sopenharmony_ci
1338c2ecf20Sopenharmony_ci
1348c2ecf20Sopenharmony_citypedef struct _MSG_LAN_RESET_REPLY
1358c2ecf20Sopenharmony_ci{
1368c2ecf20Sopenharmony_ci    U16                     Reserved;           /* 00h */
1378c2ecf20Sopenharmony_ci    U8                      MsgLength;          /* 02h */
1388c2ecf20Sopenharmony_ci    U8                      Function;           /* 03h */
1398c2ecf20Sopenharmony_ci    U16                     Reserved2;          /* 04h */
1408c2ecf20Sopenharmony_ci    U8                      PortNumber;         /* 06h */
1418c2ecf20Sopenharmony_ci    U8                      MsgFlags;           /* 07h */
1428c2ecf20Sopenharmony_ci    U32                     MsgContext;         /* 08h */
1438c2ecf20Sopenharmony_ci    U16                     Reserved3;          /* 0Ch */
1448c2ecf20Sopenharmony_ci    U16                     IOCStatus;          /* 0Eh */
1458c2ecf20Sopenharmony_ci    U32                     IOCLogInfo;         /* 10h */
1468c2ecf20Sopenharmony_ci} MSG_LAN_RESET_REPLY, MPI_POINTER PTR_MSG_LAN_RESET_REPLY,
1478c2ecf20Sopenharmony_ci  LANResetReply_t, MPI_POINTER pLANResetReply_t;
1488c2ecf20Sopenharmony_ci
1498c2ecf20Sopenharmony_ci
1508c2ecf20Sopenharmony_ci/****************************************************************************/
1518c2ecf20Sopenharmony_ci/* LAN Context Reply defines and macros                                     */
1528c2ecf20Sopenharmony_ci/****************************************************************************/
1538c2ecf20Sopenharmony_ci
1548c2ecf20Sopenharmony_ci#define LAN_REPLY_PACKET_LENGTH_MASK            (0x0000FFFF)
1558c2ecf20Sopenharmony_ci#define LAN_REPLY_PACKET_LENGTH_SHIFT           (0)
1568c2ecf20Sopenharmony_ci#define LAN_REPLY_BUCKET_CONTEXT_MASK           (0x07FF0000)
1578c2ecf20Sopenharmony_ci#define LAN_REPLY_BUCKET_CONTEXT_SHIFT          (16)
1588c2ecf20Sopenharmony_ci#define LAN_REPLY_BUFFER_CONTEXT_MASK           (0x07FFFFFF)
1598c2ecf20Sopenharmony_ci#define LAN_REPLY_BUFFER_CONTEXT_SHIFT          (0)
1608c2ecf20Sopenharmony_ci#define LAN_REPLY_FORM_MASK                     (0x18000000)
1618c2ecf20Sopenharmony_ci#define LAN_REPLY_FORM_RECEIVE_SINGLE           (0x00)
1628c2ecf20Sopenharmony_ci#define LAN_REPLY_FORM_RECEIVE_MULTIPLE         (0x01)
1638c2ecf20Sopenharmony_ci#define LAN_REPLY_FORM_SEND_SINGLE              (0x02)
1648c2ecf20Sopenharmony_ci#define LAN_REPLY_FORM_MESSAGE_CONTEXT          (0x03)
1658c2ecf20Sopenharmony_ci#define LAN_REPLY_FORM_SHIFT                    (27)
1668c2ecf20Sopenharmony_ci
1678c2ecf20Sopenharmony_ci#define GET_LAN_PACKET_LENGTH(x)    (((x) & LAN_REPLY_PACKET_LENGTH_MASK)   \
1688c2ecf20Sopenharmony_ci                                        >> LAN_REPLY_PACKET_LENGTH_SHIFT)
1698c2ecf20Sopenharmony_ci
1708c2ecf20Sopenharmony_ci#define SET_LAN_PACKET_LENGTH(x, lth)                                       \
1718c2ecf20Sopenharmony_ci            ((x) = ((x) & ~LAN_REPLY_PACKET_LENGTH_MASK) |                  \
1728c2ecf20Sopenharmony_ci                            (((lth) << LAN_REPLY_PACKET_LENGTH_SHIFT) &     \
1738c2ecf20Sopenharmony_ci                                        LAN_REPLY_PACKET_LENGTH_MASK))
1748c2ecf20Sopenharmony_ci
1758c2ecf20Sopenharmony_ci#define GET_LAN_BUCKET_CONTEXT(x)   (((x) & LAN_REPLY_BUCKET_CONTEXT_MASK)  \
1768c2ecf20Sopenharmony_ci                                        >> LAN_REPLY_BUCKET_CONTEXT_SHIFT)
1778c2ecf20Sopenharmony_ci
1788c2ecf20Sopenharmony_ci#define SET_LAN_BUCKET_CONTEXT(x, ctx)                                      \
1798c2ecf20Sopenharmony_ci            ((x) = ((x) & ~LAN_REPLY_BUCKET_CONTEXT_MASK) |                 \
1808c2ecf20Sopenharmony_ci                            (((ctx) << LAN_REPLY_BUCKET_CONTEXT_SHIFT) &    \
1818c2ecf20Sopenharmony_ci                                        LAN_REPLY_BUCKET_CONTEXT_MASK))
1828c2ecf20Sopenharmony_ci
1838c2ecf20Sopenharmony_ci#define GET_LAN_BUFFER_CONTEXT(x)   (((x) & LAN_REPLY_BUFFER_CONTEXT_MASK)  \
1848c2ecf20Sopenharmony_ci                                        >> LAN_REPLY_BUFFER_CONTEXT_SHIFT)
1858c2ecf20Sopenharmony_ci
1868c2ecf20Sopenharmony_ci#define SET_LAN_BUFFER_CONTEXT(x, ctx)                                      \
1878c2ecf20Sopenharmony_ci            ((x) = ((x) & ~LAN_REPLY_BUFFER_CONTEXT_MASK) |                 \
1888c2ecf20Sopenharmony_ci                            (((ctx) << LAN_REPLY_BUFFER_CONTEXT_SHIFT) &    \
1898c2ecf20Sopenharmony_ci                                        LAN_REPLY_BUFFER_CONTEXT_MASK))
1908c2ecf20Sopenharmony_ci
1918c2ecf20Sopenharmony_ci#define GET_LAN_FORM(x)             (((x) & LAN_REPLY_FORM_MASK)            \
1928c2ecf20Sopenharmony_ci                                        >> LAN_REPLY_FORM_SHIFT)
1938c2ecf20Sopenharmony_ci
1948c2ecf20Sopenharmony_ci#define SET_LAN_FORM(x, frm)                                                \
1958c2ecf20Sopenharmony_ci            ((x) = ((x) & ~LAN_REPLY_FORM_MASK) |                           \
1968c2ecf20Sopenharmony_ci                            (((frm) << LAN_REPLY_FORM_SHIFT) &              \
1978c2ecf20Sopenharmony_ci                                        LAN_REPLY_FORM_MASK))
1988c2ecf20Sopenharmony_ci
1998c2ecf20Sopenharmony_ci
2008c2ecf20Sopenharmony_ci/****************************************************************************/
2018c2ecf20Sopenharmony_ci/* LAN Current Device State defines                                         */
2028c2ecf20Sopenharmony_ci/****************************************************************************/
2038c2ecf20Sopenharmony_ci
2048c2ecf20Sopenharmony_ci#define MPI_LAN_DEVICE_STATE_RESET                     (0x00)
2058c2ecf20Sopenharmony_ci#define MPI_LAN_DEVICE_STATE_OPERATIONAL               (0x01)
2068c2ecf20Sopenharmony_ci
2078c2ecf20Sopenharmony_ci
2088c2ecf20Sopenharmony_ci/****************************************************************************/
2098c2ecf20Sopenharmony_ci/* LAN Loopback defines                                                     */
2108c2ecf20Sopenharmony_ci/****************************************************************************/
2118c2ecf20Sopenharmony_ci
2128c2ecf20Sopenharmony_ci#define MPI_LAN_TX_MODES_ENABLE_LOOPBACK_SUPPRESSION   (0x01)
2138c2ecf20Sopenharmony_ci
2148c2ecf20Sopenharmony_ci#endif
2158c2ecf20Sopenharmony_ci
216