diff options
Diffstat (limited to 'drivers/scsi')
38 files changed, 497 insertions, 962 deletions
diff --git a/drivers/scsi/isci/core/sci_controller.h b/drivers/scsi/isci/core/sci_controller.h deleted file mode 100644 index 01316b1a8f27..000000000000 --- a/drivers/scsi/isci/core/sci_controller.h +++ /dev/null | |||
@@ -1,69 +0,0 @@ | |||
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 _SCI_CONTROLLER_H_ | ||
57 | #define _SCI_CONTROLLER_H_ | ||
58 | |||
59 | /** | ||
60 | * This file contains all of the interface methods that can be called by an SCI | ||
61 | * user on all SCI controller objects. | ||
62 | * | ||
63 | * | ||
64 | */ | ||
65 | |||
66 | #define SCI_CONTROLLER_INVALID_IO_TAG 0xFFFF | ||
67 | |||
68 | #endif /* _SCI_CONTROLLER_H_ */ | ||
69 | |||
diff --git a/drivers/scsi/isci/core/sci_controller_constants.h b/drivers/scsi/isci/core/sci_controller_constants.h deleted file mode 100644 index 2525c26d7c08..000000000000 --- a/drivers/scsi/isci/core/sci_controller_constants.h +++ /dev/null | |||
@@ -1,206 +0,0 @@ | |||
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 _SCI_CONTROLLER_CONSTANTS_H_ | ||
57 | #define _SCI_CONTROLLER_CONSTANTS_H_ | ||
58 | |||
59 | /** | ||
60 | * This file contains constant values that change based on the type of core or | ||
61 | * framework being managed. These constants are exported in order to | ||
62 | * provide the user with information as to the bounds (i.e. how many) of | ||
63 | * specific objects. | ||
64 | * | ||
65 | * | ||
66 | */ | ||
67 | |||
68 | #ifndef SCI_MAX_PHYS | ||
69 | /** | ||
70 | * | ||
71 | * | ||
72 | * This constant defines the maximum number of phy objects that can be | ||
73 | * supported for the SCU Driver Standard (SDS) library. This is tied directly | ||
74 | * to silicon capabilities. | ||
75 | */ | ||
76 | #define SCI_MAX_PHYS (4) | ||
77 | #endif | ||
78 | |||
79 | #ifndef SCI_MAX_PORTS | ||
80 | /** | ||
81 | * | ||
82 | * | ||
83 | * This constant defines the maximum number of port objects that can be | ||
84 | * supported for the SCU Driver Standard (SDS) library. This is tied directly | ||
85 | * to silicon capabilities. | ||
86 | */ | ||
87 | #define SCI_MAX_PORTS SCI_MAX_PHYS | ||
88 | #endif | ||
89 | |||
90 | #ifndef SCI_MIN_SMP_PHYS | ||
91 | /** | ||
92 | * | ||
93 | * | ||
94 | * This constant defines the minimum number of SMP phy objects that can be | ||
95 | * supported for a single expander level. This was determined by using 36 | ||
96 | * physical phys and room for 2 virtual phys. | ||
97 | */ | ||
98 | #define SCI_MIN_SMP_PHYS (38) | ||
99 | #endif | ||
100 | |||
101 | #ifndef SCI_MAX_SMP_PHYS | ||
102 | /** | ||
103 | * | ||
104 | * | ||
105 | * This constant defines the maximum number of SMP phy objects that can be | ||
106 | * supported for the SCU Driver Standard (SDS) library. This number can be | ||
107 | * increased if required. | ||
108 | */ | ||
109 | #define SCI_MAX_SMP_PHYS (384) | ||
110 | #endif | ||
111 | |||
112 | #ifndef SCI_MAX_REMOTE_DEVICES | ||
113 | /** | ||
114 | * | ||
115 | * | ||
116 | * This constant defines the maximum number of remote device objects that can | ||
117 | * be supported for the SCU Driver Standard (SDS) library. This is tied | ||
118 | * directly to silicon capabilities. | ||
119 | */ | ||
120 | #define SCI_MAX_REMOTE_DEVICES (256) | ||
121 | #endif | ||
122 | |||
123 | #ifndef SCI_MIN_REMOTE_DEVICES | ||
124 | /** | ||
125 | * | ||
126 | * | ||
127 | * This constant defines the minimum number of remote device objects that can | ||
128 | * be supported for the SCU Driver Standard (SDS) library. This # can be | ||
129 | * configured for minimum memory environments to any value less than | ||
130 | * SCI_MAX_REMOTE_DEVICES | ||
131 | */ | ||
132 | #define SCI_MIN_REMOTE_DEVICES (16) | ||
133 | #endif | ||
134 | |||
135 | #ifndef SCI_MAX_IO_REQUESTS | ||
136 | /** | ||
137 | * | ||
138 | * | ||
139 | * This constant defines the maximum number of IO request objects that can be | ||
140 | * supported for the SCU Driver Standard (SDS) library. This is tied directly | ||
141 | * to silicon capabilities. | ||
142 | */ | ||
143 | #define SCI_MAX_IO_REQUESTS (256) | ||
144 | #endif | ||
145 | |||
146 | #ifndef SCI_MIN_IO_REQUESTS | ||
147 | /** | ||
148 | * | ||
149 | * | ||
150 | * This constant defines the minimum number of IO request objects that can be | ||
151 | * supported for the SCU Driver Standard (SDS) library. This # can be | ||
152 | * configured for minimum memory environments to any value less than | ||
153 | * SCI_MAX_IO_REQUESTS. | ||
154 | */ | ||
155 | #define SCI_MIN_IO_REQUESTS (1) | ||
156 | #endif | ||
157 | |||
158 | #ifndef SCI_MAX_MSIX_MESSAGES | ||
159 | /** | ||
160 | * | ||
161 | * | ||
162 | * This constant defines the maximum number of MSI-X interrupt vectors/messages | ||
163 | * supported for an SCU hardware controller instance. | ||
164 | */ | ||
165 | #define SCI_MAX_MSIX_MESSAGES (2) | ||
166 | #endif | ||
167 | |||
168 | #ifndef SCI_MAX_SCATTER_GATHER_ELEMENTS | ||
169 | /** | ||
170 | * | ||
171 | * | ||
172 | * This constant defines the maximum number of Scatter-Gather Elements to be | ||
173 | * used by any SCI component. | ||
174 | */ | ||
175 | #define SCI_MAX_SCATTER_GATHER_ELEMENTS 130 | ||
176 | #endif | ||
177 | |||
178 | #ifndef SCI_MIN_SCATTER_GATHER_ELEMENTS | ||
179 | /** | ||
180 | * | ||
181 | * | ||
182 | * This constant defines the minimum number of Scatter-Gather Elements to be | ||
183 | * used by any SCI component. | ||
184 | */ | ||
185 | #define SCI_MIN_SCATTER_GATHER_ELEMENTS 1 | ||
186 | #endif | ||
187 | |||
188 | /** | ||
189 | * | ||
190 | * | ||
191 | * This constant defines the maximum number of controllers that can occur in a | ||
192 | * single silicon package. | ||
193 | */ | ||
194 | #define SCI_MAX_CONTROLLERS 2 | ||
195 | |||
196 | /** | ||
197 | * | ||
198 | * | ||
199 | * The maximum number of supported domain objects is currently tied to the | ||
200 | * maximum number of support port objects. | ||
201 | */ | ||
202 | #define SCI_MAX_DOMAINS SCI_MAX_PORTS | ||
203 | |||
204 | |||
205 | #endif /* _SCI_CONTROLLER_CONSTANTS_H_ */ | ||
206 | |||
diff --git a/drivers/scsi/isci/core/sci_status.h b/drivers/scsi/isci/core/sci_status.h deleted file mode 100644 index 8b66619022cf..000000000000 --- a/drivers/scsi/isci/core/sci_status.h +++ /dev/null | |||
@@ -1,409 +0,0 @@ | |||
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 _SCI_STATUS_H_ | ||
57 | #define _SCI_STATUS_H_ | ||
58 | |||
59 | /** | ||
60 | * This file contains all of the return status codes utilized across the | ||
61 | * various sub-components in SCI. | ||
62 | * | ||
63 | * | ||
64 | */ | ||
65 | |||
66 | |||
67 | /** | ||
68 | * enum sci_status - This is the general return status enumeration for non-IO, | ||
69 | * non-task management related SCI interface methods. | ||
70 | * | ||
71 | * | ||
72 | */ | ||
73 | enum sci_status { | ||
74 | /** | ||
75 | * This member indicates successful completion. | ||
76 | */ | ||
77 | SCI_SUCCESS = 0, | ||
78 | |||
79 | /** | ||
80 | * This value indicates that the calling method completed successfully, | ||
81 | * but that the IO may have completed before having it's start method | ||
82 | * invoked. This occurs during SAT translation for requests that do | ||
83 | * not require an IO to the target or for any other requests that may | ||
84 | * be completed without having to submit IO. | ||
85 | */ | ||
86 | SCI_SUCCESS_IO_COMPLETE_BEFORE_START, | ||
87 | |||
88 | /** | ||
89 | * This Value indicates that the SCU hardware returned an early response | ||
90 | * because the io request specified more data than is returned by the | ||
91 | * target device (mode pages, inquiry data, etc.). The completion routine | ||
92 | * will handle this case to get the actual number of bytes transferred. | ||
93 | */ | ||
94 | SCI_SUCCESS_IO_DONE_EARLY, | ||
95 | |||
96 | /** | ||
97 | * This member indicates that the object for which a state change is | ||
98 | * being requested is already in said state. | ||
99 | */ | ||
100 | SCI_WARNING_ALREADY_IN_STATE, | ||
101 | |||
102 | /** | ||
103 | * This member indicates interrupt coalescence timer may cause SAS | ||
104 | * specification compliance issues (i.e. SMP target mode response | ||
105 | * frames must be returned within 1.9 milliseconds). | ||
106 | */ | ||
107 | SCI_WARNING_TIMER_CONFLICT, | ||
108 | |||
109 | /** | ||
110 | * This field indicates a sequence of action is not completed yet. Mostly, | ||
111 | * this status is used when multiple ATA commands are needed in a SATI translation. | ||
112 | */ | ||
113 | SCI_WARNING_SEQUENCE_INCOMPLETE, | ||
114 | |||
115 | /** | ||
116 | * This member indicates that there was a general failure. | ||
117 | */ | ||
118 | SCI_FAILURE, | ||
119 | |||
120 | /** | ||
121 | * This member indicates that the SCI implementation is unable to complete | ||
122 | * an operation due to a critical flaw the prevents any further operation | ||
123 | * (i.e. an invalid pointer). | ||
124 | */ | ||
125 | SCI_FATAL_ERROR, | ||
126 | |||
127 | /** | ||
128 | * This member indicates the calling function failed, because the state | ||
129 | * of the controller is in a state that prevents successful completion. | ||
130 | */ | ||
131 | SCI_FAILURE_INVALID_STATE, | ||
132 | |||
133 | /** | ||
134 | * This member indicates the calling function failed, because there is | ||
135 | * insufficient resources/memory to complete the request. | ||
136 | */ | ||
137 | SCI_FAILURE_INSUFFICIENT_RESOURCES, | ||
138 | |||
139 | /** | ||
140 | * This member indicates the calling function failed, because the | ||
141 | * controller object required for the operation can't be located. | ||
142 | */ | ||
143 | SCI_FAILURE_CONTROLLER_NOT_FOUND, | ||
144 | |||
145 | /** | ||
146 | * This member indicates the calling function failed, because the | ||
147 | * discovered controller type is not supported by the library. | ||
148 | */ | ||
149 | SCI_FAILURE_UNSUPPORTED_CONTROLLER_TYPE, | ||
150 | |||
151 | /** | ||
152 | * This member indicates the calling function failed, because the | ||
153 | * requested initialization data version isn't supported. | ||
154 | */ | ||
155 | SCI_FAILURE_UNSUPPORTED_INIT_DATA_VERSION, | ||
156 | |||
157 | /** | ||
158 | * This member indicates the calling function failed, because the | ||
159 | * requested configuration of SAS Phys into SAS Ports is not supported. | ||
160 | */ | ||
161 | SCI_FAILURE_UNSUPPORTED_PORT_CONFIGURATION, | ||
162 | |||
163 | /** | ||
164 | * This member indicates the calling function failed, because the | ||
165 | * requested protocol is not supported by the remote device, port, | ||
166 | * or controller. | ||
167 | */ | ||
168 | SCI_FAILURE_UNSUPPORTED_PROTOCOL, | ||
169 | |||
170 | /** | ||
171 | * This member indicates the calling function failed, because the | ||
172 | * requested information type is not supported by the SCI implementation. | ||
173 | */ | ||
174 | SCI_FAILURE_UNSUPPORTED_INFORMATION_TYPE, | ||
175 | |||
176 | /** | ||
177 | * This member indicates the calling function failed, because the | ||
178 | * device already exists. | ||
179 | */ | ||
180 | SCI_FAILURE_DEVICE_EXISTS, | ||
181 | |||
182 | /** | ||
183 | * This member indicates the calling function failed, because adding | ||
184 | * a phy to the object is not possible. | ||
185 | */ | ||
186 | SCI_FAILURE_ADDING_PHY_UNSUPPORTED, | ||
187 | |||
188 | /** | ||
189 | * This member indicates the calling function failed, because the | ||
190 | * requested information type is not supported by the SCI implementation. | ||
191 | */ | ||
192 | SCI_FAILURE_UNSUPPORTED_INFORMATION_FIELD, | ||
193 | |||
194 | /** | ||
195 | * This member indicates the calling function failed, because the SCI | ||
196 | * implementation does not support the supplied time limit. | ||
197 | */ | ||
198 | SCI_FAILURE_UNSUPPORTED_TIME_LIMIT, | ||
199 | |||
200 | /** | ||
201 | * This member indicates the calling method failed, because the SCI | ||
202 | * implementation does not contain the specified Phy. | ||
203 | */ | ||
204 | SCI_FAILURE_INVALID_PHY, | ||
205 | |||
206 | /** | ||
207 | * This member indicates the calling method failed, because the SCI | ||
208 | * implementation does not contain the specified Port. | ||
209 | */ | ||
210 | SCI_FAILURE_INVALID_PORT, | ||
211 | |||
212 | /** | ||
213 | * This member indicates the calling method was partly successful | ||
214 | * The port was reset but not all phys in port are operational | ||
215 | */ | ||
216 | SCI_FAILURE_RESET_PORT_PARTIAL_SUCCESS, | ||
217 | |||
218 | /** | ||
219 | * This member indicates that calling method failed | ||
220 | * The port reset did not complete because none of the phys are operational | ||
221 | */ | ||
222 | SCI_FAILURE_RESET_PORT_FAILURE, | ||
223 | |||
224 | /** | ||
225 | * This member indicates the calling method failed, because the SCI | ||
226 | * implementation does not contain the specified remote device. | ||
227 | */ | ||
228 | SCI_FAILURE_INVALID_REMOTE_DEVICE, | ||
229 | |||
230 | /** | ||
231 | * This member indicates the calling method failed, because the remote | ||
232 | * device is in a bad state and requires a reset. | ||
233 | */ | ||
234 | SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED, | ||
235 | |||
236 | /** | ||
237 | * This member indicates the calling method failed, because the SCI | ||
238 | * implementation does not contain or support the specified IO tag. | ||
239 | */ | ||
240 | SCI_FAILURE_INVALID_IO_TAG, | ||
241 | |||
242 | /** | ||
243 | * This member indicates that the operation failed and the user should | ||
244 | * check the response data associated with the IO. | ||
245 | */ | ||
246 | SCI_FAILURE_IO_RESPONSE_VALID, | ||
247 | |||
248 | /** | ||
249 | * This member indicates that the operation failed, the failure is | ||
250 | * controller implementation specific, and the response data associated | ||
251 | * with the request is not valid. You can query for the controller | ||
252 | * specific error information via scic_controller_get_request_status() | ||
253 | */ | ||
254 | SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR, | ||
255 | |||
256 | /** | ||
257 | * This member indicated that the operation failed because the | ||
258 | * user requested this IO to be terminated. | ||
259 | */ | ||
260 | SCI_FAILURE_IO_TERMINATED, | ||
261 | |||
262 | /** | ||
263 | * This member indicates that the operation failed and the associated | ||
264 | * request requires a SCSI abort task to be sent to the target. | ||
265 | */ | ||
266 | SCI_FAILURE_IO_REQUIRES_SCSI_ABORT, | ||
267 | |||
268 | /** | ||
269 | * This member indicates that the operation failed because the supplied | ||
270 | * device could not be located. | ||
271 | */ | ||
272 | SCI_FAILURE_DEVICE_NOT_FOUND, | ||
273 | |||
274 | /** | ||
275 | * This member indicates that the operation failed because the | ||
276 | * objects association is required and is not correctly set. | ||
277 | */ | ||
278 | SCI_FAILURE_INVALID_ASSOCIATION, | ||
279 | |||
280 | /** | ||
281 | * This member indicates that the operation failed, because a timeout | ||
282 | * occurred. | ||
283 | */ | ||
284 | SCI_FAILURE_TIMEOUT, | ||
285 | |||
286 | /** | ||
287 | * This member indicates that the operation failed, because the user | ||
288 | * specified a value that is either invalid or not supported. | ||
289 | */ | ||
290 | SCI_FAILURE_INVALID_PARAMETER_VALUE, | ||
291 | |||
292 | /** | ||
293 | * This value indicates that the operation failed, because the number | ||
294 | * of messages (MSI-X) is not supported. | ||
295 | */ | ||
296 | SCI_FAILURE_UNSUPPORTED_MESSAGE_COUNT, | ||
297 | |||
298 | /** | ||
299 | * This value indicates that the method failed due to a lack of | ||
300 | * available NCQ tags. | ||
301 | */ | ||
302 | SCI_FAILURE_NO_NCQ_TAG_AVAILABLE, | ||
303 | |||
304 | /** | ||
305 | * This value indicates that a protocol violation has occurred on the | ||
306 | * link. | ||
307 | */ | ||
308 | SCI_FAILURE_PROTOCOL_VIOLATION, | ||
309 | |||
310 | /** | ||
311 | * This value indicates a failure condition that retry may help to clear. | ||
312 | */ | ||
313 | SCI_FAILURE_RETRY_REQUIRED, | ||
314 | |||
315 | /** | ||
316 | * This field indicates the retry limit was reached when a retry is attempted | ||
317 | */ | ||
318 | SCI_FAILURE_RETRY_LIMIT_REACHED, | ||
319 | |||
320 | /** | ||
321 | * This member indicates the calling method was partly successful. | ||
322 | * Mostly, this status is used when a LUN_RESET issued to an expander attached | ||
323 | * STP device in READY NCQ substate needs to have RNC suspended/resumed | ||
324 | * before posting TC. | ||
325 | */ | ||
326 | SCI_FAILURE_RESET_DEVICE_PARTIAL_SUCCESS, | ||
327 | |||
328 | /** | ||
329 | * This field indicates an illegal phy connection based on the routing attribute | ||
330 | * of both expander phy attached to each other. | ||
331 | */ | ||
332 | SCI_FAILURE_ILLEGAL_ROUTING_ATTRIBUTE_CONFIGURATION, | ||
333 | |||
334 | /** | ||
335 | * This field indicates a CONFIG ROUTE INFO command has a response with function result | ||
336 | * INDEX DOES NOT EXIST, usually means exceeding max route index. | ||
337 | */ | ||
338 | SCI_FAILURE_EXCEED_MAX_ROUTE_INDEX, | ||
339 | |||
340 | /** | ||
341 | * This value indicates that an unsupported PCI device ID has been | ||
342 | * specified. This indicates that attempts to invoke | ||
343 | * scic_library_allocate_controller() will fail. | ||
344 | */ | ||
345 | SCI_FAILURE_UNSUPPORTED_PCI_DEVICE_ID | ||
346 | |||
347 | }; | ||
348 | |||
349 | /** | ||
350 | * enum sci_io_status - This enumeration depicts all of the possible IO | ||
351 | * completion status values. Each value in this enumeration maps directly | ||
352 | * to a value in the enum sci_status enumeration. Please refer to that | ||
353 | * enumeration for detailed comments concerning what the status represents. | ||
354 | * | ||
355 | * Add the API to retrieve the SCU status from the core. Check to see that the | ||
356 | * following status are properly handled: - SCI_IO_FAILURE_UNSUPPORTED_PROTOCOL | ||
357 | * - SCI_IO_FAILURE_INVALID_IO_TAG | ||
358 | */ | ||
359 | enum sci_io_status { | ||
360 | SCI_IO_SUCCESS = SCI_SUCCESS, | ||
361 | SCI_IO_FAILURE = SCI_FAILURE, | ||
362 | SCI_IO_SUCCESS_COMPLETE_BEFORE_START = SCI_SUCCESS_IO_COMPLETE_BEFORE_START, | ||
363 | SCI_IO_SUCCESS_IO_DONE_EARLY = SCI_SUCCESS_IO_DONE_EARLY, | ||
364 | SCI_IO_FAILURE_INVALID_STATE = SCI_FAILURE_INVALID_STATE, | ||
365 | SCI_IO_FAILURE_INSUFFICIENT_RESOURCES = SCI_FAILURE_INSUFFICIENT_RESOURCES, | ||
366 | SCI_IO_FAILURE_UNSUPPORTED_PROTOCOL = SCI_FAILURE_UNSUPPORTED_PROTOCOL, | ||
367 | SCI_IO_FAILURE_RESPONSE_VALID = SCI_FAILURE_IO_RESPONSE_VALID, | ||
368 | SCI_IO_FAILURE_CONTROLLER_SPECIFIC_ERR = SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR, | ||
369 | SCI_IO_FAILURE_TERMINATED = SCI_FAILURE_IO_TERMINATED, | ||
370 | SCI_IO_FAILURE_REQUIRES_SCSI_ABORT = SCI_FAILURE_IO_REQUIRES_SCSI_ABORT, | ||
371 | SCI_IO_FAILURE_INVALID_PARAMETER_VALUE = SCI_FAILURE_INVALID_PARAMETER_VALUE, | ||
372 | SCI_IO_FAILURE_NO_NCQ_TAG_AVAILABLE = SCI_FAILURE_NO_NCQ_TAG_AVAILABLE, | ||
373 | SCI_IO_FAILURE_PROTOCOL_VIOLATION = SCI_FAILURE_PROTOCOL_VIOLATION, | ||
374 | |||
375 | SCI_IO_FAILURE_REMOTE_DEVICE_RESET_REQUIRED = SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED, | ||
376 | |||
377 | SCI_IO_FAILURE_RETRY_REQUIRED = SCI_FAILURE_RETRY_REQUIRED, | ||
378 | SCI_IO_FAILURE_RETRY_LIMIT_REACHED = SCI_FAILURE_RETRY_LIMIT_REACHED, | ||
379 | SCI_IO_FAILURE_INVALID_REMOTE_DEVICE = SCI_FAILURE_INVALID_REMOTE_DEVICE | ||
380 | }; | ||
381 | |||
382 | /** | ||
383 | * enum sci_task_status - This enumeration depicts all of the possible task | ||
384 | * completion status values. Each value in this enumeration maps directly | ||
385 | * to a value in the enum sci_status enumeration. Please refer to that | ||
386 | * enumeration for detailed comments concerning what the status represents. | ||
387 | * | ||
388 | * Check to see that the following status are properly handled: | ||
389 | */ | ||
390 | enum sci_task_status { | ||
391 | SCI_TASK_SUCCESS = SCI_SUCCESS, | ||
392 | SCI_TASK_FAILURE = SCI_FAILURE, | ||
393 | SCI_TASK_FAILURE_INVALID_STATE = SCI_FAILURE_INVALID_STATE, | ||
394 | SCI_TASK_FAILURE_INSUFFICIENT_RESOURCES = SCI_FAILURE_INSUFFICIENT_RESOURCES, | ||
395 | SCI_TASK_FAILURE_UNSUPPORTED_PROTOCOL = SCI_FAILURE_UNSUPPORTED_PROTOCOL, | ||
396 | SCI_TASK_FAILURE_INVALID_TAG = SCI_FAILURE_INVALID_IO_TAG, | ||
397 | SCI_TASK_FAILURE_RESPONSE_VALID = SCI_FAILURE_IO_RESPONSE_VALID, | ||
398 | SCI_TASK_FAILURE_CONTROLLER_SPECIFIC_ERR = SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR, | ||
399 | SCI_TASK_FAILURE_TERMINATED = SCI_FAILURE_IO_TERMINATED, | ||
400 | SCI_TASK_FAILURE_INVALID_PARAMETER_VALUE = SCI_FAILURE_INVALID_PARAMETER_VALUE, | ||
401 | |||
402 | SCI_TASK_FAILURE_REMOTE_DEVICE_RESET_REQUIRED = SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED, | ||
403 | SCI_TASK_FAILURE_RESET_DEVICE_PARTIAL_SUCCESS = SCI_FAILURE_RESET_DEVICE_PARTIAL_SUCCESS | ||
404 | |||
405 | }; | ||
406 | |||
407 | |||
408 | #endif /* _SCI_STATUS_H_ */ | ||
409 | |||
diff --git a/drivers/scsi/isci/core/sci_util.c b/drivers/scsi/isci/core/sci_util.c index 4e60d55836e9..0101fec23865 100644 --- a/drivers/scsi/isci/core/sci_util.c +++ b/drivers/scsi/isci/core/sci_util.c | |||
@@ -56,6 +56,7 @@ | |||
56 | #include <linux/kernel.h> | 56 | #include <linux/kernel.h> |
57 | #include "sci_util.h" | 57 | #include "sci_util.h" |
58 | #include "sci_environment.h" | 58 | #include "sci_environment.h" |
59 | #include "request.h" | ||
59 | 60 | ||
60 | void *scic_request_get_virt_addr(struct scic_sds_request *sci_req, dma_addr_t phys_addr) | 61 | void *scic_request_get_virt_addr(struct scic_sds_request *sci_req, dma_addr_t phys_addr) |
61 | { | 62 | { |
diff --git a/drivers/scsi/isci/core/scic_config_parameters.h b/drivers/scsi/isci/core/scic_config_parameters.h index ea09d0bd2d1b..8b8c9259f52f 100644 --- a/drivers/scsi/isci/core/scic_config_parameters.h +++ b/drivers/scsi/isci/core/scic_config_parameters.h | |||
@@ -56,17 +56,6 @@ | |||
56 | #ifndef _SCIC_SDS_USER_PARAMETERS_H_ | 56 | #ifndef _SCIC_SDS_USER_PARAMETERS_H_ |
57 | #define _SCIC_SDS_USER_PARAMETERS_H_ | 57 | #define _SCIC_SDS_USER_PARAMETERS_H_ |
58 | 58 | ||
59 | /** | ||
60 | * This file contains all of the structure definitions and interface methods | ||
61 | * that can be called by a SCIC user on the SCU Driver Standard | ||
62 | * (struct scic_sds_user_parameters) user parameter block. | ||
63 | * | ||
64 | * | ||
65 | */ | ||
66 | |||
67 | |||
68 | #include "sci_status.h" | ||
69 | #include "sci_controller_constants.h" | ||
70 | #include "probe_roms.h" | 59 | #include "probe_roms.h" |
71 | 60 | ||
72 | struct scic_sds_controller; | 61 | struct scic_sds_controller; |
diff --git a/drivers/scsi/isci/core/scic_controller.h b/drivers/scsi/isci/core/scic_controller.h index 50ba155a6c7c..bd08f306ed67 100644 --- a/drivers/scsi/isci/core/scic_controller.h +++ b/drivers/scsi/isci/core/scic_controller.h | |||
@@ -56,8 +56,6 @@ | |||
56 | #ifndef _SCIC_CONTROLLER_H_ | 56 | #ifndef _SCIC_CONTROLLER_H_ |
57 | #define _SCIC_CONTROLLER_H_ | 57 | #define _SCIC_CONTROLLER_H_ |
58 | 58 | ||
59 | #include "sci_status.h" | ||
60 | #include "sci_controller.h" | ||
61 | #include "scic_config_parameters.h" | 59 | #include "scic_config_parameters.h" |
62 | 60 | ||
63 | struct scic_sds_request; | 61 | struct scic_sds_request; |
@@ -65,12 +63,6 @@ struct scic_sds_phy; | |||
65 | struct scic_sds_port; | 63 | struct scic_sds_port; |
66 | struct scic_sds_remote_device; | 64 | struct scic_sds_remote_device; |
67 | 65 | ||
68 | |||
69 | enum sci_controller_mode { | ||
70 | SCI_MODE_SPEED, /* Optimized for performance */ | ||
71 | SCI_MODE_SIZE /* Optimized for memory use */ | ||
72 | }; | ||
73 | |||
74 | enum sci_status scic_controller_construct(struct scic_sds_controller *c, | 66 | enum sci_status scic_controller_construct(struct scic_sds_controller *c, |
75 | void __iomem *scu_base, | 67 | void __iomem *scu_base, |
76 | void __iomem *smu_base); | 68 | void __iomem *smu_base); |
diff --git a/drivers/scsi/isci/core/scic_io_request.h b/drivers/scsi/isci/core/scic_io_request.h index f7c6d426f8c0..a4664cc3c576 100644 --- a/drivers/scsi/isci/core/scic_io_request.h +++ b/drivers/scsi/isci/core/scic_io_request.h | |||
@@ -56,15 +56,7 @@ | |||
56 | #ifndef _SCIC_IO_REQUEST_H_ | 56 | #ifndef _SCIC_IO_REQUEST_H_ |
57 | #define _SCIC_IO_REQUEST_H_ | 57 | #define _SCIC_IO_REQUEST_H_ |
58 | 58 | ||
59 | /** | ||
60 | * This file contains the structures and interface methods that can be | ||
61 | * referenced and used by the SCI user for the SCI IO request object. | ||
62 | * | ||
63 | * Determine the failure situations and return values. | ||
64 | */ | ||
65 | |||
66 | #include <linux/kernel.h> | 59 | #include <linux/kernel.h> |
67 | #include "sci_status.h" | ||
68 | 60 | ||
69 | struct scic_sds_request; | 61 | struct scic_sds_request; |
70 | struct scic_sds_remote_device; | 62 | struct scic_sds_remote_device; |
diff --git a/drivers/scsi/isci/core/scic_phy.h b/drivers/scsi/isci/core/scic_phy.h index 1fb49f02162b..f046b4af4b8d 100644 --- a/drivers/scsi/isci/core/scic_phy.h +++ b/drivers/scsi/isci/core/scic_phy.h | |||
@@ -66,7 +66,6 @@ | |||
66 | 66 | ||
67 | #include <scsi/sas.h> | 67 | #include <scsi/sas.h> |
68 | #include <scsi/libsas.h> | 68 | #include <scsi/libsas.h> |
69 | #include "sci_status.h" | ||
70 | 69 | ||
71 | struct scic_sds_phy; | 70 | struct scic_sds_phy; |
72 | struct scic_sds_port; | 71 | struct scic_sds_port; |
diff --git a/drivers/scsi/isci/core/scic_port.h b/drivers/scsi/isci/core/scic_port.h index 44a8ea887151..51e7eede5c88 100644 --- a/drivers/scsi/isci/core/scic_port.h +++ b/drivers/scsi/isci/core/scic_port.h | |||
@@ -56,8 +56,8 @@ | |||
56 | #ifndef _SCIC_PORT_H_ | 56 | #ifndef _SCIC_PORT_H_ |
57 | #define _SCIC_PORT_H_ | 57 | #define _SCIC_PORT_H_ |
58 | 58 | ||
59 | #include "isci.h" | ||
59 | #include "sas.h" | 60 | #include "sas.h" |
60 | #include "sci_status.h" | ||
61 | #include "scic_phy.h" | 61 | #include "scic_phy.h" |
62 | 62 | ||
63 | struct scic_sds_port; | 63 | struct scic_sds_port; |
diff --git a/drivers/scsi/isci/core/scic_sds_controller.c b/drivers/scsi/isci/core/scic_sds_controller.c index 852b7d52f84f..e77265b9b9ec 100644 --- a/drivers/scsi/isci/core/scic_sds_controller.c +++ b/drivers/scsi/isci/core/scic_sds_controller.c | |||
@@ -68,11 +68,11 @@ | |||
68 | #include "sci_environment.h" | 68 | #include "sci_environment.h" |
69 | #include "sci_util.h" | 69 | #include "sci_util.h" |
70 | #include "scu_completion_codes.h" | 70 | #include "scu_completion_codes.h" |
71 | #include "scu_constants.h" | ||
72 | #include "scu_event_codes.h" | 71 | #include "scu_event_codes.h" |
73 | #include "scu_remote_node_context.h" | 72 | #include "scu_remote_node_context.h" |
74 | #include "scu_task_context.h" | 73 | #include "scu_task_context.h" |
75 | #include "scu_unsolicited_frame.h" | 74 | #include "scu_unsolicited_frame.h" |
75 | #include "timers.h" | ||
76 | 76 | ||
77 | #define SCU_CONTEXT_RAM_INIT_STALL_TIME 200 | 77 | #define SCU_CONTEXT_RAM_INIT_STALL_TIME 200 |
78 | 78 | ||
diff --git a/drivers/scsi/isci/core/scic_sds_controller.h b/drivers/scsi/isci/core/scic_sds_controller.h index 0d5047319cbf..5c00f9688c18 100644 --- a/drivers/scsi/isci/core/scic_sds_controller.h +++ b/drivers/scsi/isci/core/scic_sds_controller.h | |||
@@ -67,7 +67,6 @@ | |||
67 | */ | 67 | */ |
68 | 68 | ||
69 | #include "sci_pool.h" | 69 | #include "sci_pool.h" |
70 | #include "sci_controller_constants.h" | ||
71 | #include "sci_base_state.h" | 70 | #include "sci_base_state.h" |
72 | #include "sci_base_state_machine.h" | 71 | #include "sci_base_state_machine.h" |
73 | #include "scic_config_parameters.h" | 72 | #include "scic_config_parameters.h" |
@@ -76,7 +75,6 @@ | |||
76 | #include "remote_node_table.h" | 75 | #include "remote_node_table.h" |
77 | #include "remote_device.h" | 76 | #include "remote_device.h" |
78 | #include "scu_registers.h" | 77 | #include "scu_registers.h" |
79 | #include "scu_constants.h" | ||
80 | #include "scu_task_context.h" | 78 | #include "scu_task_context.h" |
81 | #include "scu_unsolicited_frame.h" | 79 | #include "scu_unsolicited_frame.h" |
82 | #include "scic_sds_unsolicited_frame_control.h" | 80 | #include "scic_sds_unsolicited_frame_control.h" |
diff --git a/drivers/scsi/isci/core/scic_sds_phy.c b/drivers/scsi/isci/core/scic_sds_phy.c index f0f4c74e4619..c6df0e2c842e 100644 --- a/drivers/scsi/isci/core/scic_sds_phy.c +++ b/drivers/scsi/isci/core/scic_sds_phy.c | |||
@@ -65,6 +65,7 @@ | |||
65 | #include "sci_environment.h" | 65 | #include "sci_environment.h" |
66 | #include "sci_util.h" | 66 | #include "sci_util.h" |
67 | #include "scu_event_codes.h" | 67 | #include "scu_event_codes.h" |
68 | #include "timers.h" | ||
68 | 69 | ||
69 | #define SCIC_SDS_PHY_MIN_TIMER_COUNT (SCI_MAX_PHYS) | 70 | #define SCIC_SDS_PHY_MIN_TIMER_COUNT (SCI_MAX_PHYS) |
70 | #define SCIC_SDS_PHY_MAX_TIMER_COUNT (SCI_MAX_PHYS) | 71 | #define SCIC_SDS_PHY_MAX_TIMER_COUNT (SCI_MAX_PHYS) |
diff --git a/drivers/scsi/isci/core/scic_sds_port.c b/drivers/scsi/isci/core/scic_sds_port.c index 01288dd44fb6..9302e397e4ca 100644 --- a/drivers/scsi/isci/core/scic_sds_port.c +++ b/drivers/scsi/isci/core/scic_sds_port.c | |||
@@ -64,6 +64,7 @@ | |||
64 | #include "scic_sds_request.h" | 64 | #include "scic_sds_request.h" |
65 | #include "sci_environment.h" | 65 | #include "sci_environment.h" |
66 | #include "scu_registers.h" | 66 | #include "scu_registers.h" |
67 | #include "timers.h" | ||
67 | 68 | ||
68 | #define SCIC_SDS_PORT_MIN_TIMER_COUNT (SCI_MAX_PORTS) | 69 | #define SCIC_SDS_PORT_MIN_TIMER_COUNT (SCI_MAX_PORTS) |
69 | #define SCIC_SDS_PORT_MAX_TIMER_COUNT (SCI_MAX_PORTS) | 70 | #define SCIC_SDS_PORT_MAX_TIMER_COUNT (SCI_MAX_PORTS) |
diff --git a/drivers/scsi/isci/core/scic_sds_port.h b/drivers/scsi/isci/core/scic_sds_port.h index 3633561b686a..3696debcce12 100644 --- a/drivers/scsi/isci/core/scic_sds_port.h +++ b/drivers/scsi/isci/core/scic_sds_port.h | |||
@@ -58,21 +58,15 @@ | |||
58 | 58 | ||
59 | #include <linux/kernel.h> | 59 | #include <linux/kernel.h> |
60 | #include "sas.h" | 60 | #include "sas.h" |
61 | #include "sci_controller_constants.h" | ||
62 | #include "scu_registers.h" | 61 | #include "scu_registers.h" |
63 | 62 | #include "sci_base_state_machine.h" | |
64 | #define SCIC_SDS_DUMMY_PORT 0xFF | ||
65 | 63 | ||
66 | struct scic_sds_controller; | 64 | struct scic_sds_controller; |
67 | struct scic_sds_phy; | 65 | struct scic_sds_phy; |
68 | struct scic_sds_remote_device; | 66 | struct scic_sds_remote_device; |
69 | struct scic_sds_request; | 67 | struct scic_sds_request; |
70 | 68 | ||
71 | /** | 69 | #define SCIC_SDS_DUMMY_PORT 0xFF |
72 | * This constant defines the value utilized by SCI Components to indicate | ||
73 | * an invalid handle. | ||
74 | */ | ||
75 | #define SCI_INVALID_HANDLE 0x0 | ||
76 | 70 | ||
77 | /** | 71 | /** |
78 | * enum SCIC_SDS_PORT_READY_SUBSTATES - | 72 | * enum SCIC_SDS_PORT_READY_SUBSTATES - |
diff --git a/drivers/scsi/isci/core/scic_sds_port_configuration_agent.c b/drivers/scsi/isci/core/scic_sds_port_configuration_agent.c index 2d3d067396d3..3fad8c1db6c9 100644 --- a/drivers/scsi/isci/core/scic_sds_port_configuration_agent.c +++ b/drivers/scsi/isci/core/scic_sds_port_configuration_agent.c | |||
@@ -53,17 +53,11 @@ | |||
53 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 53 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
54 | */ | 54 | */ |
55 | 55 | ||
56 | /** | ||
57 | * This file contains the implementation for the public and protected methods | ||
58 | * for the port configuration agent. | ||
59 | * | ||
60 | * | ||
61 | */ | ||
62 | |||
63 | #include "sci_environment.h" | 56 | #include "sci_environment.h" |
64 | #include "scic_controller.h" | 57 | #include "scic_controller.h" |
65 | #include "scic_sds_controller.h" | 58 | #include "scic_sds_controller.h" |
66 | #include "scic_sds_port_configuration_agent.h" | 59 | #include "scic_sds_port_configuration_agent.h" |
60 | #include "timers.h" | ||
67 | 61 | ||
68 | #define SCIC_SDS_MPC_RECONFIGURATION_TIMEOUT (10) | 62 | #define SCIC_SDS_MPC_RECONFIGURATION_TIMEOUT (10) |
69 | #define SCIC_SDS_APC_RECONFIGURATION_TIMEOUT (10) | 63 | #define SCIC_SDS_APC_RECONFIGURATION_TIMEOUT (10) |
diff --git a/drivers/scsi/isci/core/scic_sds_request.c b/drivers/scsi/isci/core/scic_sds_request.c index 50dd19bba3db..de35885eb1f9 100644 --- a/drivers/scsi/isci/core/scic_sds_request.c +++ b/drivers/scsi/isci/core/scic_sds_request.c | |||
@@ -67,8 +67,9 @@ | |||
67 | #include "sci_environment.h" | 67 | #include "sci_environment.h" |
68 | #include "sci_util.h" | 68 | #include "sci_util.h" |
69 | #include "scu_completion_codes.h" | 69 | #include "scu_completion_codes.h" |
70 | #include "scu_constants.h" | ||
71 | #include "scu_task_context.h" | 70 | #include "scu_task_context.h" |
71 | #include "request.h" | ||
72 | #include "task.h" | ||
72 | 73 | ||
73 | /* | 74 | /* |
74 | * **************************************************************************** | 75 | * **************************************************************************** |
diff --git a/drivers/scsi/isci/core/scic_sds_request.h b/drivers/scsi/isci/core/scic_sds_request.h index 1dd98aabe32d..5ce7ff2aed9a 100644 --- a/drivers/scsi/isci/core/scic_sds_request.h +++ b/drivers/scsi/isci/core/scic_sds_request.h | |||
@@ -56,11 +56,11 @@ | |||
56 | #ifndef _SCIC_SDS_IO_REQUEST_H_ | 56 | #ifndef _SCIC_SDS_IO_REQUEST_H_ |
57 | #define _SCIC_SDS_IO_REQUEST_H_ | 57 | #define _SCIC_SDS_IO_REQUEST_H_ |
58 | 58 | ||
59 | #include "isci.h" | ||
59 | #include "scic_io_request.h" | 60 | #include "scic_io_request.h" |
60 | #include "sci_base_state_machine.h" | 61 | #include "sci_base_state_machine.h" |
61 | #include "scu_task_context.h" | 62 | #include "scu_task_context.h" |
62 | #include "scic_sds_stp_request.h" | 63 | #include "scic_sds_stp_request.h" |
63 | #include "scu_constants.h" | ||
64 | #include "sas.h" | 64 | #include "sas.h" |
65 | 65 | ||
66 | struct scic_sds_controller; | 66 | struct scic_sds_controller; |
diff --git a/drivers/scsi/isci/core/scic_sds_stp_request.c b/drivers/scsi/isci/core/scic_sds_stp_request.c index 2677393db6f4..c1c316cad522 100644 --- a/drivers/scsi/isci/core/scic_sds_stp_request.c +++ b/drivers/scsi/isci/core/scic_sds_stp_request.c | |||
@@ -69,6 +69,7 @@ | |||
69 | #include "scu_completion_codes.h" | 69 | #include "scu_completion_codes.h" |
70 | #include "scu_event_codes.h" | 70 | #include "scu_event_codes.h" |
71 | #include "scu_task_context.h" | 71 | #include "scu_task_context.h" |
72 | #include "request.h" | ||
72 | 73 | ||
73 | void scic_sds_stp_request_assign_buffers(struct scic_sds_request *sci_req) | 74 | void scic_sds_stp_request_assign_buffers(struct scic_sds_request *sci_req) |
74 | { | 75 | { |
diff --git a/drivers/scsi/isci/core/scic_sds_unsolicited_frame_control.h b/drivers/scsi/isci/core/scic_sds_unsolicited_frame_control.h index 4eb244c06cfc..0d8ca8c4770f 100644 --- a/drivers/scsi/isci/core/scic_sds_unsolicited_frame_control.h +++ b/drivers/scsi/isci/core/scic_sds_unsolicited_frame_control.h | |||
@@ -53,19 +53,11 @@ | |||
53 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 53 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
54 | */ | 54 | */ |
55 | 55 | ||
56 | /** | ||
57 | * This file contains all of the unsolicited frame related management for the | ||
58 | * address table, the headers, and actual payload buffers. | ||
59 | * | ||
60 | * | ||
61 | */ | ||
62 | |||
63 | #ifndef _SCIC_SDS_UNSOLICITED_FRAME_CONTROL_H_ | 56 | #ifndef _SCIC_SDS_UNSOLICITED_FRAME_CONTROL_H_ |
64 | #define _SCIC_SDS_UNSOLICITED_FRAME_CONTROL_H_ | 57 | #define _SCIC_SDS_UNSOLICITED_FRAME_CONTROL_H_ |
65 | 58 | ||
59 | #include "isci.h" | ||
66 | #include "scu_unsolicited_frame.h" | 60 | #include "scu_unsolicited_frame.h" |
67 | #include "scu_constants.h" | ||
68 | #include "sci_status.h" | ||
69 | 61 | ||
70 | /** | 62 | /** |
71 | * enum unsolicited_frame_state - | 63 | * enum unsolicited_frame_state - |
@@ -144,15 +136,6 @@ struct scic_sds_uf_header_array { | |||
144 | 136 | ||
145 | }; | 137 | }; |
146 | 138 | ||
147 | /* | ||
148 | * Determine the size of the unsolicited frame array including | ||
149 | * unused buffers. */ | ||
150 | #if SCU_UNSOLICITED_FRAME_COUNT <= SCU_MIN_UF_TABLE_ENTRIES | ||
151 | #define SCU_UNSOLICITED_FRAME_CONTROL_ARRAY_SIZE SCU_MIN_UF_TABLE_ENTRIES | ||
152 | #else | ||
153 | #define SCU_UNSOLICITED_FRAME_CONTROL_ARRAY_SIZE SCU_MAX_UNSOLICITED_FRAMES | ||
154 | #endif /* SCU_UNSOLICITED_FRAME_COUNT <= SCU_MIN_UF_TABLE_ENTRIES */ | ||
155 | |||
156 | /** | 139 | /** |
157 | * struct scic_sds_uf_buffer_array - | 140 | * struct scic_sds_uf_buffer_array - |
158 | * | 141 | * |
diff --git a/drivers/scsi/isci/core/scic_task_request.h b/drivers/scsi/isci/core/scic_task_request.h index 98cfaa9e6d38..790cee9b4af6 100644 --- a/drivers/scsi/isci/core/scic_task_request.h +++ b/drivers/scsi/isci/core/scic_task_request.h | |||
@@ -56,16 +56,7 @@ | |||
56 | #ifndef _SCIC_TASK_REQUEST_H_ | 56 | #ifndef _SCIC_TASK_REQUEST_H_ |
57 | #define _SCIC_TASK_REQUEST_H_ | 57 | #define _SCIC_TASK_REQUEST_H_ |
58 | 58 | ||
59 | /** | 59 | #include "isci.h" |
60 | * This file contains the structures and interface methods that can be | ||
61 | * referenced and used by the SCI user for to utilize task management | ||
62 | * requests. | ||
63 | * | ||
64 | * | ||
65 | */ | ||
66 | |||
67 | |||
68 | #include "sci_status.h" | ||
69 | 60 | ||
70 | struct scic_sds_request; | 61 | struct scic_sds_request; |
71 | struct scic_sds_remote_device; | 62 | struct scic_sds_remote_device; |
diff --git a/drivers/scsi/isci/core/scu_constants.h b/drivers/scsi/isci/core/scu_constants.h deleted file mode 100644 index a99d1103ad3b..000000000000 --- a/drivers/scsi/isci/core/scu_constants.h +++ /dev/null | |||
@@ -1,151 +0,0 @@ | |||
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 _SCU_CONSTANTS_H_ | ||
57 | #define _SCU_CONSTANTS_H_ | ||
58 | |||
59 | /** | ||
60 | * This file contains the SCU hardware constants. | ||
61 | * | ||
62 | * | ||
63 | */ | ||
64 | |||
65 | #include "sci_controller_constants.h" | ||
66 | |||
67 | /** | ||
68 | * | ||
69 | * | ||
70 | * 2 indicates the maximum number of UFs that can occur for a given IO request. | ||
71 | * The hardware handles reception of additional unsolicited frames while all | ||
72 | * UFs are in use, by holding off the transmitting device. This number could | ||
73 | * be theoretically reduced to 1, but 2 provides for more reliable operation. | ||
74 | * During SATA PIO operation, it is possible under some conditions for there to | ||
75 | * be 3 separate FISes received, back to back to back (PIO Setup, Data, D2H | ||
76 | * Register). It is unlikely to have all 3 pending all at once without some of | ||
77 | * them already being processed. | ||
78 | */ | ||
79 | #define SCU_MIN_UNSOLICITED_FRAMES (1) | ||
80 | #define SCU_MIN_CRITICAL_NOTIFICATIONS (24) | ||
81 | #define SCU_MIN_EVENTS (4) | ||
82 | #define SCU_MIN_COMPLETION_QUEUE_SCRATCH (2) | ||
83 | #define SCU_MIN_COMPLETION_QUEUE_ENTRIES (SCU_MIN_CRITICAL_NOTIFICATIONS \ | ||
84 | + SCU_MIN_EVENTS \ | ||
85 | + SCU_MIN_UNSOLICITED_FRAMES \ | ||
86 | + SCI_MIN_IO_REQUESTS \ | ||
87 | + SCU_MIN_COMPLETION_QUEUE_SCRATCH) | ||
88 | |||
89 | #define SCU_MAX_CRITICAL_NOTIFICATIONS (384) | ||
90 | #define SCU_MAX_EVENTS (128) | ||
91 | #define SCU_MAX_UNSOLICITED_FRAMES (128) | ||
92 | #define SCU_MAX_COMPLETION_QUEUE_SCRATCH (128) | ||
93 | #define SCU_MAX_COMPLETION_QUEUE_ENTRIES (SCU_MAX_CRITICAL_NOTIFICATIONS \ | ||
94 | + SCU_MAX_EVENTS \ | ||
95 | + SCU_MAX_UNSOLICITED_FRAMES \ | ||
96 | + SCI_MAX_IO_REQUESTS \ | ||
97 | + SCU_MAX_COMPLETION_QUEUE_SCRATCH) | ||
98 | |||
99 | #if !defined(ENABLE_MINIMUM_MEMORY_MODE) | ||
100 | #define SCU_UNSOLICITED_FRAME_COUNT SCU_MAX_UNSOLICITED_FRAMES | ||
101 | #define SCU_CRITICAL_NOTIFICATION_COUNT SCU_MAX_CRITICAL_NOTIFICATIONS | ||
102 | #define SCU_EVENT_COUNT SCU_MAX_EVENTS | ||
103 | #define SCU_COMPLETION_QUEUE_SCRATCH SCU_MAX_COMPLETION_QUEUE_SCRATCH | ||
104 | #define SCU_IO_REQUEST_COUNT SCI_MAX_IO_REQUESTS | ||
105 | #define SCU_IO_REQUEST_SGE_COUNT SCI_MAX_SCATTER_GATHER_ELEMENTS | ||
106 | #define SCU_COMPLETION_QUEUE_COUNT SCU_MAX_COMPLETION_QUEUE_ENTRIES | ||
107 | #else | ||
108 | #define SCU_UNSOLICITED_FRAME_COUNT SCU_MIN_UNSOLICITED_FRAMES | ||
109 | #define SCU_CRITICAL_NOTIFICATION_COUNT SCU_MIN_CRITICAL_NOTIFICATIONS | ||
110 | #define SCU_EVENT_COUNT SCU_MIN_EVENTS | ||
111 | #define SCU_COMPLETION_QUEUE_SCRATCH SCU_MIN_COMPLETION_QUEUE_SCRATCH | ||
112 | #define SCU_IO_REQUEST_COUNT SCI_MIN_IO_REQUESTS | ||
113 | #define SCU_IO_REQUEST_SGE_COUNT SCI_MIN_SCATTER_GATHER_ELEMENTS | ||
114 | #define SCU_COMPLETION_QUEUE_COUNT SCU_MIN_COMPLETION_QUEUE_ENTRIES | ||
115 | #endif /* !defined(ENABLE_MINIMUM_MEMORY_OPERATION) */ | ||
116 | |||
117 | /** | ||
118 | * | ||
119 | * | ||
120 | * The SCU_COMPLETION_QUEUE_COUNT constant indicates the size of the completion | ||
121 | * queue into which the hardware DMAs 32-bit quantas (completion entries). | ||
122 | */ | ||
123 | |||
124 | /** | ||
125 | * | ||
126 | * | ||
127 | * This queue must be programmed to a power of 2 size (e.g. 32, 64, 1024, etc.). | ||
128 | */ | ||
129 | #if (SCU_COMPLETION_QUEUE_COUNT != 16) && \ | ||
130 | (SCU_COMPLETION_QUEUE_COUNT != 32) && \ | ||
131 | (SCU_COMPLETION_QUEUE_COUNT != 64) && \ | ||
132 | (SCU_COMPLETION_QUEUE_COUNT != 128) && \ | ||
133 | (SCU_COMPLETION_QUEUE_COUNT != 256) && \ | ||
134 | (SCU_COMPLETION_QUEUE_COUNT != 512) && \ | ||
135 | (SCU_COMPLETION_QUEUE_COUNT != 1024) | ||
136 | #error "SCU_COMPLETION_QUEUE_COUNT must be set to a power of 2." | ||
137 | #endif | ||
138 | |||
139 | #if SCU_MIN_UNSOLICITED_FRAMES > SCU_MAX_UNSOLICITED_FRAMES | ||
140 | #error "Invalid configuration of unsolicited frame constants" | ||
141 | #endif /* SCU_MIN_UNSOLICITED_FRAMES > SCU_MAX_UNSOLICITED_FRAMES */ | ||
142 | |||
143 | #define SCU_MIN_UF_TABLE_ENTRIES (8) | ||
144 | #define SCU_ABSOLUTE_MAX_UNSOLICITED_FRAMES (4096) | ||
145 | #define SCU_UNSOLICITED_FRAME_BUFFER_SIZE (1024) | ||
146 | #define SCU_INVALID_FRAME_INDEX (0xFFFF) | ||
147 | |||
148 | #define SCU_IO_REQUEST_MAX_SGE_SIZE (0x00FFFFFF) | ||
149 | #define SCU_IO_REQUEST_MAX_TRANSFER_LENGTH (0x00FFFFFF) | ||
150 | |||
151 | #endif /* _SCU_CONSTANTS_H_ */ | ||
diff --git a/drivers/scsi/isci/host.c b/drivers/scsi/isci/host.c index 271a7e171e7d..5847149857a9 100644 --- a/drivers/scsi/isci/host.c +++ b/drivers/scsi/isci/host.c | |||
@@ -60,7 +60,9 @@ | |||
60 | #include "request.h" | 60 | #include "request.h" |
61 | #include "host.h" | 61 | #include "host.h" |
62 | #include "probe_roms.h" | 62 | #include "probe_roms.h" |
63 | #include "scic_controller.h" | ||
63 | #include "scic_sds_controller.h" | 64 | #include "scic_sds_controller.h" |
65 | #include "timers.h" | ||
64 | 66 | ||
65 | irqreturn_t isci_msix_isr(int vec, void *data) | 67 | irqreturn_t isci_msix_isr(int vec, void *data) |
66 | { | 68 | { |
diff --git a/drivers/scsi/isci/host.h b/drivers/scsi/isci/host.h index afa41e83eaa7..13c1c99ef294 100644 --- a/drivers/scsi/isci/host.h +++ b/drivers/scsi/isci/host.h | |||
@@ -53,26 +53,12 @@ | |||
53 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 53 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
54 | */ | 54 | */ |
55 | 55 | ||
56 | 56 | #ifndef _SCI_HOST_H_ | |
57 | #if !defined(_SCI_HOST_H_) | ||
58 | #define _SCI_HOST_H_ | 57 | #define _SCI_HOST_H_ |
59 | 58 | ||
60 | #include "phy.h" | ||
61 | #include "scic_sds_controller.h" | 59 | #include "scic_sds_controller.h" |
62 | #include "timers.h" | ||
63 | #include "remote_device.h" | 60 | #include "remote_device.h" |
64 | 61 | #include "phy.h" | |
65 | #define DRV_NAME "isci" | ||
66 | #define SCI_PCI_BAR_COUNT 2 | ||
67 | #define SCI_NUM_MSI_X_INT 2 | ||
68 | #define SCI_SMU_BAR 0 | ||
69 | #define SCI_SMU_BAR_SIZE (16*1024) | ||
70 | #define SCI_SCU_BAR 1 | ||
71 | #define SCI_SCU_BAR_SIZE (4*1024*1024) | ||
72 | #define SCI_IO_SPACE_BAR0 2 | ||
73 | #define SCI_IO_SPACE_BAR1 3 | ||
74 | #define ISCI_CAN_QUEUE_VAL 250 /* < SCI_MAX_IO_REQUESTS ? */ | ||
75 | #define SCIC_CONTROLLER_STOP_TIMEOUT 5000 | ||
76 | 62 | ||
77 | struct isci_host { | 63 | struct isci_host { |
78 | struct scic_sds_controller sci; | 64 | struct scic_sds_controller sci; |
diff --git a/drivers/scsi/isci/init.c b/drivers/scsi/isci/init.c index 522d39f9e132..df132c07badf 100644 --- a/drivers/scsi/isci/init.c +++ b/drivers/scsi/isci/init.c | |||
@@ -61,9 +61,9 @@ | |||
61 | #include <asm/string.h> | 61 | #include <asm/string.h> |
62 | #include "isci.h" | 62 | #include "isci.h" |
63 | #include "task.h" | 63 | #include "task.h" |
64 | #include "sci_controller_constants.h" | ||
65 | #include "sci_environment.h" | 64 | #include "sci_environment.h" |
66 | #include "probe_roms.h" | 65 | #include "probe_roms.h" |
66 | #include "scic_controller.h" | ||
67 | 67 | ||
68 | static struct scsi_transport_template *isci_transport_template; | 68 | static struct scsi_transport_template *isci_transport_template; |
69 | 69 | ||
diff --git a/drivers/scsi/isci/isci.h b/drivers/scsi/isci/isci.h index 60c84627c13e..800f2332ecd0 100644 --- a/drivers/scsi/isci/isci.h +++ b/drivers/scsi/isci/isci.h | |||
@@ -56,22 +56,470 @@ | |||
56 | #ifndef __ISCI_H__ | 56 | #ifndef __ISCI_H__ |
57 | #define __ISCI_H__ | 57 | #define __ISCI_H__ |
58 | 58 | ||
59 | #include <linux/kernel.h> | ||
60 | #include <linux/list.h> | ||
61 | #include <linux/types.h> | ||
62 | #include <linux/spinlock.h> | ||
63 | #include <linux/interrupt.h> | 59 | #include <linux/interrupt.h> |
64 | #include <linux/bug.h> | 60 | |
65 | #include <scsi/libsas.h> | 61 | #define DRV_NAME "isci" |
66 | #include <scsi/scsi.h> | 62 | #define SCI_PCI_BAR_COUNT 2 |
67 | 63 | #define SCI_NUM_MSI_X_INT 2 | |
68 | #include "scic_controller.h" | 64 | #define SCI_SMU_BAR 0 |
69 | #include "host.h" | 65 | #define SCI_SMU_BAR_SIZE (16*1024) |
70 | #include "timers.h" | 66 | #define SCI_SCU_BAR 1 |
71 | #include "sci_status.h" | 67 | #define SCI_SCU_BAR_SIZE (4*1024*1024) |
72 | #include "request.h" | 68 | #define SCI_IO_SPACE_BAR0 2 |
73 | #include "task.h" | 69 | #define SCI_IO_SPACE_BAR1 3 |
74 | #include "sata.h" | 70 | #define ISCI_CAN_QUEUE_VAL 250 /* < SCI_MAX_IO_REQUESTS ? */ |
71 | #define SCIC_CONTROLLER_STOP_TIMEOUT 5000 | ||
72 | |||
73 | #define SCI_CONTROLLER_INVALID_IO_TAG 0xFFFF | ||
74 | |||
75 | enum sci_controller_mode { | ||
76 | SCI_MODE_SPEED, | ||
77 | SCI_MODE_SIZE /* deprecated */ | ||
78 | }; | ||
79 | |||
80 | #define SCI_MAX_PHYS (4) | ||
81 | #define SCI_MAX_PORTS SCI_MAX_PHYS | ||
82 | #define SCI_MIN_SMP_PHYS (38) | ||
83 | #define SCI_MAX_SMP_PHYS (384) /* not silicon constrained */ | ||
84 | #define SCI_MAX_REMOTE_DEVICES (256) | ||
85 | #define SCI_MIN_REMOTE_DEVICES (16) | ||
86 | #define SCI_MAX_IO_REQUESTS (256) | ||
87 | #define SCI_MIN_IO_REQUESTS (1) | ||
88 | #define SCI_MAX_MSIX_MESSAGES (2) | ||
89 | #define SCI_MAX_SCATTER_GATHER_ELEMENTS 130 /* not silicon constrained */ | ||
90 | #define SCI_MIN_SCATTER_GATHER_ELEMENTS 1 | ||
91 | #define SCI_MAX_CONTROLLERS 2 | ||
92 | #define SCI_MAX_DOMAINS SCI_MAX_PORTS | ||
93 | |||
94 | /* 2 indicates the maximum number of UFs that can occur for a given IO request. | ||
95 | * The hardware handles reception of additional unsolicited frames while all | ||
96 | * UFs are in use, by holding off the transmitting device. This number could | ||
97 | * be theoretically reduced to 1, but 2 provides for more reliable operation. | ||
98 | * During SATA PIO operation, it is possible under some conditions for there to | ||
99 | * be 3 separate FISes received, back to back to back (PIO Setup, Data, D2H | ||
100 | * Register). It is unlikely to have all 3 pending all at once without some of | ||
101 | * them already being processed. | ||
102 | */ | ||
103 | #define SCU_MIN_UNSOLICITED_FRAMES (1) | ||
104 | #define SCU_MIN_CRITICAL_NOTIFICATIONS (24) | ||
105 | #define SCU_MIN_EVENTS (4) | ||
106 | #define SCU_MIN_COMPLETION_QUEUE_SCRATCH (2) | ||
107 | #define SCU_MIN_COMPLETION_QUEUE_ENTRIES (SCU_MIN_CRITICAL_NOTIFICATIONS \ | ||
108 | + SCU_MIN_EVENTS \ | ||
109 | + SCU_MIN_UNSOLICITED_FRAMES \ | ||
110 | + SCI_MIN_IO_REQUESTS \ | ||
111 | + SCU_MIN_COMPLETION_QUEUE_SCRATCH) | ||
112 | |||
113 | #define SCU_MAX_CRITICAL_NOTIFICATIONS (384) | ||
114 | #define SCU_MAX_EVENTS (128) | ||
115 | #define SCU_MAX_UNSOLICITED_FRAMES (128) | ||
116 | #define SCU_MAX_COMPLETION_QUEUE_SCRATCH (128) | ||
117 | #define SCU_MAX_COMPLETION_QUEUE_ENTRIES (SCU_MAX_CRITICAL_NOTIFICATIONS \ | ||
118 | + SCU_MAX_EVENTS \ | ||
119 | + SCU_MAX_UNSOLICITED_FRAMES \ | ||
120 | + SCI_MAX_IO_REQUESTS \ | ||
121 | + SCU_MAX_COMPLETION_QUEUE_SCRATCH) | ||
122 | |||
123 | #if !defined(ENABLE_MINIMUM_MEMORY_MODE) | ||
124 | #define SCU_UNSOLICITED_FRAME_COUNT SCU_MAX_UNSOLICITED_FRAMES | ||
125 | #define SCU_CRITICAL_NOTIFICATION_COUNT SCU_MAX_CRITICAL_NOTIFICATIONS | ||
126 | #define SCU_EVENT_COUNT SCU_MAX_EVENTS | ||
127 | #define SCU_COMPLETION_QUEUE_SCRATCH SCU_MAX_COMPLETION_QUEUE_SCRATCH | ||
128 | #define SCU_IO_REQUEST_COUNT SCI_MAX_IO_REQUESTS | ||
129 | #define SCU_IO_REQUEST_SGE_COUNT SCI_MAX_SCATTER_GATHER_ELEMENTS | ||
130 | #define SCU_COMPLETION_QUEUE_COUNT SCU_MAX_COMPLETION_QUEUE_ENTRIES | ||
131 | #else | ||
132 | #define SCU_UNSOLICITED_FRAME_COUNT SCU_MIN_UNSOLICITED_FRAMES | ||
133 | #define SCU_CRITICAL_NOTIFICATION_COUNT SCU_MIN_CRITICAL_NOTIFICATIONS | ||
134 | #define SCU_EVENT_COUNT SCU_MIN_EVENTS | ||
135 | #define SCU_COMPLETION_QUEUE_SCRATCH SCU_MIN_COMPLETION_QUEUE_SCRATCH | ||
136 | #define SCU_IO_REQUEST_COUNT SCI_MIN_IO_REQUESTS | ||
137 | #define SCU_IO_REQUEST_SGE_COUNT SCI_MIN_SCATTER_GATHER_ELEMENTS | ||
138 | #define SCU_COMPLETION_QUEUE_COUNT SCU_MIN_COMPLETION_QUEUE_ENTRIES | ||
139 | #endif /* !defined(ENABLE_MINIMUM_MEMORY_OPERATION) */ | ||
140 | |||
141 | /** | ||
142 | * | ||
143 | * | ||
144 | * The SCU_COMPLETION_QUEUE_COUNT constant indicates the size of the completion | ||
145 | * queue into which the hardware DMAs 32-bit quantas (completion entries). | ||
146 | */ | ||
147 | |||
148 | /** | ||
149 | * | ||
150 | * | ||
151 | * This queue must be programmed to a power of 2 size (e.g. 32, 64, 1024, etc.). | ||
152 | */ | ||
153 | #if (SCU_COMPLETION_QUEUE_COUNT != 16) && \ | ||
154 | (SCU_COMPLETION_QUEUE_COUNT != 32) && \ | ||
155 | (SCU_COMPLETION_QUEUE_COUNT != 64) && \ | ||
156 | (SCU_COMPLETION_QUEUE_COUNT != 128) && \ | ||
157 | (SCU_COMPLETION_QUEUE_COUNT != 256) && \ | ||
158 | (SCU_COMPLETION_QUEUE_COUNT != 512) && \ | ||
159 | (SCU_COMPLETION_QUEUE_COUNT != 1024) | ||
160 | #error "SCU_COMPLETION_QUEUE_COUNT must be set to a power of 2." | ||
161 | #endif | ||
162 | |||
163 | #if SCU_MIN_UNSOLICITED_FRAMES > SCU_MAX_UNSOLICITED_FRAMES | ||
164 | #error "Invalid configuration of unsolicited frame constants" | ||
165 | #endif /* SCU_MIN_UNSOLICITED_FRAMES > SCU_MAX_UNSOLICITED_FRAMES */ | ||
166 | |||
167 | #define SCU_MIN_UF_TABLE_ENTRIES (8) | ||
168 | #define SCU_ABSOLUTE_MAX_UNSOLICITED_FRAMES (4096) | ||
169 | #define SCU_UNSOLICITED_FRAME_BUFFER_SIZE (1024) | ||
170 | #define SCU_INVALID_FRAME_INDEX (0xFFFF) | ||
171 | |||
172 | #define SCU_IO_REQUEST_MAX_SGE_SIZE (0x00FFFFFF) | ||
173 | #define SCU_IO_REQUEST_MAX_TRANSFER_LENGTH (0x00FFFFFF) | ||
174 | |||
175 | /* | ||
176 | * Determine the size of the unsolicited frame array including | ||
177 | * unused buffers. */ | ||
178 | #if SCU_UNSOLICITED_FRAME_COUNT <= SCU_MIN_UF_TABLE_ENTRIES | ||
179 | #define SCU_UNSOLICITED_FRAME_CONTROL_ARRAY_SIZE SCU_MIN_UF_TABLE_ENTRIES | ||
180 | #else | ||
181 | #define SCU_UNSOLICITED_FRAME_CONTROL_ARRAY_SIZE SCU_MAX_UNSOLICITED_FRAMES | ||
182 | #endif /* SCU_UNSOLICITED_FRAME_COUNT <= SCU_MIN_UF_TABLE_ENTRIES */ | ||
183 | |||
184 | /** | ||
185 | * enum sci_status - This is the general return status enumeration for non-IO, | ||
186 | * non-task management related SCI interface methods. | ||
187 | * | ||
188 | * | ||
189 | */ | ||
190 | enum sci_status { | ||
191 | /** | ||
192 | * This member indicates successful completion. | ||
193 | */ | ||
194 | SCI_SUCCESS = 0, | ||
195 | |||
196 | /** | ||
197 | * This value indicates that the calling method completed successfully, | ||
198 | * but that the IO may have completed before having it's start method | ||
199 | * invoked. This occurs during SAT translation for requests that do | ||
200 | * not require an IO to the target or for any other requests that may | ||
201 | * be completed without having to submit IO. | ||
202 | */ | ||
203 | SCI_SUCCESS_IO_COMPLETE_BEFORE_START, | ||
204 | |||
205 | /** | ||
206 | * This Value indicates that the SCU hardware returned an early response | ||
207 | * because the io request specified more data than is returned by the | ||
208 | * target device (mode pages, inquiry data, etc.). The completion routine | ||
209 | * will handle this case to get the actual number of bytes transferred. | ||
210 | */ | ||
211 | SCI_SUCCESS_IO_DONE_EARLY, | ||
212 | |||
213 | /** | ||
214 | * This member indicates that the object for which a state change is | ||
215 | * being requested is already in said state. | ||
216 | */ | ||
217 | SCI_WARNING_ALREADY_IN_STATE, | ||
218 | |||
219 | /** | ||
220 | * This member indicates interrupt coalescence timer may cause SAS | ||
221 | * specification compliance issues (i.e. SMP target mode response | ||
222 | * frames must be returned within 1.9 milliseconds). | ||
223 | */ | ||
224 | SCI_WARNING_TIMER_CONFLICT, | ||
225 | |||
226 | /** | ||
227 | * This field indicates a sequence of action is not completed yet. Mostly, | ||
228 | * this status is used when multiple ATA commands are needed in a SATI translation. | ||
229 | */ | ||
230 | SCI_WARNING_SEQUENCE_INCOMPLETE, | ||
231 | |||
232 | /** | ||
233 | * This member indicates that there was a general failure. | ||
234 | */ | ||
235 | SCI_FAILURE, | ||
236 | |||
237 | /** | ||
238 | * This member indicates that the SCI implementation is unable to complete | ||
239 | * an operation due to a critical flaw the prevents any further operation | ||
240 | * (i.e. an invalid pointer). | ||
241 | */ | ||
242 | SCI_FATAL_ERROR, | ||
243 | |||
244 | /** | ||
245 | * This member indicates the calling function failed, because the state | ||
246 | * of the controller is in a state that prevents successful completion. | ||
247 | */ | ||
248 | SCI_FAILURE_INVALID_STATE, | ||
249 | |||
250 | /** | ||
251 | * This member indicates the calling function failed, because there is | ||
252 | * insufficient resources/memory to complete the request. | ||
253 | */ | ||
254 | SCI_FAILURE_INSUFFICIENT_RESOURCES, | ||
255 | |||
256 | /** | ||
257 | * This member indicates the calling function failed, because the | ||
258 | * controller object required for the operation can't be located. | ||
259 | */ | ||
260 | SCI_FAILURE_CONTROLLER_NOT_FOUND, | ||
261 | |||
262 | /** | ||
263 | * This member indicates the calling function failed, because the | ||
264 | * discovered controller type is not supported by the library. | ||
265 | */ | ||
266 | SCI_FAILURE_UNSUPPORTED_CONTROLLER_TYPE, | ||
267 | |||
268 | /** | ||
269 | * This member indicates the calling function failed, because the | ||
270 | * requested initialization data version isn't supported. | ||
271 | */ | ||
272 | SCI_FAILURE_UNSUPPORTED_INIT_DATA_VERSION, | ||
273 | |||
274 | /** | ||
275 | * This member indicates the calling function failed, because the | ||
276 | * requested configuration of SAS Phys into SAS Ports is not supported. | ||
277 | */ | ||
278 | SCI_FAILURE_UNSUPPORTED_PORT_CONFIGURATION, | ||
279 | |||
280 | /** | ||
281 | * This member indicates the calling function failed, because the | ||
282 | * requested protocol is not supported by the remote device, port, | ||
283 | * or controller. | ||
284 | */ | ||
285 | SCI_FAILURE_UNSUPPORTED_PROTOCOL, | ||
286 | |||
287 | /** | ||
288 | * This member indicates the calling function failed, because the | ||
289 | * requested information type is not supported by the SCI implementation. | ||
290 | */ | ||
291 | SCI_FAILURE_UNSUPPORTED_INFORMATION_TYPE, | ||
292 | |||
293 | /** | ||
294 | * This member indicates the calling function failed, because the | ||
295 | * device already exists. | ||
296 | */ | ||
297 | SCI_FAILURE_DEVICE_EXISTS, | ||
298 | |||
299 | /** | ||
300 | * This member indicates the calling function failed, because adding | ||
301 | * a phy to the object is not possible. | ||
302 | */ | ||
303 | SCI_FAILURE_ADDING_PHY_UNSUPPORTED, | ||
304 | |||
305 | /** | ||
306 | * This member indicates the calling function failed, because the | ||
307 | * requested information type is not supported by the SCI implementation. | ||
308 | */ | ||
309 | SCI_FAILURE_UNSUPPORTED_INFORMATION_FIELD, | ||
310 | |||
311 | /** | ||
312 | * This member indicates the calling function failed, because the SCI | ||
313 | * implementation does not support the supplied time limit. | ||
314 | */ | ||
315 | SCI_FAILURE_UNSUPPORTED_TIME_LIMIT, | ||
316 | |||
317 | /** | ||
318 | * This member indicates the calling method failed, because the SCI | ||
319 | * implementation does not contain the specified Phy. | ||
320 | */ | ||
321 | SCI_FAILURE_INVALID_PHY, | ||
322 | |||
323 | /** | ||
324 | * This member indicates the calling method failed, because the SCI | ||
325 | * implementation does not contain the specified Port. | ||
326 | */ | ||
327 | SCI_FAILURE_INVALID_PORT, | ||
328 | |||
329 | /** | ||
330 | * This member indicates the calling method was partly successful | ||
331 | * The port was reset but not all phys in port are operational | ||
332 | */ | ||
333 | SCI_FAILURE_RESET_PORT_PARTIAL_SUCCESS, | ||
334 | |||
335 | /** | ||
336 | * This member indicates that calling method failed | ||
337 | * The port reset did not complete because none of the phys are operational | ||
338 | */ | ||
339 | SCI_FAILURE_RESET_PORT_FAILURE, | ||
340 | |||
341 | /** | ||
342 | * This member indicates the calling method failed, because the SCI | ||
343 | * implementation does not contain the specified remote device. | ||
344 | */ | ||
345 | SCI_FAILURE_INVALID_REMOTE_DEVICE, | ||
346 | |||
347 | /** | ||
348 | * This member indicates the calling method failed, because the remote | ||
349 | * device is in a bad state and requires a reset. | ||
350 | */ | ||
351 | SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED, | ||
352 | |||
353 | /** | ||
354 | * This member indicates the calling method failed, because the SCI | ||
355 | * implementation does not contain or support the specified IO tag. | ||
356 | */ | ||
357 | SCI_FAILURE_INVALID_IO_TAG, | ||
358 | |||
359 | /** | ||
360 | * This member indicates that the operation failed and the user should | ||
361 | * check the response data associated with the IO. | ||
362 | */ | ||
363 | SCI_FAILURE_IO_RESPONSE_VALID, | ||
364 | |||
365 | /** | ||
366 | * This member indicates that the operation failed, the failure is | ||
367 | * controller implementation specific, and the response data associated | ||
368 | * with the request is not valid. You can query for the controller | ||
369 | * specific error information via scic_controller_get_request_status() | ||
370 | */ | ||
371 | SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR, | ||
372 | |||
373 | /** | ||
374 | * This member indicated that the operation failed because the | ||
375 | * user requested this IO to be terminated. | ||
376 | */ | ||
377 | SCI_FAILURE_IO_TERMINATED, | ||
378 | |||
379 | /** | ||
380 | * This member indicates that the operation failed and the associated | ||
381 | * request requires a SCSI abort task to be sent to the target. | ||
382 | */ | ||
383 | SCI_FAILURE_IO_REQUIRES_SCSI_ABORT, | ||
384 | |||
385 | /** | ||
386 | * This member indicates that the operation failed because the supplied | ||
387 | * device could not be located. | ||
388 | */ | ||
389 | SCI_FAILURE_DEVICE_NOT_FOUND, | ||
390 | |||
391 | /** | ||
392 | * This member indicates that the operation failed because the | ||
393 | * objects association is required and is not correctly set. | ||
394 | */ | ||
395 | SCI_FAILURE_INVALID_ASSOCIATION, | ||
396 | |||
397 | /** | ||
398 | * This member indicates that the operation failed, because a timeout | ||
399 | * occurred. | ||
400 | */ | ||
401 | SCI_FAILURE_TIMEOUT, | ||
402 | |||
403 | /** | ||
404 | * This member indicates that the operation failed, because the user | ||
405 | * specified a value that is either invalid or not supported. | ||
406 | */ | ||
407 | SCI_FAILURE_INVALID_PARAMETER_VALUE, | ||
408 | |||
409 | /** | ||
410 | * This value indicates that the operation failed, because the number | ||
411 | * of messages (MSI-X) is not supported. | ||
412 | */ | ||
413 | SCI_FAILURE_UNSUPPORTED_MESSAGE_COUNT, | ||
414 | |||
415 | /** | ||
416 | * This value indicates that the method failed due to a lack of | ||
417 | * available NCQ tags. | ||
418 | */ | ||
419 | SCI_FAILURE_NO_NCQ_TAG_AVAILABLE, | ||
420 | |||
421 | /** | ||
422 | * This value indicates that a protocol violation has occurred on the | ||
423 | * link. | ||
424 | */ | ||
425 | SCI_FAILURE_PROTOCOL_VIOLATION, | ||
426 | |||
427 | /** | ||
428 | * This value indicates a failure condition that retry may help to clear. | ||
429 | */ | ||
430 | SCI_FAILURE_RETRY_REQUIRED, | ||
431 | |||
432 | /** | ||
433 | * This field indicates the retry limit was reached when a retry is attempted | ||
434 | */ | ||
435 | SCI_FAILURE_RETRY_LIMIT_REACHED, | ||
436 | |||
437 | /** | ||
438 | * This member indicates the calling method was partly successful. | ||
439 | * Mostly, this status is used when a LUN_RESET issued to an expander attached | ||
440 | * STP device in READY NCQ substate needs to have RNC suspended/resumed | ||
441 | * before posting TC. | ||
442 | */ | ||
443 | SCI_FAILURE_RESET_DEVICE_PARTIAL_SUCCESS, | ||
444 | |||
445 | /** | ||
446 | * This field indicates an illegal phy connection based on the routing attribute | ||
447 | * of both expander phy attached to each other. | ||
448 | */ | ||
449 | SCI_FAILURE_ILLEGAL_ROUTING_ATTRIBUTE_CONFIGURATION, | ||
450 | |||
451 | /** | ||
452 | * This field indicates a CONFIG ROUTE INFO command has a response with function result | ||
453 | * INDEX DOES NOT EXIST, usually means exceeding max route index. | ||
454 | */ | ||
455 | SCI_FAILURE_EXCEED_MAX_ROUTE_INDEX, | ||
456 | |||
457 | /** | ||
458 | * This value indicates that an unsupported PCI device ID has been | ||
459 | * specified. This indicates that attempts to invoke | ||
460 | * scic_library_allocate_controller() will fail. | ||
461 | */ | ||
462 | SCI_FAILURE_UNSUPPORTED_PCI_DEVICE_ID | ||
463 | |||
464 | }; | ||
465 | |||
466 | /** | ||
467 | * enum sci_io_status - This enumeration depicts all of the possible IO | ||
468 | * completion status values. Each value in this enumeration maps directly | ||
469 | * to a value in the enum sci_status enumeration. Please refer to that | ||
470 | * enumeration for detailed comments concerning what the status represents. | ||
471 | * | ||
472 | * Add the API to retrieve the SCU status from the core. Check to see that the | ||
473 | * following status are properly handled: - SCI_IO_FAILURE_UNSUPPORTED_PROTOCOL | ||
474 | * - SCI_IO_FAILURE_INVALID_IO_TAG | ||
475 | */ | ||
476 | enum sci_io_status { | ||
477 | SCI_IO_SUCCESS = SCI_SUCCESS, | ||
478 | SCI_IO_FAILURE = SCI_FAILURE, | ||
479 | SCI_IO_SUCCESS_COMPLETE_BEFORE_START = SCI_SUCCESS_IO_COMPLETE_BEFORE_START, | ||
480 | SCI_IO_SUCCESS_IO_DONE_EARLY = SCI_SUCCESS_IO_DONE_EARLY, | ||
481 | SCI_IO_FAILURE_INVALID_STATE = SCI_FAILURE_INVALID_STATE, | ||
482 | SCI_IO_FAILURE_INSUFFICIENT_RESOURCES = SCI_FAILURE_INSUFFICIENT_RESOURCES, | ||
483 | SCI_IO_FAILURE_UNSUPPORTED_PROTOCOL = SCI_FAILURE_UNSUPPORTED_PROTOCOL, | ||
484 | SCI_IO_FAILURE_RESPONSE_VALID = SCI_FAILURE_IO_RESPONSE_VALID, | ||
485 | SCI_IO_FAILURE_CONTROLLER_SPECIFIC_ERR = SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR, | ||
486 | SCI_IO_FAILURE_TERMINATED = SCI_FAILURE_IO_TERMINATED, | ||
487 | SCI_IO_FAILURE_REQUIRES_SCSI_ABORT = SCI_FAILURE_IO_REQUIRES_SCSI_ABORT, | ||
488 | SCI_IO_FAILURE_INVALID_PARAMETER_VALUE = SCI_FAILURE_INVALID_PARAMETER_VALUE, | ||
489 | SCI_IO_FAILURE_NO_NCQ_TAG_AVAILABLE = SCI_FAILURE_NO_NCQ_TAG_AVAILABLE, | ||
490 | SCI_IO_FAILURE_PROTOCOL_VIOLATION = SCI_FAILURE_PROTOCOL_VIOLATION, | ||
491 | |||
492 | SCI_IO_FAILURE_REMOTE_DEVICE_RESET_REQUIRED = SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED, | ||
493 | |||
494 | SCI_IO_FAILURE_RETRY_REQUIRED = SCI_FAILURE_RETRY_REQUIRED, | ||
495 | SCI_IO_FAILURE_RETRY_LIMIT_REACHED = SCI_FAILURE_RETRY_LIMIT_REACHED, | ||
496 | SCI_IO_FAILURE_INVALID_REMOTE_DEVICE = SCI_FAILURE_INVALID_REMOTE_DEVICE | ||
497 | }; | ||
498 | |||
499 | /** | ||
500 | * enum sci_task_status - This enumeration depicts all of the possible task | ||
501 | * completion status values. Each value in this enumeration maps directly | ||
502 | * to a value in the enum sci_status enumeration. Please refer to that | ||
503 | * enumeration for detailed comments concerning what the status represents. | ||
504 | * | ||
505 | * Check to see that the following status are properly handled: | ||
506 | */ | ||
507 | enum sci_task_status { | ||
508 | SCI_TASK_SUCCESS = SCI_SUCCESS, | ||
509 | SCI_TASK_FAILURE = SCI_FAILURE, | ||
510 | SCI_TASK_FAILURE_INVALID_STATE = SCI_FAILURE_INVALID_STATE, | ||
511 | SCI_TASK_FAILURE_INSUFFICIENT_RESOURCES = SCI_FAILURE_INSUFFICIENT_RESOURCES, | ||
512 | SCI_TASK_FAILURE_UNSUPPORTED_PROTOCOL = SCI_FAILURE_UNSUPPORTED_PROTOCOL, | ||
513 | SCI_TASK_FAILURE_INVALID_TAG = SCI_FAILURE_INVALID_IO_TAG, | ||
514 | SCI_TASK_FAILURE_RESPONSE_VALID = SCI_FAILURE_IO_RESPONSE_VALID, | ||
515 | SCI_TASK_FAILURE_CONTROLLER_SPECIFIC_ERR = SCI_FAILURE_CONTROLLER_SPECIFIC_IO_ERR, | ||
516 | SCI_TASK_FAILURE_TERMINATED = SCI_FAILURE_IO_TERMINATED, | ||
517 | SCI_TASK_FAILURE_INVALID_PARAMETER_VALUE = SCI_FAILURE_INVALID_PARAMETER_VALUE, | ||
518 | |||
519 | SCI_TASK_FAILURE_REMOTE_DEVICE_RESET_REQUIRED = SCI_FAILURE_REMOTE_DEVICE_RESET_REQUIRED, | ||
520 | SCI_TASK_FAILURE_RESET_DEVICE_PARTIAL_SUCCESS = SCI_FAILURE_RESET_DEVICE_PARTIAL_SUCCESS | ||
521 | |||
522 | }; | ||
75 | 523 | ||
76 | extern unsigned char no_outbound_task_to; | 524 | extern unsigned char no_outbound_task_to; |
77 | extern u16 ssp_max_occ_to; | 525 | extern u16 ssp_max_occ_to; |
@@ -85,9 +533,9 @@ irqreturn_t isci_msix_isr(int vec, void *data); | |||
85 | irqreturn_t isci_intx_isr(int vec, void *data); | 533 | irqreturn_t isci_intx_isr(int vec, void *data); |
86 | irqreturn_t isci_error_isr(int vec, void *data); | 534 | irqreturn_t isci_error_isr(int vec, void *data); |
87 | 535 | ||
536 | struct scic_sds_controller; | ||
88 | bool scic_sds_controller_isr(struct scic_sds_controller *scic); | 537 | bool scic_sds_controller_isr(struct scic_sds_controller *scic); |
89 | void scic_sds_controller_completion_handler(struct scic_sds_controller *scic); | 538 | void scic_sds_controller_completion_handler(struct scic_sds_controller *scic); |
90 | bool scic_sds_controller_error_isr(struct scic_sds_controller *scic); | 539 | bool scic_sds_controller_error_isr(struct scic_sds_controller *scic); |
91 | void scic_sds_controller_error_handler(struct scic_sds_controller *scic); | 540 | void scic_sds_controller_error_handler(struct scic_sds_controller *scic); |
92 | |||
93 | #endif /* __ISCI_H__ */ | 541 | #endif /* __ISCI_H__ */ |
diff --git a/drivers/scsi/isci/phy.c b/drivers/scsi/isci/phy.c index 328004918329..1134395c970e 100644 --- a/drivers/scsi/isci/phy.c +++ b/drivers/scsi/isci/phy.c | |||
@@ -54,10 +54,10 @@ | |||
54 | */ | 54 | */ |
55 | 55 | ||
56 | #include "isci.h" | 56 | #include "isci.h" |
57 | #include "host.h" | ||
57 | #include "phy.h" | 58 | #include "phy.h" |
58 | #include "scic_port.h" | 59 | #include "scic_port.h" |
59 | #include "scic_config_parameters.h" | 60 | #include "scic_config_parameters.h" |
60 | #include "core/scic_sds_phy.h" | ||
61 | 61 | ||
62 | struct scic_sds_phy; | 62 | struct scic_sds_phy; |
63 | extern enum sci_status scic_sds_phy_start(struct scic_sds_phy *sci_phy); | 63 | extern enum sci_status scic_sds_phy_start(struct scic_sds_phy *sci_phy); |
diff --git a/drivers/scsi/isci/phy.h b/drivers/scsi/isci/phy.h index 93ec2d4a9c30..3a95adbb508c 100644 --- a/drivers/scsi/isci/phy.h +++ b/drivers/scsi/isci/phy.h | |||
@@ -52,16 +52,12 @@ | |||
52 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 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. | 53 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
54 | */ | 54 | */ |
55 | |||
56 | |||
57 | #ifndef _ISCI_PHY_H_ | 55 | #ifndef _ISCI_PHY_H_ |
58 | #define _ISCI_PHY_H_ | 56 | #define _ISCI_PHY_H_ |
59 | 57 | ||
60 | #include <scsi/sas.h> | 58 | #include <scsi/sas.h> |
61 | #include <scsi/libsas.h> | 59 | #include <scsi/libsas.h> |
62 | #include "scic_sds_phy.h" | 60 | #include "scic_sds_phy.h" |
63 | #include "port.h" | ||
64 | #include "host.h" | ||
65 | 61 | ||
66 | struct isci_phy { | 62 | struct isci_phy { |
67 | struct scic_sds_phy sci; | 63 | struct scic_sds_phy sci; |
@@ -89,6 +85,7 @@ static inline struct isci_phy *sci_phy_to_iphy(struct scic_sds_phy *sci_phy) | |||
89 | return iphy; | 85 | return iphy; |
90 | } | 86 | } |
91 | 87 | ||
88 | struct isci_host; | ||
92 | void isci_phy_init(struct isci_phy *iphy, struct isci_host *ihost, int index); | 89 | void isci_phy_init(struct isci_phy *iphy, struct isci_host *ihost, int index); |
93 | int isci_phy_control(struct asd_sas_phy *phy, enum phy_func func, void *buf); | 90 | int isci_phy_control(struct asd_sas_phy *phy, enum phy_func func, void *buf); |
94 | 91 | ||
diff --git a/drivers/scsi/isci/port.h b/drivers/scsi/isci/port.h index 355034542e4c..59505cbf2bb3 100644 --- a/drivers/scsi/isci/port.h +++ b/drivers/scsi/isci/port.h | |||
@@ -55,6 +55,9 @@ | |||
55 | 55 | ||
56 | #ifndef _ISCI_PORT_H_ | 56 | #ifndef _ISCI_PORT_H_ |
57 | #define _ISCI_PORT_H_ | 57 | #define _ISCI_PORT_H_ |
58 | |||
59 | #include <scsi/libsas.h> | ||
60 | #include "isci.h" | ||
58 | #include "scic_sds_port.h" | 61 | #include "scic_sds_port.h" |
59 | 62 | ||
60 | struct isci_phy; | 63 | struct isci_phy; |
diff --git a/drivers/scsi/isci/probe_roms.c b/drivers/scsi/isci/probe_roms.c index 933d81109ea4..705517440441 100644 --- a/drivers/scsi/isci/probe_roms.c +++ b/drivers/scsi/isci/probe_roms.c | |||
@@ -32,7 +32,6 @@ | |||
32 | 32 | ||
33 | #include "isci.h" | 33 | #include "isci.h" |
34 | #include "task.h" | 34 | #include "task.h" |
35 | #include "sci_controller_constants.h" | ||
36 | #include "sci_environment.h" | 35 | #include "sci_environment.h" |
37 | #include "probe_roms.h" | 36 | #include "probe_roms.h" |
38 | 37 | ||
diff --git a/drivers/scsi/isci/probe_roms.h b/drivers/scsi/isci/probe_roms.h index 55983363764b..f4ef19ac281c 100644 --- a/drivers/scsi/isci/probe_roms.h +++ b/drivers/scsi/isci/probe_roms.h | |||
@@ -58,6 +58,7 @@ | |||
58 | #ifdef __KERNEL__ | 58 | #ifdef __KERNEL__ |
59 | #include <linux/firmware.h> | 59 | #include <linux/firmware.h> |
60 | #include <linux/pci.h> | 60 | #include <linux/pci.h> |
61 | #include "isci.h" | ||
61 | 62 | ||
62 | struct isci_orom *isci_request_oprom(struct pci_dev *pdev); | 63 | struct isci_orom *isci_request_oprom(struct pci_dev *pdev); |
63 | 64 | ||
diff --git a/drivers/scsi/isci/remote_device.h b/drivers/scsi/isci/remote_device.h index 2e433b7f16b3..a118f5873f64 100644 --- a/drivers/scsi/isci/remote_device.h +++ b/drivers/scsi/isci/remote_device.h | |||
@@ -56,7 +56,6 @@ | |||
56 | #ifndef _ISCI_REMOTE_DEVICE_H_ | 56 | #ifndef _ISCI_REMOTE_DEVICE_H_ |
57 | #define _ISCI_REMOTE_DEVICE_H_ | 57 | #define _ISCI_REMOTE_DEVICE_H_ |
58 | #include <scsi/libsas.h> | 58 | #include <scsi/libsas.h> |
59 | #include "sci_status.h" | ||
60 | #include "scu_remote_node_context.h" | 59 | #include "scu_remote_node_context.h" |
61 | #include "remote_node_context.h" | 60 | #include "remote_node_context.h" |
62 | #include "port.h" | 61 | #include "port.h" |
diff --git a/drivers/scsi/isci/remote_node_table.h b/drivers/scsi/isci/remote_node_table.h index 9c02a6ccb2fe..5737d9a30cca 100644 --- a/drivers/scsi/isci/remote_node_table.h +++ b/drivers/scsi/isci/remote_node_table.h | |||
@@ -56,14 +56,7 @@ | |||
56 | #ifndef _SCIC_SDS_REMOTE_NODE_TABLE_H_ | 56 | #ifndef _SCIC_SDS_REMOTE_NODE_TABLE_H_ |
57 | #define _SCIC_SDS_REMOTE_NODE_TABLE_H_ | 57 | #define _SCIC_SDS_REMOTE_NODE_TABLE_H_ |
58 | 58 | ||
59 | /** | 59 | #include "isci.h" |
60 | * This file contains the structures, constants and prototypes used for the | ||
61 | * remote node table. | ||
62 | * | ||
63 | * | ||
64 | */ | ||
65 | |||
66 | #include "sci_controller_constants.h" | ||
67 | 60 | ||
68 | /** | 61 | /** |
69 | * | 62 | * |
diff --git a/drivers/scsi/isci/request.c b/drivers/scsi/isci/request.c index 4961ee347091..a58072807a37 100644 --- a/drivers/scsi/isci/request.c +++ b/drivers/scsi/isci/request.c | |||
@@ -62,6 +62,7 @@ | |||
62 | #include "sata.h" | 62 | #include "sata.h" |
63 | #include "scu_completion_codes.h" | 63 | #include "scu_completion_codes.h" |
64 | #include "scic_sds_request.h" | 64 | #include "scic_sds_request.h" |
65 | #include "scic_controller.h" | ||
65 | #include "sas.h" | 66 | #include "sas.h" |
66 | 67 | ||
67 | static enum sci_status isci_request_ssp_request_construct( | 68 | static enum sci_status isci_request_ssp_request_construct( |
diff --git a/drivers/scsi/isci/request.h b/drivers/scsi/isci/request.h index 89d8b0a27dfe..06786ece9bb2 100644 --- a/drivers/scsi/isci/request.h +++ b/drivers/scsi/isci/request.h | |||
@@ -57,6 +57,7 @@ | |||
57 | #define _ISCI_REQUEST_H_ | 57 | #define _ISCI_REQUEST_H_ |
58 | 58 | ||
59 | #include "isci.h" | 59 | #include "isci.h" |
60 | #include "host.h" | ||
60 | #include "scic_sds_request.h" | 61 | #include "scic_sds_request.h" |
61 | 62 | ||
62 | /** | 63 | /** |
diff --git a/drivers/scsi/isci/sci_environment.h b/drivers/scsi/isci/sci_environment.h index 1806969fc435..30addba4d43a 100644 --- a/drivers/scsi/isci/sci_environment.h +++ b/drivers/scsi/isci/sci_environment.h | |||
@@ -56,8 +56,7 @@ | |||
56 | #ifndef _SCI_ENVIRONMENT_H_ | 56 | #ifndef _SCI_ENVIRONMENT_H_ |
57 | #define _SCI_ENVIRONMENT_H_ | 57 | #define _SCI_ENVIRONMENT_H_ |
58 | 58 | ||
59 | #include "isci.h" | 59 | #include "host.h" |
60 | #include "core/scic_sds_controller.h" | ||
61 | 60 | ||
62 | 61 | ||
63 | static inline struct device *scic_to_dev(struct scic_sds_controller *scic) | 62 | static inline struct device *scic_to_dev(struct scic_sds_controller *scic) |
diff --git a/drivers/scsi/isci/task.c b/drivers/scsi/isci/task.c index 7adaf71c19d1..597c49020ac8 100644 --- a/drivers/scsi/isci/task.c +++ b/drivers/scsi/isci/task.c | |||
@@ -65,6 +65,8 @@ | |||
65 | #include "sata.h" | 65 | #include "sata.h" |
66 | #include "task.h" | 66 | #include "task.h" |
67 | #include "scic_sds_request.h" | 67 | #include "scic_sds_request.h" |
68 | #include "scic_controller.h" | ||
69 | #include "timers.h" | ||
68 | 70 | ||
69 | /** | 71 | /** |
70 | * isci_task_refuse() - complete the request to the upper layer driver in | 72 | * isci_task_refuse() - complete the request to the upper layer driver in |
diff --git a/drivers/scsi/isci/task.h b/drivers/scsi/isci/task.h index ecc5f1395063..c59dc9620cf9 100644 --- a/drivers/scsi/isci/task.h +++ b/drivers/scsi/isci/task.h | |||
@@ -56,6 +56,7 @@ | |||
56 | #define _ISCI_TASK_H_ | 56 | #define _ISCI_TASK_H_ |
57 | 57 | ||
58 | #include <scsi/sas_ata.h> | 58 | #include <scsi/sas_ata.h> |
59 | #include "host.h" | ||
59 | 60 | ||
60 | struct isci_request; | 61 | struct isci_request; |
61 | 62 | ||
diff --git a/drivers/scsi/isci/timers.c b/drivers/scsi/isci/timers.c index f33eff00dc01..007700e3eb6a 100644 --- a/drivers/scsi/isci/timers.c +++ b/drivers/scsi/isci/timers.c | |||
@@ -55,6 +55,7 @@ | |||
55 | 55 | ||
56 | #include "isci.h" | 56 | #include "isci.h" |
57 | #include "timers.h" | 57 | #include "timers.h" |
58 | #include "host.h" | ||
58 | 59 | ||
59 | /** | 60 | /** |
60 | * isci_timer_list_construct() - This method contrucst the SCI Timer List | 61 | * isci_timer_list_construct() - This method contrucst the SCI Timer List |