xref: /freebsd/sys/cam/ctl/ctl_cmd_table.c (revision 473c31f15836fb5b98ded9e9a0fca84fa1e9e2f1)
1 /*-
2  * Copyright (c) 2003, 2004, 2005, 2009 Silicon Graphics International Corp.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  * 1. Redistributions of source code must retain the above copyright
9  *    notice, this list of conditions, and the following disclaimer,
10  *    without modification.
11  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
12  *    substantially similar to the "NO WARRANTY" disclaimer below
13  *    ("Disclaimer") and any redistribution must be conditioned upon
14  *    including a substantially similar Disclaimer requirement for further
15  *    binary redistribution.
16  *
17  * NO WARRANTY
18  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
19  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
20  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
21  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
22  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
26  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
27  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28  * POSSIBILITY OF SUCH DAMAGES.
29  *
30  * $Id: //depot/users/kenm/FreeBSD-test2/sys/cam/ctl/ctl_cmd_table.c#4 $
31  * $FreeBSD$
32  */
33 /*
34  * CAM Target Layer command table.
35  *
36  * Author: Ken Merry <ken@FreeBSD.org>, Kim Le
37  */
38 
39 #include <sys/cdefs.h>
40 #include <sys/param.h>
41 #include <sys/systm.h>
42 #include <sys/kernel.h>
43 #include <sys/types.h>
44 #include <sys/malloc.h>
45 #include <sys/condvar.h>
46 #include <sys/queue.h>
47 #include <sys/sysctl.h>
48 
49 #include <cam/scsi/scsi_all.h>
50 #include <cam/scsi/scsi_da.h>
51 #include <cam/ctl/ctl_io.h>
52 #include <cam/ctl/ctl.h>
53 #include <cam/ctl/ctl_frontend.h>
54 #include <cam/ctl/ctl_backend.h>
55 #include <cam/ctl/ctl_ioctl.h>
56 #include <cam/ctl/ctl_ha.h>
57 #include <cam/ctl/ctl_private.h>
58 
59 /*
60  * Whenever support for a new command is added, it should be added to these
61  * tables.
62  */
63 
64 /* 5E PERSISTENT RESERVE IN */
65 const struct ctl_cmd_entry ctl_cmd_table_5e[32] =
66 {
67 /* 00 READ KEYS */
68 {ctl_persistent_reserve_in, CTL_SERIDX_RES, CTL_CMD_FLAG_ALLOW_ON_RESV |
69 						CTL_CMD_FLAG_OK_ON_BOTH |
70 						CTL_CMD_FLAG_OK_ON_STOPPED |
71 						CTL_CMD_FLAG_OK_ON_INOPERABLE |
72 						CTL_CMD_FLAG_OK_ON_STANDBY |
73 						CTL_FLAG_DATA_IN |
74 						CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
75  CTL_LUN_PAT_NONE,
76  10, { 0x00, 0, 0, 0, 0, 0, 0xff, 0xff, 0x07}},
77 
78 /* 01 READ RESERVATION */
79 {ctl_persistent_reserve_in, CTL_SERIDX_RES, CTL_CMD_FLAG_ALLOW_ON_RESV |
80 						CTL_CMD_FLAG_OK_ON_BOTH |
81 						CTL_CMD_FLAG_OK_ON_STOPPED |
82 						CTL_CMD_FLAG_OK_ON_INOPERABLE |
83 						CTL_CMD_FLAG_OK_ON_STANDBY |
84 						CTL_FLAG_DATA_IN |
85 						CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
86  CTL_LUN_PAT_NONE,
87  10, { 0x01, 0, 0, 0, 0, 0, 0xff, 0xff, 0x07}},
88 
89 /* 02 REPORT CAPABILITIES */
90 {ctl_persistent_reserve_in, CTL_SERIDX_INQ, CTL_CMD_FLAG_ALLOW_ON_RESV |
91 					    CTL_CMD_FLAG_OK_ON_BOTH |
92 					    CTL_CMD_FLAG_OK_ON_STOPPED |
93 					    CTL_CMD_FLAG_OK_ON_INOPERABLE |
94 					    CTL_CMD_FLAG_OK_ON_STANDBY |
95 					    CTL_FLAG_DATA_IN |
96 					    CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
97  CTL_LUN_PAT_NONE,
98  10, { 0x02, 0, 0, 0, 0, 0, 0xff, 0xff, 0x07}},
99 
100 /* 03 READ FULL STATUS */
101 {ctl_persistent_reserve_in, CTL_SERIDX_INQ, CTL_CMD_FLAG_ALLOW_ON_RESV |
102 					    CTL_CMD_FLAG_OK_ON_BOTH |
103 					    CTL_CMD_FLAG_OK_ON_STOPPED |
104 					    CTL_CMD_FLAG_OK_ON_INOPERABLE |
105 					    CTL_CMD_FLAG_OK_ON_STANDBY |
106 					    CTL_FLAG_DATA_IN |
107 					    CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
108  CTL_LUN_PAT_NONE,
109  10, { 0x03, 0, 0, 0, 0, 0, 0xff, 0xff, 0x07}},
110 
111 /* 04-1f */
112 };
113 
114 /* 5F PERSISTENT RESERVE OUT */
115 const struct ctl_cmd_entry ctl_cmd_table_5f[32] =
116 {
117 /* 00 REGISTER */
118 {ctl_persistent_reserve_out, CTL_SERIDX_RES, CTL_CMD_FLAG_ALLOW_ON_RESV |
119 						CTL_CMD_FLAG_OK_ON_BOTH |
120 						CTL_CMD_FLAG_OK_ON_STOPPED |
121 						CTL_CMD_FLAG_OK_ON_INOPERABLE |
122 						CTL_CMD_FLAG_OK_ON_STANDBY |
123 						CTL_FLAG_DATA_OUT |
124 						CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
125  CTL_LUN_PAT_NONE,
126  10, { 0x00, 0xff, 0, 0, 0xff, 0xff, 0xff, 0xff, 0x07}},
127 
128 /* 01 RESERVE */
129 {ctl_persistent_reserve_out, CTL_SERIDX_RES, CTL_CMD_FLAG_ALLOW_ON_RESV |
130 						CTL_CMD_FLAG_OK_ON_BOTH |
131 						CTL_CMD_FLAG_OK_ON_STOPPED |
132 						CTL_CMD_FLAG_OK_ON_INOPERABLE |
133 						CTL_CMD_FLAG_OK_ON_STANDBY |
134 						CTL_FLAG_DATA_OUT |
135 						CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
136  CTL_LUN_PAT_NONE,
137  10, { 0x01, 0xff, 0, 0, 0xff, 0xff, 0xff, 0xff, 0x07}},
138 
139 /* 02 RELEASE */
140 {ctl_persistent_reserve_out, CTL_SERIDX_RES, CTL_CMD_FLAG_ALLOW_ON_RESV |
141 						CTL_CMD_FLAG_OK_ON_BOTH |
142 						CTL_CMD_FLAG_OK_ON_STOPPED |
143 						CTL_CMD_FLAG_OK_ON_INOPERABLE |
144 						CTL_CMD_FLAG_OK_ON_STANDBY |
145 						CTL_FLAG_DATA_OUT |
146 						CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
147  CTL_LUN_PAT_NONE,
148  10, { 0x02, 0xff, 0, 0, 0xff, 0xff, 0xff, 0xff, 0x07}},
149 
150 /* 03 CLEAR */
151 {ctl_persistent_reserve_out, CTL_SERIDX_RES, CTL_CMD_FLAG_ALLOW_ON_RESV |
152 						CTL_CMD_FLAG_OK_ON_BOTH |
153 						CTL_CMD_FLAG_OK_ON_STOPPED |
154 						CTL_CMD_FLAG_OK_ON_INOPERABLE |
155 						CTL_CMD_FLAG_OK_ON_STANDBY |
156 						CTL_FLAG_DATA_OUT |
157 						CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
158  CTL_LUN_PAT_NONE,
159  10, { 0x03, 0xff, 0, 0, 0xff, 0xff, 0xff, 0xff, 0x07}},
160 
161 /* 04 PREEMPT */
162 {ctl_persistent_reserve_out, CTL_SERIDX_RES, CTL_CMD_FLAG_ALLOW_ON_RESV |
163 						CTL_CMD_FLAG_OK_ON_BOTH |
164 						CTL_CMD_FLAG_OK_ON_STOPPED |
165 						CTL_CMD_FLAG_OK_ON_INOPERABLE |
166 						CTL_CMD_FLAG_OK_ON_STANDBY |
167 						CTL_FLAG_DATA_OUT |
168 						CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
169  CTL_LUN_PAT_NONE,
170  10, { 0x04, 0xff, 0, 0, 0xff, 0xff, 0xff, 0xff, 0x07}},
171 
172 /* 05 PREEMPT AND ABORT */
173 {ctl_persistent_reserve_out, CTL_SERIDX_RES, CTL_CMD_FLAG_ALLOW_ON_RESV |
174 						CTL_CMD_FLAG_OK_ON_BOTH |
175 						CTL_CMD_FLAG_OK_ON_STOPPED |
176 						CTL_CMD_FLAG_OK_ON_INOPERABLE |
177 						CTL_CMD_FLAG_OK_ON_STANDBY |
178 						CTL_FLAG_DATA_OUT |
179 						CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
180  CTL_LUN_PAT_NONE,
181  10, { 0x05, 0xff, 0, 0, 0xff, 0xff, 0xff, 0xff, 0x07}},
182 
183 /* 06 REGISTER AND IGNORE EXISTING KEY */
184 {ctl_persistent_reserve_out, CTL_SERIDX_RES, CTL_CMD_FLAG_ALLOW_ON_RESV |
185 						CTL_CMD_FLAG_OK_ON_BOTH |
186 						CTL_CMD_FLAG_OK_ON_STOPPED |
187 						CTL_CMD_FLAG_OK_ON_INOPERABLE |
188 						CTL_CMD_FLAG_OK_ON_STANDBY |
189 						CTL_FLAG_DATA_OUT |
190 						CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
191  CTL_LUN_PAT_NONE,
192  10, { 0x06, 0xff, 0, 0, 0xff, 0xff, 0xff, 0xff, 0x07}},
193 
194 /* 07 REGISTER AND MOVE */
195 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
196 
197 /* 08-1f */
198 };
199 
200 /* 83 EXTENDED COPY */
201 const struct ctl_cmd_entry ctl_cmd_table_83[32] =
202 {
203 /* 00 EXTENDED COPY (LID1) */
204 {ctl_extended_copy_lid1, CTL_SERIDX_RD_CAP, CTL_CMD_FLAG_OK_ON_BOTH |
205 					    CTL_FLAG_DATA_OUT,
206  CTL_LUN_PAT_NONE,
207  16, { 0x00, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
208 
209 /* 01 EXTENDED COPY (LID4) */
210 {ctl_extended_copy_lid4, CTL_SERIDX_RD_CAP, CTL_CMD_FLAG_OK_ON_BOTH |
211 					    CTL_FLAG_DATA_OUT,
212  CTL_LUN_PAT_NONE,
213  16, { 0x01, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
214 
215 /* 02 */
216 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
217 
218 /* 03 */
219 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
220 
221 /* 04 */
222 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
223 
224 /* 05 */
225 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
226 
227 /* 06 */
228 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
229 
230 /* 07 */
231 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
232 
233 /* 08 */
234 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
235 
236 /* 09 */
237 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
238 
239 /* 0A */
240 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
241 
242 /* 0B */
243 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
244 
245 /* 0C */
246 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
247 
248 /* 0D */
249 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
250 
251 /* 0E */
252 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
253 
254 /* 0F */
255 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
256 
257 /* 10 POPULATE TOKEN */
258 {ctl_populate_token, CTL_SERIDX_RD_CAP, CTL_CMD_FLAG_OK_ON_SLUN |
259 					CTL_FLAG_DATA_OUT |
260 					CTL_CMD_FLAG_ALLOW_ON_PR_WRESV,
261  CTL_LUN_PAT_NONE,
262  16, { 0x10, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff,
263        0xff, 0xff, 0xff, 0xff, 0, 0x07}},
264 
265 /* 11 WRITE USING TOKEN */
266 {ctl_write_using_token, CTL_SERIDX_RD_CAP, CTL_CMD_FLAG_OK_ON_SLUN |
267 					CTL_FLAG_DATA_OUT,
268  CTL_LUN_PAT_NONE,
269  16, { 0x11, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff,
270        0xff, 0xff, 0xff, 0xff, 0, 0x07}},
271 
272 /* 12 */
273 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
274 
275 /* 13 */
276 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
277 
278 /* 14 */
279 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
280 
281 /* 15 */
282 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
283 
284 /* 16 */
285 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
286 
287 /* 17 */
288 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
289 
290 /* 18 */
291 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
292 
293 /* 19 */
294 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
295 
296 /* 1A */
297 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
298 
299 /* 1B */
300 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
301 
302 /* 1C COPY OPERATION ABORT */
303 {ctl_copy_operation_abort, CTL_SERIDX_RD_CAP, CTL_CMD_FLAG_OK_ON_BOTH |
304 					      CTL_FLAG_DATA_NONE,
305  CTL_LUN_PAT_NONE,
306  16, { 0x1c, 0xff, 0xff, 0xff, 0xff, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x07}},
307 };
308 
309 /* 84 RECEIVE COPY STATUS */
310 const struct ctl_cmd_entry ctl_cmd_table_84[32] =
311 {
312 /* 00 RECEIVE COPY STATUS (LID1) */
313 {ctl_receive_copy_status_lid1, CTL_SERIDX_RD_CAP,
314  CTL_CMD_FLAG_OK_ON_BOTH |
315  CTL_FLAG_DATA_IN |
316  CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
317  CTL_LUN_PAT_NONE,
318  16, {0x00, 0xff, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
319 
320 /* 01 RECEIVE COPY DATA (LID1) */
321 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
322 
323 /* 02 */
324 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
325 
326 /* 03 RECEIVE COPY OPERATING PARAMETERS */
327 {ctl_receive_copy_operating_parameters, CTL_SERIDX_RD_CAP,
328  CTL_CMD_FLAG_OK_ON_BOTH |
329  CTL_CMD_FLAG_OK_ON_STOPPED |
330  CTL_CMD_FLAG_OK_ON_INOPERABLE |
331  CTL_CMD_FLAG_OK_ON_STANDBY |
332  CTL_FLAG_DATA_IN |
333  CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
334  CTL_LUN_PAT_NONE,
335  16, {0x03, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
336 
337 /* 04 RECEIVE COPY FAILURE DETAILS (LID1) */
338 {ctl_receive_copy_failure_details, CTL_SERIDX_RD_CAP,
339  CTL_CMD_FLAG_OK_ON_BOTH |
340  CTL_FLAG_DATA_IN |
341  CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
342  CTL_LUN_PAT_NONE,
343  16, {0x04, 0xff, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
344 
345 /* 05 RECEIVE COPY STATUS (LID4) */
346 {ctl_receive_copy_status_lid4, CTL_SERIDX_RD_CAP,
347  CTL_CMD_FLAG_OK_ON_BOTH |
348  CTL_FLAG_DATA_IN |
349  CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
350  CTL_LUN_PAT_NONE,
351  16, {0x05, 0xff, 0xff, 0xff, 0xff, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
352 
353 /* 06 RECEIVE COPY DATA (LID4)*/
354 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
355 
356 /* 07 RECEIVE ROD TOKEN INFORMATION */
357 {ctl_receive_rod_token_information, CTL_SERIDX_RD_CAP,
358  CTL_CMD_FLAG_OK_ON_BOTH |
359  CTL_FLAG_DATA_IN |
360  CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
361  CTL_LUN_PAT_NONE,
362  16, {0x07, 0xff, 0xff, 0xff, 0xff, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
363 
364 /* 08 REPORT ALL ROD TOKENS */
365 {ctl_report_all_rod_tokens, CTL_SERIDX_RD_CAP,
366  CTL_CMD_FLAG_OK_ON_BOTH |
367  CTL_FLAG_DATA_IN |
368  CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
369  CTL_LUN_PAT_NONE,
370  16, {0x08, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
371 };
372 
373 /* 9E SERVICE ACTION IN(16) */
374 const struct ctl_cmd_entry ctl_cmd_table_9e[32] =
375 {
376 /* 00 */
377 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
378 
379 /* 01 */
380 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
381 
382 /* 02 */
383 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
384 
385 /* 03 */
386 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
387 
388 /* 04 */
389 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
390 
391 /* 05 */
392 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
393 
394 /* 06 */
395 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
396 
397 /* 07 */
398 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
399 
400 /* 08 */
401 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
402 
403 /* 09 */
404 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
405 
406 /* 0A */
407 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
408 
409 /* 0B */
410 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
411 
412 /* 0C */
413 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
414 
415 /* 0D */
416 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
417 
418 /* 0E */
419 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
420 
421 /* 0F */
422 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
423 
424 /* 10 READ CAPACITY(16) */
425 {ctl_read_capacity_16, CTL_SERIDX_RD_CAP, CTL_CMD_FLAG_OK_ON_SLUN |
426 					  CTL_CMD_FLAG_OK_ON_STOPPED |
427 					  CTL_CMD_FLAG_OK_ON_INOPERABLE |
428 					  CTL_FLAG_DATA_IN |
429 					  CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
430  CTL_LUN_PAT_READCAP,
431  16, {0x10, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
432 
433 /* 11 */
434 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
435 
436 /* 12 GET LBA STATUS */
437 {ctl_get_lba_status, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN |
438 				      CTL_FLAG_DATA_IN |
439 				      CTL_CMD_FLAG_ALLOW_ON_PR_WRESV,
440  CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE,
441  16, {0x12, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
442     0xff, 0xff, 0xff, 0xff, 0, 0x07}},
443 
444 /* 13-1f */
445 };
446 
447 /* A3 MAINTENANCE IN */
448 const struct ctl_cmd_entry ctl_cmd_table_a3[32] =
449 {
450 /* 00 */
451 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
452 
453 /* 01 */
454 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
455 
456 /* 02 */
457 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
458 
459 /* 03 */
460 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
461 
462 /* 04 */
463 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
464 
465 /* 05 */
466 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
467 
468 /* 06 */
469 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
470 
471 /* 07 */
472 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
473 
474 /* 08 */
475 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
476 
477 /* 09 */
478 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
479 
480 /* 0A REPORT TARGET PORT GROUPS */
481 {ctl_report_tagret_port_groups, CTL_SERIDX_INQ, CTL_CMD_FLAG_OK_ON_BOTH |
482 						CTL_CMD_FLAG_OK_ON_STOPPED |
483 						CTL_CMD_FLAG_OK_ON_INOPERABLE |
484 						CTL_CMD_FLAG_OK_ON_STANDBY |
485 						CTL_CMD_FLAG_OK_ON_UNAVAIL |
486 						CTL_FLAG_DATA_IN |
487 						CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
488  CTL_LUN_PAT_NONE,
489  12, {0xea, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
490 
491 /* 0B */
492 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
493 
494 /* 0C REPORT SUPPORTED_OPCODES */
495 {ctl_report_supported_opcodes, CTL_SERIDX_INQ, CTL_CMD_FLAG_OK_ON_BOTH |
496 						CTL_CMD_FLAG_OK_ON_STOPPED |
497 						CTL_CMD_FLAG_OK_ON_INOPERABLE |
498 						CTL_CMD_FLAG_OK_ON_STANDBY |
499 						CTL_CMD_FLAG_OK_ON_UNAVAIL |
500 						CTL_FLAG_DATA_IN |
501 						CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
502  CTL_LUN_PAT_NONE,
503  12, {0x0c, 0x87, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
504 
505 /* 0D REPORT SUPPORTED_TASK MANAGEMENT FUNCTIONS */
506 {ctl_report_supported_tmf, CTL_SERIDX_INQ, CTL_CMD_FLAG_OK_ON_BOTH |
507 					   CTL_CMD_FLAG_OK_ON_STOPPED |
508 					   CTL_CMD_FLAG_OK_ON_INOPERABLE |
509 					   CTL_CMD_FLAG_OK_ON_STANDBY |
510 					   CTL_CMD_FLAG_OK_ON_UNAVAIL |
511 					   CTL_FLAG_DATA_IN |
512 					   CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
513  CTL_LUN_PAT_NONE,
514  12, {0x0d, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
515 
516 /* 0E */
517 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
518 
519 /* 0F REPORT TIMESTAMP */
520 {ctl_report_timestamp, CTL_SERIDX_INQ, CTL_CMD_FLAG_OK_ON_BOTH |
521 					CTL_CMD_FLAG_OK_ON_STOPPED |
522 					CTL_CMD_FLAG_OK_ON_INOPERABLE |
523 					CTL_CMD_FLAG_OK_ON_STANDBY |
524 					CTL_CMD_FLAG_OK_ON_UNAVAIL |
525 					CTL_FLAG_DATA_IN |
526 					CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
527  CTL_LUN_PAT_NONE,
528  12, {0x0f, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
529 
530 /* 10-1f */
531 };
532 
533 const struct ctl_cmd_entry ctl_cmd_table[256] =
534 {
535 /* 00 TEST UNIT READY */
536 {ctl_tur, CTL_SERIDX_TUR, CTL_CMD_FLAG_OK_ON_BOTH |
537 			  CTL_FLAG_DATA_NONE |
538 			  CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
539  CTL_LUN_PAT_TUR, 6, {0, 0, 0, 0, 0x07}},
540 
541 /* 01 REWIND */
542 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
543 
544 /* 02 */
545 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
546 
547 /* 03 REQUEST SENSE */
548 {ctl_request_sense, CTL_SERIDX_RQ_SNS, CTL_FLAG_DATA_IN |
549 				       CTL_CMD_FLAG_OK_ON_NO_LUN |
550 				       CTL_CMD_FLAG_OK_ON_BOTH |
551 				       CTL_CMD_FLAG_ALLOW_ON_RESV |
552 				       CTL_CMD_FLAG_NO_SENSE |
553 				       CTL_CMD_FLAG_OK_ON_STOPPED |
554 				       CTL_CMD_FLAG_OK_ON_INOPERABLE |
555 				       CTL_CMD_FLAG_OK_ON_STANDBY |
556 				       CTL_CMD_FLAG_OK_ON_UNAVAIL |
557 				       CTL_CMD_FLAG_ALLOW_ON_PR_RESV |
558 				       CTL_CMD_FLAG_RUN_HERE,
559  CTL_LUN_PAT_NONE, 6, {0x01, 0, 0, 0xff, 0x07}},
560 
561 /* 04 FORMAT UNIT */
562 {ctl_format, CTL_SERIDX_FORMAT, CTL_CMD_FLAG_OK_ON_SLUN |
563 				CTL_CMD_FLAG_OK_ON_INOPERABLE |
564 				CTL_FLAG_DATA_OUT,
565  CTL_LUN_PAT_NONE, 6, {0xff, 0, 0, 0, 0x07}},
566 
567 /* 05 READ BLOCK LIMITS */
568 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
569 
570 /* 06 */
571 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
572 
573 /* 07 REASSIGN BLOCKS */
574 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
575 
576 /* 08 READ(6) */
577 {ctl_read_write, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN |
578 				  CTL_FLAG_DATA_IN |
579 				  CTL_CMD_FLAG_ALLOW_ON_PR_WRESV,
580  CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE, 6, {0x1f, 0xff, 0xff, 0xff, 0x07}},
581 
582 /* 09 */
583 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
584 
585 /* 0A WRITE(6) */
586 {ctl_read_write, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_SLUN |
587 				   CTL_FLAG_DATA_OUT,
588  CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE, 6, {0x1f, 0xff, 0xff, 0xff, 0x07}},
589 
590 /* 0B SEEK(6) */
591 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
592 
593 /* 0C */
594 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
595 
596 /* 0D */
597 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
598 
599 /* 0E */
600 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
601 
602 /* 0F READ REVERSE(6) */
603 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
604 
605 /* 10 WRITE FILEMARKS(6) */
606 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
607 
608 /* 11 SPACE(6) */
609 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
610 
611 /* 12 INQUIRY */
612 {ctl_inquiry, CTL_SERIDX_INQ, CTL_CMD_FLAG_OK_ON_NO_LUN |
613 			      CTL_CMD_FLAG_OK_ON_BOTH |
614 			      CTL_CMD_FLAG_ALLOW_ON_RESV |
615 			      CTL_CMD_FLAG_NO_SENSE |
616 			      CTL_CMD_FLAG_OK_ON_STOPPED |
617 			      CTL_CMD_FLAG_OK_ON_INOPERABLE |
618 			      CTL_CMD_FLAG_OK_ON_STANDBY |
619 			      CTL_CMD_FLAG_OK_ON_UNAVAIL |
620 			      CTL_FLAG_DATA_IN |
621 			      CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
622  CTL_LUN_PAT_NONE, 6, {0xe1, 0xff, 0xff, 0xff, 0x07}},
623 
624 /* 13 */
625 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
626 
627 /* 14 RECOVER BUFFERED DATA */
628 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
629 
630 /* 15 MODE SELECT(6) */
631 {ctl_mode_select, CTL_SERIDX_MD_SEL, CTL_CMD_FLAG_OK_ON_BOTH |
632 				     CTL_CMD_FLAG_OK_ON_STOPPED |
633 				     CTL_CMD_FLAG_OK_ON_INOPERABLE |
634 				     CTL_CMD_FLAG_OK_ON_STANDBY |
635 				     CTL_FLAG_DATA_OUT,
636  CTL_LUN_PAT_NONE, 6, {0x11, 0, 0, 0xff, 0x07}},
637 
638 /* 16 RESERVE(6) */
639 {ctl_scsi_reserve, CTL_SERIDX_RES, CTL_CMD_FLAG_ALLOW_ON_RESV |
640 				    CTL_CMD_FLAG_OK_ON_BOTH |
641 				    CTL_CMD_FLAG_OK_ON_STOPPED |
642 				    CTL_CMD_FLAG_OK_ON_INOPERABLE |
643 				    CTL_CMD_FLAG_OK_ON_STANDBY |
644 				    CTL_FLAG_DATA_OUT,
645  CTL_LUN_PAT_NONE, 6, {0, 0, 0, 0, 0x07}},
646 
647 /* 17 RELEASE(6) */
648 {ctl_scsi_release, CTL_SERIDX_RES, CTL_CMD_FLAG_ALLOW_ON_RESV |
649 				   CTL_CMD_FLAG_OK_ON_BOTH |
650 				   CTL_CMD_FLAG_OK_ON_STOPPED |
651 				   CTL_CMD_FLAG_OK_ON_INOPERABLE |
652 				   CTL_CMD_FLAG_OK_ON_STANDBY |
653 				   CTL_FLAG_DATA_NONE,
654  CTL_LUN_PAT_NONE, 6, {0, 0, 0, 0, 0x07}},
655 
656 /* 18 COPY */
657 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
658 
659 /* 19 ERASE(6) */
660 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
661 
662 /* 1A MODE SENSE(6) */
663 {ctl_mode_sense, CTL_SERIDX_MD_SNS, CTL_CMD_FLAG_OK_ON_BOTH |
664 				    CTL_CMD_FLAG_OK_ON_STOPPED |
665 				    CTL_CMD_FLAG_OK_ON_INOPERABLE |
666 				    CTL_CMD_FLAG_OK_ON_STANDBY |
667 				    CTL_FLAG_DATA_IN |
668 				    CTL_CMD_FLAG_ALLOW_ON_PR_WRESV,
669  CTL_LUN_PAT_NONE, 6, {0x08, 0xff, 0xff, 0xff, 0x07}},
670 
671 /* 1B START STOP UNIT */
672 {ctl_start_stop, CTL_SERIDX_START, CTL_CMD_FLAG_OK_ON_SLUN |
673 				   CTL_CMD_FLAG_OK_ON_STOPPED |
674 				   CTL_CMD_FLAG_OK_ON_INOPERABLE |
675 				   CTL_FLAG_DATA_NONE |
676 				   CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
677  CTL_LUN_PAT_NONE, 6, {0x01, 0, 0, 0x03, 0x07}},
678 
679 /* 1C RECEIVE DIAGNOSTIC RESULTS */
680 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
681 
682 /* 1D SEND DIAGNOSTIC */
683 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
684 
685 /* 1E PREVENT ALLOW MEDIUM REMOVAL */
686 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
687 
688 /* 1F */
689 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
690 
691 /* 20 */
692 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
693 
694 /* 21 */
695 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
696 
697 /* 22 */
698 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
699 
700 /* 23 */
701 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
702 
703 /* 24 SET WINDOW */
704 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
705 
706 /* 25 READ CAPACITY(10) */
707 {ctl_read_capacity, CTL_SERIDX_RD_CAP, CTL_CMD_FLAG_OK_ON_SLUN|
708 				       CTL_CMD_FLAG_OK_ON_STOPPED |
709 				       CTL_CMD_FLAG_OK_ON_INOPERABLE |
710 				       CTL_FLAG_DATA_IN |
711 				       CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
712  CTL_LUN_PAT_READCAP, 10, {0, 0, 0, 0, 0, 0, 0, 0, 0x07}},
713 
714 /* 26 */
715 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
716 
717 /* 27 */
718 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
719 
720 /* 28 READ(10) */
721 {ctl_read_write, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN |
722 				  CTL_FLAG_DATA_IN |
723 				  CTL_CMD_FLAG_ALLOW_ON_PR_WRESV,
724  CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE,
725  10, {0x1a, 0xff, 0xff, 0xff, 0xff, 0, 0xff, 0xff, 0x07}},
726 
727 /* 29 READ GENERATION */
728 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
729 
730 /* 2A WRITE(10) */
731 {ctl_read_write, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_SLUN| CTL_FLAG_DATA_OUT,
732  CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE,
733  10, {0x1a, 0xff, 0xff, 0xff, 0xff, 0, 0xff, 0xff, 0x07}},
734 
735 /* 2B SEEK(10) */
736 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
737 
738 /* 2C ERASE(10) */
739 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
740 
741 /* 2D READ UPDATED BLOCK */
742 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
743 
744 /* 2E WRITE AND VERIFY(10) */
745 {ctl_read_write, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_SLUN| CTL_FLAG_DATA_OUT,
746  CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE,
747  10, {0x12, 0xff, 0xff, 0xff, 0xff, 0, 0xff, 0xff, 0x07}},
748 
749 /* 2F VERIFY(10) */
750 {ctl_verify, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN |
751 			      CTL_FLAG_DATA_OUT |
752 			      CTL_CMD_FLAG_ALLOW_ON_PR_WRESV,
753  CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE,
754  10, {0x16, 0xff, 0xff, 0xff, 0xff, 0, 0xff, 0xff, 0x07}},
755 
756 /* 30 SEARCH DATA HIGH(10) */
757 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
758 
759 /* 31 SEARCH DATA EQUAL(10) */
760 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
761 
762 /* 32 SEARCH DATA LOW(10) */
763 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
764 
765 /* 33 SET LIMITS(10) */
766 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
767 
768 /* 34 PRE-FETCH(10) */
769 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
770 
771 /* 35 SYNCHRONIZE CACHE(10) */
772 {ctl_sync_cache, CTL_SERIDX_SYNC, CTL_CMD_FLAG_OK_ON_SLUN |
773 				  CTL_FLAG_DATA_NONE,
774  CTL_LUN_PAT_WRITE,
775  10, {0x02, 0xff, 0xff, 0xff, 0xff, 0, 0xff, 0xff, 0x07}},
776 
777 /* 36 LOCK UNLOCK CACHE(10) */
778 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
779 
780 /* 37 READ DEFECT DATA(10) */
781 {ctl_read_defect, CTL_SERIDX_MD_SNS, CTL_CMD_FLAG_OK_ON_SLUN |
782 				     CTL_FLAG_DATA_IN |
783 				     CTL_CMD_FLAG_ALLOW_ON_PR_WRESV,
784  CTL_LUN_PAT_NONE,
785  10, {0, 0x1f, 0, 0, 0, 0, 0xff, 0xff, 0x07}},
786 
787 /* 38 MEDIUM SCAN */
788 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
789 
790 /* 39 COMPARE */
791 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
792 
793 /* 3A COPY AND VERIFY */
794 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
795 
796 /* 3B WRITE BUFFER */
797 {ctl_write_buffer, CTL_SERIDX_MD_SEL, CTL_CMD_FLAG_OK_ON_BOTH |
798 				      CTL_CMD_FLAG_OK_ON_STOPPED |
799 				      CTL_CMD_FLAG_OK_ON_INOPERABLE |
800 				      CTL_CMD_FLAG_OK_ON_STANDBY |
801 				      CTL_FLAG_DATA_OUT,
802  CTL_LUN_PAT_NONE,
803  10, {0x1f, 0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07}},
804 
805 /* 3C READ BUFFER */
806 {ctl_read_buffer, CTL_SERIDX_MD_SNS, CTL_CMD_FLAG_OK_ON_BOTH |
807 				     CTL_CMD_FLAG_OK_ON_STOPPED |
808 				     CTL_CMD_FLAG_OK_ON_INOPERABLE |
809 				     CTL_CMD_FLAG_OK_ON_STANDBY |
810 				     CTL_FLAG_DATA_IN |
811 				     CTL_CMD_FLAG_ALLOW_ON_PR_WRESV,
812  CTL_LUN_PAT_NONE,
813  10, {0x1f, 0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07}},
814 
815 /* 3D UPDATE BLOCK */
816 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
817 
818 /* 3E READ LONG */
819 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
820 
821 /* 3F WRITE LONG */
822 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
823 
824 /* 40 CHANGE DEFINITION */
825 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
826 
827 /* 41 WRITE SAME(10) */
828 {ctl_write_same, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_SLUN |
829 				   CTL_FLAG_DATA_OUT,
830  CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE,
831  10, {0x1a, 0xff, 0xff, 0xff, 0xff, 0, 0xff, 0xff, 0x07}},
832 
833 /* 42 READ SUB-CHANNEL / UNMAP */
834 {ctl_unmap, CTL_SERIDX_UNMAP, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_OUT,
835  CTL_LUN_PAT_WRITE,
836  10, {1, 0, 0, 0, 0, 0, 0xff, 0xff, 0x07}},
837 
838 /* 43 READ TOC/PMA/ATIP */
839 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
840 
841 /* 44 REPORT DENSITY SUPPORT */
842 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
843 
844 /* 45 PLAY AUDIO(10) */
845 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
846 
847 /* 46 GET CONFIGURATION */
848 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
849 
850 /* 47 PLAY AUDIO MSF */
851 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
852 
853 /* 48 PLAY AUDIO TRACK INDEX */
854 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
855 
856 /* 49 PLAY TRACK RELATIVE(10) */
857 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
858 
859 /* 4A GET EVENT STATUS NOTIFICATION */
860 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
861 
862 /* 4B PAUSE/RESUME */
863 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
864 
865 /* 4C LOG SELECT */
866 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
867 
868 /* 4D LOG SENSE */
869 {ctl_log_sense, CTL_SERIDX_LOG_SNS, CTL_CMD_FLAG_OK_ON_SLUN |
870 				    CTL_FLAG_DATA_IN |
871 				    CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
872  CTL_LUN_PAT_NONE, 10, {0, 0xff, 0xff, 0, 0xff, 0xff, 0xff, 0xff, 0x07} },
873 
874 /* 4E STOP PLAY/SCAN */
875 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
876 
877 /* 4F */
878 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
879 
880 /* 50 XDWRITE(10) */
881 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
882 
883 /* 51 XPWRITE(10) */
884 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
885 
886 /* 52 XDREAD(10) */
887 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
888 
889 /* 53 RESERVE TRACK */
890 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
891 
892 /* 54 SEND OPC INFORMATION */
893 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
894 
895 /* 55 MODE SELECT(10) */
896 {ctl_mode_select, CTL_SERIDX_MD_SEL, CTL_CMD_FLAG_OK_ON_BOTH |
897 				     CTL_CMD_FLAG_OK_ON_STOPPED |
898 				     CTL_CMD_FLAG_OK_ON_INOPERABLE |
899 				     CTL_CMD_FLAG_OK_ON_STANDBY |
900 				     CTL_FLAG_DATA_OUT,
901  CTL_LUN_PAT_NONE, 10, {0x11, 0, 0, 0, 0, 0, 0xff, 0xff, 0x07} },
902 
903 /* 56 RESERVE(10) */
904 {ctl_scsi_reserve, CTL_SERIDX_RES, CTL_CMD_FLAG_ALLOW_ON_RESV |
905 				    CTL_CMD_FLAG_OK_ON_BOTH |
906 				    CTL_CMD_FLAG_OK_ON_STOPPED |
907 				    CTL_CMD_FLAG_OK_ON_INOPERABLE |
908 				    CTL_CMD_FLAG_OK_ON_STANDBY |
909 				    CTL_FLAG_DATA_OUT,
910  CTL_LUN_PAT_NONE, 10, {0x02, 0, 0xff, 0, 0, 0, 0xff, 0xff, 0x07} },
911 
912 /* 57 RELEASE(10) */
913 {ctl_scsi_release, CTL_SERIDX_RES, CTL_CMD_FLAG_ALLOW_ON_RESV |
914 				   CTL_CMD_FLAG_OK_ON_BOTH |
915 				   CTL_CMD_FLAG_OK_ON_STOPPED |
916 				   CTL_CMD_FLAG_OK_ON_INOPERABLE |
917 				   CTL_CMD_FLAG_OK_ON_STANDBY |
918 				   CTL_FLAG_DATA_OUT,
919  CTL_LUN_PAT_NONE, 10, {0x02, 0, 0xff, 0, 0, 0, 0xff, 0xff, 0x07} },
920 
921 /* 58 REPAIR TRACK */
922 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
923 
924 /* 59 READ MASTER CUE */
925 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
926 
927 /* 5A MODE SENSE(10) */
928 {ctl_mode_sense, CTL_SERIDX_MD_SNS, CTL_CMD_FLAG_OK_ON_BOTH |
929 				    CTL_CMD_FLAG_OK_ON_STOPPED |
930 				    CTL_CMD_FLAG_OK_ON_INOPERABLE |
931 				    CTL_CMD_FLAG_OK_ON_STANDBY |
932 				    CTL_FLAG_DATA_IN |
933 				    CTL_CMD_FLAG_ALLOW_ON_PR_WRESV,
934  CTL_LUN_PAT_NONE, 10, {0x18, 0xff, 0xff, 0, 0, 0, 0xff, 0xff, 0x07} },
935 
936 /* 5B CLOSE TRACK/SESSION */
937 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
938 
939 /* 5C READ BUFFER CAPACITY */
940 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
941 
942 /* 5D SEND CUE SHEET */
943 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
944 
945 /* 5E PERSISTENT RESERVE IN */
946 {__DECONST(ctl_opfunc *, ctl_cmd_table_5e), CTL_SERIDX_INVLD, CTL_CMD_FLAG_SA5,
947  CTL_LUN_PAT_NONE},
948 
949 /* 5F PERSISTENT RESERVE OUT */
950 {__DECONST(ctl_opfunc *, ctl_cmd_table_5f), CTL_SERIDX_INVLD, CTL_CMD_FLAG_SA5,
951  CTL_LUN_PAT_NONE},
952 
953 /* 60 */
954 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
955 
956 /* 61 */
957 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
958 
959 /* 62 */
960 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
961 
962 /* 63 */
963 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
964 
965 /* 64 */
966 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
967 
968 /* 65 */
969 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
970 
971 /* 66 */
972 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
973 
974 /* 67 */
975 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
976 
977 /* 68 */
978 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
979 
980 /* 69 */
981 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
982 
983 /* 6A */
984 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
985 
986 /* 6B */
987 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
988 
989 /* 6C */
990 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
991 
992 /* 6D */
993 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
994 
995 /* 6E */
996 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
997 
998 /* 6F */
999 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1000 
1001 /* 70 */
1002 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1003 
1004 /* 71 */
1005 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1006 
1007 /* 72 */
1008 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1009 
1010 /* 73 */
1011 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1012 
1013 /* 74 */
1014 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1015 
1016 /* 75 */
1017 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1018 
1019 /* 76 */
1020 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1021 
1022 /* 77 */
1023 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1024 
1025 /* 78 */
1026 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1027 
1028 /* 79 */
1029 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1030 
1031 /* 7A */
1032 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1033 
1034 /* 7B */
1035 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1036 
1037 /* 7C */
1038 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1039 
1040 /* 7D */
1041 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1042 
1043 /* 7E */
1044 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1045 
1046 /* 7F */
1047 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1048 
1049 /* 80 XDWRITE EXTENDED(16) */
1050 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1051 
1052 /* 81 REBUILD(16) */
1053 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1054 
1055 /* 82 REGENERATE(16) */
1056 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1057 
1058 /* 83 EXTENDED COPY */
1059 {__DECONST(ctl_opfunc *, ctl_cmd_table_83), CTL_SERIDX_INVLD, CTL_CMD_FLAG_SA5,
1060  CTL_LUN_PAT_NONE},
1061 
1062 /* 84 RECEIVE COPY RESULTS */
1063 {__DECONST(ctl_opfunc *, ctl_cmd_table_84), CTL_SERIDX_INVLD, CTL_CMD_FLAG_SA5,
1064  CTL_LUN_PAT_NONE},
1065 
1066 /* 85 */
1067 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1068 
1069 /* 86 ACCESS CONTROL IN */
1070 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1071 
1072 /* 87 ACCESS CONTROL OUT */
1073 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1074 
1075 /* 88 READ(16) */
1076 {ctl_read_write, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_IN |
1077                                   CTL_CMD_FLAG_ALLOW_ON_PR_WRESV,
1078  CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE,
1079  16, {0x1a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1080       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
1081 
1082 /* 89 COMPARE AND WRITE */
1083 {ctl_cnw, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_SLUN| CTL_FLAG_DATA_OUT,
1084  CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE,
1085  16, {0x18, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1086       0xff, 0xff, 0, 0, 0, 0xff, 0, 0x07}},
1087 
1088 /* 8A WRITE(16) */
1089 {ctl_read_write, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_SLUN| CTL_FLAG_DATA_OUT,
1090  CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE,
1091  16, {0x1a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1092       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
1093 
1094 /* 8B */
1095 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1096 
1097 /* 8C READ ATTRIBUTE */
1098 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1099 
1100 /* 8D WRITE ATTRIBUTE */
1101 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1102 
1103 /* 8E WRITE AND VERIFY(16) */
1104 {ctl_read_write, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_SLUN| CTL_FLAG_DATA_OUT,
1105  CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE,
1106  16, {0x12, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1107       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
1108 
1109 /* 8F VERIFY(16) */
1110 {ctl_verify, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN |
1111 			      CTL_FLAG_DATA_OUT |
1112 			      CTL_CMD_FLAG_ALLOW_ON_PR_WRESV,
1113  CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE,
1114  16, {0x16, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1115       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
1116 
1117 /* 90 PRE-FETCH(16) */
1118 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1119 
1120 /* 91 SYNCHRONIZE CACHE(16) */
1121 {ctl_sync_cache, CTL_SERIDX_SYNC, CTL_CMD_FLAG_OK_ON_SLUN |
1122 				  CTL_FLAG_DATA_NONE,
1123  CTL_LUN_PAT_WRITE,
1124  16, {0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1125       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
1126 
1127 /* 92 LOCK UNLOCK CACHE(16) */
1128 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1129 
1130 /* 93 WRITE SAME(16) */
1131 {ctl_write_same, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_SLUN |
1132 				   CTL_FLAG_DATA_OUT,
1133  CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE,
1134  16, {0x1b, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1135       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
1136 
1137 /* 94 */
1138 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1139 
1140 /* 95 */
1141 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1142 
1143 /* 96 */
1144 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1145 
1146 /* 97 */
1147 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1148 
1149 /* 98 */
1150 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1151 
1152 /* 99 */
1153 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1154 
1155 /* 9A */
1156 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1157 
1158 /* 9B READ BUFFER(16) */
1159 {ctl_read_buffer, CTL_SERIDX_MD_SNS, CTL_CMD_FLAG_OK_ON_BOTH |
1160 				     CTL_CMD_FLAG_OK_ON_STOPPED |
1161 				     CTL_CMD_FLAG_OK_ON_INOPERABLE |
1162 				     CTL_CMD_FLAG_OK_ON_STANDBY |
1163 				     CTL_FLAG_DATA_IN |
1164 				     CTL_CMD_FLAG_ALLOW_ON_PR_WRESV,
1165  CTL_LUN_PAT_NONE,
1166  10, {0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1167       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
1168 
1169 /* 9C WRITE ATOMIC (16) */
1170 {ctl_read_write, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_SLUN| CTL_FLAG_DATA_OUT,
1171  CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE,
1172  16, {0x18, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1173       0xff, 0xff, 0, 0, 0xff, 0xff, 0, 0x07}},
1174 
1175 /* 9D */
1176 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1177 
1178 /* 9E SERVICE ACTION IN(16) */
1179 {__DECONST(ctl_opfunc *, ctl_cmd_table_9e), CTL_SERIDX_INVLD, CTL_CMD_FLAG_SA5,
1180  CTL_LUN_PAT_NONE},
1181 
1182 /* 9F SERVICE ACTION OUT(16) */
1183 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1184 
1185 /* A0 REPORT LUNS */
1186 {ctl_report_luns, CTL_SERIDX_INQ, CTL_FLAG_DATA_IN |
1187 				  CTL_CMD_FLAG_OK_ON_NO_LUN |
1188 				  CTL_CMD_FLAG_OK_ON_BOTH |
1189 				  CTL_CMD_FLAG_ALLOW_ON_RESV |
1190 				  CTL_CMD_FLAG_NO_SENSE |
1191 				  CTL_CMD_FLAG_OK_ON_STOPPED |
1192 				  CTL_CMD_FLAG_OK_ON_INOPERABLE |
1193 				  CTL_CMD_FLAG_OK_ON_STANDBY |
1194 				  CTL_CMD_FLAG_OK_ON_UNAVAIL |
1195 				  CTL_CMD_FLAG_ALLOW_ON_PR_RESV |
1196 				  CTL_CMD_FLAG_RUN_HERE,
1197  CTL_LUN_PAT_NONE,
1198  12, {0, 0xff, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
1199 
1200 /* A1 BLANK */
1201 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1202 
1203 /* A2 SEND EVENT */
1204 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1205 
1206 /* A3 MAINTENANCE IN */
1207 {__DECONST(ctl_opfunc *, ctl_cmd_table_a3), CTL_SERIDX_INVLD, CTL_CMD_FLAG_SA5,
1208  CTL_LUN_PAT_NONE},
1209 
1210 /* A4 MAINTENANCE OUT */
1211 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1212 
1213 /* A5 MOVE MEDIUM */
1214 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1215 
1216 /* A6 EXCHANGE MEDIUM */
1217 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1218 
1219 /* A7 MOVE MEDIUM ATTACHED */
1220 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1221 
1222 /* A8 READ(12) */
1223 {ctl_read_write, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN | CTL_FLAG_DATA_IN |
1224                                   CTL_CMD_FLAG_ALLOW_ON_PR_WRESV,
1225  CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE,
1226  12, {0x1a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
1227 
1228 /* A9 PLAY TRACK RELATIVE(12) */
1229 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1230 
1231 /* AA WRITE(12) */
1232 {ctl_read_write, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_SLUN| CTL_FLAG_DATA_OUT,
1233  CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE,
1234  12, {0x1a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
1235 
1236 /* AB SERVICE ACTION IN(12) */
1237 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1238 
1239 /* AC ERASE(12) */
1240 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1241 
1242 /* AD READ DVD STRUCTURE */
1243 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1244 
1245 /* AE WRITE AND VERIFY(12) */
1246 {ctl_read_write, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_SLUN| CTL_FLAG_DATA_OUT,
1247  CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE,
1248  12, {0x12, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
1249 
1250 /* AF VERIFY(12) */
1251 {ctl_verify, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_SLUN |
1252 			      CTL_FLAG_DATA_OUT |
1253 			      CTL_CMD_FLAG_ALLOW_ON_PR_WRESV,
1254  CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE,
1255  12, {0x16, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
1256 
1257 /* B0 SEARCH DATA HIGH(12) */
1258 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1259 
1260 /* B1 SEARCH DATA EQUAL(12) */
1261 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1262 
1263 /* B2 SEARCH DATA LOW(12) */
1264 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1265 
1266 /* B3 SET LIMITS(12) */
1267 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1268 
1269 /* B4 READ ELEMENT STATUS ATTACHED */
1270 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1271 
1272 /* B5 REQUEST VOLUME ELEMENT ADDRESS */
1273 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1274 
1275 /* B6 SEND VOLUME TAG */
1276 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1277 
1278 /* B7 READ DEFECT DATA(12) */
1279 {ctl_read_defect, CTL_SERIDX_MD_SNS, CTL_CMD_FLAG_OK_ON_SLUN |
1280 				     CTL_FLAG_DATA_IN |
1281 				     CTL_CMD_FLAG_ALLOW_ON_PR_WRESV,
1282  CTL_LUN_PAT_NONE,
1283  12, {0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
1284 
1285 /* B8 READ ELEMENT STATUS */
1286 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1287 
1288 /* B9 READ CD MSF */
1289 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1290 
1291 /* BA REDUNDANCY GROUP IN */
1292 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1293 
1294 /* BB REDUNDANCY GROUP OUT */
1295 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1296 
1297 /* BC SPARE IN */
1298 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1299 
1300 /* BD SPARE OUT */
1301 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1302 
1303 /* BE VOLUME SET IN */
1304 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1305 
1306 /* BF VOLUME SET OUT */
1307 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1308 
1309 /* C0 */
1310 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1311 
1312 /* C1 */
1313 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1314 
1315 /* C2 */
1316 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1317 
1318 /* C3 */
1319 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1320 
1321 /* C4 */
1322 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1323 
1324 /* C5 */
1325 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1326 
1327 /* C6 */
1328 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1329 
1330 /* C7 */
1331 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1332 
1333 /* C8 */
1334 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1335 
1336 /* C9 */
1337 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1338 
1339 /* CA */
1340 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1341 
1342 /* CB */
1343 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1344 
1345 /* CC */
1346 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1347 
1348 /* CD */
1349 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1350 
1351 /* CE */
1352 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1353 
1354 /* CF */
1355 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1356 
1357 /* D0 */
1358 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1359 
1360 /* D1 */
1361 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1362 
1363 /* D2 */
1364 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1365 
1366 /* D3 */
1367 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1368 
1369 /* D4 */
1370 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1371 
1372 /* D5 */
1373 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1374 
1375 /* D6 */
1376 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1377 
1378 /* D7 */
1379 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1380 
1381 /* D8 */
1382 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1383 
1384 /* D9 */
1385 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1386 
1387 /* DA */
1388 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1389 
1390 /* DB */
1391 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1392 
1393 /* DC */
1394 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1395 
1396 /* DD */
1397 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1398 
1399 /* DE */
1400 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1401 
1402 /* DF */
1403 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1404 
1405 /* E0 */
1406 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1407 
1408 /* E1 */
1409 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1410 
1411 /* E2 */
1412 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1413 
1414 /* E3 */
1415 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1416 
1417 /* E4 */
1418 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1419 
1420 /* E5 */
1421 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1422 
1423 /* E6 */
1424 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1425 
1426 /* E7 */
1427 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1428 
1429 /* E8 */
1430 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1431 
1432 /* E9 */
1433 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1434 
1435 /* EA */
1436 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1437 
1438 /* EB */
1439 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1440 
1441 /* EC */
1442 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1443 
1444 /* ED */
1445 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1446 
1447 /* EE */
1448 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1449 
1450 /* EF */
1451 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1452 
1453 /* F0 */
1454 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1455 
1456 /* F1 */
1457 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1458 
1459 /* F2 */
1460 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1461 
1462 /* F3 */
1463 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1464 
1465 /* F4 */
1466 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1467 
1468 /* F5 */
1469 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1470 
1471 /* F6 */
1472 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1473 
1474 /* F7 */
1475 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1476 
1477 /* F8 */
1478 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1479 
1480 /* F9 */
1481 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1482 
1483 /* FA */
1484 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1485 
1486 /* FB */
1487 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1488 
1489 /* FC */
1490 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1491 
1492 /* FD */
1493 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1494 
1495 /* FE */
1496 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1497 
1498 /* FF */
1499 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}
1500 
1501 };
1502