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