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