isci: fixup SAS iaf protocols data structure
[deliverable/linux.git] / drivers / scsi / isci / core / intel_sas.h
CommitLineData
6f231dda
DW
1/*
2 * This file is provided under a dual BSD/GPLv2 license. When using or
3 * redistributing this file, you may do so under either license.
4 *
5 * GPL LICENSE SUMMARY
6 *
7 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of version 2 of the GNU General Public License as
11 * published by the Free Software Foundation.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
21 * The full GNU General Public License is included in this distribution
22 * in the file called LICENSE.GPL.
23 *
24 * BSD LICENSE
25 *
26 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
27 * All rights reserved.
28 *
29 * Redistribution and use in source and binary forms, with or without
30 * modification, are permitted provided that the following conditions
31 * are met:
32 *
33 * * Redistributions of source code must retain the above copyright
34 * notice, this list of conditions and the following disclaimer.
35 * * Redistributions in binary form must reproduce the above copyright
36 * notice, this list of conditions and the following disclaimer in
37 * the documentation and/or other materials provided with the
38 * distribution.
39 * * Neither the name of Intel Corporation nor the names of its
40 * contributors may be used to endorse or promote products derived
41 * from this software without specific prior written permission.
42 *
43 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
44 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
45 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
46 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
47 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
48 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
49 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
50 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
51 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
52 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
53 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
54 */
55
56#ifndef _INTEL_SAS_H_
57#define _INTEL_SAS_H_
58
59/**
60 * This file contains all of the definitions relating to structures, constants,
61 * etc. defined by the SAS specification.
62 *
63 *
64 */
e76d6180 65#include <linux/kernel.h>
6f231dda
DW
66#include "intel_scsi.h"
67
68/**
69 * struct sci_sas_address - This structure depicts how a SAS address is
70 * represented by SCI.
71 *
72 *
73 */
74struct sci_sas_address {
75 /**
76 * This member contains the higher 32-bits of the SAS address.
77 */
78 u32 high;
79
80 /**
81 * This member contains the lower 32-bits of the SAS address.
82 */
83 u32 low;
84
85};
86
6f231dda
DW
87/**
88 * enum _SCI_SAS_TASK_ATTRIBUTE - This enumeration depicts the SAM/SAS
89 * specification defined task attribute values for a command information
90 * unit.
91 *
92 *
93 */
94enum sci_sas_task_attribute {
95 SCI_SAS_SIMPLE_ATTRIBUTE = 0,
96 SCI_SAS_HEAD_OF_QUEUE_ATTRIBUTE = 1,
97 SCI_SAS_ORDERED_ATTRIBUTE = 2,
98 SCI_SAS_ACA_ATTRIBUTE = 4,
99};
100
101/**
102 * enum _SCI_SAS_TASK_MGMT_FUNCTION - This enumeration depicts the SAM/SAS
103 * specification defined task management functions.
104 *
105 * This HARD_RESET function listed here is not actually defined as a task
106 * management function in the industry standard.
107 */
108enum sci_sas_task_mgmt_function {
109 SCI_SAS_ABORT_TASK = SCSI_TASK_REQUEST_ABORT_TASK,
110 SCI_SAS_ABORT_TASK_SET = SCSI_TASK_REQUEST_ABORT_TASK_SET,
111 SCI_SAS_CLEAR_TASK_SET = SCSI_TASK_REQUEST_CLEAR_TASK_SET,
112 SCI_SAS_LOGICAL_UNIT_RESET = SCSI_TASK_REQUEST_LOGICAL_UNIT_RESET,
113 SCI_SAS_I_T_NEXUS_RESET = SCSI_TASK_REQUEST_I_T_NEXUS_RESET,
114 SCI_SAS_CLEAR_ACA = SCSI_TASK_REQUEST_CLEAR_ACA,
115 SCI_SAS_QUERY_TASK = SCSI_TASK_REQUEST_QUERY_TASK,
116 SCI_SAS_QUERY_TASK_SET = SCSI_TASK_REQUEST_QUERY_TASK_SET,
117 SCI_SAS_QUERY_ASYNCHRONOUS_EVENT = SCSI_TASK_REQUEST_QUERY_UNIT_ATTENTION,
118 SCI_SAS_HARD_RESET = 0xFF
119};
120
121
122/**
123 * enum _SCI_SAS_FRAME_TYPE - This enumeration depicts the SAS specification
124 * defined SSP frame types.
125 *
126 *
127 */
128enum sci_sas_frame_type {
129 SCI_SAS_DATA_FRAME = 0x01,
130 SCI_SAS_XFER_RDY_FRAME = 0x05,
131 SCI_SAS_COMMAND_FRAME = 0x06,
132 SCI_SAS_RESPONSE_FRAME = 0x07,
133 SCI_SAS_TASK_FRAME = 0x16
134};
135
6f231dda
DW
136/**
137 * struct sci_ssp_frame_header - This structure depicts the contents of an SSP
138 * frame header. For specific information on the individual fields please
139 * reference the SAS specification transport layer SSP frame format.
140 *
141 *
142 */
143struct sci_ssp_frame_header {
144 /* Word 0 */
145 u32 hashed_destination_address:24;
146 u32 frame_type:8;
147
148 /* Word 1 */
149 u32 hashed_source_address:24;
150 u32 reserved1_0:8;
151
152 /* Word 2 */
153 u32 reserved2_2:6;
154 u32 fill_bytes:2;
155 u32 reserved2_1:3;
156 u32 tlr_control:2;
157 u32 retry_data_frames:1;
158 u32 retransmit:1;
159 u32 changing_data_pointer:1;
160 u32 reserved2_0:16;
161
162 /* Word 3 */
163 u32 uiResv4;
164
165 /* Word 4 */
166 u16 target_port_transfer_tag;
167 u16 tag;
168
169 /* Word 5 */
170 u32 data_offset;
171
172};
173
6f231dda
DW
174
175#define PHY_OPERATION_NOP 0x00
176#define PHY_OPERATION_LINK_RESET 0x01
177#define PHY_OPERATION_HARD_RESET 0x02
178#define PHY_OPERATION_DISABLE 0x03
179#define PHY_OPERATION_CLEAR_ERROR_LOG 0x05
180#define PHY_OPERATION_CLEAR_AFFILIATION 0x06
181
182#define NPLR_PHY_ENABLED_UNK_LINK_RATE 0x00
183#define NPLR_PHY_DISABLED 0x01
184#define NPLR_PHY_ENABLED_SPD_NEG_FAILED 0x02
185#define NPLR_PHY_ENABLED_SATA_HOLD 0x03
186#define NPLR_PHY_ENABLED_1_5G 0x08
187#define NPLR_PHY_ENABLED_3_0G 0x09
188
189/* SMP Function Result values. */
190#define SMP_RESULT_FUNCTION_ACCEPTED 0x00
191#define SMP_RESULT_UNKNOWN_FUNCTION 0x01
192#define SMP_RESULT_FUNCTION_FAILED 0x02
193#define SMP_RESULT_INVALID_REQUEST_FRAME_LEN 0x03
194#define SMP_RESULT_INAVALID_EXPANDER_CHANGE_COUNT 0x04
195#define SMP_RESULT_BUSY 0x05
196#define SMP_RESULT_INCOMPLETE_DESCRIPTOR_LIST 0x06
197#define SMP_RESULT_PHY_DOES_NOT_EXIST 0x10
198#define SMP_RESULT_INDEX_DOES_NOT_EXIST 0x11
199#define SMP_RESULT_PHY_DOES_NOT_SUPPORT_SATA 0x12
200#define SMP_RESULT_UNKNOWN_PHY_OPERATION 0x13
201#define SMP_RESULT_UNKNOWN_PHY_TEST_FUNCTION 0x14
202#define SMP_RESULT_PHY_TEST_IN_PROGRESS 0x15
203#define SMP_RESULT_PHY_VACANT 0x16
204
205/* Attached Device Types */
206#define SMP_NO_DEVICE_ATTACHED 0
207#define SMP_END_DEVICE_ONLY 1
208#define SMP_EDGE_EXPANDER_DEVICE 2
209#define SMP_FANOUT_EXPANDER_DEVICE 3
210
211/* Expander phy routine attribute */
212#define DIRECT_ROUTING_ATTRIBUTE 0
213#define SUBTRACTIVE_ROUTING_ATTRIBUTE 1
214#define TABLE_ROUTING_ATTRIBUTE 2
215
216#endif /* _INTEL_SAS_H_ */
217
This page took 0.041449 seconds and 5 git commands to generate.