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