1285809Sscottl/******************************************************************************
2285809Sscottl*Copyright (c) 2014 PMC-Sierra, Inc.  All rights reserved.
3285809Sscottl*
4285809Sscottl*Redistribution and use in source and binary forms, with or without modification, are permitted provided
5285809Sscottl*that the following conditions are met:
6285809Sscottl*1. Redistributions of source code must retain the above copyright notice, this list of conditions and the
7285809Sscottl*following disclaimer.
8285809Sscottl*2. Redistributions in binary form must reproduce the above copyright notice,
9285809Sscottl*this list of conditions and the following disclaimer in the documentation and/or other materials provided
10285809Sscottl*with the distribution.
11285809Sscottl*
12285809Sscottl*THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED
13285809Sscottl*WARRANTIES,INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
14285809Sscottl*FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
15285809Sscottl*FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
16285809Sscottl*NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
17285809Sscottl*BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
18285809Sscottl*LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
19285809Sscottl*SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
20285809Sscottl*
21285809Sscottl* $FreeBSD$
22285809Sscottl*
23285809Sscottl******************************************************************************/
24285809Sscottl/*****************************************************************************/
25285809Sscottl/*! \file sa_spec.h
26285809Sscottl *  \brief The file defines the constants defined by sas spec
27285809Sscottl */
28285809Sscottl
29285809Sscottl/*****************************************************************************/
30285809Sscottl
31285809Sscottl#ifndef  __SA_SPEC_H__
32285809Sscottl#define __SA_SPEC_H__
33285809Sscottl
34285809Sscottl/****************************************************************
35285809Sscottl *            SAS Specification related defines                 *
36285809Sscottl ****************************************************************/
37285809Sscottl#define SA_SAS_PROTOCOL_SMP                               0x00
38285809Sscottl#define SA_SAS_PROTOCOL_SSP                               0x01
39285809Sscottl#define SA_SAS_PROTOCOL_STP                               0x02
40285809Sscottl
41285809Sscottl#define SA_OPENFRM_SIZE                                   (28)
42285809Sscottl#define SA_IDENTIFY_FRAME_SIZE                            (28)
43285809Sscottl//#define SAS_IDENTIFY_FRM_SIZE                             SA_IDENTIFY_FRAME_SIZE
44285809Sscottl
45285809Sscottl#define SA_SAS_FRAME_TYPE_SSP_DATA                        0x01
46285809Sscottl#define SA_SAS_FRAME_TYPE_SSP_XRDY                        0x05
47285809Sscottl#define SA_SAS_FRAME_TYPE_SSP_CMD                         0x06
48285809Sscottl#define SA_SAS_FRAME_TYPE_SSP_RSP                         0x07
49285809Sscottl#define SA_SAS_FRAME_TYPE_SSP_TASK                        0x16
50285809Sscottl#define SA_SAS_FRAME_TYPE_SMP_REQ                         0x40
51285809Sscottl#define SA_SAS_FRAME_TYPE_SMP_RSP                         0x41
52285809Sscottl
53285809Sscottl#define SA_SAS_CONNECTION_RATE_1_5G                       0x08
54285809Sscottl#define SA_SAS_CONNECTION_RATE_3_0G                       0x09
55285809Sscottl#define SA_SAS_CONNECTION_RATE_6_0G                       0x0A
56285809Sscottl#define SA_SAS_CONNECTION_RATE_12_0G                      0x0B
57285809Sscottl
58285809Sscottl#define SA_SAS_DEV_TYPE_NO_DEVICE                         0x00
59285809Sscottl#define SA_SAS_DEV_TYPE_END_DEVICE                        0x01
60285809Sscottl#define SA_SAS_DEV_TYPE_EDGE_EXPANDER                     0x02
61285809Sscottl#define SA_SAS_DEV_TYPE_FANOUT_EXPANDER                   0x03
62285809Sscottl
63285809Sscottl#define AGSA_DEV_TYPE_END_DEVICE                          (SA_SAS_DEV_TYPE_END_DEVICE << 4)
64285809Sscottl#define AGSA_DEV_TYPE_EDGE_EXPANDER                       (SA_SAS_DEV_TYPE_EDGE_EXPANDER << 4)
65285809Sscottl#define AGSA_DEV_TYPE_FAN_EXPANDER                        (SA_SAS_DEV_TYPE_FANOUT_EXPANDER << 4)
66285809Sscottl
67285809Sscottl#define SA_SAS_SMP_REPORT_GENERAL                         0x00
68285809Sscottl#define SA_SAS_SMP_REPORT_MANUFACTURE_INFORMATION         0x01
69285809Sscottl#define SA_SAS_SMP_READ_GPIO_REGISTER                     0x02
70285809Sscottl#define SA_SAS_SMP_DISCOVER                               0x10
71285809Sscottl#define SA_SAS_SMP_REPORT_PHY_ERROR_LOG                   0x11
72285809Sscottl#define SA_SAS_SMP_REPORT_PHY_SATA                        0x12
73285809Sscottl#define SA_SAS_SMP_REPORT_ROUTING_INFORMATION             0x13
74285809Sscottl#define SA_SAS_SMP_WRITE_GPIO_REGISTER                    0x82
75285809Sscottl#define SA_SAS_SMP_CONFIGURE_ROUTING_INFORMATION          0x90
76285809Sscottl#define SA_SAS_SMP_PHY_CONTROL                            0x91
77285809Sscottl#define SA_SAS_SMP_PHY_TEST                               0x92
78285809Sscottl
79285809Sscottl#define SA_SAS_SMP_FUNCTION_ACCEPTED                      0x00
80285809Sscottl#define SA_SAS_SMP_FUNCTION_UNKNOWN                       0x01
81285809Sscottl#define SA_SAS_SMP_FUNCTION_FAILED                        0x02
82285809Sscottl#define SA_SAS_SMP_INVALID_REQ_FRAME_LENGTH               0x03
83285809Sscottl#define SA_SAS_SMP_PHY_NOT_EXIST                          0x10
84285809Sscottl
85285809Sscottl#define SA_SAS_ROUTING_DIRECT                             0x00
86285809Sscottl#define SA_SAS_ROUTING_SUBTRACTIVE                        0x01
87285809Sscottl#define SA_SAS_ROUTING_TABLE                              0x02
88285809Sscottl
89285809Sscottl#define SA_SAS_PHYCTL_LINK_RESET                          0x01
90285809Sscottl#define SA_SAS_PHYCTL_HARD_RESET                          0x02
91285809Sscottl#define SA_SAS_PHYCTL_DISABLE                             0x03
92285809Sscottl#define SA_SAS_PHYCTL_CLEAR_ERROR_LOG                     0x05
93285809Sscottl#define SA_SAS_PHYCTL_CLEAR_AFFILIATION                   0x06
94285809Sscottl#define SA_SAS_PHYCTL_TRANSMIT_PS_SIGNAL                  0x07
95285809Sscottl
96285809Sscottl#define SA_SSP_CMDIU_LEN_BYTES                            28
97285809Sscottl#define SA_SSP_TMIU_LEN_BYTES                             28
98285809Sscottl
99285809Sscottl
100285809Sscottl#define SASD_DEV_SATA_MASK                                0xF0
101285809Sscottl#define SASD_DEV_SAS_MASK                                 0x0F
102285809Sscottl
103285809Sscottl#define SASD_DEV_SAS_END_DEVICE                           0x01 /* SAS end device type */
104285809Sscottl#define SASD_DEV_SAS_EDGE_EXPANDER                        0x02 /* SAS edge expander device type */
105285809Sscottl#define SASD_DEV_SAS_FAN_EXPANDER                         0x03 /* SAS fan out expander device type */
106285809Sscottl
107285809Sscottl#define SASD_DEV_SATA_ATA_DEVICE                          0x10 /* SATA ATA device type */
108285809Sscottl#define SASD_DEV_SATA_ATAPI_DEVICE                        0x20 /* SATA ATAPI device type */
109285809Sscottl#define SASD_DEV_SATA_PM_DEVICE                           0x30 /* SATA PM device type */
110285809Sscottl#define SASD_DEV_SATA_SEMB_DEVICE                         0x40 /* SATA SEMB device type */
111285809Sscottl#define SASD_DEV_SATA_SEMB_WO_SEP_DEVICE                  0x50 /* SATA SEMB without SEP device type */
112285809Sscottl
113285809Sscottl#define SASD_DEV_SATA_UNKNOWN_DEVICE                      0xFF /* SAS SATA unknown device type */
114285809Sscottl
115285809Sscottl
116285809Sscottl#define SASD_TASK_ATTR_SIMPLE                             0x0
117285809Sscottl#define SASD_TASK_ATTR_HEAD_OF_QUEUE                      0x1
118285809Sscottl#define SASD_TASK_ATTR_ORDERED                            0x2
119285809Sscottl#define SASD_TASK_ATTR_ACA                                0x4
120285809Sscottl
121285809Sscottl
122285809Sscottl/*****************************************************************************
123285809Sscottl** SAS TM Function definitions
124285809Sscottl*****************************************************************************/
125285809Sscottl#define SASD_SAS_ABORT_TASK                               0x01
126285809Sscottl#define SASD_SAS_ABORT_TASK_SET                           0x02
127285809Sscottl#define SASD_SAS_CLEAR_TASK_SET                           0x04
128285809Sscottl#define SASD_SAS_LOGICAL_UNIT_RESET                       0x08
129285809Sscottl#define SASD_SAS_CLEAR_ACA                                0x40
130285809Sscottl#define SASD_SAS_QUARY_TASK                               0x80
131285809Sscottl
132285809Sscottl/****************************************************************
133285809Sscottl *            SATA Specification related defines                *
134285809Sscottl ****************************************************************/
135285809Sscottl#define SA_SATA_MAX_QUEUED_COMMANDS                       32
136285809Sscottl#define SA_SATA_MAX_PM_PORTS                              15
137285809Sscottl
138285809Sscottl#define SA_SATA_FIS_TYPE_HOST_2_DEV                       0x27
139285809Sscottl#define SA_SATA_FIS_TYPE_DEV_2_HOST                       0x34
140285809Sscottl#define SA_SATA_FIS_TYPE_SET_DEVICE                       0xA1
141285809Sscottl#define SA_SATA_FIS_TYPE_DMA_ACTIVE                       0x39
142285809Sscottl#define SA_SATA_FIS_TYPE_FDMA_SETUP                       0x41
143285809Sscottl#define SA_SATA_FIS_TYPE_BIST                             0x58
144285809Sscottl
145285809Sscottl#define SA_SATA_CMD_IDENTIFY_DEVICE                       0xEC
146285809Sscottl#define SA_SATA_CMD_EXEC_DEV_DIAG                         0x90
147285809Sscottl
148285809Sscottl#define SA_SATA_CONTROL_SRST                              0x04
149285809Sscottl
150285809Sscottl#define SA_SATA_H2DREG_LEN_BYTES                          20
151285809Sscottl#define SA_SATA_H2D_BIST_LEN_BYTES                        12
152285809Sscottl/****************************************************************
153285809Sscottl *            SAS Specification related structures              *
154285809Sscottl ****************************************************************/
155285809Sscottl
156285809Sscottl
157285809Sscottl
158285809Sscottl/** \brief Structure for SATA BIST FIS
159285809Sscottl *
160285809Sscottl * The agsaFisBIST_t data structure describes a SATA FIS (Frame Information Structures)
161285809Sscottl * for FIS type BIST (Built In Self Test) Activate Bidirectional.
162285809Sscottl *
163285809Sscottl * This data structure is one instance of the SATA request structure agsaSATAInitiatorRequest_t,
164285809Sscottl * which is one instance of the generic request, issued to saSATAStart().
165285809Sscottl */
166285809Sscottl
167285809Sscottl
168285809Sscottl#define SA_SATA_BIST_PATTERN_T_BIT  0x80
169285809Sscottl#define SA_SATA_BIST_PATTERN_A_BIT  0x40
170285809Sscottl#define SA_SATA_BIST_PATTERN_S_BIT  0x20
171285809Sscottl#define SA_SATA_BIST_PATTERN_L_BIT  0x10
172285809Sscottl#define SA_SATA_BIST_PATTERN_F_BIT  0x08
173285809Sscottl#define SA_SATA_BIST_PATTERN_P_BIT  0x04
174285809Sscottl#define SA_SATA_BIST_PATTERN_R_BIT  0x02
175285809Sscottl#define SA_SATA_BIST_PATTERN_V_BIT  0x01
176285809Sscottl
177285809Sscottl/*
178285809Sscottl * The first SATA DWORD types.
179285809Sscottl */
180285809Sscottltypedef struct agsaFisBISTHeader_s
181285809Sscottl{
182285809Sscottl    bit8    fisType; /* fisType, set to 58h for BIST */
183285809Sscottl    bit8    pmPort;
184285809Sscottl    /* b7-b4  reserved */
185285809Sscottl    /* b3-b0  PM Port. device port address that the PM should deliver the FIS to */
186285809Sscottl    bit8   patternDefinition;
187285809Sscottl    /* b7 : T Far end transmit only mode */
188285809Sscottl    /* b6 : A ALIGN Bypass (Do not Transmit Align Primitives) (valid only in combination with T Bit) (optional behavior) */
189285809Sscottl    /* b5 : S Bypass Scrambling (valid only in combination with T Bit) (optional behavior) */
190285809Sscottl    /* b4 : L Far End Retimed Loopback. Transmitter shall insert additional ALIGNS) */
191285809Sscottl    /* b3 : F Far End Analog (AFE) Loopback (Optional) */
192285809Sscottl    /* b2 : P Primitive bit. (valid only in combination with the T Bit) (optional behavior) */
193285809Sscottl    /* b1 : R Reserved */
194285809Sscottl    /* b0 : V Vendor Specific Test Mode. Causes all other bits to be ignored */
195285809Sscottl    bit8   reserved5;       /* Reserved */
196285809Sscottl} agsaFisBISTHeader_t;
197285809Sscottl
198285809Sscottl
199285809Sscottltypedef struct agsaFisRegD2HHeader_s
200285809Sscottl{
201285809Sscottl    bit8    fisType; /* fisType, set to 34h for DeviceToHostReg */
202285809Sscottl    bit8    i_pmPort;
203285809Sscottl    /* b7     : reserved */
204285809Sscottl    /* b6     : I Interrupt bit */
205285809Sscottl    /* b5-b4  : reserved */
206285809Sscottl    /* b3-b0  : PM Port */
207285809Sscottl    bit8    status; /* Contains the contents to be placed in the Status(and Alternate status)
208285809Sscottl                       Register of the Shadow Command Block */
209285809Sscottl    bit8    error;  /* Contains the contents to be placed in the Error register of the Shadow Command Block */
210285809Sscottl} agsaFisRegD2HHeader_t;
211285809Sscottl
212285809Sscottltypedef struct agsaFisSetDevBitsHeader_s
213285809Sscottl{
214285809Sscottl    bit8    fisType;    /* fisType, set to A1h for SetDeviceBit */
215285809Sscottl    bit8    n_i_pmPort;
216285809Sscottl    /* b7   : n Bit. Notification bit. If set device needs attention. */
217285809Sscottl    /* b6   : i Bit. Interrupt Bit */
218285809Sscottl    /* b5-b4: reserved2 */
219285809Sscottl    /* b3-b0: PM Port */
220285809Sscottl    bit8    statusHi_Lo;
221285809Sscottl    /* b7   : reserved */
222285809Sscottl    /* b6-b4: Status Hi. Contains the contents to be placed in bits 6, 5, and 4 of
223285809Sscottl       the Status register of the Shadow Command Block */
224285809Sscottl    /* b3   : Reserved */
225285809Sscottl    /* b2-b0: Status Lo  Contains the contents to be placed in bits 2,1, and 0 of the
226285809Sscottl       Status register of the Shadow Command Block */
227285809Sscottl    bit8    error;    /* Contains the contents to be placed in the Error register of
228285809Sscottl                         the Shadow Command Block */
229285809Sscottl} agsaFisSetDevBitsHeader_t;
230285809Sscottl
231285809Sscottltypedef struct agsaFisRegH2DHeader_s
232285809Sscottl{
233285809Sscottl    bit8    fisType;      /* fisType, set to 27h for DeviceToHostReg */
234285809Sscottl    bit8    c_pmPort;
235285809Sscottl    /* b7   : C_bit This bit is set to one when the register transfer is
236285809Sscottl       due to an update of the Command register */
237285809Sscottl    /* b6-b4: reserved */
238285809Sscottl    /* b3-b0: PM Port */
239285809Sscottl    bit8    command;  /* Contains the contents of the Command register of
240285809Sscottl                         the Shadow Command Block */
241285809Sscottl    bit8    features; /* Contains the contents of the Features register of
242285809Sscottl                         the Shadow Command Block */
243285809Sscottl} agsaFisRegH2DHeader_t;
244285809Sscottl
245285809Sscottltypedef struct agsaFisPioSetupHeader_s
246285809Sscottl{
247285809Sscottl    bit8    fisType;  /* set to 5F */
248285809Sscottl    bit8    i_d_pmPort;
249285809Sscottl    /* b7   : reserved */
250285809Sscottl    /* b6   : i bit. Interrupt bit */
251285809Sscottl    /* b5   : d bit. data transfer direction. set to 1 for device to host xfer */
252285809Sscottl    /* b4   : reserved */
253285809Sscottl    /* b3-b0: PM Port */
254285809Sscottl    bit8    status;
255285809Sscottl    bit8    error;
256285809Sscottl} agsaFisPioSetupHeader_t;
257285809Sscottl
258285809Sscottltypedef union agsaFisHeader_s
259285809Sscottl{
260285809Sscottl    agsaFisBISTHeader_t       Bist;
261285809Sscottl    agsaFisRegD2HHeader_t     D2H;
262285809Sscottl    agsaFisRegH2DHeader_t     H2D;
263285809Sscottl    agsaFisSetDevBitsHeader_t SetDevBits;
264285809Sscottl    agsaFisPioSetupHeader_t   PioSetup;
265285809Sscottl} agsaFisHeader_t;
266285809Sscottl
267285809Sscottl
268285809Sscottltypedef struct agsaFisBISTData_s
269285809Sscottl{
270285809Sscottl    bit8    data[8]; /* BIST data */
271285809Sscottl} agsaFisBISTData_t;
272285809Sscottl
273285809Sscottl
274285809Sscottltypedef struct agsaFisBIST_s
275285809Sscottl{
276285809Sscottl    agsaFisBISTHeader_t   h;
277285809Sscottl    agsaFisBISTData_t     d;
278285809Sscottl} agsaFisBIST_t;
279285809Sscottl
280285809Sscottl/** \brief Structure for SATA Device to Host Register FIS
281285809Sscottl *
282285809Sscottl * The agsaFisRegDeviceToHost_t data structure describes a SATA FIS (Frame Information
283285809Sscottl * Structures) for FIS type Register Device to Host.
284285809Sscottl *
285285809Sscottl * This structure is used only as inbound data (device to host) to describe device to
286285809Sscottl * host response.
287285809Sscottl */
288285809Sscottl
289285809Sscottl#define SA_SATA_RD2H_I_BIT  0x40
290285809Sscottl
291285809Sscottltypedef struct agsaFisRegD2HData_s
292285809Sscottl{
293285809Sscottl    bit8    lbaLow;     /* Contains the contents to be placed in the LBA Low register
294285809Sscottl                           of the Shadow Command Block */
295285809Sscottl    bit8    lbaMid;     /* Contains the contents to be placed in the LBA Mid register
296285809Sscottl                           of the Shadow Command Block */
297285809Sscottl
298285809Sscottl    bit8    lbaHigh;    /* Contains the contents to be placed in the LBA High register
299285809Sscottl                           of the Shadow Command Block */
300285809Sscottl    bit8    device;     /* Contains the contents to be placed in the Device register of the Shadow Command Block */
301285809Sscottl
302285809Sscottl    bit8    lbaLowExp;  /* Contains the contents of the expanded address field
303285809Sscottl                           of the Shadow Command Block */
304285809Sscottl    bit8    lbaMidExp;  /* Contains the contents of the expanded address field
305285809Sscottl                           of the Shadow Command Block */
306285809Sscottl    bit8    lbaHighExp; /* Contains the contents of the expanded address field
307285809Sscottl                           of the Shadow Command Block */
308285809Sscottl    bit8    reserved4;  /** reserved */
309285809Sscottl
310285809Sscottl    bit8    sectorCount; /* Contains the contents to be placed in the Sector
311285809Sscottl                            Count register of the Shadow Command Block */
312285809Sscottl    bit8    sectorCountExp;  /* Contains the contents of the expanded address
313285809Sscottl                                field of the Shadow Command Block */
314285809Sscottl    bit8    reserved6;  /* Reserved */
315285809Sscottl    bit8    reserved5;  /* Reserved */
316285809Sscottl    bit32   reserved7; /* Reserved */
317285809Sscottl} agsaFisRegD2HData_t;
318285809Sscottl
319285809Sscottl
320285809Sscottltypedef struct agsaFisRegDeviceToHost_s
321285809Sscottl{
322285809Sscottl    agsaFisRegD2HHeader_t     h;
323285809Sscottl    agsaFisRegD2HData_t       d;
324285809Sscottl} agsaFisRegDeviceToHost_t;
325285809Sscottl
326285809Sscottl
327285809Sscottl
328285809Sscottl/** \brief Structure for SATA Host to Device Register FIS
329285809Sscottl *
330285809Sscottl * The agsaFisRegHostToDevice_t data structure describes a SATA FIS
331285809Sscottl * (Frame Information Structures) for FIS type Register Host to Device.
332285809Sscottl
333285809Sscottl * This data structure is one instance of the SATA request structure
334285809Sscottl * agsaSATAInitiatorRequest_t, which is one instance of the generic request,
335285809Sscottl * issued to saSATAStart().
336285809Sscottl */
337285809Sscottltypedef struct agsaFisRegH2DData_s
338285809Sscottl{
339285809Sscottl    bit8    lbaLow;       /* Contains the contents of the LBA Low register of the Shadow Command Block */
340285809Sscottl    bit8    lbaMid;       /* Contains the contents of the LBA Mid register of the Shadow Command Block */
341285809Sscottl    bit8    lbaHigh;      /* Contains the contents of the LBA High register of the Shadow Command Block */
342285809Sscottl    bit8    device;       /* Contains the contents of the Device register of the Shadow Command Block */
343285809Sscottl
344285809Sscottl    bit8    lbaLowExp;    /* Contains the contents of the expanded address field of the
345285809Sscottl                             Shadow Command Block */
346285809Sscottl    bit8    lbaMidExp;    /* Contains the contents of the expanded address field of the
347285809Sscottl                             Shadow Command Block */
348285809Sscottl    bit8    lbaHighExp;   /* Contains the contents of the expanded address field of the
349285809Sscottl                             Shadow Command Block */
350285809Sscottl    bit8    featuresExp;  /* Contains the contents of the expanded address field of the
351285809Sscottl                             Shadow Command Block */
352285809Sscottl
353285809Sscottl    bit8    sectorCount;    /* Contains the contents of the Sector Count register of the
354285809Sscottl                               Shadow Command Block */
355285809Sscottl    bit8    sectorCountExp; /* Contains the contents of the expanded address field of
356285809Sscottl                               the Shadow Command Block */
357285809Sscottl    bit8    reserved4;    /* Reserved */
358285809Sscottl    bit8    control;      /* Contains the contents of the Device Control register of the
359285809Sscottl                             Shadow Command Block */
360285809Sscottl    bit32   reserved5;      /* Reserved */
361285809Sscottl} agsaFisRegH2DData_t;
362285809Sscottl
363285809Sscottltypedef struct agsaFisRegHostToDevice_s
364285809Sscottl{
365285809Sscottl    agsaFisRegH2DHeader_t   h;
366285809Sscottl    agsaFisRegH2DData_t     d;
367285809Sscottl} agsaFisRegHostToDevice_t;
368285809Sscottl
369285809Sscottl
370285809Sscottl/** \brief Structure for SATA SetDeviceBit FIS
371285809Sscottl *
372285809Sscottl * The agsaFisSetDevBits_t data structure describes a SATA FIS (Frame Information Structures)
373285809Sscottl * for FIS type Set Device Bits - Device to Host.
374285809Sscottl *
375285809Sscottl * This structure is used only as inbound data (device to host) to describe device to host
376285809Sscottl * response.
377285809Sscottl */
378285809Sscottltypedef struct agsaFisSetDevBitsData_s
379285809Sscottl{
380285809Sscottl    bit32   reserved6; /* Reserved */
381285809Sscottl} agsaFisSetDevBitsData_t;
382285809Sscottl
383285809Sscottl
384285809Sscottltypedef struct agsaFisSetDevBits_s
385285809Sscottl{
386285809Sscottl    agsaFisSetDevBitsHeader_t   h;
387285809Sscottl    agsaFisSetDevBitsData_t     d;
388285809Sscottl} agsaFisSetDevBits_t;
389285809Sscottl
390285809Sscottl
391285809Sscottl/** \brief union data structure specifies a FIS from host software
392285809Sscottl *
393285809Sscottl * union data structure specifies a FIS from host software
394285809Sscottl */
395285809Sscottltypedef union agsaSATAHostFis_u
396285809Sscottl{
397285809Sscottl    agsaFisRegHostToDevice_t    fisRegHostToDev; /* Structure containing the FIS request
398285809Sscottl                                                    for Register - Host to Device */
399285809Sscottl    agsaFisBIST_t               fisBIST; /* Structure containing the FIS request for BIST */
400285809Sscottl} agsaSATAHostFis_t;
401285809Sscottl
402285809Sscottl/** \brief
403285809Sscottl *
404285809Sscottl * This structure is used
405285809Sscottl *
406285809Sscottl */
407285809Sscottltypedef struct agsaFisPioSetupData_s
408285809Sscottl{
409285809Sscottl    bit8    lbaLow;       /* Contains the contents of the LBA Low register of the Shadow Command Block */
410285809Sscottl    bit8    lbaMid;       /* Contains the contents of the LBA Mid register of the Shadow Command Block */
411285809Sscottl    bit8    lbaHigh;      /* Contains the contents of the LBA High register of the Shadow Command Block */
412285809Sscottl    bit8    device;       /* Contains the contents of the Device register of the Shadow Command Block */
413285809Sscottl
414285809Sscottl    bit8    lbaLowExp;    /* Contains the contents of the expanded address field of the
415285809Sscottl                             Shadow Command Block */
416285809Sscottl    bit8    lbaMidExp;    /* Contains the contents of the expanded address field of the
417285809Sscottl                             Shadow Command Block */
418285809Sscottl    bit8    lbaHighExp;   /* Contains the contents of the expanded address field of the
419285809Sscottl                             Shadow Command Block */
420285809Sscottl    bit8    reserved1;    /* reserved */
421285809Sscottl
422285809Sscottl    bit8    sectorCount;    /* Contains the contents of the Sector Count register of the
423285809Sscottl                               Shadow Command Block */
424285809Sscottl    bit8    sectorCountExp; /* Contains the contents of the expanded address field of
425285809Sscottl                               the Shadow Command Block */
426285809Sscottl    bit8    reserved2;    /* Reserved */
427285809Sscottl    bit8    e_status;     /* Contains the new value of Status Reg of the Command block
428285809Sscottl                             at the conclusion of the subsequent Data FIS */
429285809Sscottl    bit8    reserved4[2];    /* Reserved */
430285809Sscottl    bit8    transferCount[2]; /* the number of bytes to be xfered in the subsequent Data FiS */
431285809Sscottl} agsaFisPioSetupData_t;
432285809Sscottl
433285809Sscottl
434285809Sscottltypedef struct agsaFisPioSetup_s
435285809Sscottl{
436285809Sscottl    agsaFisPioSetupHeader_t h;
437285809Sscottl    agsaFisPioSetupData_t   d;
438285809Sscottl} agsaFisPioSetup_t;
439285809Sscottl
440285809Sscottl
441285809Sscottl
442285809Sscottl/** \brief describe SAS IDENTIFY address frame
443285809Sscottl *
444285809Sscottl * describe SAS IDENTIFY address frame, the CRC field is not included in the structure
445285809Sscottl *
446285809Sscottl */
447285809Sscottltypedef struct agsaSASIdentify_s
448285809Sscottl{
449285809Sscottl    bit8  deviceType_addressFrameType;
450285809Sscottl    /* b7   : reserved */
451285809Sscottl    /* b6-4 : device type */
452285809Sscottl    /* b3-0 : address frame type */
453285809Sscottl    bit8  reason;  /* reserved */
454285809Sscottl    /* b7-4 : reserved */
455285809Sscottl    /* b3-0 : reason SAS2 */
456285809Sscottl    bit8  initiator_ssp_stp_smp;
457285809Sscottl    /* b8-4 : reserved */
458285809Sscottl    /* b3   : SSP initiator port */
459285809Sscottl    /* b2   : STP initiator port */
460285809Sscottl    /* b1   : SMP initiator port */
461285809Sscottl    /* b0   : reserved */
462285809Sscottl    bit8  target_ssp_stp_smp;
463285809Sscottl    /* b8-4 : reserved */
464285809Sscottl    /* b3   : SSP target port */
465285809Sscottl    /* b2   : STP target port */
466285809Sscottl    /* b1   : SMP target port */
467285809Sscottl    /* b0   : reserved */
468285809Sscottl    bit8  deviceName[8];            /* reserved */
469285809Sscottl
470285809Sscottl    bit8  sasAddressHi[4];          /* BE SAS address Lo */
471285809Sscottl    bit8  sasAddressLo[4];          /* BE SAS address Hi */
472285809Sscottl
473285809Sscottl    bit8  phyIdentifier;            /* phy identifier of the phy transmitting the IDENTIFY address frame */
474285809Sscottl    bit8  zpsds_breakReplyCap;
475285809Sscottl    /* b7-3 : reserved */
476285809Sscottl    /* b2   : Inside ZPSDS Persistent */
477285809Sscottl    /* b1   : Requested Inside ZPSDS */
478285809Sscottl    /* b0   : Break Reply Capable */
479285809Sscottl    bit8  reserved3[6];             /* reserved */
480285809Sscottl} agsaSASIdentify_t;
481285809Sscottl
482285809Sscottl#define SA_IDFRM_GET_SAS_ADDRESSLO(identFrame)                  \
483285809Sscottl    DMA_BEBIT32_TO_BIT32(*(bit32 *)(identFrame)->sasAddressLo)
484285809Sscottl
485285809Sscottl#define SA_IDFRM_GET_SAS_ADDRESSHI(identFrame)                  \
486285809Sscottl    DMA_BEBIT32_TO_BIT32(*(bit32 *)(identFrame)->sasAddressHi)
487285809Sscottl
488285809Sscottl#define SA_IDFRM_GET_DEVICETTYPE(identFrame)                    \
489285809Sscottl    (((identFrame)->deviceType_addressFrameType & 0x70) >> 4)
490285809Sscottl
491285809Sscottl#define SA_IDFRM_PUT_SAS_ADDRESSLO(identFrame, src32)                   \
492285809Sscottl    ((*(bit32 *)((identFrame)->sasAddressLo)) = BIT32_TO_DMA_BEBIT32(src32))
493285809Sscottl
494285809Sscottl#define SA_IDFRM_PUT_SAS_ADDRESSHI(identFrame, src32)                   \
495285809Sscottl    ((*(bit32 *)((identFrame)->sasAddressHi)) = BIT32_TO_DMA_BEBIT32(src32))
496285809Sscottl
497285809Sscottl#define SA_IDFRM_SSP_BIT         0x8   /* SSP Initiator port */
498285809Sscottl#define SA_IDFRM_STP_BIT         0x4   /* STP Initiator port */
499285809Sscottl#define SA_IDFRM_SMP_BIT         0x2   /* SMP Initiator port */
500285809Sscottl#define SA_IDFRM_SATA_BIT        0x1   /* SATA device, valid in the discovery response only */
501285809Sscottl
502285809Sscottl
503285809Sscottl#define SA_IDFRM_IS_SSP_INITIATOR(identFrame)                           \
504285809Sscottl    (((identFrame)->initiator_ssp_stp_smp & SA_IDFRM_SSP_BIT) == SA_IDFRM_SSP_BIT)
505285809Sscottl
506285809Sscottl#define SA_IDFRM_IS_STP_INITIATOR(identFrame)                           \
507285809Sscottl    (((identFrame)->initiator_ssp_stp_smp & SA_IDFRM_STP_BIT) == SA_IDFRM_STP_BIT)
508285809Sscottl
509285809Sscottl#define SA_IDFRM_IS_SMP_INITIATOR(identFrame)                           \
510285809Sscottl    (((identFrame)->initiator_ssp_stp_smp & SA_IDFRM_SMP_BIT) == SA_IDFRM_SMP_BIT)
511285809Sscottl
512285809Sscottl#define SA_IDFRM_IS_SSP_TARGET(identFrame)                              \
513285809Sscottl    (((identFrame)->target_ssp_stp_smp & SA_IDFRM_SSP_BIT) == SA_IDFRM_SSP_BIT)
514285809Sscottl
515285809Sscottl#define SA_IDFRM_IS_STP_TARGET(identFrame)                              \
516285809Sscottl    (((identFrame)->target_ssp_stp_smp & SA_IDFRM_STP_BIT) == SA_IDFRM_STP_BIT)
517285809Sscottl
518285809Sscottl#define SA_IDFRM_IS_SMP_TARGET(identFrame)                              \
519285809Sscottl    (((identFrame)->target_ssp_stp_smp & SA_IDFRM_SMP_BIT) == SA_IDFRM_SMP_BIT)
520285809Sscottl
521285809Sscottl#define SA_IDFRM_IS_SATA_DEVICE(identFrame)                             \
522285809Sscottl    (((identFrame)->target_ssp_stp_smp & SA_IDFRM_SATA_BIT) == SA_IDFRM_SATA_BIT)
523285809Sscottl
524285809Sscottl/** \brief data structure provides the identify data of the SATA device
525285809Sscottl *
526285809Sscottl * data structure provides the identify data of the SATA device
527285809Sscottl *
528285809Sscottl */
529285809Sscottltypedef struct agsaSATAIdentifyData_s
530285809Sscottl{
531285809Sscottl  bit16   rm_ataDevice;
532285809Sscottl    /* b15-b9 :  */
533285809Sscottl    /* b8     :  ataDevice */
534285809Sscottl    /* b7-b1  : */
535285809Sscottl    /* b0     :  removableMedia */
536285809Sscottl  bit16   word1_9[9];                    /**< word 1 to 9 of identify device information */
537285809Sscottl  bit8    serialNumber[20];              /**< word 10 to 19 of identify device information, 20 ASCII chars */
538285809Sscottl  bit16   word20_22[3];                  /**< word 20 to 22 of identify device information */
539285809Sscottl  bit8    firmwareVersion[8];            /**< word 23 to 26 of identify device information, 4 ASCII chars */
540285809Sscottl  bit8    modelNumber[40];               /**< word 27 to 46 of identify device information, 40 ASCII chars */
541285809Sscottl  bit16   word47_48[2];                  /**< word 47 to 48 of identify device information, 40 ASCII chars */
542285809Sscottl  bit16   dma_lba_iod_ios_stimer;
543285809Sscottl    /* b15-b14:word49_bit14_15 */
544285809Sscottl    /* b13    : standbyTimerSupported */
545285809Sscottl    /* b12    : word49_bit12 */
546285809Sscottl    /* b11    : IORDYSupported */
547285809Sscottl    /* b10     : IORDYDisabled */
548285809Sscottl    /* b9     : lbaSupported */
549285809Sscottl    /* b8     : dmaSupported */
550285809Sscottl    /* b7-b0  : retired */
551285809Sscottl  bit16   word50_52[3];                  /**< word 50 to 52 of identify device information, 40 ASCII chars */
552285809Sscottl  bit16   valid_w88_w70;
553285809Sscottl    /* b15-3  : word53_bit3_15 */
554285809Sscottl    /* b2     : validWord88  */
555285809Sscottl    /* b1     : validWord70_64  */
556285809Sscottl    /* b0     : word53_bit0  */
557285809Sscottl  bit16   word54_59[6];                  /**< word54-59 of identify device information  */
558285809Sscottl  bit16   numOfUserAddressableSectorsLo; /**< word60 of identify device information  */
559285809Sscottl  bit16   numOfUserAddressableSectorsHi; /**< word61 of identify device information  */
560285809Sscottl  bit16   word62_74[13];                 /**< word62-74 of identify device information  */
561285809Sscottl  bit16   queueDepth;
562285809Sscottl    /* b15-5  : word75_bit5_15 */
563285809Sscottl    /* b4-0   : queueDepth */
564285809Sscottl  bit16   sataCapabilities;
565285809Sscottl    /* b15-b11: word76_bit11_15  */
566285809Sscottl    /* b10    : phyEventCountersSupport */
567285809Sscottl    /* b9     : hostInitPowerMangment */
568285809Sscottl    /* b8     : nativeCommandQueuing */
569285809Sscottl    /* b7-b3  : word76_bit4_7 */
570285809Sscottl    /* b2     : sataGen2Supported (3.0 Gbps) */
571285809Sscottl    /* b1     : sataGen1Supported (1.5 Gbps) */
572285809Sscottl    /* b0      :word76_bit0 */
573285809Sscottl  bit16   word77;                        /**< word77 of identify device information */
574285809Sscottl    /* b15-b6 : word77 bit6_15, Reserved */
575285809Sscottl    /* b5     : DMA Setup Auto-Activate support */
576285809Sscottl    /* b4     : NCQ streaming support */
577285809Sscottl    /* b3-b1  : coded value indicating current negotiated SATA signal speed */
578285809Sscottl    /* b0     : shall be zero */
579285809Sscottl  bit16   sataFeaturesSupported;
580285809Sscottl    /* b15-b7 : word78_bit7_15 */
581285809Sscottl    /* b6     : softSettingPreserveSupported */
582285809Sscottl    /* b5     : word78_bit5 */
583285809Sscottl    /* b4     : inOrderDataDeliverySupported */
584285809Sscottl    /* b3     : devInitPowerManagementSupported */
585285809Sscottl    /* b2     : autoActiveDMASupported */
586285809Sscottl    /* b1     : nonZeroBufOffsetSupported */
587285809Sscottl    /* b0     : word78_bit0  */
588285809Sscottl  bit16   sataFeaturesEnabled;
589285809Sscottl    /* b15-7  : word79_bit7_15  */
590285809Sscottl    /* b6     : softSettingPreserveEnabled */
591285809Sscottl    /* b5     : word79_bit5  */
592285809Sscottl    /* b4     : inOrderDataDeliveryEnabled */
593285809Sscottl    /* b3     : devInitPowerManagementEnabled */
594285809Sscottl    /* b2     : autoActiveDMAEnabled */
595285809Sscottl    /* b1     : nonZeroBufOffsetEnabled */
596285809Sscottl    /* b0     : word79_bit0 */
597285809Sscottl  bit16   majorVersionNumber;
598285809Sscottl    /* b15    : word80_bit15 */
599285809Sscottl    /* b14    : supportATA_ATAPI14 */
600285809Sscottl    /* b13    : supportATA_ATAPI13 */
601285809Sscottl    /* b12    : supportATA_ATAPI12 */
602285809Sscottl    /* b11    : supportATA_ATAPI11 */
603285809Sscottl    /* b10    : supportATA_ATAPI10 */
604285809Sscottl    /* b9     : supportATA_ATAPI9  */
605285809Sscottl    /* b8     : supportATA_ATAPI8  */
606285809Sscottl    /* b7     : supportATA_ATAPI7  */
607285809Sscottl    /* b6     : supportATA_ATAPI6  */
608285809Sscottl    /* b5     : supportATA_ATAPI5  */
609285809Sscottl    /* b4     : supportATA_ATAPI4 */
610285809Sscottl    /* b3     : supportATA3 */
611285809Sscottl    /* b2-0   : word80_bit0_2 */
612285809Sscottl  bit16   minorVersionNumber;            /**< word81 of identify device information */
613285809Sscottl  bit16   commandSetSupported;
614285809Sscottl    /* b15    : word82_bit15 */
615285809Sscottl    /* b14    : NOPSupported */
616285809Sscottl    /* b13    : READ_BUFFERSupported */
617285809Sscottl    /* b12    : WRITE_BUFFERSupported */
618285809Sscottl    /* b11    : word82_bit11 */
619285809Sscottl    /* b10    : hostProtectedAreaSupported */
620285809Sscottl    /* b9     : DEVICE_RESETSupported */
621285809Sscottl    /* b8     : SERVICEInterruptSupported */
622285809Sscottl    /* b7     : releaseInterruptSupported */
623285809Sscottl    /* b6     : lookAheadSupported */
624285809Sscottl    /* b5     : writeCacheSupported */
625285809Sscottl    /* b4     : word82_bit4 */
626285809Sscottl    /* b3     : mandPowerManagmentSupported */
627285809Sscottl    /* b2     : removableMediaSupported */
628285809Sscottl    /* b1     : securityModeSupported */
629285809Sscottl    /* b0     : SMARTSupported */
630285809Sscottl  bit16   commandSetSupported1;
631285809Sscottl    /* b15-b14: word83_bit14_15  */
632285809Sscottl    /* b13    : FLUSH_CACHE_EXTSupported  */
633285809Sscottl    /* b12    : mandatoryFLUSH_CACHESupported */
634285809Sscottl    /* b11    : devConfOverlaySupported */
635285809Sscottl    /* b10    : address48BitsSupported */
636285809Sscottl    /* b9     : autoAcousticManageSupported */
637285809Sscottl    /* b8     : SET_MAX_SecurityExtSupported */
638285809Sscottl    /* b7     : word83_bit7 */
639285809Sscottl    /* b6     : SET_FEATUREReqSpinupSupported */
640285809Sscottl    /* b5     : powerUpInStandyBySupported */
641285809Sscottl    /* b4     : removableMediaStNotifSupported */
642285809Sscottl    /* b3     : advanPowerManagmentSupported */
643285809Sscottl    /* b2     : CFASupported */
644285809Sscottl    /* b1     : DMAQueuedSupported */
645285809Sscottl    /* b0     : DOWNLOAD_MICROCODESupported */
646285809Sscottl  bit16   commandSetFeatureSupportedExt;
647285809Sscottl    /* b15-b13: word84_bit13_15 */
648285809Sscottl    /* b12    : timeLimitRWContSupported */
649285809Sscottl    /* b11    : timeLimitRWSupported */
650285809Sscottl    /* b10    : writeURGBitSupported */
651285809Sscottl    /* b9     : readURGBitSupported */
652285809Sscottl    /* b8     : wwwNameSupported */
653285809Sscottl    /* b7     : WRITE_DMAQ_FUA_EXTSupported */
654285809Sscottl    /* b6     : WRITE_FUA_EXTSupported */
655285809Sscottl    /* b5     : generalPurposeLogSupported */
656285809Sscottl    /* b4     : streamingSupported  */
657285809Sscottl    /* b3     : mediaCardPassThroughSupported */
658285809Sscottl    /* b2     : mediaSerialNoSupported */
659285809Sscottl    /* b1     : SMARTSelfRestSupported */
660285809Sscottl    /* b0     : SMARTErrorLogSupported */
661285809Sscottl  bit16   commandSetFeatureEnabled;
662285809Sscottl    /* b15    : word85_bit15 */
663285809Sscottl    /* b14    : NOPEnabled */
664285809Sscottl    /* b13    : READ_BUFFEREnabled  */
665285809Sscottl    /* b12    : WRITE_BUFFEREnabled */
666285809Sscottl    /* b11    : word85_bit11 */
667285809Sscottl    /* b10    : hostProtectedAreaEnabled  */
668285809Sscottl    /* b9     : DEVICE_RESETEnabled */
669285809Sscottl    /* b8     : SERVICEInterruptEnabled */
670285809Sscottl    /* b7     : releaseInterruptEnabled */
671285809Sscottl    /* b6     : lookAheadEnabled */
672285809Sscottl    /* b5     : writeCacheEnabled */
673285809Sscottl    /* b4     : word85_bit4 */
674285809Sscottl    /* b3     : mandPowerManagmentEnabled */
675285809Sscottl    /* b2     : removableMediaEnabled */
676285809Sscottl    /* b1     : securityModeEnabled */
677285809Sscottl    /* b0     : SMARTEnabled */
678285809Sscottl  bit16   commandSetFeatureEnabled1;
679285809Sscottl    /* b15-b14: word86_bit14_15 */
680285809Sscottl    /* b13    : FLUSH_CACHE_EXTEnabled */
681285809Sscottl    /* b12    : mandatoryFLUSH_CACHEEnabled */
682285809Sscottl    /* b11    : devConfOverlayEnabled */
683285809Sscottl    /* b10    : address48BitsEnabled */
684285809Sscottl    /* b9     : autoAcousticManageEnabled */
685285809Sscottl    /* b8     : SET_MAX_SecurityExtEnabled */
686285809Sscottl    /* b7     : word86_bit7 */
687285809Sscottl    /* b6     : SET_FEATUREReqSpinupEnabled */
688285809Sscottl    /* b5     : powerUpInStandyByEnabled  */
689285809Sscottl    /* b4     : removableMediaStNotifEnabled */
690285809Sscottl    /* b3     : advanPowerManagmentEnabled */
691285809Sscottl    /* b2     : CFAEnabled */
692285809Sscottl    /* b1     : DMAQueuedEnabled */
693285809Sscottl    /* b0     : DOWNLOAD_MICROCODEEnabled */
694285809Sscottl  bit16   commandSetFeatureDefault;
695285809Sscottl    /* b15-b13: word87_bit13_15 */
696285809Sscottl    /* b12    : timeLimitRWContEnabled */
697285809Sscottl    /* b11    : timeLimitRWEnabled */
698285809Sscottl    /* b10    : writeURGBitEnabled */
699285809Sscottl    /* b9     : readURGBitEnabled */
700285809Sscottl    /* b8     : wwwNameEnabled */
701285809Sscottl    /* b7     : WRITE_DMAQ_FUA_EXTEnabled */
702285809Sscottl    /* b6     : WRITE_FUA_EXTEnabled */
703285809Sscottl    /* b5     : generalPurposeLogEnabled */
704285809Sscottl    /* b4     : streamingEnabled */
705285809Sscottl    /* b3     : mediaCardPassThroughEnabled */
706285809Sscottl    /* b2     : mediaSerialNoEnabled */
707285809Sscottl    /* b1     : SMARTSelfRestEnabled */
708285809Sscottl    /* b0     : SMARTErrorLogEnabled */
709285809Sscottl  bit16   ultraDMAModes;
710285809Sscottl    /* b15    : word88_bit15 */
711285809Sscottl    /* b14    : ultraDMAMode6Selected */
712285809Sscottl    /* b13    : ultraDMAMode5Selected */
713285809Sscottl    /* b12    : ultraDMAMode4Selected */
714285809Sscottl    /* b11    : ultraDMAMode3Selected */
715285809Sscottl    /* b10    : ultraDMAMode2Selected */
716285809Sscottl    /* b9     : ultraDMAMode1Selected */
717285809Sscottl    /* b8     : ultraDMAMode0Selected */
718285809Sscottl    /* b7     : word88_bit7  */
719285809Sscottl    /* b6     : ultraDMAMode6Supported */
720285809Sscottl    /* b5     : ultraDMAMode5Supported */
721285809Sscottl    /* b4     : ultraDMAMode4Supported */
722285809Sscottl    /* b3     : ultraDMAMode3Supported */
723285809Sscottl    /* b2     : ultraDMAMode2Supported */
724285809Sscottl    /* b1     : ultraDMAMode1Supported */
725285809Sscottl    /* b0     : ultraDMAMode0Supported */
726285809Sscottl  bit16   timeToSecurityErase;
727285809Sscottl  bit16   timeToEnhhancedSecurityErase;
728285809Sscottl  bit16   currentAPMValue;
729285809Sscottl  bit16   masterPasswordRevCode;
730285809Sscottl  bit16   hardwareResetResult;
731285809Sscottl    /* b15-b14: word93_bit15_14 */
732285809Sscottl    /* b13    : deviceDetectedCBLIBbelow Vil */
733285809Sscottl    /* b12-b8 : device1 HardwareResetResult */
734285809Sscottl    /* b7-b0  : device0 HardwareResetResult */
735285809Sscottl  bit16   currentAutoAccousticManagementValue;
736285809Sscottl    /* b15-b8 : Vendor recommended value */
737285809Sscottl    /* b7-b0  : current value */
738285809Sscottl  bit16   word95_99[5];                  /**< word85-99 of identify device information  */
739285809Sscottl  bit16   maxLBA0_15;                    /**< word100 of identify device information  */
740285809Sscottl  bit16   maxLBA16_31;                   /**< word101 of identify device information  */
741285809Sscottl  bit16   maxLBA32_47;                   /**< word102 of identify device information  */
742285809Sscottl  bit16   maxLBA48_63;                   /**< word103 of identify device information  */
743285809Sscottl  bit16   word104_107[4];                /**< word104-107 of identify device information  */
744285809Sscottl  bit16   namingAuthority;
745285809Sscottl    /* b15-b12: NAA_bit0_3  */
746285809Sscottl    /* b11-b0 : IEEE_OUI_bit12_23*/
747285809Sscottl  bit16   namingAuthority1;
748285809Sscottl    /* b15-b4 : IEEE_OUI_bit0_11 */
749285809Sscottl    /* b3-b0  : uniqueID_bit32_35 */
750285809Sscottl  bit16   uniqueID_bit16_31;                      /**< word110 of identify device information  */
751285809Sscottl  bit16   uniqueID_bit0_15;                       /**< word111 of identify device information  */
752285809Sscottl  bit16   word112_126[15];
753285809Sscottl  bit16   removableMediaStatusNotificationFeature;
754285809Sscottl    /* b15-b2 : word127_b16_2 */
755285809Sscottl    /* b1-b0  : supported set see ATAPI6 spec */
756285809Sscottl  bit16   securityStatus;
757285809Sscottl    /* b15-b9 : word128_b15_9 */
758285809Sscottl    /* b8     : securityLevel */
759285809Sscottl    /* b7-b6  : word128_b7_6 */
760285809Sscottl    /* b5     : enhancedSecurityEraseSupported */
761285809Sscottl    /* b4     : securityCountExpired */
762285809Sscottl    /* b3     : securityFrozen */
763285809Sscottl    /* b2     : securityLocked */
764285809Sscottl    /* b1     : securityEnabled */
765285809Sscottl    /* b0     : securitySupported */
766285809Sscottl  bit16   vendorSpecific[31];
767285809Sscottl  bit16   cfaPowerMode1;
768285809Sscottl    /* b15    : word 160 supported */
769285809Sscottl    /* b14    : word160_b14 */
770285809Sscottl    /* b13    : cfaPowerRequired */
771285809Sscottl    /* b12    : cfaPowerModeDisabled */
772285809Sscottl    /* b11-b0 : maxCurrentInMa */
773285809Sscottl  bit16   word161_175[15];
774285809Sscottl  bit16   currentMediaSerialNumber[30];
775285809Sscottl  bit16   word206_254[49];              /**< word206-254 of identify device information  */
776285809Sscottl  bit16   integrityWord;
777285809Sscottl    /* b15-b8 : cheksum */
778285809Sscottl    /* b7-b0  : signature */
779285809Sscottl} agsaSATAIdentifyData_t;
780285809Sscottl
781285809Sscottl
782285809Sscottl
783285809Sscottl
784285809Sscottl/** \brief data structure describes an SSP Command INFORMATION UNIT
785285809Sscottl *
786285809Sscottl * data structure describes an SSP Command INFORMATION UNIT used for SSP command and is part of
787285809Sscottl * the SSP frame.
788285809Sscottl *
789285809Sscottl * Currently, only CDB up to 16 bytes is supported. Additional CDB length is supported to 0 bytes..
790285809Sscottl *
791285809Sscottl */
792285809Sscottltypedef struct agsaSSPCmdInfoUnit_s
793285809Sscottl{
794285809Sscottl    bit8    lun[8];                /* SCSI Logical Unit Number */
795285809Sscottl    bit8    reserved1;             /* reserved */
796285809Sscottl    bit8    efb_tp_taskAttribute;
797285809Sscottl    /* B7   : enabledFirstBurst */
798285809Sscottl    /* B6-3 : taskPriority */
799285809Sscottl    /* B2-0 : taskAttribute */
800285809Sscottl    bit8    reserved2;             /* reserved */
801285809Sscottl    bit8    additionalCdbLen;
802285809Sscottl    /* B7-2 : additionalCdbLen */
803285809Sscottl    /* B1-0 : reserved */
804285809Sscottl    bit8    cdb[16];      /* The SCSI CDB up to 16 bytes length */
805285809Sscottl} agsaSSPCmdInfoUnit_t;
806285809Sscottl
807285809Sscottl#define SA_SSPCMD_GET_TASKATTRIB(pCmd) ((pCmd)->efb_tp_taskAttribute & 0x7)
808285809Sscottl
809285809Sscottl
810285809Sscottl/** \brief structure describes an SSP Response INFORMATION UNIT
811285809Sscottl *
812285809Sscottl * data structure describes an SSP Response INFORMATION UNIT used for SSP response to Command IU
813285809Sscottl * or Task IU and is part of the SSP frame
814285809Sscottl *
815285809Sscottl */
816285809Sscottl
817285809Sscottltypedef struct agsaSSPResponseInfoUnit_s
818285809Sscottl{
819285809Sscottl    bit8    reserved1[10];      /* reserved */
820285809Sscottl
821285809Sscottl    bit8    dataPres;           /* which data is present */
822285809Sscottl    /* B7-2 : reserved */
823285809Sscottl    /* B1-0 : data Present */
824285809Sscottl    bit8    status;             /* SCSI status as define by SAM-3 */
825285809Sscottl    bit8    reserved4[4];       /* reserved */
826285809Sscottl    bit8    senseDataLen[4];    /* SCSI Sense Data length */
827285809Sscottl    bit8    responsedataLen[4]; /* Response data length */
828285809Sscottl    /* Follow by Response Data if any */
829285809Sscottl    /* Follow by Sense Data if any */
830285809Sscottl} agsaSSPResponseInfoUnit_t;
831285809Sscottl
832285809Sscottl
833285809Sscottltypedef struct agsaSSPFrameFormat_s
834285809Sscottl{
835285809Sscottl    bit8    frameType;             /* frame type */
836285809Sscottl    bit8    hdsa[3];               /* Hashed destination SAS Address */
837285809Sscottl    bit8    reserved1;
838285809Sscottl    bit8    hssa[3];               /* Hashed source SAS Address */
839285809Sscottl    bit8    reserved2;
840285809Sscottl    bit8    reserved3;
841285809Sscottl    bit8    tlr_rdf;
842285809Sscottl    /* B7-5 : reserved */
843285809Sscottl    /* B4-3 : TLR control*/
844285809Sscottl    /* B2   : Retry Data Frames */
845285809Sscottl    /* B1   : Retransmit */
846285809Sscottl    /* B0   : Changing Data Pointer */
847285809Sscottl    bit8    fill_bytes;
848285809Sscottl    /* B7-2 : reserved */
849285809Sscottl    /* B1-0 : Number of Fill bytes*/
850285809Sscottl    bit8    reserved5;
851285809Sscottl    bit8    reserved6[3];
852285809Sscottl    bit8    tag[2];               /* CMD or TM tag */
853285809Sscottl    bit8    tptt[2];              /* target port transfer tag */
854285809Sscottl    bit8    dataOffset[4];        /* data offset */
855285809Sscottl    /* Follow by IU  */
856285809Sscottl} agsaSSPFrameFormat_t;
857285809Sscottl
858285809Sscottl
859285809Sscottltypedef struct agsaSSPOpenFrame_s
860285809Sscottl{
861285809Sscottl    bit8    frameType;             /* frame type */
862285809Sscottl    /* B7   : Initiator Port */
863285809Sscottl    /* B6-4 : Protocol */
864285809Sscottl    /* B3-0 : Address Frame Type */
865285809Sscottl    bit8    feat_connrate;
866285809Sscottl    /* B7-4 : features */
867285809Sscottl    /* B3-0 : connection rate */
868285809Sscottl    bit8    initiatorConnTag[2];    /* Initiator connection tag */
869285809Sscottl    bit8    dstSasAddr[8];          /* Destination SAS Address */
870285809Sscottl    bit8    srcSasAddr[8];          /* Source SAS Address */
871285809Sscottl    bit8    zoneSrcGroup;           /* Zone source group */
872285809Sscottl    bit8    pathwayBlockCount;      /* pathway block count */
873285809Sscottl    bit8    arbWaitTime[2];         /* Arbitration Wait Time */
874285809Sscottl    bit8    moreCompatFeat[4];      /* More Compatibility Features */
875285809Sscottl    /* Follow by CRC  */
876285809Sscottl} agsaSSPOpenFrame_t;
877285809Sscottl
878285809Sscottl#define SA_SSPRESP_GET_SENSEDATALEN(pSSPResp)                   \
879285809Sscottl    DMA_BEBIT32_TO_BIT32(*(bit32*)(pSSPResp)->senseDataLen)
880285809Sscottl
881285809Sscottl#define SA_SSPRESP_GET_RESPONSEDATALEN(pSSPResp)                \
882285809Sscottl    DMA_BEBIT32_TO_BIT32(*(bit32*)(pSSPResp)->responsedataLen)
883285809Sscottl
884285809Sscottl#define SA_SSPRESP_GET_DATAPRES(pSSPResp) ((pSSPResp)->dataPres & 0x3)
885285809Sscottl
886285809Sscottl/** \brief structure describes a SAS SSP Task Management command request
887285809Sscottl *
888285809Sscottl * The agsaSSPScsiTaskMgntReq_t data structure describes a SAS SSP Task Management command request sent by the
889285809Sscottl * initiator or received by the target.
890285809Sscottl *
891285809Sscottl * The response to Task Management is specified by agsaSSPResponseInfoUnit_t.
892285809Sscottl *
893285809Sscottl * This data structure is one instance of the generic request issued to saSSPStart() and is passed
894285809Sscottl * as an agsaSASRequestBody_t
895285809Sscottl *
896285809Sscottl */
897285809Sscottltypedef struct agsaSSPScsiTaskMgntReq_s
898285809Sscottl{
899285809Sscottl    bit8    lun[8];               /* SCSI Logical Unit Number */
900285809Sscottl    bit16   reserved1;            /* reserved */
901285809Sscottl    bit8    taskMgntFunction;     /* task management function code */
902285809Sscottl    bit8    reserved2;            /* reserved */
903285809Sscottl    bit16   tagOfTaskToBeManaged; /* Tag/context of task to be managed */
904285809Sscottl    bit16   reserved3;            /* reserved */
905285809Sscottl    bit32   reserved4[3];         /* reserved */
906285809Sscottl    bit32   tmOption;             /* Not part of SSP TMF IU */
907285809Sscottl    /* B7-2 : reserved */
908285809Sscottl    /* B1   : DS_OPTION */
909285809Sscottl    /* B0   : ADS_OPTION */
910285809Sscottl} agsaSSPScsiTaskMgntReq_t;
911285809Sscottl
912285809Sscottl
913285809Sscottl/** \brief data structure describes the first four bytes of the SMP frame.
914285809Sscottl *
915285809Sscottl * The agsaSMPFrameHeader_t data structure describes the first four bytes of the SMP frame.
916285809Sscottl *
917285809Sscottl *
918285809Sscottl */
919285809Sscottl
920285809Sscottltypedef struct agsaSMPFrameHeader_s
921285809Sscottl{
922285809Sscottl    bit8   smpFrameType;      /* The first byte of SMP frame represents the SMP FRAME TYPE */
923285809Sscottl    bit8   smpFunction;       /* The second byte of the SMP frame represents the SMP FUNCTION */
924285809Sscottl    bit8   smpFunctionResult; /* The third byte of SMP frame represents FUNCTION RESULT of the SMP response. */
925285809Sscottl    bit8   smpReserved;       /* reserved */
926285809Sscottl} agsaSMPFrameHeader_t;
927285809Sscottl
928285809Sscottl/****************************************************************
929285809Sscottl *            report general response
930285809Sscottl ****************************************************************/
931285809Sscottl#define SA_REPORT_GENERAL_CONFIGURING_BIT     0x2
932285809Sscottl#define SA_REPORT_GENERAL_CONFIGURABLE_BIT    0x1
933285809Sscottl
934285809Sscottltypedef struct agsaSmpRespReportGeneral_s
935285809Sscottl{
936285809Sscottl  bit8   expanderChangeCount16[2];
937285809Sscottl  bit8   expanderRouteIndexes16[2];
938285809Sscottl  bit8   reserved1;
939285809Sscottl  bit8   numOfPhys;
940285809Sscottl  bit8   configuring_configurable;
941285809Sscottl    /* B7-2 : reserved */
942285809Sscottl    /* B1   : configuring */
943285809Sscottl    /* B0   : configurable */
944285809Sscottl  bit8   reserved4[17];
945285809Sscottl} agsaSmpRespReportGeneral_t;
946285809Sscottl
947285809Sscottl#define SA_REPORT_GENERAL_IS_CONFIGURING(pResp) \
948285809Sscottl  (((pResp)->configuring_configurable & SA_REPORT_GENERAL_CONFIGURING_BIT) == \
949285809Sscottl      SA_REPORT_GENERAL_CONFIGURING_BIT)
950285809Sscottl
951285809Sscottl#define SA_REPORT_GENERAL_IS_CONFIGURABLE(pResp) \
952285809Sscottl  (((pResp)->configuring_configurable & SA_REPORT_GENERAL_CONFIGURABLE_BIT) == \
953285809Sscottl      SA_REPORT_GENERAL_CONFIGURABLE_BIT)
954285809Sscottl
955285809Sscottl#define SA_REPORT_GENERAL_GET_ROUTEINDEXES(pResp) \
956285809Sscottl  DMA_BEBIT16_TO_BIT16(*(bit16 *)((pResp)->expanderRouteIndexes16))
957285809Sscottl
958285809Sscottl/****************************************************************
959285809Sscottl *            report manufacturer info response
960285809Sscottl ****************************************************************/
961285809Sscottltypedef struct agsaSmpRespReportManufactureInfo_s
962285809Sscottl{
963285809Sscottl  bit8    reserved1[8];
964285809Sscottl  bit8    vendorIdentification[8];
965285809Sscottl  bit8    productIdentification[16];
966285809Sscottl  bit8    productRevisionLevel[4];
967285809Sscottl  bit8    vendorSpecific[20];
968285809Sscottl} agsaSmpRespReportManufactureInfo_t;
969285809Sscottl
970285809Sscottl/****************************************************************
971285809Sscottl *           discover request
972285809Sscottl ****************************************************************/
973285809Sscottltypedef struct agsaSmpReqDiscover_s
974285809Sscottl{
975285809Sscottl  bit32   reserved1;
976285809Sscottl  bit8    reserved2;
977285809Sscottl  bit8    phyIdentifier;
978285809Sscottl  bit8    ignored;
979285809Sscottl  bit8    reserved3;
980285809Sscottl} agsaSmpReqDiscover_t;
981285809Sscottl
982285809Sscottl/****************************************************************
983285809Sscottl *           discover response
984285809Sscottl ****************************************************************/
985285809Sscottltypedef struct agsaSmpRespDiscover_s
986285809Sscottl{
987285809Sscottl  bit8   reserved1[4];
988285809Sscottl  bit8   reserved2;
989285809Sscottl  bit8   phyIdentifier;
990285809Sscottl  bit8   reserved3[2];
991285809Sscottl  bit8   attachedDeviceType;
992285809Sscottl    /* B7   : reserved */
993285809Sscottl    /* B6-4 : attachedDeviceType */
994285809Sscottl    /* B3-0 : reserved */
995285809Sscottl  bit8   negotiatedPhyLinkRate;
996285809Sscottl    /* B7-4 : reserved */
997285809Sscottl    /* B3-0 : negotiatedPhyLinkRate */
998285809Sscottl  bit8   attached_Ssp_Stp_Smp_Sata_Initiator;
999285809Sscottl    /* B7-4 : reserved */
1000285809Sscottl    /* B3   : attachedSspInitiator */
1001285809Sscottl    /* B2   : attachedStpInitiator */
1002285809Sscottl    /* B1   : attachedSmpInitiator */
1003285809Sscottl    /* B0   : attachedSataHost */
1004285809Sscottl  bit8   attached_SataPS_Ssp_Stp_Smp_Sata_Target;
1005285809Sscottl    /* B7   : attachedSataPortSelector */
1006285809Sscottl    /* B6-4 : reserved */
1007285809Sscottl    /* B3   : attachedSspTarget */
1008285809Sscottl    /* B2   : attachedStpTarget */
1009285809Sscottl    /* B1   : attachedSmpTarget */
1010285809Sscottl    /* B0   : attachedSatadevice */
1011285809Sscottl  bit8   sasAddressHi[4];
1012285809Sscottl  bit8   sasAddressLo[4];
1013285809Sscottl  bit8   attachedSasAddressHi[4];
1014285809Sscottl  bit8   attachedSasAddressLo[4];
1015285809Sscottl  bit8   attachedPhyIdentifier;
1016285809Sscottl  bit8   reserved9[7];
1017285809Sscottl  bit8   programmedAndHardware_MinPhyLinkRate;
1018285809Sscottl    /* B7-4 : programmedMinPhyLinkRate */
1019285809Sscottl    /* B3-0 : hardwareMinPhyLinkRate */
1020285809Sscottl  bit8   programmedAndHardware_MaxPhyLinkRate;
1021285809Sscottl    /* B7-4 : programmedMaxPhyLinkRate */
1022285809Sscottl    /* B3-0 : hardwareMaxPhyLinkRate */
1023285809Sscottl  bit8   phyChangeCount;
1024285809Sscottl  bit8   virtualPhy_partialPathwayTimeout;
1025285809Sscottl    /* B7   : virtualPhy*/
1026285809Sscottl    /* B6-4 : reserved */
1027285809Sscottl    /* B3-0 : partialPathwayTimeout */
1028285809Sscottl  bit8   routingAttribute;
1029285809Sscottl    /* B7-4 : reserved */
1030285809Sscottl    /* B3-0 : routingAttribute */
1031285809Sscottl  bit8   reserved13[5];
1032285809Sscottl  bit8   vendorSpecific[2];
1033285809Sscottl} agsaSmpRespDiscover_t;
1034285809Sscottl
1035285809Sscottl#define SA_DISCRSP_SSP_BIT    0x08
1036285809Sscottl#define SA_DISCRSP_STP_BIT    0x04
1037285809Sscottl#define SA_DISCRSP_SMP_BIT    0x02
1038285809Sscottl#define SA_DISCRSP_SATA_BIT   0x01
1039285809Sscottl
1040285809Sscottl#define SA_DISCRSP_SATA_PS_BIT   0x80
1041285809Sscottl
1042285809Sscottl#define SA_DISCRSP_GET_ATTACHED_DEVTYPE(pResp) \
1043285809Sscottl  (((pResp)->attachedDeviceType & 0x70) >> 4)
1044285809Sscottl#define SA_DISCRSP_GET_LINKRATE(pResp) \
1045285809Sscottl  ((pResp)->negotiatedPhyLinkRate & 0x0F)
1046285809Sscottl
1047285809Sscottl#define SA_DISCRSP_IS_SSP_INITIATOR(pResp) \
1048285809Sscottl  (((pResp)->attached_Ssp_Stp_Smp_Sata_Initiator & SA_DISCRSP_SSP_BIT) == SA_DISCRSP_SSP_BIT)
1049285809Sscottl#define SA_DISCRSP_IS_STP_INITIATOR(pResp) \
1050285809Sscottl  (((pResp)->attached_Ssp_Stp_Smp_Sata_Initiator & SA_DISCRSP_STP_BIT) == SA_DISCRSP_STP_BIT)
1051285809Sscottl#define SA_DISCRSP_IS_SMP_INITIATOR(pResp) \
1052285809Sscottl  (((pResp)->attached_Ssp_Stp_Smp_Sata_Initiator & SA_DISCRSP_SMP_BIT) == SA_DISCRSP_SMP_BIT)
1053285809Sscottl#define SA_DISCRSP_IS_SATA_HOST(pResp) \
1054285809Sscottl  (((pResp)->attached_Ssp_Stp_Smp_Sata_Initiator & SA_DISCRSP_SATA_BIT) == SA_DISCRSP_SATA_BIT)
1055285809Sscottl
1056285809Sscottl#define SA_DISCRSP_IS_SSP_TARGET(pResp) \
1057285809Sscottl  (((pResp)->attached_SataPS_Ssp_Stp_Smp_Sata_Target & SA_DISCRSP_SSP_BIT) == SA_DISCRSP_SSP_BIT)
1058285809Sscottl#define SA_DISCRSP_IS_STP_TARGET(pResp) \
1059285809Sscottl  (((pResp)->attached_SataPS_Ssp_Stp_Smp_Sata_Target & SA_DISCRSP_STP_BIT) == SA_DISCRSP_STP_BIT)
1060285809Sscottl#define SA_DISCRSP_IS_SMP_TARGET(pResp) \
1061285809Sscottl  (((pResp)->attached_SataPS_Ssp_Stp_Smp_Sata_Target & SA_DISCRSP_SMP_BIT) == SA_DISCRSP_SMP_BIT)
1062285809Sscottl#define SA_DISCRSP_IS_SATA_DEVICE(pResp) \
1063285809Sscottl  (((pResp)->attached_SataPS_Ssp_Stp_Smp_Sata_Target & SA_DISCRSP_SATA_BIT) == SA_DISCRSP_SATA_BIT)
1064285809Sscottl#define SA_DISCRSP_IS_SATA_PORTSELECTOR(pResp) \
1065285809Sscottl  (((pResp)->attached_SataPS_Ssp_Stp_Smp_Sata_Target & SA_DISCRSP_SATA_PS_BIT) == SA_DISCRSP_SATA_PS_BIT)
1066285809Sscottl
1067285809Sscottl#define SA_DISCRSP_GET_SAS_ADDRESSHI(pResp) \
1068285809Sscottl  DMA_BEBIT32_TO_BIT32(*(bit32 *)(pResp)->sasAddressHi)
1069285809Sscottl#define SA_DISCRSP_GET_SAS_ADDRESSLO(pResp) \
1070285809Sscottl  DMA_BEBIT32_TO_BIT32(*(bit32 *)(pResp)->sasAddressLo)
1071285809Sscottl
1072285809Sscottl#define SA_DISCRSP_GET_ATTACHED_SAS_ADDRESSHI(pResp) \
1073285809Sscottl  DMA_BEBIT32_TO_BIT32(*(bit32 *)(pResp)->attachedSasAddressHi)
1074285809Sscottl#define SA_DISCRSP_GET_ATTACHED_SAS_ADDRESSLO(pResp) \
1075285809Sscottl  DMA_BEBIT32_TO_BIT32(*(bit32 *)(pResp)->attachedSasAddressLo)
1076285809Sscottl
1077285809Sscottl#define SA_DISCRSP_VIRTUALPHY_BIT 0x80
1078285809Sscottl#define SA_DISCRSP_IS_VIRTUALPHY(pResp) \
1079285809Sscottl  (((pResp)->virtualPhy_partialPathwayTimeout & SA_DISCRSP_VIRTUALPHY_BIT) == SA_DISCRSP_VIRTUALPHY_BIT)
1080285809Sscottl
1081285809Sscottl#define SA_DISCRSP_GET_ROUTINGATTRIB(pResp) \
1082285809Sscottl  ((pResp)->routingAttribute & 0x0F)
1083285809Sscottl
1084285809Sscottl/****************************************************************
1085285809Sscottl *            report route table request
1086285809Sscottl ****************************************************************/
1087285809Sscottltypedef struct agsaSmpReqReportRouteTable_s
1088285809Sscottl{
1089285809Sscottl  bit8   reserved1[2];
1090285809Sscottl  bit8   expanderRouteIndex16[20];
1091285809Sscottl  bit8   reserved2;
1092285809Sscottl  bit8   phyIdentifier;
1093285809Sscottl  bit8   reserved3[2];
1094285809Sscottl} agsaSmpReqReportRouteTable_t;
1095285809Sscottl
1096285809Sscottl/****************************************************************
1097285809Sscottl *            report route response
1098285809Sscottl ****************************************************************/
1099285809Sscottltypedef struct agsaSmpRespReportRouteTable_s
1100285809Sscottl{
1101285809Sscottl  bit8   reserved1[2];
1102285809Sscottl  bit8   expanderRouteIndex16[2];
1103285809Sscottl  bit8   reserved2;
1104285809Sscottl  bit8   phyIdentifier;
1105285809Sscottl  bit8   reserved3[2];
1106285809Sscottl  bit8   disabled;
1107285809Sscottl    /* B7   : expander route entry disabled */
1108285809Sscottl    /* B6-0 : reserved */
1109285809Sscottl  bit8   reserved5[3];
1110285809Sscottl  bit8   routedSasAddressHi32[4];
1111285809Sscottl  bit8   routedSasAddressLo32[4];
1112285809Sscottl  bit8   reserved6[16];
1113285809Sscottl} agsaSmpRespReportRouteTable_t;
1114285809Sscottl
1115285809Sscottl/****************************************************************
1116285809Sscottl *            configure route information request
1117285809Sscottl ****************************************************************/
1118285809Sscottltypedef struct agsaSmpReqConfigureRouteInformation_s
1119285809Sscottl{
1120285809Sscottl  bit8   reserved1[2];
1121285809Sscottl  bit8   expanderRouteIndex[2];
1122285809Sscottl  bit8   reserved2;
1123285809Sscottl  bit8   phyIdentifier;
1124285809Sscottl  bit8   reserved3[2];
1125285809Sscottl  bit8   disabledBit_reserved4;
1126285809Sscottl  bit8   reserved5[3];
1127285809Sscottl  bit8   routedSasAddressHi[4];
1128285809Sscottl  bit8   routedSasAddressLo[4];
1129285809Sscottl  bit8   reserved6[16];
1130285809Sscottl} agsaSmpReqConfigureRouteInformation_t;
1131285809Sscottl
1132285809Sscottl/****************************************************************
1133285809Sscottl *            report Phy Sata request
1134285809Sscottl ****************************************************************/
1135285809Sscottltypedef struct agsaSmpReqReportPhySata_s
1136285809Sscottl{
1137285809Sscottl  bit8   reserved1[4];
1138285809Sscottl  bit8   reserved2;
1139285809Sscottl  bit8   phyIdentifier;
1140285809Sscottl  bit8   reserved3[2];
1141285809Sscottl} agsaSmpReqReportPhySata_t;
1142285809Sscottl
1143285809Sscottl/****************************************************************
1144285809Sscottl *            report Phy Sata response
1145285809Sscottl ****************************************************************/
1146285809Sscottltypedef struct agsaSmpRespReportPhySata_s
1147285809Sscottl{
1148285809Sscottl  bit8   reserved1[4];
1149285809Sscottl  bit8   reserved2;
1150285809Sscottl  bit8   phyIdentifier;
1151285809Sscottl  bit8   reserved3;
1152285809Sscottl  bit8   affiliations_sup_valid;
1153285809Sscottl    /* b7-2 : reserved */
1154285809Sscottl    /* b1   : Affiliations supported */
1155285809Sscottl    /* b0   : Affiliation valid */
1156285809Sscottl  bit8   reserved5[4];
1157285809Sscottl  bit8   stpSasAddressHi[4];
1158285809Sscottl  bit8   stpSasAddressLo[4];
1159285809Sscottl  bit8   regDevToHostFis[20];
1160285809Sscottl  bit8   reserved6[4];
1161285809Sscottl  bit8   affiliatedStpInitiatorSasAddressHi[4];
1162285809Sscottl  bit8   affiliatedStpInitiatorSasAddressLo[4];
1163285809Sscottl} agsaSmpRespReportPhySata_t;
1164285809Sscottl
1165285809Sscottl/****************************************************************
1166285809Sscottl *            Phy Control request
1167285809Sscottl ****************************************************************/
1168285809Sscottltypedef struct agsaSmpReqPhyControl_s
1169285809Sscottl{
1170285809Sscottl  bit8   reserved1[4];
1171285809Sscottl  bit8   reserved2;
1172285809Sscottl  bit8   phyIdentifier;
1173285809Sscottl  bit8   phyOperation;
1174285809Sscottl  bit8   updatePartialPathwayTOValue;
1175285809Sscottl    /* b7-1 : reserved */
1176285809Sscottl    /* b0   : update partial pathway timeout value */
1177285809Sscottl  bit8   reserved3[20];
1178285809Sscottl  bit8   programmedMinPhysicalLinkRate;
1179285809Sscottl    /* b7-4 : programmed Minimum Physical Link Rate*/
1180285809Sscottl    /* b3-0 : reserved */
1181285809Sscottl  bit8   programmedMaxPhysicalLinkRate;
1182285809Sscottl    /* b7-4 : programmed Maximum Physical Link Rate*/
1183285809Sscottl    /* b3-0 : reserved */
1184285809Sscottl  bit8   reserved4[2];
1185285809Sscottl  bit8   partialPathwayTOValue;
1186285809Sscottl    /* b7-4 : reserved */
1187285809Sscottl    /* b3-0 : partial Pathway TO Value */
1188285809Sscottl  bit8   reserved5[3];
1189285809Sscottl} agsaSmpReqPhyControl_t;
1190285809Sscottl
1191285809Sscottl
1192285809Sscottl
1193285809Sscottl
1194285809Sscottl#endif  /*__SASPEC_H__ */
1195