Print this page
hg changesets 607a5b46a793..b706c96317c3
Fix ncpus for early boot config
Purge the ack to the interrupt before exiting mptsas_intr()
Changes from code review
Initial modifications using the code changes present between
the LSI source code for FreeBSD drivers. Specifically the changes
between from mpslsi-source-17.00.00.00 -> mpslsi-source-03.00.00.00.
This mainly involves using a different scatter/gather element in
frame setup.
Changes to enable driver to compile.
Header paths, object lists, etc.
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/sys/scsi/adapters/mpt_sas3/mptsas3_ioctl.h
+++ new/usr/src/uts/common/sys/scsi/adapters/mpt_sas3/mptsas3_ioctl.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
↓ open down ↓ |
17 lines elided |
↑ open up ↑ |
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 23 * Copyright 2010 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 25 */
26 26 /*
27 27 * Copyright (c) 2013, Joyent, Inc. All rights reserved.
28 + * Copyright (c) 2014, Tegile Systems Inc. All rights reserved.
28 29 */
29 30
30 31 /*
31 32 * Copyright (c) 2000 to 2010, LSI Corporation.
32 33 * All rights reserved.
33 34 *
34 35 * Redistribution and use in source and binary forms of all code within
35 36 * this file that is exclusively owned by LSI, with or without
36 37 * modification, is permitted provided that, in addition to the CDDL 1.0
37 38 * License requirements, the following conditions are met:
38 39 *
39 40 * Neither the name of the author nor the names of its contributors may be
40 41 * used to endorse or promote products derived from this software without
41 42 * specific prior written permission.
42 43 *
43 44 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
44 45 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
45 46 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
46 47 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
↓ open down ↓ |
9 lines elided |
↑ open up ↑ |
47 48 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
48 49 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
49 50 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
50 51 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
51 52 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
52 53 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
53 54 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
54 55 * DAMAGE.
55 56 */
56 57
57 -#ifndef _MPTSAS_IOCTL_H
58 -#define _MPTSAS_IOCTL_H
58 +#ifndef _MPTSAS3_IOCTL_H
59 +#define _MPTSAS3_IOCTL_H
59 60
60 61 #ifdef __cplusplus
61 62 extern "C" {
62 63 #endif
63 64
64 65 #include <sys/types.h>
65 66
66 67 #define MPTIOCTL ('I' << 8)
67 68 #define MPTIOCTL_GET_ADAPTER_DATA (MPTIOCTL | 1)
68 69 #define MPTIOCTL_UPDATE_FLASH (MPTIOCTL | 2)
69 70 #define MPTIOCTL_RESET_ADAPTER (MPTIOCTL | 3)
70 71 #define MPTIOCTL_PASS_THRU (MPTIOCTL | 4)
71 72 #define MPTIOCTL_EVENT_QUERY (MPTIOCTL | 5)
72 73 #define MPTIOCTL_EVENT_ENABLE (MPTIOCTL | 6)
73 74 #define MPTIOCTL_EVENT_REPORT (MPTIOCTL | 7)
74 75 #define MPTIOCTL_GET_PCI_INFO (MPTIOCTL | 8)
75 76 #define MPTIOCTL_DIAG_ACTION (MPTIOCTL | 9)
76 77 #define MPTIOCTL_REG_ACCESS (MPTIOCTL | 10)
77 78 #define MPTIOCTL_GET_DISK_INFO (MPTIOCTL | 11)
78 79 #define MPTIOCTL_LED_CONTROL (MPTIOCTL | 12)
79 80
80 81 /*
81 82 * The following are our ioctl() return status values. If everything went
82 83 * well, we return good status. If the buffer length sent to us is too short
83 84 * we return a status to tell the user.
84 85 */
85 86 #define MPTIOCTL_STATUS_GOOD 0
86 87 #define MPTIOCTL_STATUS_LEN_TOO_SHORT 1
87 88
88 89 typedef struct mptsas_pci_bits
89 90 {
90 91 union {
91 92 struct {
92 93 uint32_t DeviceNumber :5;
93 94 uint32_t FunctionNumber :3;
94 95 uint32_t BusNumber :24;
↓ open down ↓ |
26 lines elided |
↑ open up ↑ |
95 96 } bits;
96 97 uint32_t AsDWORD;
97 98 } u;
98 99 uint32_t PciSegmentId;
99 100 } mptsas_pci_bits_t;
100 101 /*
101 102 * The following is the MPTIOCTL_GET_ADAPTER_DATA data structure. This data
102 103 * structure is setup so that we hopefully are properly aligned for both
103 104 * 32-bit and 64-bit mode applications.
104 105 *
105 - * Adapter Type - Value = 4 = SCSI Protocol through SAS-2 adapter
106 + * Adapter Type - Value = 6 = SCSI Protocol through SAS-3 adapter
106 107 *
107 108 * MPI Port Number - The PCI Function number for this device
108 109 *
109 110 * PCI Device HW Id - The PCI device number for this device
110 111 *
111 112 */
112 -#define MPTIOCTL_ADAPTER_TYPE_SAS2 4
113 +#define MPTIOCTL_ADAPTER_TYPE_SAS3 6
113 114 typedef struct mptsas_adapter_data
114 115 {
115 116 uint32_t StructureLength;
116 117 uint32_t AdapterType;
117 118 uint32_t MpiPortNumber;
118 119 uint32_t PCIDeviceHwId;
119 120 uint32_t PCIDeviceHwRev;
120 121 uint32_t SubSystemId;
121 122 uint32_t SubsystemVendorId;
122 123 uint32_t Reserved1;
123 124 uint32_t MpiFirmwareVersion;
124 125 uint32_t BiosVersion;
125 126 uint8_t DriverVersion[32];
126 127 uint8_t Reserved2;
127 128 uint8_t ScsiId;
128 129 uint16_t Reserved3;
129 130 mptsas_pci_bits_t PciInformation;
130 131 } mptsas_adapter_data_t;
131 132
132 133
133 134 typedef struct mptsas_update_flash
134 135 {
135 136 uint64_t PtrBuffer;
136 137 uint32_t ImageChecksum;
137 138 uint32_t ImageOffset;
138 139 uint32_t ImageSize;
139 140 uint32_t ImageType;
140 141 } mptsas_update_flash_t;
141 142
142 143
143 144 #define MPTSAS_PASS_THRU_DIRECTION_NONE 0
144 145 #define MPTSAS_PASS_THRU_DIRECTION_READ 1
145 146 #define MPTSAS_PASS_THRU_DIRECTION_WRITE 2
146 147 #define MPTSAS_PASS_THRU_DIRECTION_BOTH 3
147 148
148 149 typedef struct mptsas_pass_thru
149 150 {
150 151 uint64_t PtrRequest;
151 152 uint64_t PtrReply;
152 153 uint64_t PtrData;
153 154 uint32_t RequestSize;
154 155 uint32_t ReplySize;
155 156 uint32_t DataSize;
156 157 uint32_t DataDirection;
157 158 uint64_t PtrDataOut;
158 159 uint32_t DataOutSize;
159 160 uint32_t Timeout;
160 161 } mptsas_pass_thru_t;
161 162
162 163
163 164 /*
164 165 * Event queue defines
165 166 */
166 167 #define MPTSAS_EVENT_QUEUE_SIZE (50) /* Max Events stored in driver */
167 168 #define MPTSAS_MAX_EVENT_DATA_LENGTH (48) /* Size of each event in Dwords */
168 169
169 170 typedef struct mptsas_event_query
170 171 {
171 172 uint16_t Entries;
172 173 uint16_t Reserved;
173 174 uint32_t Types[4];
174 175 } mptsas_event_query_t;
175 176
176 177 typedef struct mptsas_event_enable
177 178 {
178 179 uint32_t Types[4];
179 180 } mptsas_event_enable_t;
180 181
181 182 /*
182 183 * Event record entry for ioctl.
183 184 */
184 185 typedef struct mptsas_event_entry
185 186 {
186 187 uint32_t Type;
187 188 uint32_t Number;
188 189 uint32_t Data[MPTSAS_MAX_EVENT_DATA_LENGTH];
189 190 } mptsas_event_entry_t;
190 191
191 192 typedef struct mptsas_event_report
192 193 {
193 194 uint32_t Size;
194 195 mptsas_event_entry_t Events[1];
195 196 } mptsas_event_report_t;
196 197
197 198
198 199 typedef struct mptsas_pci_info
199 200 {
200 201 uint32_t BusNumber;
201 202 uint8_t DeviceNumber;
202 203 uint8_t FunctionNumber;
203 204 uint16_t InterruptVector;
204 205 uint8_t PciHeader[256];
205 206 } mptsas_pci_info_t;
206 207
207 208
208 209 typedef struct mptsas_diag_action
209 210 {
210 211 uint32_t Action;
211 212 uint32_t Length;
212 213 uint64_t PtrDiagAction;
213 214 uint32_t ReturnCode;
214 215 } mptsas_diag_action_t;
215 216
216 217 #define MPTSAS_FW_DIAGNOSTIC_UID_NOT_FOUND (0xFF)
217 218
218 219 #define MPTSAS_FW_DIAG_NEW (0x806E6577)
219 220
220 221 #define MPTSAS_FW_DIAG_TYPE_REGISTER (0x00000001)
221 222 #define MPTSAS_FW_DIAG_TYPE_UNREGISTER (0x00000002)
222 223 #define MPTSAS_FW_DIAG_TYPE_QUERY (0x00000003)
223 224 #define MPTSAS_FW_DIAG_TYPE_READ_BUFFER (0x00000004)
224 225 #define MPTSAS_FW_DIAG_TYPE_RELEASE (0x00000005)
225 226
226 227 #define MPTSAS_FW_DIAG_INVALID_UID (0x00000000)
227 228
228 229 #define MPTSAS_FW_DIAG_ERROR_SUCCESS (0x00000000)
229 230 #define MPTSAS_FW_DIAG_ERROR_FAILURE (0x00000001)
230 231 #define MPTSAS_FW_DIAG_ERROR_INVALID_PARAMETER (0x00000002)
231 232 #define MPTSAS_FW_DIAG_ERROR_POST_FAILED (0x00000010)
232 233 #define MPTSAS_FW_DIAG_ERROR_INVALID_UID (0x00000011)
233 234 #define MPTSAS_FW_DIAG_ERROR_RELEASE_FAILED (0x00000012)
234 235 #define MPTSAS_FW_DIAG_ERROR_NO_BUFFER (0x00000013)
235 236 #define MPTSAS_FW_DIAG_ERROR_ALREADY_RELEASED (0x00000014)
236 237
237 238
238 239 typedef struct mptsas_fw_diag_register
239 240 {
240 241 uint8_t ExtendedType;
241 242 uint8_t BufferType;
242 243 uint16_t ApplicationFlags;
243 244 uint32_t DiagnosticFlags;
244 245 uint32_t ProductSpecific[23];
245 246 uint32_t RequestedBufferSize;
246 247 uint32_t UniqueId;
247 248 } mptsas_fw_diag_register_t;
248 249
249 250 typedef struct mptsas_fw_diag_unregister
250 251 {
251 252 uint32_t UniqueId;
252 253 } mptsas_fw_diag_unregister_t;
253 254
254 255 #define MPTSAS_FW_DIAG_FLAG_APP_OWNED (0x0001)
255 256 #define MPTSAS_FW_DIAG_FLAG_BUFFER_VALID (0x0002)
256 257 #define MPTSAS_FW_DIAG_FLAG_FW_BUFFER_ACCESS (0x0004)
257 258
258 259 typedef struct mptsas_fw_diag_query
259 260 {
260 261 uint8_t ExtendedType;
261 262 uint8_t BufferType;
262 263 uint16_t ApplicationFlags;
263 264 uint32_t DiagnosticFlags;
264 265 uint32_t ProductSpecific[23];
265 266 uint32_t TotalBufferSize;
266 267 uint32_t DriverAddedBufferSize;
267 268 uint32_t UniqueId;
268 269 } mptsas_fw_diag_query_t;
269 270
270 271 typedef struct mptsas_fw_diag_release
271 272 {
272 273 uint32_t UniqueId;
273 274 } mptsas_fw_diag_release_t;
274 275
275 276 #define MPTSAS_FW_DIAG_FLAG_REREGISTER (0x0001)
276 277 #define MPTSAS_FW_DIAG_FLAG_FORCE_RELEASE (0x0002)
277 278
278 279 typedef struct mptsas_diag_read_buffer
279 280 {
280 281 uint8_t Status;
281 282 uint8_t Reserved;
282 283 uint16_t Flags;
283 284 uint32_t StartingOffset;
284 285 uint32_t BytesToRead;
285 286 uint32_t UniqueId;
286 287 uint32_t DataBuffer[1];
287 288 } mptsas_diag_read_buffer_t;
288 289
289 290 /*
290 291 * Register Access
291 292 */
292 293 #define REG_IO_READ 1
293 294 #define REG_IO_WRITE 2
294 295 #define REG_MEM_READ 3
295 296 #define REG_MEM_WRITE 4
296 297
297 298 typedef struct mptsas_reg_access
298 299 {
299 300 uint32_t Command;
300 301 uint32_t RegOffset;
301 302 uint32_t RegData;
302 303 } mptsas_reg_access_t;
303 304
304 305 /*
305 306 * Disk Toplogy Information
306 307 */
307 308 typedef struct mptsas_disk_info
308 309 {
309 310 uint64_t SasAddress;
310 311 uint16_t Instance;
311 312 uint16_t Enclosure;
312 313 uint16_t Slot;
313 314 } mptsas_disk_info_t;
314 315
315 316 typedef struct mptsas_get_disk_info
316 317 {
317 318 uint16_t DiskCount;
318 319 mptsas_disk_info_t *PtrDiskInfoArray;
319 320 uint64_t DiskInfoArraySize;
320 321 } mptsas_get_disk_info_t;
321 322
322 323 #ifdef _KERNEL
323 324
324 325 typedef struct mptsas_get_disk_info32
325 326 {
326 327 uint16_t DiskCount;
327 328 caddr32_t PtrDiskInfoArray;
328 329 uint64_t DiskInfoArraySize;
329 330 } mptsas_get_disk_info32_t;
330 331
331 332 #endif /* _KERNEL */
332 333
333 334 /*
334 335 * LED Control
335 336 */
336 337
337 338 typedef struct mptsas_led_control
338 339 {
339 340 uint8_t Command;
340 341 uint16_t Enclosure;
341 342 uint16_t Slot;
342 343 uint8_t Led;
343 344 uint8_t LedStatus;
344 345 } mptsas_led_control_t;
345 346
346 347 #define MPTSAS_LEDCTL_FLAG_SET 1
347 348 #define MPTSAS_LEDCTL_FLAG_GET 2
348 349
349 350 #define MPTSAS_LEDCTL_LED_IDENT 1
↓ open down ↓ |
227 lines elided |
↑ open up ↑ |
350 351 #define MPTSAS_LEDCTL_LED_FAIL 2
351 352 #define MPTSAS_LEDCTL_LED_OK2RM 3
352 353
353 354 #define MPTSAS_LEDCTL_LED_MIN MPTSAS_LEDCTL_LED_IDENT
354 355 #define MPTSAS_LEDCTL_LED_MAX MPTSAS_LEDCTL_LED_OK2RM
355 356
356 357 #ifdef __cplusplus
357 358 }
358 359 #endif
359 360
360 -#endif /* _MPTSAS_IOCTL_H */
361 +#endif /* _MPTSAS3_IOCTL_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX