xref: /freebsd/sys/dev/mpi3mr/mpi/mpi30_sas.h (revision 92f340d137ba5d6db7610ba1dae35842e2c9c8ea)
1 /*
2  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
3  *
4  * Copyright (c) 2016-2025, Broadcom Inc. All rights reserved.
5  * Support: <fbsd-storage-driver.pdl@broadcom.com>
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions are
9  * met:
10  *
11  * 1. Redistributions of source code must retain the above copyright notice,
12  *    this list of conditions and the following disclaimer.
13  * 2. Redistributions in binary form must reproduce the above copyright notice,
14  *    this list of conditions and the following disclaimer in the documentation and/or other
15  *    materials provided with the distribution.
16  * 3. Neither the name of the Broadcom Inc. nor the names of its contributors
17  *    may be used to endorse or promote products derived from this software without
18  *    specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
24  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  *
32  * The views and conclusions contained in the software and documentation are
33  * those of the authors and should not be interpreted as representing
34  * official policies,either expressed or implied, of the FreeBSD Project.
35  *
36  * Mail to: Broadcom Inc 1320 Ridder Park Dr, San Jose, CA 95131
37  *
38  * Broadcom Inc. (Broadcom) MPI3MR Adapter FreeBSD
39  *
40  */
41 
42 #ifndef MPI30_SAS_H
43 #define MPI30_SAS_H     1
44 
45 /*****************************************************************************
46  *              SAS Device Info Definitions                                  *
47  ****************************************************************************/
48 #define MPI3_SAS_DEVICE_INFO_SSP_TARGET             (0x00000100)
49 #define MPI3_SAS_DEVICE_INFO_STP_SATA_TARGET        (0x00000080)
50 #define MPI3_SAS_DEVICE_INFO_SMP_TARGET             (0x00000040)
51 #define MPI3_SAS_DEVICE_INFO_SSP_INITIATOR          (0x00000020)
52 #define MPI3_SAS_DEVICE_INFO_STP_INITIATOR          (0x00000010)
53 #define MPI3_SAS_DEVICE_INFO_SMP_INITIATOR          (0x00000008)
54 #define MPI3_SAS_DEVICE_INFO_DEVICE_TYPE_MASK       (0x00000007)
55 #define MPI3_SAS_DEVICE_INFO_DEVICE_TYPE_SHIFT      (0)
56 #define MPI3_SAS_DEVICE_INFO_DEVICE_TYPE_NO_DEVICE  (0x00000000)
57 #define MPI3_SAS_DEVICE_INFO_DEVICE_TYPE_END_DEVICE (0x00000001)
58 #define MPI3_SAS_DEVICE_INFO_DEVICE_TYPE_EXPANDER   (0x00000002)
59 
60 /*****************************************************************************
61  *              SMP Passthrough Request Message                              *
62  ****************************************************************************/
63 typedef struct _MPI3_SMP_PASSTHROUGH_REQUEST
64 {
65     U16                     HostTag;                        /* 0x00 */
66     U8                      IOCUseOnly02;                   /* 0x02 */
67     U8                      Function;                       /* 0x03 */
68     U16                     IOCUseOnly04;                   /* 0x04 */
69     U8                      IOCUseOnly06;                   /* 0x06 */
70     U8                      MsgFlags;                       /* 0x07 */
71     U16                     ChangeCount;                    /* 0x08 */
72     U8                      Reserved0A;                     /* 0x0A */
73     U8                      IOUnitPort;                     /* 0x0B */
74     U32                     Reserved0C[3];                  /* 0x0C */
75     U64                     SASAddress;                     /* 0x18 */
76     MPI3_SGE_SIMPLE         RequestSGE;                     /* 0x20 */
77     MPI3_SGE_SIMPLE         ResponseSGE;                    /* 0x30 */
78 } MPI3_SMP_PASSTHROUGH_REQUEST, MPI3_POINTER PTR_MPI3_SMP_PASSTHROUGH_REQUEST,
79   Mpi3SmpPassthroughRequest_t, MPI3_POINTER pMpi3SmpPassthroughRequest_t;
80 
81 /*****************************************************************************
82  *              SMP Passthrough Reply Message                               *
83  ****************************************************************************/
84 typedef struct _MPI3_SMP_PASSTHROUGH_REPLY
85 {
86     U16                     HostTag;                        /* 0x00 */
87     U8                      IOCUseOnly02;                   /* 0x02 */
88     U8                      Function;                       /* 0x03 */
89     U16                     IOCUseOnly04;                   /* 0x04 */
90     U8                      IOCUseOnly06;                   /* 0x06 */
91     U8                      MsgFlags;                       /* 0x07 */
92     U16                     IOCUseOnly08;                   /* 0x08 */
93     U16                     IOCStatus;                      /* 0x0A */
94     U32                     IOCLogInfo;                     /* 0x0C */
95     U16                     ResponseDataLength;             /* 0x10 */
96     U16                     Reserved12;                     /* 0x12 */
97 } MPI3_SMP_PASSTHROUGH_REPLY, MPI3_POINTER PTR_MPI3_SMP_PASSTHROUGH_REPLY,
98   Mpi3SmpPassthroughReply_t, MPI3_POINTER pMpi3SmpPassthroughReply_t;
99 
100 #endif  /* MPI30_SAS_H */
101