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