1265236Sken/*-
2283661Sslm * Copyright (c) 2012-2015 LSI Corp.
3299263Sslm * Copyright (c) 2013-2016 Avago Technologies
4265236Sken * All rights reserved.
5265236Sken *
6265236Sken * Redistribution and use in source and binary forms, with or without
7265236Sken * modification, are permitted provided that the following conditions
8265236Sken * are met:
9265236Sken * 1. Redistributions of source code must retain the above copyright
10265236Sken *    notice, this list of conditions and the following disclaimer.
11265236Sken * 2. Redistributions in binary form must reproduce the above copyright
12265236Sken *    notice, this list of conditions and the following disclaimer in the
13265236Sken *    documentation and/or other materials provided with the distribution.
14265236Sken * 3. Neither the name of the author nor the names of any co-contributors
15265236Sken *    may be used to endorse or promote products derived from this software
16265236Sken *    without specific prior written permission.
17265236Sken *
18265236Sken * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
19265236Sken * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20265236Sken * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21265236Sken * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
22265236Sken * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23265236Sken * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24265236Sken * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25265236Sken * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26265236Sken * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27265236Sken * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28265236Sken * SUCH DAMAGE.
29265236Sken *
30283661Sslm * Avago Technologies (LSI) MPT-Fusion Host Adapter FreeBSD
31265236Sken *
32265236Sken * $FreeBSD: stable/11/sys/dev/mpr/mpi/mpi2_hbd.h 319435 2017-06-01 15:39:09Z slm $
33265236Sken */
34265236Sken
35265236Sken/*
36283661Sslm *  Copyright (c) 2009-2015 LSI Corporation.
37299263Sslm *  Copyright (c) 2013-2016 Avago Technologies
38299263Sslm *  All rights reserved.
39265236Sken *
40265236Sken *
41265236Sken *           Name:  mpi2_hbd.h
42265236Sken *          Title:  MPI Host Based Discovery messages and structures
43265236Sken *  Creation Date:  October 21, 2009
44265236Sken *
45319435Sslm *  mpi2_hbd.h Version:  02.00.04
46265236Sken *
47265236Sken *  NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25
48265236Sken *        prefix are for use only on MPI v2.5 products, and must not be used
49265236Sken *        with MPI v2.0 products. Unless otherwise noted, names beginning with
50265236Sken *        MPI2 or Mpi2 are for use with both MPI v2.0 and MPI v2.5 products.
51265236Sken *
52265236Sken *  Version History
53265236Sken *  ---------------
54265236Sken *
55265236Sken *  Date      Version   Description
56265236Sken *  --------  --------  ------------------------------------------------------
57265236Sken *  10-28-09  02.00.00  Initial version.
58265236Sken *  08-11-10  02.00.01  Removed PortGroups, DmaGroup, and ControlGroup from
59265236Sken *                      HBD Action request, replaced by AdditionalInfo field.
60265236Sken *  11-18-11  02.00.02  Incorporating additions for MPI v2.5.
61299263Sslm *  11-18-14  02.00.03  Updated copyright information.
62319435Sslm *  02-17-16  02.00.04  Added SAS 4 22.5 gbs speed support.
63265236Sken *  --------------------------------------------------------------------------
64265236Sken */
65265236Sken
66265236Sken#ifndef MPI2_HBD_H
67265236Sken#define MPI2_HBD_H
68265236Sken
69265236Sken/****************************************************************************
70265236Sken*  Host Based Discovery Action messages
71265236Sken****************************************************************************/
72265236Sken
73265236Sken/* Host Based Discovery Action Request Message */
74265236Skentypedef struct _MPI2_HBD_ACTION_REQUEST
75265236Sken{
76265236Sken    U8                      Operation;          /* 0x00 */
77265236Sken    U8                      Reserved1;          /* 0x01 */
78265236Sken    U8                      ChainOffset;        /* 0x02 */
79265236Sken    U8                      Function;           /* 0x03 */
80265236Sken    U16                     DevHandle;          /* 0x04 */
81265236Sken    U8                      Reserved2;          /* 0x06 */
82265236Sken    U8                      MsgFlags;           /* 0x07 */
83265236Sken    U8                      VP_ID;              /* 0x08 */
84265236Sken    U8                      VF_ID;              /* 0x09 */
85265236Sken    U16                     Reserved3;          /* 0x0A */
86265236Sken    U32                     Reserved4;          /* 0x0C */
87265236Sken    U64                     SASAddress;         /* 0x10 */
88265236Sken    U32                     Reserved5;          /* 0x18 */
89265236Sken    U32                     HbdDeviceInfo;      /* 0x1C */
90265236Sken    U16                     ParentDevHandle;    /* 0x20 */
91265236Sken    U16                     MaxQDepth;          /* 0x22 */
92265236Sken    U8                      FirstPhyIdentifier; /* 0x24 */
93265236Sken    U8                      Port;               /* 0x25 */
94265236Sken    U8                      MaxConnections;     /* 0x26 */
95265236Sken    U8                      MaxRate;            /* 0x27 */
96265236Sken    U32                     AdditionalInfo;     /* 0x28 */
97265236Sken    U16                     InitialAWT;         /* 0x2C */
98265236Sken    U16                     Reserved7;          /* 0x2E */
99265236Sken    U32                     Reserved8;          /* 0x30 */
100265236Sken} MPI2_HBD_ACTION_REQUEST, MPI2_POINTER PTR_MPI2_HBD_ACTION_REQUEST,
101265236Sken  Mpi2HbdActionRequest_t, MPI2_POINTER pMpi2HbdActionRequest_t;
102265236Sken
103265236Sken/* values for the Operation field */
104265236Sken#define MPI2_HBD_OP_ADD_DEVICE                  (0x01)
105265236Sken#define MPI2_HBD_OP_REMOVE_DEVICE               (0x02)
106265236Sken#define MPI2_HBD_OP_UPDATE_DEVICE               (0x03)
107265236Sken
108265236Sken/* values for the HbdDeviceInfo field */
109265236Sken#define MPI2_HBD_DEVICE_INFO_VIRTUAL_DEVICE     (0x00004000)
110265236Sken#define MPI2_HBD_DEVICE_INFO_ATAPI_DEVICE       (0x00002000)
111265236Sken#define MPI2_HBD_DEVICE_INFO_DIRECT_ATTACH      (0x00000800)
112265236Sken#define MPI2_HBD_DEVICE_INFO_SSP_TARGET         (0x00000400)
113265236Sken#define MPI2_HBD_DEVICE_INFO_STP_TARGET         (0x00000200)
114265236Sken#define MPI2_HBD_DEVICE_INFO_SMP_TARGET         (0x00000100)
115265236Sken#define MPI2_HBD_DEVICE_INFO_SATA_DEVICE        (0x00000080)
116265236Sken#define MPI2_HBD_DEVICE_INFO_SSP_INITIATOR      (0x00000040)
117265236Sken#define MPI2_HBD_DEVICE_INFO_STP_INITIATOR      (0x00000020)
118265236Sken#define MPI2_HBD_DEVICE_INFO_SMP_INITIATOR      (0x00000010)
119265236Sken#define MPI2_HBD_DEVICE_INFO_SATA_HOST          (0x00000008)
120265236Sken
121265236Sken#define MPI2_HBD_DEVICE_INFO_MASK_DEVICE_TYPE   (0x00000007)
122265236Sken#define MPI2_HBD_DEVICE_INFO_NO_DEVICE          (0x00000000)
123265236Sken#define MPI2_HBD_DEVICE_INFO_END_DEVICE         (0x00000001)
124265236Sken#define MPI2_HBD_DEVICE_INFO_EDGE_EXPANDER      (0x00000002)
125265236Sken#define MPI2_HBD_DEVICE_INFO_FANOUT_EXPANDER    (0x00000003)
126265236Sken
127265236Sken/* values for the MaxRate field */
128265236Sken#define MPI2_HBD_MAX_RATE_MASK                  (0x0F)
129265236Sken#define MPI2_HBD_MAX_RATE_1_5                   (0x08)
130265236Sken#define MPI2_HBD_MAX_RATE_3_0                   (0x09)
131265236Sken#define MPI2_HBD_MAX_RATE_6_0                   (0x0A)
132265236Sken#define MPI25_HBD_MAX_RATE_12_0                 (0x0B)
133319435Sslm#define MPI26_HBD_MAX_RATE_22_5                 (0x0C)
134265236Sken
135265236Sken
136265236Sken/* Host Based Discovery Action Reply Message */
137265236Skentypedef struct _MPI2_HBD_ACTION_REPLY
138265236Sken{
139265236Sken    U8                      Operation;          /* 0x00 */
140265236Sken    U8                      Reserved1;          /* 0x01 */
141265236Sken    U8                      MsgLength;          /* 0x02 */
142265236Sken    U8                      Function;           /* 0x03 */
143265236Sken    U16                     DevHandle;          /* 0x04 */
144265236Sken    U8                      Reserved2;          /* 0x06 */
145265236Sken    U8                      MsgFlags;           /* 0x07 */
146265236Sken    U8                      VP_ID;              /* 0x08 */
147265236Sken    U8                      VF_ID;              /* 0x09 */
148265236Sken    U16                     Reserved3;          /* 0x0A */
149265236Sken    U16                     Reserved4;          /* 0x0C */
150265236Sken    U16                     IOCStatus;          /* 0x0E */
151265236Sken    U32                     IOCLogInfo;         /* 0x10 */
152265236Sken} MPI2_HBD_ACTION_REPLY, MPI2_POINTER PTR_MPI2_HBD_ACTION_REPLY,
153265236Sken  Mpi2HbdActionReply_t, MPI2_POINTER pMpi2HbdActionReply_t;
154265236Sken
155265236Sken
156265236Sken#endif
157265236Sken
158265236Sken
159