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