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