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