mpi_lan.h revision 147883
1101704Smjacob/* $FreeBSD: head/sys/dev/mpt/mpilib/mpi_lan.h 147883 2005-07-10 15:05:39Z scottl $ */ 2139749Simp/*- 3147883Sscottl * Copyright (c) 2000-2005, LSI Logic Corporation and its contributors. 4147883Sscottl * All rights reserved. 5147883Sscottl * 6102599Smjacob * Redistribution and use in source and binary forms, with or without 7147883Sscottl * modification, are permitted provided that the following conditions are 8147883Sscottl * met: 9102599Smjacob * 1. Redistributions of source code must retain the above copyright 10147883Sscottl * notice, this list of conditions and the following disclaimer. 11147883Sscottl * 2. Redistributions in binary form must reproduce at minimum a disclaimer 12147883Sscottl * substantially similar to the "NO WARRANTY" disclaimer below 13147883Sscottl * ("Disclaimer") and any redistribution must be conditioned upon including 14147883Sscottl * a substantially similar Disclaimer requirement for further binary 15147883Sscottl * redistribution. 16147883Sscottl * 3. Neither the name of the LSI Logic Corporation nor the names of its 17147883Sscottl * contributors may be used to endorse or promote products derived from 18147883Sscottl * this software without specific prior written permission. 19147883Sscottl * 20147883Sscottl * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21147883Sscottl * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22102599Smjacob * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 23147883Sscottl * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 24147883Sscottl * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 25147883Sscottl * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 26147883Sscottl * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 27147883Sscottl * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 28147883Sscottl * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 29147883Sscottl * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF THE COPYRIGHT 30147883Sscottl * OWNER OR CONTRIBUTOR IS ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31102599Smjacob * 32102599Smjacob * 33101704Smjacob * Name: MPI_LAN.H 34101704Smjacob * Title: MPI LAN messages and structures 35101704Smjacob * Creation Date: June 30, 2000 36101704Smjacob * 37147883Sscottl * MPI_LAN.H Version: 01.02.01 38101704Smjacob * 39101704Smjacob * Version History 40101704Smjacob * --------------- 41101704Smjacob * 42101704Smjacob * Date Version Description 43101704Smjacob * -------- -------- ------------------------------------------------------ 44101704Smjacob * 05-08-00 00.10.01 Original release for 0.10 spec dated 4/26/2000. 45101704Smjacob * 05-24-00 00.10.02 Added LANStatus field to _MSG_LAN_SEND_REPLY. 46101704Smjacob * Added LANStatus field to _MSG_LAN_RECEIVE_POST_REPLY. 47101704Smjacob * Moved ListCount field in _MSG_LAN_RECEIVE_POST_REPLY. 48101704Smjacob * 06-06-00 01.00.01 Update version number for 1.0 release. 49101704Smjacob * 06-12-00 01.00.02 Added MPI_ to BUCKETSTATUS_ definitions. 50101704Smjacob * 06-22-00 01.00.03 Major changes to match new LAN definition in 1.0 spec. 51101704Smjacob * 06-30-00 01.00.04 Added Context Reply definitions per revised proposal. 52101704Smjacob * Changed transaction context usage to bucket/buffer. 53101704Smjacob * 07-05-00 01.00.05 Removed LAN_RECEIVE_POST_BUCKET_CONTEXT_MASK definition 54101704Smjacob * to lan private header file 55101704Smjacob * 11-02-00 01.01.01 Original release for post 1.0 work 56101704Smjacob * 02-20-01 01.01.02 Started using MPI_POINTER. 57101704Smjacob * 03-27-01 01.01.03 Added structure offset comments. 58101704Smjacob * 08-08-01 01.02.01 Original release for v1.2 work. 59101704Smjacob * -------------------------------------------------------------------------- 60101704Smjacob */ 61101704Smjacob 62101704Smjacob#ifndef MPI_LAN_H 63101704Smjacob#define MPI_LAN_H 64101704Smjacob 65101704Smjacob 66101704Smjacob/****************************************************************************** 67101704Smjacob* 68101704Smjacob* L A N M e s s a g e s 69101704Smjacob* 70101704Smjacob*******************************************************************************/ 71101704Smjacob 72101704Smjacob/* LANSend messages */ 73101704Smjacob 74101704Smjacobtypedef struct _MSG_LAN_SEND_REQUEST 75101704Smjacob{ 76101704Smjacob U16 Reserved; /* 00h */ 77101704Smjacob U8 ChainOffset; /* 02h */ 78101704Smjacob U8 Function; /* 03h */ 79101704Smjacob U16 Reserved2; /* 04h */ 80101704Smjacob U8 PortNumber; /* 06h */ 81101704Smjacob U8 MsgFlags; /* 07h */ 82101704Smjacob U32 MsgContext; /* 08h */ 83101704Smjacob SGE_MPI_UNION SG_List[1]; /* 0Ch */ 84101704Smjacob} MSG_LAN_SEND_REQUEST, MPI_POINTER PTR_MSG_LAN_SEND_REQUEST, 85101704Smjacob LANSendRequest_t, MPI_POINTER pLANSendRequest_t; 86101704Smjacob 87101704Smjacob 88101704Smjacobtypedef struct _MSG_LAN_SEND_REPLY 89101704Smjacob{ 90101704Smjacob U16 Reserved; /* 00h */ 91101704Smjacob U8 MsgLength; /* 02h */ 92101704Smjacob U8 Function; /* 03h */ 93101704Smjacob U8 Reserved2; /* 04h */ 94101704Smjacob U8 NumberOfContexts; /* 05h */ 95101704Smjacob U8 PortNumber; /* 06h */ 96101704Smjacob U8 MsgFlags; /* 07h */ 97101704Smjacob U32 MsgContext; /* 08h */ 98101704Smjacob U16 Reserved3; /* 0Ch */ 99101704Smjacob U16 IOCStatus; /* 0Eh */ 100101704Smjacob U32 IOCLogInfo; /* 10h */ 101101704Smjacob U32 BufferContext; /* 14h */ 102101704Smjacob} MSG_LAN_SEND_REPLY, MPI_POINTER PTR_MSG_LAN_SEND_REPLY, 103101704Smjacob LANSendReply_t, MPI_POINTER pLANSendReply_t; 104101704Smjacob 105101704Smjacob 106101704Smjacob/* LANReceivePost */ 107101704Smjacob 108101704Smjacobtypedef struct _MSG_LAN_RECEIVE_POST_REQUEST 109101704Smjacob{ 110101704Smjacob U16 Reserved; /* 00h */ 111101704Smjacob U8 ChainOffset; /* 02h */ 112101704Smjacob U8 Function; /* 03h */ 113101704Smjacob U16 Reserved2; /* 04h */ 114101704Smjacob U8 PortNumber; /* 06h */ 115101704Smjacob U8 MsgFlags; /* 07h */ 116101704Smjacob U32 MsgContext; /* 08h */ 117101704Smjacob U32 BucketCount; /* 0Ch */ 118101704Smjacob SGE_MPI_UNION SG_List[1]; /* 10h */ 119101704Smjacob} MSG_LAN_RECEIVE_POST_REQUEST, MPI_POINTER PTR_MSG_LAN_RECEIVE_POST_REQUEST, 120101704Smjacob LANReceivePostRequest_t, MPI_POINTER pLANReceivePostRequest_t; 121101704Smjacob 122101704Smjacob 123101704Smjacobtypedef struct _MSG_LAN_RECEIVE_POST_REPLY 124101704Smjacob{ 125101704Smjacob U16 Reserved; /* 00h */ 126101704Smjacob U8 MsgLength; /* 02h */ 127101704Smjacob U8 Function; /* 03h */ 128101704Smjacob U8 Reserved2; /* 04h */ 129101704Smjacob U8 NumberOfContexts; /* 05h */ 130101704Smjacob U8 PortNumber; /* 06h */ 131101704Smjacob U8 MsgFlags; /* 07h */ 132101704Smjacob U32 MsgContext; /* 08h */ 133101704Smjacob U16 Reserved3; /* 0Ch */ 134101704Smjacob U16 IOCStatus; /* 0Eh */ 135101704Smjacob U32 IOCLogInfo; /* 10h */ 136101704Smjacob U32 BucketsRemaining; /* 14h */ 137101704Smjacob U32 PacketOffset; /* 18h */ 138101704Smjacob U32 PacketLength; /* 1Ch */ 139101704Smjacob U32 BucketContext[1]; /* 20h */ 140101704Smjacob} MSG_LAN_RECEIVE_POST_REPLY, MPI_POINTER PTR_MSG_LAN_RECEIVE_POST_REPLY, 141101704Smjacob LANReceivePostReply_t, MPI_POINTER pLANReceivePostReply_t; 142101704Smjacob 143101704Smjacob 144101704Smjacob/* LANReset */ 145101704Smjacob 146101704Smjacobtypedef struct _MSG_LAN_RESET_REQUEST 147101704Smjacob{ 148101704Smjacob U16 Reserved; /* 00h */ 149101704Smjacob U8 ChainOffset; /* 02h */ 150101704Smjacob U8 Function; /* 03h */ 151101704Smjacob U16 Reserved2; /* 04h */ 152101704Smjacob U8 PortNumber; /* 05h */ 153101704Smjacob U8 MsgFlags; /* 07h */ 154101704Smjacob U32 MsgContext; /* 08h */ 155101704Smjacob} MSG_LAN_RESET_REQUEST, MPI_POINTER PTR_MSG_LAN_RESET_REQUEST, 156101704Smjacob LANResetRequest_t, MPI_POINTER pLANResetRequest_t; 157101704Smjacob 158101704Smjacob 159101704Smjacobtypedef struct _MSG_LAN_RESET_REPLY 160101704Smjacob{ 161101704Smjacob U16 Reserved; /* 00h */ 162101704Smjacob U8 MsgLength; /* 02h */ 163101704Smjacob U8 Function; /* 03h */ 164101704Smjacob U16 Reserved2; /* 04h */ 165101704Smjacob U8 PortNumber; /* 06h */ 166101704Smjacob U8 MsgFlags; /* 07h */ 167101704Smjacob U32 MsgContext; /* 08h */ 168101704Smjacob U16 Reserved3; /* 0Ch */ 169101704Smjacob U16 IOCStatus; /* 0Eh */ 170101704Smjacob U32 IOCLogInfo; /* 10h */ 171101704Smjacob} MSG_LAN_RESET_REPLY, MPI_POINTER PTR_MSG_LAN_RESET_REPLY, 172101704Smjacob LANResetReply_t, MPI_POINTER pLANResetReply_t; 173101704Smjacob 174101704Smjacob 175101704Smjacob/****************************************************************************/ 176101704Smjacob/* LAN Context Reply defines and macros */ 177101704Smjacob/****************************************************************************/ 178101704Smjacob 179101704Smjacob#define LAN_REPLY_PACKET_LENGTH_MASK (0x0000FFFF) 180101704Smjacob#define LAN_REPLY_PACKET_LENGTH_SHIFT (0) 181101704Smjacob#define LAN_REPLY_BUCKET_CONTEXT_MASK (0x07FF0000) 182101704Smjacob#define LAN_REPLY_BUCKET_CONTEXT_SHIFT (16) 183101704Smjacob#define LAN_REPLY_BUFFER_CONTEXT_MASK (0x07FFFFFF) 184101704Smjacob#define LAN_REPLY_BUFFER_CONTEXT_SHIFT (0) 185101704Smjacob#define LAN_REPLY_FORM_MASK (0x18000000) 186101704Smjacob#define LAN_REPLY_FORM_RECEIVE_SINGLE (0x00) 187101704Smjacob#define LAN_REPLY_FORM_RECEIVE_MULTIPLE (0x01) 188101704Smjacob#define LAN_REPLY_FORM_SEND_SINGLE (0x02) 189101704Smjacob#define LAN_REPLY_FORM_MESSAGE_CONTEXT (0x03) 190101704Smjacob#define LAN_REPLY_FORM_SHIFT (27) 191101704Smjacob 192101704Smjacob#define GET_LAN_PACKET_LENGTH(x) (((x) & LAN_REPLY_PACKET_LENGTH_MASK) \ 193101704Smjacob >> LAN_REPLY_PACKET_LENGTH_SHIFT) 194101704Smjacob 195101704Smjacob#define SET_LAN_PACKET_LENGTH(x, lth) \ 196101704Smjacob ((x) = ((x) & ~LAN_REPLY_PACKET_LENGTH_MASK) | \ 197101704Smjacob (((lth) << LAN_REPLY_PACKET_LENGTH_SHIFT) & \ 198101704Smjacob LAN_REPLY_PACKET_LENGTH_MASK)) 199101704Smjacob 200101704Smjacob#define GET_LAN_BUCKET_CONTEXT(x) (((x) & LAN_REPLY_BUCKET_CONTEXT_MASK) \ 201101704Smjacob >> LAN_REPLY_BUCKET_CONTEXT_SHIFT) 202101704Smjacob 203101704Smjacob#define SET_LAN_BUCKET_CONTEXT(x, ctx) \ 204101704Smjacob ((x) = ((x) & ~LAN_REPLY_BUCKET_CONTEXT_MASK) | \ 205101704Smjacob (((ctx) << LAN_REPLY_BUCKET_CONTEXT_SHIFT) & \ 206101704Smjacob LAN_REPLY_BUCKET_CONTEXT_MASK)) 207101704Smjacob 208101704Smjacob#define GET_LAN_BUFFER_CONTEXT(x) (((x) & LAN_REPLY_BUFFER_CONTEXT_MASK) \ 209101704Smjacob >> LAN_REPLY_BUFFER_CONTEXT_SHIFT) 210101704Smjacob 211101704Smjacob#define SET_LAN_BUFFER_CONTEXT(x, ctx) \ 212101704Smjacob ((x) = ((x) & ~LAN_REPLY_BUFFER_CONTEXT_MASK) | \ 213101704Smjacob (((ctx) << LAN_REPLY_BUFFER_CONTEXT_SHIFT) & \ 214101704Smjacob LAN_REPLY_BUFFER_CONTEXT_MASK)) 215101704Smjacob 216101704Smjacob#define GET_LAN_FORM(x) (((x) & LAN_REPLY_FORM_MASK) \ 217101704Smjacob >> LAN_REPLY_FORM_SHIFT) 218101704Smjacob 219101704Smjacob#define SET_LAN_FORM(x, frm) \ 220101704Smjacob ((x) = ((x) & ~LAN_REPLY_FORM_MASK) | \ 221101704Smjacob (((frm) << LAN_REPLY_FORM_SHIFT) & \ 222101704Smjacob LAN_REPLY_FORM_MASK)) 223101704Smjacob 224101704Smjacob 225101704Smjacob/****************************************************************************/ 226101704Smjacob/* LAN Current Device State defines */ 227101704Smjacob/****************************************************************************/ 228101704Smjacob 229101704Smjacob#define MPI_LAN_DEVICE_STATE_RESET (0x00) 230101704Smjacob#define MPI_LAN_DEVICE_STATE_OPERATIONAL (0x01) 231101704Smjacob 232101704Smjacob 233101704Smjacob/****************************************************************************/ 234101704Smjacob/* LAN Loopback defines */ 235101704Smjacob/****************************************************************************/ 236101704Smjacob 237101704Smjacob#define MPI_LAN_TX_MODES_ENABLE_LOOPBACK_SUPPRESSION (0x01) 238101704Smjacob 239101704Smjacob#endif 240101704Smjacob 241