isci: fixup SAS iaf protocols data structure
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / drivers / scsi / isci / core / intel_sas.h
blobf2d5ca1c72ed26cc3a04ad4dc994e21c9f080b50
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.
5 * GPL LICENSE SUMMARY
7 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
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.
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.
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.
24 * BSD LICENSE
26 * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
27 * All rights reserved.
29 * Redistribution and use in source and binary forms, with or without
30 * modification, are permitted provided that the following conditions
31 * are met:
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.
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.
56 #ifndef _INTEL_SAS_H_
57 #define _INTEL_SAS_H_
59 /**
60 * This file contains all of the definitions relating to structures, constants,
61 * etc. defined by the SAS specification.
65 #include <linux/kernel.h>
66 #include "intel_scsi.h"
68 /**
69 * struct sci_sas_address - This structure depicts how a SAS address is
70 * represented by SCI.
74 struct sci_sas_address {
75 /**
76 * This member contains the higher 32-bits of the SAS address.
78 u32 high;
80 /**
81 * This member contains the lower 32-bits of the SAS address.
83 u32 low;
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.
94 enum 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,
102 * enum _SCI_SAS_TASK_MGMT_FUNCTION - This enumeration depicts the SAM/SAS
103 * specification defined task management functions.
105 * This HARD_RESET function listed here is not actually defined as a task
106 * management function in the industry standard.
108 enum 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
123 * enum _SCI_SAS_FRAME_TYPE - This enumeration depicts the SAS specification
124 * defined SSP frame types.
128 enum 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
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.
143 struct sci_ssp_frame_header {
144 /* Word 0 */
145 u32 hashed_destination_address:24;
146 u32 frame_type:8;
148 /* Word 1 */
149 u32 hashed_source_address:24;
150 u32 reserved1_0:8;
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;
162 /* Word 3 */
163 u32 uiResv4;
165 /* Word 4 */
166 u16 target_port_transfer_tag;
167 u16 tag;
169 /* Word 5 */
170 u32 data_offset;
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
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
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
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
211 /* Expander phy routine attribute */
212 #define DIRECT_ROUTING_ATTRIBUTE 0
213 #define SUBTRACTIVE_ROUTING_ATTRIBUTE 1
214 #define TABLE_ROUTING_ATTRIBUTE 2
216 #endif /* _INTEL_SAS_H_ */