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