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