xref: /freebsd/sys/cam/ctl/ctl_cmd_table.c (revision ebacd8013fe5f7fdf9f6a5b286f6680dd2891036)
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 /* 9E SERVICE ACTION IN(16) */
742 const struct ctl_cmd_entry ctl_cmd_table_9e[32] =
743 {
744 /* 00 */
745 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
746 
747 /* 01 */
748 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
749 
750 /* 02 */
751 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
752 
753 /* 03 */
754 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
755 
756 /* 04 */
757 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
758 
759 /* 05 */
760 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
761 
762 /* 06 */
763 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
764 
765 /* 07 */
766 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
767 
768 /* 08 */
769 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
770 
771 /* 09 */
772 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
773 
774 /* 0A */
775 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
776 
777 /* 0B */
778 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
779 
780 /* 0C */
781 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
782 
783 /* 0D */
784 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
785 
786 /* 0E */
787 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
788 
789 /* 0F RECEIVE BINDING REPORT */
790 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
791 
792 /* 10 READ CAPACITY(16) */
793 {ctl_read_capacity_16, CTL_SERIDX_RD_CAP, CTL_CMD_FLAG_OK_ON_DIRECT |
794 					  CTL_FLAG_DATA_IN |
795 					  CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
796  CTL_LUN_PAT_READCAP,
797  16, {0x10, 0, 0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
798 
799 /* 11 */
800 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
801 
802 /* 12 GET LBA STATUS */
803 {ctl_get_lba_status, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_DIRECT |
804 				      CTL_FLAG_DATA_IN |
805 				      CTL_CMD_FLAG_ALLOW_ON_PR_WRESV,
806  CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE,
807  16, {0x12, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
808     0xff, 0xff, 0xff, 0xff, 0, 0x07}},
809 
810 /* 13-1f */
811 };
812 
813 /* A3 MAINTENANCE IN */
814 const struct ctl_cmd_entry ctl_cmd_table_a3[32] =
815 {
816 /* 00 */
817 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
818 
819 /* 01 */
820 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
821 
822 /* 02 */
823 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
824 
825 /* 03 */
826 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
827 
828 /* 04 */
829 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
830 
831 /* 05 REPORT IDENTIFYING INFORMATION */
832 {ctl_report_ident_info, CTL_SERIDX_INQ, CTL_CMD_FLAG_OK_ON_BOTH |
833 					CTL_CMD_FLAG_OK_ON_NO_MEDIA |
834 					CTL_CMD_FLAG_OK_ON_STANDBY |
835 					CTL_CMD_FLAG_OK_ON_UNAVAIL |
836 					CTL_FLAG_DATA_IN |
837 					CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
838  CTL_LUN_PAT_NONE,
839  12, {0x0f, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x07}},
840 
841 /* 06 */
842 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
843 
844 /* 07 */
845 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
846 
847 /* 08 */
848 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
849 
850 /* 09 */
851 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
852 
853 /* 0A REPORT TARGET PORT GROUPS */
854 {ctl_report_tagret_port_groups, CTL_SERIDX_INQ, CTL_CMD_FLAG_OK_ON_BOTH |
855 						CTL_CMD_FLAG_OK_ON_NO_MEDIA |
856 						CTL_CMD_FLAG_OK_ON_STANDBY |
857 						CTL_CMD_FLAG_OK_ON_UNAVAIL |
858 						CTL_FLAG_DATA_IN |
859 						CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
860  CTL_LUN_PAT_NONE,
861  12, {0xea, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
862 
863 /* 0B REPORT ALIASES */
864 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
865 
866 /* 0C REPORT SUPPORTED_OPCODES */
867 {ctl_report_supported_opcodes, CTL_SERIDX_INQ, CTL_CMD_FLAG_OK_ON_BOTH |
868 						CTL_CMD_FLAG_OK_ON_NO_MEDIA |
869 						CTL_CMD_FLAG_OK_ON_STANDBY |
870 						CTL_CMD_FLAG_OK_ON_UNAVAIL |
871 						CTL_FLAG_DATA_IN |
872 						CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
873  CTL_LUN_PAT_NONE,
874  12, {0x0c, 0x87, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
875 
876 /* 0D REPORT SUPPORTED_TASK MANAGEMENT FUNCTIONS */
877 {ctl_report_supported_tmf, CTL_SERIDX_INQ, CTL_CMD_FLAG_OK_ON_BOTH |
878 					   CTL_CMD_FLAG_OK_ON_NO_MEDIA |
879 					   CTL_CMD_FLAG_OK_ON_STANDBY |
880 					   CTL_CMD_FLAG_OK_ON_UNAVAIL |
881 					   CTL_FLAG_DATA_IN |
882 					   CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
883  CTL_LUN_PAT_NONE,
884  12, {0x0d, 0x80, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
885 
886 /* 0E REPORT PRIORITY */
887 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
888 
889 /* 0F REPORT TIMESTAMP */
890 {ctl_report_timestamp, CTL_SERIDX_INQ, CTL_CMD_FLAG_OK_ON_BOTH |
891 					CTL_CMD_FLAG_OK_ON_NO_MEDIA |
892 					CTL_CMD_FLAG_OK_ON_STANDBY |
893 					CTL_CMD_FLAG_OK_ON_UNAVAIL |
894 					CTL_FLAG_DATA_IN |
895 					CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
896  CTL_LUN_PAT_NONE,
897  12, {0x0f, 0, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
898 
899 /* 10 MANAGEMENT PROTOCOL IN */
900 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
901 
902 /* 11-1f */
903 };
904 
905 const struct ctl_cmd_entry ctl_cmd_table[256] =
906 {
907 /* 00 TEST UNIT READY */
908 {ctl_tur, CTL_SERIDX_TUR, CTL_CMD_FLAG_OK_ON_BOTH |
909 			  CTL_FLAG_DATA_NONE |
910 			  CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
911  CTL_LUN_PAT_TUR, 6, {0, 0, 0, 0, 0x07}},
912 
913 /* 01 REWIND */
914 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
915 
916 /* 02 */
917 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
918 
919 /* 03 REQUEST SENSE */
920 {ctl_request_sense, CTL_SERIDX_RQ_SNS, CTL_FLAG_DATA_IN |
921 				       CTL_CMD_FLAG_OK_ON_NO_LUN |
922 				       CTL_CMD_FLAG_OK_ON_BOTH |
923 				       CTL_CMD_FLAG_ALLOW_ON_RESV |
924 				       CTL_CMD_FLAG_NO_SENSE |
925 				       CTL_CMD_FLAG_OK_ON_NO_MEDIA |
926 				       CTL_CMD_FLAG_OK_ON_STANDBY |
927 				       CTL_CMD_FLAG_OK_ON_UNAVAIL |
928 				       CTL_CMD_FLAG_ALLOW_ON_PR_RESV |
929 				       CTL_CMD_FLAG_RUN_HERE,
930  CTL_LUN_PAT_NONE, 6, {0x01, 0, 0, 0xff, 0x07}},
931 
932 /* 04 FORMAT UNIT */
933 {ctl_format, CTL_SERIDX_FORMAT, CTL_CMD_FLAG_OK_ON_DIRECT |
934 				CTL_FLAG_DATA_OUT,
935  CTL_LUN_PAT_NONE, 6, {0xff, 0, 0, 0, 0x07}},
936 
937 /* 05 READ BLOCK LIMITS */
938 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
939 
940 /* 06 */
941 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
942 
943 /* 07 REASSIGN BLOCKS */
944 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
945 
946 /* 08 READ(6) */
947 {ctl_read_write, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_DIRECT |
948 				  CTL_FLAG_DATA_IN |
949 				  CTL_CMD_FLAG_ALLOW_ON_PR_WRESV,
950  CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE, 6, {0x1f, 0xff, 0xff, 0xff, 0x07}},
951 
952 /* 09 */
953 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
954 
955 /* 0A WRITE(6) */
956 {ctl_read_write, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_DIRECT |
957 				   CTL_FLAG_DATA_OUT,
958  CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE, 6, {0x1f, 0xff, 0xff, 0xff, 0x07}},
959 
960 /* 0B SEEK(6) */
961 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
962 
963 /* 0C */
964 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
965 
966 /* 0D */
967 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
968 
969 /* 0E */
970 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
971 
972 /* 0F READ REVERSE(6) */
973 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
974 
975 /* 10 WRITE FILEMARKS(6) */
976 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
977 
978 /* 11 SPACE(6) */
979 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
980 
981 /* 12 INQUIRY */
982 {ctl_inquiry, CTL_SERIDX_INQ, CTL_CMD_FLAG_OK_ON_NO_LUN |
983 			      CTL_CMD_FLAG_OK_ON_BOTH |
984 			      CTL_CMD_FLAG_ALLOW_ON_RESV |
985 			      CTL_CMD_FLAG_NO_SENSE |
986 			      CTL_CMD_FLAG_OK_ON_NO_MEDIA |
987 			      CTL_CMD_FLAG_OK_ON_STANDBY |
988 			      CTL_CMD_FLAG_OK_ON_UNAVAIL |
989 			      CTL_FLAG_DATA_IN |
990 			      CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
991  CTL_LUN_PAT_NONE, 6, {0xe1, 0xff, 0xff, 0xff, 0x07}},
992 
993 /* 13 */
994 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
995 
996 /* 14 RECOVER BUFFERED DATA */
997 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
998 
999 /* 15 MODE SELECT(6) */
1000 {ctl_mode_select, CTL_SERIDX_MD_SEL, CTL_CMD_FLAG_OK_ON_BOTH |
1001 				     CTL_CMD_FLAG_OK_ON_NO_MEDIA |
1002 				     CTL_CMD_FLAG_OK_ON_STANDBY |
1003 				     CTL_FLAG_DATA_OUT,
1004  CTL_LUN_PAT_NONE, 6, {0x13, 0, 0, 0xff, 0x07}},
1005 
1006 /* 16 RESERVE(6) */
1007 {ctl_scsi_reserve, CTL_SERIDX_RES, CTL_CMD_FLAG_ALLOW_ON_RESV |
1008 				    CTL_CMD_FLAG_OK_ON_BOTH |
1009 				    CTL_CMD_FLAG_OK_ON_NO_MEDIA |
1010 				    CTL_CMD_FLAG_OK_ON_STANDBY |
1011 				    CTL_FLAG_DATA_OUT,
1012  CTL_LUN_PAT_NONE, 6, {0, 0, 0, 0, 0x07}},
1013 
1014 /* 17 RELEASE(6) */
1015 {ctl_scsi_release, CTL_SERIDX_RES, CTL_CMD_FLAG_ALLOW_ON_RESV |
1016 				   CTL_CMD_FLAG_OK_ON_BOTH |
1017 				   CTL_CMD_FLAG_OK_ON_NO_MEDIA |
1018 				   CTL_CMD_FLAG_OK_ON_STANDBY |
1019 				   CTL_FLAG_DATA_NONE,
1020  CTL_LUN_PAT_NONE, 6, {0, 0, 0, 0, 0x07}},
1021 
1022 /* 18 COPY */
1023 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1024 
1025 /* 19 ERASE(6) */
1026 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1027 
1028 /* 1A MODE SENSE(6) */
1029 {ctl_mode_sense, CTL_SERIDX_MD_SNS, CTL_CMD_FLAG_OK_ON_BOTH |
1030 				    CTL_CMD_FLAG_OK_ON_NO_MEDIA |
1031 				    CTL_CMD_FLAG_OK_ON_STANDBY |
1032 				    CTL_FLAG_DATA_IN |
1033 				    CTL_CMD_FLAG_ALLOW_ON_PR_WRESV,
1034  CTL_LUN_PAT_NONE, 6, {0x08, 0xff, 0xff, 0xff, 0x07}},
1035 
1036 /* 1B START STOP UNIT */
1037 {ctl_start_stop, CTL_SERIDX_START, CTL_CMD_FLAG_OK_ON_DIRECT |
1038 				   CTL_CMD_FLAG_OK_ON_CDROM |
1039 				   CTL_CMD_FLAG_OK_ON_NO_MEDIA |
1040 				   CTL_FLAG_DATA_NONE |
1041 				   CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
1042  CTL_LUN_PAT_NONE, 6, {0x01, 0, 0x0f, 0xf7, 0x07}},
1043 
1044 /* 1C RECEIVE DIAGNOSTIC RESULTS */
1045 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1046 
1047 /* 1D SEND DIAGNOSTIC */
1048 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1049 
1050 /* 1E PREVENT ALLOW MEDIUM REMOVAL */
1051 {ctl_prevent_allow, CTL_SERIDX_START, CTL_CMD_FLAG_OK_ON_DIRECT |
1052 				      CTL_CMD_FLAG_OK_ON_CDROM |
1053 				      CTL_CMD_FLAG_OK_ON_NO_MEDIA |
1054 				      CTL_FLAG_DATA_NONE,
1055  CTL_LUN_PAT_NONE, 6, {0x01, 0, 0, 0x03, 0x07}},
1056 
1057 /* 1F */
1058 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1059 
1060 /* 20 */
1061 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1062 
1063 /* 21 */
1064 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1065 
1066 /* 22 */
1067 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1068 
1069 /* 23 */
1070 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1071 
1072 /* 24 SET WINDOW */
1073 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1074 
1075 /* 25 READ CAPACITY(10) */
1076 {ctl_read_capacity, CTL_SERIDX_RD_CAP, CTL_CMD_FLAG_OK_ON_DIRECT |
1077 				       CTL_CMD_FLAG_OK_ON_CDROM |
1078 				       CTL_FLAG_DATA_IN |
1079 				       CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
1080  CTL_LUN_PAT_READCAP, 10, {0, 0, 0, 0, 0, 0, 0, 0, 0x07}},
1081 
1082 /* 26 */
1083 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1084 
1085 /* 27 */
1086 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1087 
1088 /* 28 READ(10) */
1089 {ctl_read_write, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_DIRECT |
1090 				  CTL_CMD_FLAG_OK_ON_CDROM |
1091 				  CTL_FLAG_DATA_IN |
1092 				  CTL_CMD_FLAG_ALLOW_ON_PR_WRESV,
1093  CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE,
1094  10, {0x1a, 0xff, 0xff, 0xff, 0xff, 0, 0xff, 0xff, 0x07}},
1095 
1096 /* 29 READ GENERATION */
1097 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1098 
1099 /* 2A WRITE(10) */
1100 {ctl_read_write, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_DIRECT| CTL_FLAG_DATA_OUT,
1101  CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE,
1102  10, {0x1a, 0xff, 0xff, 0xff, 0xff, 0, 0xff, 0xff, 0x07}},
1103 
1104 /* 2B SEEK(10) */
1105 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1106 
1107 /* 2C ERASE(10) */
1108 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1109 
1110 /* 2D READ UPDATED BLOCK */
1111 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1112 
1113 /* 2E WRITE AND VERIFY(10) */
1114 {ctl_read_write, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_DIRECT| CTL_FLAG_DATA_OUT,
1115  CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE,
1116  10, {0x12, 0xff, 0xff, 0xff, 0xff, 0, 0xff, 0xff, 0x07}},
1117 
1118 /* 2F VERIFY(10) */
1119 {ctl_verify, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_DIRECT |
1120 			      CTL_FLAG_DATA_OUT |
1121 			      CTL_CMD_FLAG_ALLOW_ON_PR_WRESV,
1122  CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE,
1123  10, {0x16, 0xff, 0xff, 0xff, 0xff, 0, 0xff, 0xff, 0x07}},
1124 
1125 /* 30 SEARCH DATA HIGH(10) */
1126 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1127 
1128 /* 31 SEARCH DATA EQUAL(10) */
1129 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1130 
1131 /* 32 SEARCH DATA LOW(10) */
1132 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1133 
1134 /* 33 SET LIMITS(10) */
1135 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1136 
1137 /* 34 PRE-FETCH(10) */
1138 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1139 
1140 /* 35 SYNCHRONIZE CACHE(10) */
1141 {ctl_sync_cache, CTL_SERIDX_SYNC, CTL_CMD_FLAG_OK_ON_DIRECT |
1142 				  CTL_FLAG_DATA_NONE,
1143  CTL_LUN_PAT_WRITE,
1144  10, {0x06, 0xff, 0xff, 0xff, 0xff, 0, 0xff, 0xff, 0x07}},
1145 
1146 /* 36 LOCK UNLOCK CACHE(10) */
1147 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1148 
1149 /* 37 READ DEFECT DATA(10) */
1150 {ctl_read_defect, CTL_SERIDX_MD_SNS, CTL_CMD_FLAG_OK_ON_DIRECT |
1151 				     CTL_FLAG_DATA_IN |
1152 				     CTL_CMD_FLAG_ALLOW_ON_PR_WRESV,
1153  CTL_LUN_PAT_NONE,
1154  10, {0, 0x1f, 0, 0, 0, 0, 0xff, 0xff, 0x07}},
1155 
1156 /* 38 MEDIUM SCAN */
1157 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1158 
1159 /* 39 COMPARE */
1160 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1161 
1162 /* 3A COPY AND VERIFY */
1163 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1164 
1165 /* 3B WRITE BUFFER */
1166 {__DECONST(ctl_opfunc *, ctl_cmd_table_3b), CTL_SERIDX_INVLD, CTL_CMD_FLAG_SA5,
1167  CTL_LUN_PAT_NONE},
1168 
1169 /* 3C READ BUFFER */
1170 {__DECONST(ctl_opfunc *, ctl_cmd_table_3c), CTL_SERIDX_INVLD, CTL_CMD_FLAG_SA5,
1171  CTL_LUN_PAT_NONE},
1172 
1173 /* 3D UPDATE BLOCK */
1174 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1175 
1176 /* 3E READ LONG */
1177 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1178 
1179 /* 3F WRITE LONG */
1180 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1181 
1182 /* 40 CHANGE DEFINITION */
1183 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1184 
1185 /* 41 WRITE SAME(10) */
1186 {ctl_write_same, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_DIRECT |
1187 				   CTL_FLAG_DATA_OUT,
1188  CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE,
1189  10, {0x1a, 0xff, 0xff, 0xff, 0xff, 0, 0xff, 0xff, 0x07}},
1190 
1191 /* 42 READ SUB-CHANNEL / UNMAP */
1192 {ctl_unmap, CTL_SERIDX_UNMAP, CTL_CMD_FLAG_OK_ON_DIRECT | CTL_FLAG_DATA_OUT,
1193  CTL_LUN_PAT_WRITE,
1194  10, {1, 0, 0, 0, 0, 0, 0xff, 0xff, 0x07}},
1195 
1196 /* 43 READ TOC/PMA/ATIP */
1197 {ctl_read_toc, CTL_SERIDX_RD_CAP, CTL_CMD_FLAG_OK_ON_CDROM |
1198 				  CTL_CMD_FLAG_ALLOW_ON_PR_WRESV |
1199 				  CTL_FLAG_DATA_IN,
1200  CTL_LUN_PAT_NONE,
1201  10, {0x02, 0x01, 0, 0, 0, 0xff, 0xff, 0xff, 0x07}},
1202 
1203 /* 44 REPORT DENSITY SUPPORT */
1204 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1205 
1206 /* 45 PLAY AUDIO(10) */
1207 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1208 
1209 /* 46 GET CONFIGURATION */
1210 {ctl_get_config, CTL_SERIDX_INQ, CTL_CMD_FLAG_OK_ON_CDROM |
1211 				 CTL_CMD_FLAG_OK_ON_NO_MEDIA |
1212 				 CTL_CMD_FLAG_ALLOW_ON_PR_RESV |
1213 				 CTL_FLAG_DATA_IN,
1214  CTL_LUN_PAT_NONE,
1215  10, {0x03, 0xff, 0xff, 0, 0, 0, 0xff, 0xff, 0x07}},
1216 
1217 /* 47 PLAY AUDIO MSF */
1218 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1219 
1220 /* 48 PLAY AUDIO TRACK INDEX */
1221 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1222 
1223 /* 49 PLAY TRACK RELATIVE(10) */
1224 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1225 
1226 /* 4A GET EVENT STATUS NOTIFICATION */
1227 {ctl_get_event_status, CTL_SERIDX_RD_CAP, CTL_CMD_FLAG_OK_ON_CDROM |
1228 					  CTL_CMD_FLAG_OK_ON_NO_MEDIA |
1229 					  CTL_CMD_FLAG_ALLOW_ON_PR_RESV |
1230 					  CTL_FLAG_DATA_IN,
1231  CTL_LUN_PAT_NONE,
1232  10, {0x02, 0x01, 0, 0, 0, 0xff, 0xff, 0xff, 0x07}},
1233 
1234 /* 4B PAUSE/RESUME */
1235 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1236 
1237 /* 4C LOG SELECT */
1238 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1239 
1240 /* 4D LOG SENSE */
1241 {ctl_log_sense, CTL_SERIDX_LOG_SNS, CTL_CMD_FLAG_OK_ON_BOTH |
1242 				    CTL_CMD_FLAG_OK_ON_NO_MEDIA |
1243 				    CTL_CMD_FLAG_OK_ON_STANDBY |
1244 				    CTL_FLAG_DATA_IN |
1245 				    CTL_CMD_FLAG_ALLOW_ON_PR_RESV,
1246  CTL_LUN_PAT_NONE, 10, {0, 0xff, 0xff, 0, 0xff, 0xff, 0xff, 0xff, 0x07} },
1247 
1248 /* 4E STOP PLAY/SCAN */
1249 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1250 
1251 /* 4F */
1252 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1253 
1254 /* 50 XDWRITE(10) */
1255 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1256 
1257 /* 51 XPWRITE(10) */
1258 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1259 
1260 /* 52 XDREAD(10) */
1261 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1262 
1263 /* 53 RESERVE TRACK */
1264 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1265 
1266 /* 54 SEND OPC INFORMATION */
1267 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1268 
1269 /* 55 MODE SELECT(10) */
1270 {ctl_mode_select, CTL_SERIDX_MD_SEL, CTL_CMD_FLAG_OK_ON_BOTH |
1271 				     CTL_CMD_FLAG_OK_ON_NO_MEDIA |
1272 				     CTL_CMD_FLAG_OK_ON_STANDBY |
1273 				     CTL_FLAG_DATA_OUT,
1274  CTL_LUN_PAT_NONE, 10, {0x13, 0, 0, 0, 0, 0, 0xff, 0xff, 0x07} },
1275 
1276 /* 56 RESERVE(10) */
1277 {ctl_scsi_reserve, CTL_SERIDX_RES, CTL_CMD_FLAG_ALLOW_ON_RESV |
1278 				    CTL_CMD_FLAG_OK_ON_BOTH |
1279 				    CTL_CMD_FLAG_OK_ON_NO_MEDIA |
1280 				    CTL_CMD_FLAG_OK_ON_STANDBY |
1281 				    CTL_FLAG_DATA_OUT,
1282  CTL_LUN_PAT_NONE, 10, {0, 0, 0, 0, 0, 0, 0, 0, 0x07} },
1283 
1284 /* 57 RELEASE(10) */
1285 {ctl_scsi_release, CTL_SERIDX_RES, CTL_CMD_FLAG_ALLOW_ON_RESV |
1286 				   CTL_CMD_FLAG_OK_ON_BOTH |
1287 				   CTL_CMD_FLAG_OK_ON_NO_MEDIA |
1288 				   CTL_CMD_FLAG_OK_ON_STANDBY |
1289 				   CTL_FLAG_DATA_OUT,
1290  CTL_LUN_PAT_NONE, 10, {0, 0, 0, 0, 0, 0, 0, 0, 0x07}},
1291 
1292 /* 58 REPAIR TRACK */
1293 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1294 
1295 /* 59 READ MASTER CUE */
1296 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1297 
1298 /* 5A MODE SENSE(10) */
1299 {ctl_mode_sense, CTL_SERIDX_MD_SNS, CTL_CMD_FLAG_OK_ON_BOTH |
1300 				    CTL_CMD_FLAG_OK_ON_NO_MEDIA |
1301 				    CTL_CMD_FLAG_OK_ON_STANDBY |
1302 				    CTL_FLAG_DATA_IN |
1303 				    CTL_CMD_FLAG_ALLOW_ON_PR_WRESV,
1304  CTL_LUN_PAT_NONE, 10, {0x18, 0xff, 0xff, 0, 0, 0, 0xff, 0xff, 0x07} },
1305 
1306 /* 5B CLOSE TRACK/SESSION */
1307 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1308 
1309 /* 5C READ BUFFER CAPACITY */
1310 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1311 
1312 /* 5D SEND CUE SHEET */
1313 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1314 
1315 /* 5E PERSISTENT RESERVE IN */
1316 {__DECONST(ctl_opfunc *, ctl_cmd_table_5e), CTL_SERIDX_INVLD, CTL_CMD_FLAG_SA5,
1317  CTL_LUN_PAT_NONE},
1318 
1319 /* 5F PERSISTENT RESERVE OUT */
1320 {__DECONST(ctl_opfunc *, ctl_cmd_table_5f), CTL_SERIDX_INVLD, CTL_CMD_FLAG_SA5,
1321  CTL_LUN_PAT_NONE},
1322 
1323 /* 60 */
1324 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1325 
1326 /* 61 */
1327 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1328 
1329 /* 62 */
1330 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1331 
1332 /* 63 */
1333 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1334 
1335 /* 64 */
1336 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1337 
1338 /* 65 */
1339 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1340 
1341 /* 66 */
1342 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1343 
1344 /* 67 */
1345 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1346 
1347 /* 68 */
1348 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1349 
1350 /* 69 */
1351 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1352 
1353 /* 6A */
1354 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1355 
1356 /* 6B */
1357 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1358 
1359 /* 6C */
1360 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1361 
1362 /* 6D */
1363 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1364 
1365 /* 6E */
1366 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1367 
1368 /* 6F */
1369 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1370 
1371 /* 70 */
1372 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1373 
1374 /* 71 */
1375 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1376 
1377 /* 72 */
1378 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1379 
1380 /* 73 */
1381 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1382 
1383 /* 74 */
1384 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1385 
1386 /* 75 */
1387 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1388 
1389 /* 76 */
1390 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1391 
1392 /* 77 */
1393 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1394 
1395 /* 78 */
1396 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1397 
1398 /* 79 */
1399 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1400 
1401 /* 7A */
1402 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1403 
1404 /* 7B */
1405 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1406 
1407 /* 7C */
1408 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1409 
1410 /* 7D */
1411 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1412 
1413 /* 7E */
1414 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1415 
1416 /* 7F */
1417 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1418 
1419 /* 80 XDWRITE EXTENDED(16) */
1420 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1421 
1422 /* 81 REBUILD(16) */
1423 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1424 
1425 /* 82 REGENERATE(16) */
1426 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1427 
1428 /* 83 EXTENDED COPY */
1429 {__DECONST(ctl_opfunc *, ctl_cmd_table_83), CTL_SERIDX_INVLD, CTL_CMD_FLAG_SA5,
1430  CTL_LUN_PAT_NONE},
1431 
1432 /* 84 RECEIVE COPY RESULTS */
1433 {__DECONST(ctl_opfunc *, ctl_cmd_table_84), CTL_SERIDX_INVLD, CTL_CMD_FLAG_SA5,
1434  CTL_LUN_PAT_NONE},
1435 
1436 /* 85 */
1437 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1438 
1439 /* 86 ACCESS CONTROL IN */
1440 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1441 
1442 /* 87 ACCESS CONTROL OUT */
1443 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1444 
1445 /* 88 READ(16) */
1446 {ctl_read_write, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_DIRECT | CTL_FLAG_DATA_IN |
1447                                   CTL_CMD_FLAG_ALLOW_ON_PR_WRESV,
1448  CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE,
1449  16, {0x1a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1450       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
1451 
1452 /* 89 COMPARE AND WRITE */
1453 {ctl_cnw, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_DIRECT| CTL_FLAG_DATA_OUT,
1454  CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE,
1455  16, {0x18, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1456       0xff, 0xff, 0, 0, 0, 0xff, 0, 0x07}},
1457 
1458 /* 8A WRITE(16) */
1459 {ctl_read_write, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_DIRECT| CTL_FLAG_DATA_OUT,
1460  CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE,
1461  16, {0x1a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1462       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
1463 
1464 /* 8B */
1465 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1466 
1467 /* 8C READ ATTRIBUTE */
1468 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1469 
1470 /* 8D WRITE ATTRIBUTE */
1471 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1472 
1473 /* 8E WRITE AND VERIFY(16) */
1474 {ctl_read_write, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_DIRECT| CTL_FLAG_DATA_OUT,
1475  CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE,
1476  16, {0x12, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1477       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
1478 
1479 /* 8F VERIFY(16) */
1480 {ctl_verify, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_DIRECT |
1481 			      CTL_FLAG_DATA_OUT |
1482 			      CTL_CMD_FLAG_ALLOW_ON_PR_WRESV,
1483  CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE,
1484  16, {0x16, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1485       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
1486 
1487 /* 90 PRE-FETCH(16) */
1488 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1489 
1490 /* 91 SYNCHRONIZE CACHE(16) */
1491 {ctl_sync_cache, CTL_SERIDX_SYNC, CTL_CMD_FLAG_OK_ON_DIRECT |
1492 				  CTL_FLAG_DATA_NONE,
1493  CTL_LUN_PAT_WRITE,
1494  16, {0x06, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1495       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
1496 
1497 /* 92 LOCK UNLOCK CACHE(16) */
1498 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1499 
1500 /* 93 WRITE SAME(16) */
1501 {ctl_write_same, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_DIRECT |
1502 				   CTL_FLAG_DATA_OUT,
1503  CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE,
1504  16, {0x1b, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1505       0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
1506 
1507 /* 94 */
1508 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1509 
1510 /* 95 */
1511 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1512 
1513 /* 96 */
1514 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1515 
1516 /* 97 */
1517 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1518 
1519 /* 98 */
1520 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1521 
1522 /* 99 */
1523 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1524 
1525 /* 9A */
1526 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1527 
1528 /* 9B READ BUFFER(16) */
1529 {__DECONST(ctl_opfunc *, ctl_cmd_table_9b), CTL_SERIDX_INVLD, CTL_CMD_FLAG_SA5,
1530  CTL_LUN_PAT_NONE},
1531 
1532 /* 9C WRITE ATOMIC (16) */
1533 {ctl_read_write, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_DIRECT| CTL_FLAG_DATA_OUT,
1534  CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE,
1535  16, {0x18, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
1536       0xff, 0xff, 0, 0, 0xff, 0xff, 0, 0x07}},
1537 
1538 /* 9D */
1539 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1540 
1541 /* 9E SERVICE ACTION IN(16) */
1542 {__DECONST(ctl_opfunc *, ctl_cmd_table_9e), CTL_SERIDX_INVLD, CTL_CMD_FLAG_SA5,
1543  CTL_LUN_PAT_NONE},
1544 
1545 /* 9F SERVICE ACTION OUT(16) */
1546 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1547 
1548 /* A0 REPORT LUNS */
1549 {ctl_report_luns, CTL_SERIDX_INQ, CTL_FLAG_DATA_IN |
1550 				  CTL_CMD_FLAG_OK_ON_NO_LUN |
1551 				  CTL_CMD_FLAG_OK_ON_BOTH |
1552 				  CTL_CMD_FLAG_ALLOW_ON_RESV |
1553 				  CTL_CMD_FLAG_NO_SENSE |
1554 				  CTL_CMD_FLAG_OK_ON_NO_MEDIA |
1555 				  CTL_CMD_FLAG_OK_ON_STANDBY |
1556 				  CTL_CMD_FLAG_OK_ON_UNAVAIL |
1557 				  CTL_CMD_FLAG_ALLOW_ON_PR_RESV |
1558 				  CTL_CMD_FLAG_RUN_HERE,
1559  CTL_LUN_PAT_NONE,
1560  12, {0, 0xff, 0, 0, 0, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
1561 
1562 /* A1 BLANK */
1563 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1564 
1565 /* A2 SEND EVENT */
1566 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1567 
1568 /* A3 MAINTENANCE IN */
1569 {__DECONST(ctl_opfunc *, ctl_cmd_table_a3), CTL_SERIDX_INVLD, CTL_CMD_FLAG_SA5,
1570  CTL_LUN_PAT_NONE},
1571 
1572 /* A4 MAINTENANCE OUT */
1573 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1574 
1575 /* A5 MOVE MEDIUM */
1576 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1577 
1578 /* A6 EXCHANGE MEDIUM */
1579 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1580 
1581 /* A7 MOVE MEDIUM ATTACHED */
1582 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1583 
1584 /* A8 READ(12) */
1585 {ctl_read_write, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_DIRECT |
1586 				  CTL_CMD_FLAG_OK_ON_CDROM |
1587 				  CTL_FLAG_DATA_IN |
1588 				  CTL_CMD_FLAG_ALLOW_ON_PR_WRESV,
1589  CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE,
1590  12, {0x1a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
1591 
1592 /* A9 PLAY TRACK RELATIVE(12) */
1593 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1594 
1595 /* AA WRITE(12) */
1596 {ctl_read_write, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_DIRECT| CTL_FLAG_DATA_OUT,
1597  CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE,
1598  12, {0x1a, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
1599 
1600 /* AB SERVICE ACTION IN(12) */
1601 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1602 
1603 /* AC ERASE(12) */
1604 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1605 
1606 /* AD READ DVD STRUCTURE */
1607 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1608 
1609 /* AE WRITE AND VERIFY(12) */
1610 {ctl_read_write, CTL_SERIDX_WRITE, CTL_CMD_FLAG_OK_ON_DIRECT| CTL_FLAG_DATA_OUT,
1611  CTL_LUN_PAT_WRITE | CTL_LUN_PAT_RANGE,
1612  12, {0x12, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
1613 
1614 /* AF VERIFY(12) */
1615 {ctl_verify, CTL_SERIDX_READ, CTL_CMD_FLAG_OK_ON_DIRECT |
1616 			      CTL_FLAG_DATA_OUT |
1617 			      CTL_CMD_FLAG_ALLOW_ON_PR_WRESV,
1618  CTL_LUN_PAT_READ | CTL_LUN_PAT_RANGE,
1619  12, {0x16, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
1620 
1621 /* B0 SEARCH DATA HIGH(12) */
1622 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1623 
1624 /* B1 SEARCH DATA EQUAL(12) */
1625 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1626 
1627 /* B2 SEARCH DATA LOW(12) */
1628 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1629 
1630 /* B3 SET LIMITS(12) */
1631 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1632 
1633 /* B4 READ ELEMENT STATUS ATTACHED */
1634 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1635 
1636 /* B5 REQUEST VOLUME ELEMENT ADDRESS */
1637 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1638 
1639 /* B6 SEND VOLUME TAG */
1640 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1641 
1642 /* B7 READ DEFECT DATA(12) */
1643 {ctl_read_defect, CTL_SERIDX_MD_SNS, CTL_CMD_FLAG_OK_ON_DIRECT |
1644 				     CTL_FLAG_DATA_IN |
1645 				     CTL_CMD_FLAG_ALLOW_ON_PR_WRESV,
1646  CTL_LUN_PAT_NONE,
1647  12, {0x1f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0, 0x07}},
1648 
1649 /* B8 READ ELEMENT STATUS */
1650 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1651 
1652 /* B9 READ CD MSF */
1653 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1654 
1655 /* BA REDUNDANCY GROUP IN */
1656 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1657 
1658 /* BB REDUNDANCY GROUP OUT */
1659 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1660 
1661 /* BC SPARE IN */
1662 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1663 
1664 /* BD SPARE OUT / MECHANISM STATUS */
1665 {ctl_mechanism_status, CTL_SERIDX_RD_CAP, CTL_CMD_FLAG_OK_ON_CDROM |
1666 					  CTL_CMD_FLAG_OK_ON_NO_MEDIA |
1667 					  CTL_CMD_FLAG_ALLOW_ON_PR_RESV |
1668 					  CTL_FLAG_DATA_IN,
1669  CTL_LUN_PAT_NONE,
1670  12, {0, 0, 0, 0, 0, 0, 0, 0xff, 0xff, 0, 0x07}},
1671 
1672 /* BE VOLUME SET IN */
1673 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1674 
1675 /* BF VOLUME SET OUT */
1676 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1677 
1678 /* C0 */
1679 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1680 
1681 /* C1 */
1682 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1683 
1684 /* C2 */
1685 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1686 
1687 /* C3 */
1688 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1689 
1690 /* C4 */
1691 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1692 
1693 /* C5 */
1694 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1695 
1696 /* C6 */
1697 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1698 
1699 /* C7 */
1700 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1701 
1702 /* C8 */
1703 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1704 
1705 /* C9 */
1706 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1707 
1708 /* CA */
1709 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1710 
1711 /* CB */
1712 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1713 
1714 /* CC */
1715 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1716 
1717 /* CD */
1718 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1719 
1720 /* CE */
1721 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1722 
1723 /* CF */
1724 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1725 
1726 /* D0 */
1727 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1728 
1729 /* D1 */
1730 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1731 
1732 /* D2 */
1733 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1734 
1735 /* D3 */
1736 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1737 
1738 /* D4 */
1739 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1740 
1741 /* D5 */
1742 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1743 
1744 /* D6 */
1745 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1746 
1747 /* D7 */
1748 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1749 
1750 /* D8 */
1751 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1752 
1753 /* D9 */
1754 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1755 
1756 /* DA */
1757 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1758 
1759 /* DB */
1760 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1761 
1762 /* DC */
1763 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1764 
1765 /* DD */
1766 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1767 
1768 /* DE */
1769 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1770 
1771 /* DF */
1772 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1773 
1774 /* E0 */
1775 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1776 
1777 /* E1 */
1778 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1779 
1780 /* E2 */
1781 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1782 
1783 /* E3 */
1784 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1785 
1786 /* E4 */
1787 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1788 
1789 /* E5 */
1790 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1791 
1792 /* E6 */
1793 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1794 
1795 /* E7 */
1796 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1797 
1798 /* E8 */
1799 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1800 
1801 /* E9 */
1802 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1803 
1804 /* EA */
1805 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1806 
1807 /* EB */
1808 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1809 
1810 /* EC */
1811 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1812 
1813 /* ED */
1814 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1815 
1816 /* EE */
1817 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1818 
1819 /* EF */
1820 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1821 
1822 /* F0 */
1823 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1824 
1825 /* F1 */
1826 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1827 
1828 /* F2 */
1829 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1830 
1831 /* F3 */
1832 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1833 
1834 /* F4 */
1835 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1836 
1837 /* F5 */
1838 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1839 
1840 /* F6 */
1841 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1842 
1843 /* F7 */
1844 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1845 
1846 /* F8 */
1847 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1848 
1849 /* F9 */
1850 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1851 
1852 /* FA */
1853 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1854 
1855 /* FB */
1856 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1857 
1858 /* FC */
1859 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1860 
1861 /* FD */
1862 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1863 
1864 /* FE */
1865 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE},
1866 
1867 /* FF */
1868 {NULL, CTL_SERIDX_INVLD, CTL_CMD_FLAG_NONE, CTL_LUN_PAT_NONE}
1869 
1870 };
1871