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