1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 * or http://www.opensolaris.org/os/licensing. 10 * See the License for the specific language governing permissions 11 * and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL HEADER in each 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21 22 /* Copyright 2015 QLogic Corporation */ 23 24 /* 25 * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved. 26 */ 27 28 #ifndef _QL_IOCB_H 29 #define _QL_IOCB_H 30 31 /* 32 * ISP2xxx Solaris Fibre Channel Adapter (FCA) driver header file. 33 * 34 * *********************************************************************** 35 * * ** 36 * * NOTICE ** 37 * * COPYRIGHT (C) 1996-2015 QLOGIC CORPORATION ** 38 * * ALL RIGHTS RESERVED ** 39 * * ** 40 * *********************************************************************** 41 * 42 */ 43 44 #ifdef __cplusplus 45 extern "C" { 46 #endif 47 48 typedef struct ql_64bit_data_seg { 49 uint32_t address[2]; 50 uint32_t length; 51 } ql_64bit_data_seg_t; 52 53 typedef struct ql_32bit_data_seg { 54 uint32_t address; 55 uint32_t length; 56 } ql_32bit_data_seg_t; 57 58 #define ABORTED_ENTRY_TYPE 0 59 60 /* 61 * ISP queue - 32-Bit DMA addressing command with extended LUN support 62 * entry structure definition. 63 */ 64 #define IOCB_CMD_TYPE_2 0x11 /* Command entry */ 65 #define MAX_CMDSZ 16 /* SCSI maximum CDB size. */ 66 #define CMD_TYPE_2_DATA_SEGMENTS 3 /* Number of data segments. */ 67 typedef struct cmd_entry { 68 uint8_t entry_type; /* Entry type. */ 69 uint8_t entry_count; /* Entry count. */ 70 uint8_t sys_define; /* System defined. */ 71 uint8_t entry_status; /* Entry Status. */ 72 uint32_t handle; /* System handle */ 73 uint8_t target_l; /* SCSI ID - LSB */ 74 uint8_t target_h; /* SCSI ID - MSB */ 75 uint8_t lun_l; /* SCSI LUN - LSB */ 76 uint8_t lun_h; /* SCSI LUN - MSB */ 77 uint8_t control_flags_l; /* Control flags - LSB. */ 78 uint8_t control_flags_h; /* Control flags - MSB. */ 79 uint8_t reserved_1[2]; 80 uint16_t timeout; /* Command timeout. */ 81 uint16_t dseg_count; /* Data segment count - LSB. */ 82 uint8_t scsi_cdb[MAX_CMDSZ]; /* SCSI command words. */ 83 uint32_t byte_count; /* Total byte count. */ 84 ql_32bit_data_seg_t dseg[3]; /* Data segments. */ 85 } cmd_entry_t, request_t; 86 87 /* 88 * Command entry control flags least significant byte. 89 */ 90 #define CF_HTAG BIT_1 91 #define CF_OTAG BIT_2 92 #define CF_STAG BIT_3 93 #define CF_DATA_IN BIT_5 94 #define CF_DATA_OUT BIT_6 95 96 /* 97 * ISP24xx queue - Command IOCB structure definition. 98 */ 99 #define IOCB_CMD_TYPE_7 0x18 100 #define CMD_TYPE_7_DATA_SEGMENTS 1 /* Number of 64 bit data segments. */ 101 typedef struct cmd7_24xx_entry { 102 uint8_t entry_type; /* Entry type. */ 103 uint8_t entry_count; /* Entry count. */ 104 uint8_t sys_define; /* System defined. */ 105 uint8_t entry_status; /* Entry Status. */ 106 uint32_t handle; /* System handle */ 107 uint16_t n_port_hdl; 108 uint16_t timeout; /* Command timeout. */ 109 uint16_t dseg_count; 110 uint8_t reserved_1[2]; 111 uint8_t fcp_lun[8]; /* SCSI LUN ID. */ 112 uint8_t control_flags; 113 uint8_t task_mgmt; /* Task management flags. */ 114 uint8_t task; /* Task Attributes Values. */ 115 uint8_t crn; /* Command reference number. */ 116 uint8_t scsi_cdb[MAX_CMDSZ]; /* SCSI command bytes. */ 117 uint32_t total_byte_count; 118 uint8_t target_id[3]; /* SCSI Target ID */ 119 uint8_t vp_index; 120 ql_64bit_data_seg_t dseg; /* Data segments. */ 121 } cmd7_24xx_entry_t; 122 123 /* 124 * ISP24xx queue - Command IOCB structure definition. 125 */ 126 #define IOCB_CMD_TYPE_6 0x48 127 #define CMD_TYPE_6_DATA_SEGMENTS 1 /* Number of 64 bit data segments. */ 128 typedef struct cmd6_24xx_entry { 129 uint8_t entry_type; /* Entry type. */ 130 uint8_t entry_count; /* Entry count. */ 131 uint8_t sys_define; /* System defined. */ 132 uint8_t entry_status; /* Entry Status. */ 133 uint32_t handle; /* System handle */ 134 uint16_t n_port_hdl; 135 uint16_t timeout; /* Command timeout. */ 136 uint16_t dseg_count; 137 uint16_t rsp_length; 138 uint8_t fcp_lun[8]; /* SCSI LUN ID. */ 139 uint16_t control_flags; 140 uint16_t cmnd_length; 141 uint32_t cmnd_address[2]; 142 uint32_t rsp_address[2]; /* Data segment 0 address. */ 143 uint32_t total_byte_count; 144 uint8_t target_id[3]; /* SCSI Target ID */ 145 uint8_t vp_index; 146 ql_64bit_data_seg_t dseg; /* Data segments. */ 147 } cmd6_24xx_entry_t; 148 149 typedef struct fcp_cmnd { 150 uint8_t fcp_lun[8]; /* SCSI LUN ID. */ 151 uint8_t crn; /* Command reference number. */ 152 uint8_t task; /* Task Attributes Values. */ 153 uint8_t task_mgmt; /* Task management flags. */ 154 uint8_t control_flags; /* Plus additional cdb length */ 155 uint8_t scsi_cdb[MAX_CMDSZ]; 156 uint32_t dl; 157 } fcp_cmnd_t; 158 159 typedef struct cmd6_2400_dma { 160 fcp_cmnd_t cmd; 161 uint32_t cookie_list[QL_DMA_SG_LIST_LENGTH + 1][3]; 162 } cmd6_2400_dma_t; 163 164 /* 165 * Task Management Flags. 166 */ 167 #define TF_TARGET_RESET BIT_13 168 #define TF_LUN_RESET BIT_12 169 #define TF_CLEAR_TASK_SET BIT_10 170 #define TF_ABORT_TASK_SET BIT_9 171 172 /* 173 * Task Attributes Values. 174 */ 175 #define TA_STAG 0 176 #define TA_HTAG 1 177 #define TA_OTAG 2 178 #define TA_ACA 4 179 #define TA_UNTAGGED 5 180 181 /* 182 * Control Flags. 183 */ 184 #define CF_DSD_PTR BIT_2 185 #define CF_RD BIT_1 186 #define CF_WR BIT_0 187 188 /* 189 * ISP queue - 64-Bit DMA addressing command with extended LUN support 190 * entry structure definition. 191 */ 192 #define IOCB_CMD_TYPE_3 0x19 /* Command Type 3 entry (64 bit) */ 193 #define CMD_TYPE_3_DATA_SEGMENTS 2 /* Number of 64 bit data segments. */ 194 typedef struct cmd_3_entry { 195 uint8_t entry_type; /* Entry type. */ 196 uint8_t entry_count; /* Entry count. */ 197 uint8_t sys_define; /* System defined. */ 198 uint8_t entry_status; /* Entry Status. */ 199 uint32_t handle; /* System handle */ 200 uint8_t target_l; /* SCSI ID - LSB */ 201 uint8_t target_h; /* SCSI ID - MSB */ 202 uint8_t lun_l; /* SCSI LUN - LSB */ 203 uint8_t lun_h; /* SCSI LUN - MSB */ 204 uint8_t control_flags_l; /* Control flags - LSB. */ 205 uint8_t control_flags_h; /* Control flags - MSB. */ 206 uint8_t reserved_1[2]; 207 uint16_t timeout; /* Command timeout. */ 208 uint16_t dseg_count; /* Data segment count - LSB. */ 209 uint8_t scsi_cdb[MAX_CMDSZ]; /* SCSI command words. */ 210 uint32_t byte_count; /* Total byte count. */ 211 ql_64bit_data_seg_t dseg[2]; /* Data segments. */ 212 } cmd_3_entry_t; 213 214 /* 215 * ISP queue - Command type 4 DSD list pointer structure definition. 216 */ 217 #define COMMAND_CHAINING_TYPE 0x15 218 typedef struct cmd_chaining_entry { 219 uint8_t entry_type; /* Entry type. */ 220 uint8_t entry_count; /* Entry count. */ 221 uint8_t sys_define; /* System defined. */ 222 uint8_t entry_status; /* Entry Status. */ 223 uint32_t handle; /* System handle */ 224 uint8_t reserved; 225 uint8_t target; /* SCSI ID */ 226 uint8_t lun_l; /* SCSI LUN - LSB */ 227 uint8_t lun_h; /* SCSI LUN - MSB */ 228 uint8_t control_flags_l; /* Control flags - LSB. */ 229 uint8_t control_flags_h; /* Control flags - MSB. */ 230 uint8_t crn; 231 uint8_t vp_index; 232 uint8_t timeout_l; /* Command timeout - LSB. */ 233 uint8_t timeout_h; /* Command timeout - MSB. */ 234 uint8_t dseg_count_l; /* Data segment count - LSB. */ 235 uint8_t dseg_count_h; /* Data segment count - MSB. */ 236 uint8_t scsi_cdb[MAX_CMDSZ]; /* SCSI command words. */ 237 uint32_t byte_count; /* Total byte count. */ 238 uint16_t list_type; /* 0 = 32bit, 1 = 64bit. */ 239 uint16_t base_address[2]; 240 uint16_t list_address[4]; 241 uint8_t reserved_2[10]; 242 } cmd_chaining_entry_t; 243 244 /* 245 * ISP queue - continuation entry structure definition. 246 */ 247 #define CONTINUATION_TYPE_0 0x02 /* Continuation entry. */ 248 #define CONT_TYPE_0_DATA_SEGMENTS 7 /* Number of 32 bit data segments. */ 249 typedef struct cont_entry { 250 uint8_t entry_type; /* Entry type. */ 251 uint8_t entry_count; /* Entry count. */ 252 uint8_t sys_define; /* System defined. */ 253 uint8_t entry_status; /* Entry Status. */ 254 uint32_t reserved; 255 ql_32bit_data_seg_t dseg[7]; /* Data segments. */ 256 } cont_entry_t; 257 258 /* 259 * ISP queue - 64-Bit addressing, continuation entry structure definition. 260 */ 261 #define CONTINUATION_TYPE_1 0x0A /* Continuation Type 1 entry. */ 262 #define CONT_TYPE_1_DATA_SEGMENTS 5 /* Number of 64 bit data segments. */ 263 typedef struct cont_type_1_entry { 264 uint8_t entry_type; /* Entry type. */ 265 uint8_t entry_count; /* Entry count. */ 266 uint8_t sys_define; /* System defined. */ 267 uint8_t entry_status; /* Entry Status. */ 268 ql_64bit_data_seg_t dseg[5]; /* Data segments. */ 269 } cont_type_1_entry_t; 270 271 /* 272 * ISP queue - status entry structure definition. 273 */ 274 #define STATUS_TYPE 0x03 /* Status entry. */ 275 typedef struct sts_entry { 276 uint8_t entry_type; /* Entry type. */ 277 uint8_t entry_count; /* Entry count. */ 278 uint8_t sys_define; /* System defined. */ 279 uint8_t entry_status; /* Entry Status. */ 280 uint32_t handle; /* System handle. */ 281 uint8_t scsi_status_l; /* SCSI status - LSB. */ 282 uint8_t scsi_status_h; /* SCSI status - MSB. */ 283 uint16_t comp_status; /* Completion status. */ 284 uint8_t state_flags_l; /* State flags - LSB. */ 285 uint8_t state_flags_h; /* State flags. */ 286 uint8_t status_flags_l; /* Status flags. */ 287 uint8_t status_flags_h; /* Status flags - MSB. */ 288 uint16_t rsp_info_length; /* Response Info Length. */ 289 uint16_t req_sense_length; /* Request sense data length. */ 290 uint32_t residual_length; /* Residual transfer length. */ 291 uint8_t rsp_info[8]; /* FCP response information. */ 292 uint8_t req_sense_data[32]; /* Request sense data. */ 293 } sts_entry_t, response_t; 294 295 /* 296 * Status entry entry status 297 */ 298 #define RF_INV_E_ORDER BIT_5 /* Invalid entry order. */ 299 #define RF_INV_E_COUNT BIT_4 /* Invalid entry count. */ 300 #define RF_INV_E_PARAM BIT_3 /* Invalid entry parameter. */ 301 #define RF_INV_E_TYPE BIT_2 /* Invalid entry type. */ 302 #define RF_BUSY BIT_1 /* Busy */ 303 304 /* 305 * Status entry SCSI status most significant byte. 306 */ 307 #define FCP_CONF_REQ BIT_4 308 #define FCP_RESID_UNDER BIT_3 309 #define FCP_RESID_OVER BIT_2 310 #define FCP_SNS_LEN_VALID BIT_1 311 #define FCP_RSP_LEN_VALID BIT_0 312 #define FCP_RSP_MASK (FCP_RESID_UNDER | FCP_RESID_OVER | \ 313 FCP_RSP_LEN_VALID) 314 315 /* 316 * Status entry state flag most significant byte. 317 * Not used in by ISP24xx 318 */ 319 #define SF_ARQ_DONE BIT_5 320 #define SF_GOT_STATUS BIT_4 321 #define SF_XFERRED_DATA BIT_3 322 #define SF_SENT_CMD BIT_2 323 #define SF_GOT_TARGET BIT_1 324 #define SF_GOT_BUS BIT_0 325 326 /* 327 * Status entry state flag least significant byte. 328 * Not used in by ISP24xx 329 */ 330 #define SF_NO_FAST_POST BIT_7 331 #define SF_DATA_OUT BIT_6 332 #define SF_DATA_IN BIT_5 333 334 #define SF_SIMPLE_Q BIT_3 335 #define SF_ORDERED_Q BIT_2 336 #define SF_HEAD_OF_Q BIT_1 337 #define SF_ACA_Q BIT_0 338 339 /* 340 * Status entry completion status definitions. 341 */ 342 #define CS_COMPLETE 0x0 /* No errors */ 343 #define CS_INCOMPLETE 0x1 /* Incomplete transfer of cmd. */ 344 #define CS_DMA_ERROR 0x2 /* A DMA direction error. */ 345 #define CS_PORT_ID_CHANGE 0x2 /* The port ID has changed. */ 346 #define CS_TRANSPORT 0x3 /* Transport error. */ 347 #define CS_RESET 0x4 /* SCSI bus reset occurred */ 348 #define CS_ABORTED 0x5 /* System aborted command. */ 349 #define CS_TIMEOUT 0x6 /* Timeout error. */ 350 #define CS_DATA_OVERRUN 0x7 /* Data overrun. */ 351 #define CS_INVALID_RX_ID 0x8 /* Invalid RX_ID. */ 352 #define CS_DATA_REASSEM_ERROR 0x11 /* Data reassembly error. */ 353 #define CS_ABTS_REC 0x13 /* ABTS from target. */ 354 #define CS_DATA_UNDERRUN 0x15 /* Data Underrun. */ 355 #define CS_QUEUE_FULL 0x1C /* Queue Full. */ 356 #define CS_PORT_UNAVAILABLE 0x28 /* Port unavailable */ 357 /* (selection timeout) */ 358 #define CS_PORT_LOGGED_OUT 0x29 /* Port Logged Out */ 359 #define CS_PORT_CONFIG_CHG 0x2A /* Port Configuration Changed */ 360 #define CS_PORT_BUSY 0x2B /* Port Busy */ 361 #define CS_RESOUCE_UNAVAILABLE 0x2C /* Frimware resource unavailable. */ 362 #define CS_TASK_MGMT_OVERRUN 0x30 /* Task management overrun. */ 363 #define CS_LOGIN_LOGOUT_ERROR 0x31 /* login/logout IOCB error. */ 364 #define CS_SEQ_COMPLETE 0x40 /* Sequence Complete. */ 365 #define CS_ABORTED_SEQ_REC 0x47 /* Abort sequence was received. */ 366 #define CS_DEV_NOT_READY 0x81 /* Device not ready */ 367 #define CS_INVALID_PARAMETER 0x102 /* IP invalid_parameter. */ 368 #define CS_ERROR_RESOURCE 0x103 /* IP insufficient resources. */ 369 #define CS_IP_NOT_INITIALIZED 0x104 /* IP not_initialized. */ 370 371 #define CS_BAD_PAYLOAD 0x180 /* Driver defined */ 372 #define CS_UNKNOWN 0x181 /* Driver defined */ 373 #define CS_CMD_FAILED 0x182 /* Driver defined */ 374 #define CS_LOOP_DOWN_ABORT 0x183 /* Driver defined */ 375 #define CS_FCP_RESPONSE_ERROR 0x184 /* Driver defined */ 376 #define CS_DEVICE_UNAVAILABLE 0x185 /* Driver defined */ 377 /* 378 * ISP24xx queue - Status IOCB structure definition. 379 */ 380 typedef struct sts_24xx_entry { 381 uint8_t entry_type; /* Entry type. */ 382 uint8_t entry_count; /* Entry count. */ 383 uint8_t sys_define; /* System defined. */ 384 uint8_t entry_status; /* Entry Status. */ 385 uint32_t handle; /* System handle. */ 386 uint16_t comp_status; /* Completion status. */ 387 uint16_t ox_id; 388 uint32_t residual_length; /* Residual transfer length. */ 389 uint16_t reserved; 390 uint8_t state_flags_l; /* State flags. */ 391 uint8_t state_flags_h; 392 uint16_t reserved_1; 393 uint8_t scsi_status_l; /* SCSI status - LSB. */ 394 uint8_t scsi_status_h; /* SCSI status - MSB. */ 395 uint32_t fcp_rsp_residual_count; 396 uint32_t fcp_sense_length; 397 uint32_t fcp_rsp_data_length; /* Response Info Length. */ 398 uint8_t rsp_sense_data[28]; /* FCP response and/or sense data. */ 399 } sts_24xx_entry_t; 400 401 /* 402 * ISP queue - status continuation entry structure definition. 403 */ 404 #define STATUS_CONT_TYPE 0x10 /* Status continuation entry. */ 405 typedef struct sts_cont_entry { 406 uint8_t entry_type; /* Entry type. */ 407 uint8_t entry_count; /* Entry count. */ 408 uint8_t sys_define; /* System defined. */ 409 uint8_t entry_status; /* Entry Status. */ 410 uint8_t req_sense_data[60]; /* Request sense data. */ 411 } sts_cont_entry_t; 412 413 /* 414 * ISP queue - marker with extended LUN support 415 * entry structure definition. 416 */ 417 #define MARKER_TYPE 0x04 /* Marker entry. */ 418 typedef struct mrk_entry { 419 uint8_t entry_type; /* Entry type. */ 420 uint8_t entry_count; /* Entry count. */ 421 uint8_t sys_define; /* System defined. */ 422 uint8_t entry_status; /* Entry Status. */ 423 uint32_t sys_define_2; /* System defined. */ 424 uint8_t target_l; /* SCSI ID - LSB */ 425 uint8_t target_h; /* SCSI ID - MSB */ 426 uint8_t modifier; /* Modifier (7-0). */ 427 uint8_t reserved_1; 428 uint8_t sequence_number[2]; /* Sequence number of event. */ 429 uint8_t lun_l; /* SCSI LUN - LSB */ 430 uint8_t lun_h; /* SCSI LUN - MSB */ 431 uint8_t reserved_2[48]; 432 } mrk_entry_t; 433 434 /* 435 * Marker modifiers 436 */ 437 #define MK_SYNC_ID_LUN 0 /* Synchronize ID/LUN */ 438 #define MK_SYNC_ID 1 /* Synchronize ID */ 439 #define MK_SYNC_ALL 2 /* Synchronize all ID/LUN */ 440 #define MK_SYNC_LIP 3 /* Synchronize all ID/LUN, */ 441 /* clear port changed, */ 442 /* use sequence number. */ 443 /* 444 * ISP24xx queue - Marker IOCB structure definition. 445 */ 446 typedef struct marker_24xx_entry { 447 uint8_t entry_type; /* Entry type. */ 448 uint8_t entry_count; /* Entry count. */ 449 uint8_t sys_define; /* System defined. */ 450 uint8_t entry_status; /* Entry Status. */ 451 uint32_t handle; /* System handle */ 452 uint16_t n_port_hdl; 453 uint8_t modifier; /* Modifier */ 454 uint8_t reserved[2]; 455 uint8_t vp_index; 456 uint8_t reserved_1[2]; 457 uint8_t fcp_lun[8]; /* SCSI LUN ID. */ 458 uint8_t reserved_2[40]; 459 } marker_24xx_entry_t; 460 461 /* 462 * ISP queue - Management Server entry structure definition. 463 */ 464 #define MS_TYPE 0x29 465 #define MS_DATA_SEGMENTS 1 /* Number of data segments. */ 466 typedef struct ms_entry { 467 uint8_t entry_type; /* Entry type. */ 468 uint8_t entry_count; /* Entry count. */ 469 uint8_t sys_define; /* System defined. */ 470 uint8_t entry_status; /* Entry Status. */ 471 uint32_t handle; /* System handle */ 472 uint8_t loop_id_l; /* device id - LSB */ 473 uint8_t loop_id_h; /* device id - MSB */ 474 uint16_t comp_status; /* Completion status */ 475 uint8_t control_flags_l; /* Control flags - LSB. */ 476 uint8_t control_flags_h; /* Control flags - MSB. */ 477 uint8_t reserved_1[2]; 478 uint16_t timeout; /* Command timeout. */ 479 uint8_t cmd_dseg_count_l; /* CMD segment count - LSB. */ 480 uint8_t cmd_dseg_count_h; /* CMD segment count - MSB. */ 481 uint16_t total_dseg_count; /* CMD + RESP segment count. */ 482 uint8_t reserved_2[10]; 483 uint32_t resp_byte_count; /* Response byte count */ 484 uint32_t cmd_byte_count; /* Command byte count */ 485 ql_64bit_data_seg_t dseg[2]; /* Data segments. */ 486 } ms_entry_t; 487 488 #define CF_ELS_PASSTHROUGH BIT_7 /* MSB */ 489 490 /* 491 * ISP24xx queue - CT Pass-Through IOCB structure definition. 492 */ 493 #define CT_PASSTHRU_TYPE 0x29 494 #define CT_PASSTHRU_DATA_SEGMENTS 1 /* Number of data segments. */ 495 typedef struct ct_passthru_entry { 496 uint8_t entry_type; /* Entry type. */ 497 uint8_t entry_count; /* Entry count. */ 498 uint8_t sys_define; /* System defined. */ 499 uint8_t entry_status; /* Entry Status. */ 500 uint32_t handle; /* System handle */ 501 uint16_t status; 502 uint16_t n_port_hdl; 503 uint16_t cmd_dseg_count; 504 uint8_t vp_index; 505 uint8_t reserved; 506 uint16_t timeout; 507 uint16_t reserved_1; 508 uint16_t resp_dseg_count; 509 uint8_t reserved_2[10]; 510 uint32_t resp_byte_count; 511 uint32_t cmd_byte_count; 512 ql_64bit_data_seg_t dseg[2]; /* Data segments. */ 513 } ct_passthru_entry_t; 514 515 /* 516 * ISP24xx queue - ELS Pass-Through IOCB structure definition. 517 */ 518 #define ELS_PASSTHRU_TYPE 0x53 519 typedef struct els_passthru_entry { 520 uint8_t entry_type; /* Entry type. */ 521 uint8_t entry_count; /* Entry count. */ 522 uint8_t sys_define; /* System defined. */ 523 uint8_t entry_status; /* Entry Status. */ 524 uint32_t handle; /* System handle */ 525 uint16_t reserved_8_9; 526 uint16_t n_port_hdl; 527 uint16_t xmt_dseg_count; /* Only one allowed */ 528 uint8_t vp_index; 529 uint8_t sof_type; 530 uint32_t rcv_exch_address; 531 uint16_t rcv_dseg_count; 532 uint8_t els_cmd_opcode; 533 uint8_t reserved_17; 534 uint8_t d_id_7_0; 535 uint8_t d_id_15_8; 536 uint8_t d_id_23_16; 537 uint8_t s_id_23_16; 538 uint8_t s_id_7_0; 539 uint8_t s_id_15_8; 540 uint16_t control_flags; 541 uint32_t rcv_payld_data_bcnt; 542 uint32_t xmt_payld_data_bcnt; 543 ql_64bit_data_seg_t dseg[2]; /* Data segments. */ 544 } els_passthru_entry_t; 545 546 /* 547 * ISP24x queue - ELS Pass-Through IOCB response. 548 */ 549 typedef struct els_passthru_entry_rsp { 550 uint8_t entry_type; /* Entry type. */ 551 uint8_t entry_count; /* Entry count. */ 552 uint8_t sys_define; /* System defined. */ 553 uint8_t entry_status; /* Entry Status. */ 554 uint32_t handle; /* System handle */ 555 uint16_t comp_status; 556 uint16_t n_port_hdl; 557 uint16_t reserved_c_d; 558 uint8_t vp_index; 559 uint8_t sof_type; 560 uint32_t rcv_exch_addr; 561 uint16_t reserved_14_15; 562 uint8_t els_cmd_opcode; 563 uint8_t reserved_17; 564 uint8_t d_id_7_0; 565 uint8_t d_id_15_8; 566 uint8_t d_id_23_16; 567 uint8_t s_id_23_16; 568 uint8_t s_id_7_0; 569 uint8_t s_id_15_8; 570 uint16_t control_flags; 571 uint32_t total_data_bcnt; 572 uint32_t error_subcode1; 573 uint32_t error_subcode2; 574 uint8_t reserved_2c_3f[20]; 575 } els_passthru_entry_rsp_t; 576 577 /* 578 * ISP24xx queue - Task Management IOCB structure definition. 579 */ 580 #define TASK_MGMT_TYPE 0x14 581 typedef struct task_mgmt_entry { 582 uint8_t entry_type; /* Entry type. */ 583 uint8_t entry_count; /* Entry count. */ 584 uint8_t sys_define; /* System defined. */ 585 uint8_t entry_status; /* Entry Status. */ 586 uint32_t handle; /* System handle */ 587 uint16_t n_port_hdl; 588 uint16_t reserved; 589 uint16_t delay; 590 uint16_t timeout; 591 uint8_t fcp_lun[8]; /* SCSI LUN ID. */ 592 uint32_t control_flags; 593 uint8_t reserved_1[20]; 594 uint8_t target_id[3]; /* SCSI Target ID */ 595 uint8_t vp_index; 596 uint8_t reserved_2[12]; 597 } task_mgmt_entry_t; 598 599 /* 600 * Control Flags. 601 */ 602 #define CF_DO_NOT_SEND BIT_31 603 #define CF_LUN_RESET BIT_4 604 #define CF_ABORT_TASK_SET BIT_3 605 #define CF_CLEAR_TASK_SET BIT_2 606 #define CF_TARGET_RESET BIT_1 607 #define CF_CLEAR_ACA BIT_0 608 609 /* 610 * ISP24xx queue - Abort I/O IOCB structure definition. 611 */ 612 #define ABORT_CMD_TYPE 0x33 613 typedef struct abort_cmd_entry { 614 uint8_t entry_type; /* Entry type. */ 615 uint8_t entry_count; /* Entry count. */ 616 uint8_t sys_define; /* System defined. */ 617 uint8_t entry_status; /* Entry Status. */ 618 uint32_t handle; /* System handle */ 619 uint16_t n_port_hdl; /* also comp_status */ 620 uint8_t options; 621 uint8_t options_h; 622 uint32_t cmd_handle; 623 uint8_t reserved[32]; 624 uint8_t target_id[3]; /* Port ID */ 625 uint8_t vp_index; 626 uint8_t reserved_1[12]; 627 } abort_cmd_entry_t; 628 629 /* 630 * Option Flags. 631 */ 632 #define AF_NO_ABTS BIT_0 633 634 /* 635 * ISP24xx queue - Login/Logout Port IOCB structure definition. 636 */ 637 #define LOG_TYPE 0x52 638 typedef struct log_entry { 639 uint8_t entry_type; /* Entry type. */ 640 uint8_t entry_count; /* Entry count. */ 641 uint8_t sys_define; /* System defined. */ 642 uint8_t entry_status; /* Entry Status. */ 643 uint32_t handle; /* System handle */ 644 uint16_t status; 645 uint16_t n_port_hdl; 646 uint16_t control_flags; 647 uint8_t vp_index; 648 uint8_t reserved; 649 uint8_t port_id[3]; 650 uint8_t rsp_size; 651 uint32_t io_param[11]; 652 } log_entry_t; 653 654 /* 655 * ISP24xx control flag commands 656 */ 657 #define CF_CMD_PLOGI 0x00 658 #define CF_CMD_PRLI 0x01 659 #define CF_CMD_PDISC 0x02 660 #define CF_CMD_ADISC 0x03 661 #define CF_CMD_LOGO 0x08 662 #define CF_CMD_PRLO 0x09 663 #define CF_CMD_TPRLO 0x0A 664 665 /* 666 * ISP24xx control flag command options 667 */ 668 #define CFO_COND_PLOGI BIT_4 669 #define CFO_SKIP_PRLI BIT_5 670 #define CFO_COMMON_FEATURES BIT_7 671 #define CFO_CLASS_2 BIT_8 672 #define CFO_FCP_2_OVR BIT_9 673 674 #define CFO_IMPLICIT_LOGO BIT_4 675 #define CFO_IMPLICIT_LOGO_ALL BIT_5 676 #define CFO_EXPLICIT_LOGO BIT_6 677 #define CFO_FREE_N_PORT_HANDLE BIT_7 678 679 #define CFO_IMPLICIT_PRLO BIT_4 680 681 /* 682 * ISP24xx Login/Logout Status Sub Codes in in I/O Parameter 0 field. 683 */ 684 #define CS0_NO_LINK 0x01 685 #define CS0_NO_IOCB 0x02 686 #define CS0_NO_EXCH_CTRL_BLK 0x03 687 #define CS0_COMMAND_FAILED 0x04 688 #define CS0_NO_FABRIC_PRESENT 0x05 689 #define CS0_FIRMWARE_NOT_READY 0x07 690 #define CS0_PORT_NOT_LOGGED_IN 0x09 691 #define CS0_NO_PCB_ALLOCATED 0x0A 692 #define CS0_ELS_REJECT_RECEIVED 0x18 693 #define CS0_CMD_PARAMETER_ERROR 0x19 694 #define CS0_PORT_ID_USED 0x1A 695 #define CS0_N_PORT_HANDLE_USED 0x1B 696 #define CS0_NO_N_PORT_HANDLE_AVAILABLE 0x1C 697 #define CS0_NO_FLOGI_ACC 0x1F 698 699 /* 700 * ISP24xx Login/Logout Status Sub Codes in in I/O Parameter 1 field. 701 */ 702 #define CS1_PLOGI_FAILED 0x02 703 #define CS1_PLOGI_RESPONSE_FAILED 0x03 704 #define CS1_PRLI_FAILED 0x04 705 #define CS1_PRLI_RESPONSE_FAILED 0x05 706 #define CS1_COMMAND_LOGGED_OUT 0x07 707 708 /* 709 * ISP queue - Enable LUN with extended LUN support 710 * entry structure definition. 711 */ 712 #define ENABLE_LUN_TYPE 0xB /* Enable LUN entry */ 713 typedef struct enable_lun_entry { 714 uint8_t entry_type; /* Entry type. */ 715 uint8_t entry_count; /* Entry count. */ 716 uint8_t sys_define; /* System defined. */ 717 uint8_t entry_status; /* Entry Status. */ 718 uint32_t handle; /* System handle */ 719 uint8_t reserved[8]; 720 uint8_t status; 721 uint8_t reserved_1; 722 uint8_t command_count; 723 uint8_t immediate_notify_count; 724 uint8_t reserved_2[2]; 725 uint8_t timeout_l; /* Timeout - LSB. */ 726 uint8_t timeout_h; /* Timeout - MSB. */ 727 uint8_t reserved_3[40]; 728 } enable_lun_entry_t; 729 730 /* 731 * ISP queue - Modify LUN with extended LUN support 732 * entry structure definition. 733 */ 734 #define MODIFY_LUN_TYPE 0xC /* Modify LUN entry */ 735 typedef struct modify_lun_entry { 736 uint8_t entry_type; /* Entry type. */ 737 uint8_t entry_count; /* Entry count. */ 738 uint8_t sys_define; /* System defined. */ 739 uint8_t entry_status; /* Entry Status. */ 740 uint32_t handle; /* System handle */ 741 uint8_t reserved[2]; 742 uint8_t operators; 743 uint8_t reserved_1[5]; 744 uint8_t status; 745 uint8_t reserved_2; 746 uint8_t command_count; 747 uint8_t immediate_notify_count; 748 uint8_t reserved_3[2]; 749 uint8_t timeout_l; /* Timeout - LSB. */ 750 uint8_t timeout_h; /* Timeout - MSB. */ 751 uint8_t reserved_4[40]; 752 } modify_lun_entry_t; 753 754 /* 755 * ISP queue - Immediate Notify with extended LUN support 756 * entry structure definition. 757 */ 758 #define IMMEDIATE_NOTIFY_TYPE 0xD /* Immediate notify entry */ 759 typedef struct immediate_notify_entry { 760 uint8_t entry_type; /* Entry type. */ 761 uint8_t entry_count; /* Entry count. */ 762 uint8_t sys_define; /* System defined. */ 763 uint8_t entry_status; /* Entry Status. */ 764 uint32_t handle; /* System handle */ 765 uint8_t initiator_id_l; 766 uint8_t initiator_id_h; 767 uint8_t lun_l; 768 uint8_t lun_h; 769 uint8_t reserved_1[4]; 770 uint16_t status; 771 uint8_t task_flags_l; 772 uint8_t task_flags_h; 773 uint16_t sequence_id; 774 uint8_t reserved_3[40]; 775 uint16_t ox_id; 776 } immediate_notify_entry_t; 777 778 /* 779 * ISP24xx queue - Immediate Notify IOCB structure definition. 780 */ 781 typedef struct immd_notify_24xx_entry { 782 uint8_t entry_type; /* Entry type. */ 783 uint8_t entry_count; /* Entry count. */ 784 uint8_t sys_define; /* System defined. */ 785 uint8_t entry_status; /* Entry Status. */ 786 uint32_t reserved; 787 uint16_t n_port_hdl; 788 uint16_t reserved_1; 789 uint16_t flags; 790 uint16_t srr_rx_id; 791 uint16_t status; 792 uint8_t status_subcode; 793 uint8_t reserved_2; 794 uint32_t receive_exchange_address; 795 uint32_t srr_relative_offset; 796 uint16_t srr_iu; 797 uint16_t srr_ox_id; 798 uint8_t reserved_3[19]; 799 uint8_t vp_index; 800 uint8_t reserved_4[10]; 801 uint16_t ox_id; 802 } immd_notify_24xx_entry_t; 803 804 /* 805 * ISP queue - Notify Acknowledge extended LUN support 806 * entry structure definition. 807 */ 808 #define NOTIFY_ACKNOWLEDGE_TYPE 0xE /* Immediate notify entry */ 809 typedef struct notify_acknowledge_entry { 810 uint8_t entry_type; /* Entry type. */ 811 uint8_t entry_count; /* Entry count. */ 812 uint8_t sys_define; /* System defined. */ 813 uint8_t entry_status; /* Entry Status. */ 814 uint32_t handle; /* System handle */ 815 uint8_t initiator_id_l; 816 uint8_t initiator_id_h; 817 uint8_t reserved_1[2]; 818 uint8_t flags_l; 819 uint8_t flags_h; 820 uint8_t reserved_2[2]; 821 uint16_t status; 822 uint8_t task_flags_l; 823 uint8_t task_flags_h; 824 uint16_t sequence_id; 825 uint8_t reserved_3[42]; 826 } notify_acknowledge_entry_t; 827 828 /* 829 * ISP24xx queue - Notify Acknowledge IOCB structure definition. 830 */ 831 typedef struct notify_ack_24xx_entry { 832 uint8_t entry_type; /* Entry type. */ 833 uint8_t entry_count; /* Entry count. */ 834 uint8_t sys_define; /* System defined. */ 835 uint8_t entry_status; /* Entry Status. */ 836 uint32_t handle; 837 uint16_t n_port_hdl; 838 uint16_t reserved_1; 839 uint16_t flags; 840 uint16_t srr_rx_id; 841 uint16_t status; 842 uint8_t status_subcode; 843 uint8_t reserved_2; 844 uint32_t receive_exchange_address; 845 uint32_t srr_relative_offset; 846 uint16_t srr_iu; 847 uint16_t srr_flags; 848 uint8_t reserved_3[19]; 849 uint8_t vp_index; 850 uint8_t srr_reject_vendor_unique; 851 uint8_t srr_reject_code_explanation; 852 uint8_t srr_reject_code; 853 uint8_t reserved_4[7]; 854 uint16_t ox_id; 855 } notify_ack_24xx_entry_t; 856 857 /* 858 * ISP queue - Accept Target I/O with extended LUN support 859 * entry structure definition. 860 */ 861 #define ATIO_TYPE 0x16 /* ATIO entry */ 862 typedef struct atio_entry { 863 uint8_t entry_type; /* Entry type. */ 864 uint8_t entry_count; /* Entry count. */ 865 uint8_t sys_define; /* System defined. */ 866 uint8_t entry_status; /* Entry Status. */ 867 uint32_t handle; /* System handle */ 868 uint8_t initiator_id_l; 869 uint8_t initiator_id_h; 870 uint16_t rx_id; 871 uint8_t flags_l; 872 uint8_t flags_h; 873 uint16_t status; 874 uint8_t reserved_1; 875 uint8_t task_codes : 3, 876 reserved_2 : 5; 877 uint8_t task_flags; 878 uint8_t execution_codes; 879 uint8_t cdb[MAX_CMDSZ]; 880 uint32_t data_length; 881 uint8_t lun_l; 882 uint8_t lun_h; 883 uint8_t reserved_3[20]; 884 uint16_t ox_id; 885 } atio_entry_t; 886 887 /* 888 * ISP24xx queue - Accept Target I/O IOCB structure definition. 889 */ 890 #define ATIO_24xx_TYPE 0x06 891 typedef struct atio_24xx_entry { 892 uint8_t entry_type; /* Entry type. */ 893 uint8_t entry_count; /* Entry count. */ 894 uint16_t len_attr; /* System defined. */ 895 uint32_t receive_exchange_address; 896 uint8_t frame_hdr[24]; 897 uint8_t payload[32]; 898 } atio_24xx_entry_t; 899 900 /* 901 * ISP queue - Continue Target I/O with extended LUN support 902 * entry structure definition. 903 */ 904 #define CTIO_TYPE_2 0x17 905 #define CTIO_TYPE_3 0x1F 906 typedef struct ctio_entry { 907 uint8_t entry_type; /* Entry type. */ 908 uint8_t entry_count; /* Entry count. */ 909 uint8_t sys_define; /* System defined. */ 910 uint8_t entry_status; /* Entry Status. */ 911 uint32_t handle; /* System handle */ 912 uint8_t initiator_id_l; 913 uint8_t initiator_id_h; 914 uint16_t rx_id; 915 uint8_t flags_l; 916 uint8_t flags_h; 917 uint16_t status; 918 uint16_t timeout; 919 uint8_t dseg_count_l; 920 uint8_t dseg_count_h; 921 uint32_t relative_offset; 922 uint32_t residual_transfer_length; 923 uint8_t reserved_1[4]; 924 925 union { 926 struct { 927 uint8_t reserved_2[2]; 928 uint8_t scsi_status_l; 929 uint8_t scsi_status_h; 930 uint32_t byte_count; 931 ql_32bit_data_seg_t dseg[3]; 932 }s0_32bit; 933 934 struct { 935 uint8_t reserved_3[2]; 936 uint8_t scsi_status_l; 937 uint8_t scsi_status_h; 938 uint32_t byte_count; 939 ql_64bit_data_seg_t dseg[2]; 940 }s0_64bit; 941 942 struct { 943 uint8_t sense_length_l; 944 uint8_t sense_length_h; 945 uint8_t scsi_status_l; 946 uint8_t scsi_status_h; 947 uint8_t response_length_l; 948 uint8_t response_length_h; 949 uint8_t response_info[26]; 950 }s1; 951 952 struct { 953 uint8_t reserved_4[2]; 954 uint32_t response_length; 955 uint32_t response_pointer; 956 uint8_t reserved[16]; 957 }s2; 958 }type; 959 } ctio_entry_t; 960 961 /* 962 * ISP24xx queue - Continue Target I/O IOCBs from the System 963 * Target Driver structure definition. 964 */ 965 #define CTIO_24xx_TYPE 0x12 966 typedef struct ctio_snd_entry { 967 uint8_t entry_type; /* Entry type. */ 968 uint8_t entry_count; /* Entry count. */ 969 uint8_t sys_define; /* System defined. */ 970 uint8_t entry_status; /* Entry Status. */ 971 uint32_t handle; 972 uint16_t n_port_hdl; 973 uint16_t timeout; 974 uint16_t dseg_count; 975 uint8_t vp_index; 976 uint8_t flags; 977 uint8_t initiator_id[3]; 978 uint8_t reserved_1; 979 uint32_t receive_exchange_address; 980 981 union { 982 struct { 983 uint16_t reserved_2; 984 uint16_t flags; 985 uint32_t residual_length; 986 uint16_t ox_id; 987 uint16_t scsi_status; 988 uint32_t relative_offset; 989 uint32_t reserved_3; 990 uint32_t transfer_length; 991 uint32_t reserved_4; 992 ql_64bit_data_seg_t dseg; 993 }s0; 994 995 struct { 996 uint16_t sense_length; 997 uint16_t flags; 998 uint32_t residual_length; 999 uint16_t ox_id; 1000 uint16_t scsi_status; 1001 uint16_t response_length; 1002 uint16_t reserved_2; 1003 uint8_t rsp_sense_data[24]; 1004 }s1; 1005 1006 struct { 1007 uint16_t reserved_2; 1008 uint16_t flags; 1009 uint32_t residual_length; 1010 uint16_t ox_id; 1011 uint8_t reserved_3[10]; 1012 uint32_t transfer_length; 1013 uint32_t reserved_4; 1014 ql_64bit_data_seg_t dseg; 1015 }s2; 1016 }type; 1017 } ctio_snd_entry_t; 1018 1019 /* 1020 * ISP24xx queue - Continue Target I/O IOCBs from the ISP24xx 1021 * Firmware structure definition. 1022 */ 1023 typedef struct ctio_rcv_entry { 1024 uint8_t entry_type; /* Entry type. */ 1025 uint8_t entry_count; /* Entry count. */ 1026 uint8_t sys_define; /* System defined. */ 1027 uint8_t entry_status; /* Entry Status. */ 1028 uint32_t handle; 1029 uint16_t status; 1030 uint16_t timeout; 1031 uint16_t dseg_count; 1032 uint8_t reserved[6]; 1033 1034 uint8_t vp_index; 1035 uint8_t flags; 1036 uint8_t initiator_id[3]; 1037 uint8_t reserved_1; 1038 uint32_t receive_exchange_address; 1039 1040 union { 1041 struct { 1042 uint16_t reserved_2; 1043 uint16_t flags; 1044 uint32_t residual_length; 1045 uint16_t ox_id; 1046 uint16_t scsi_status; 1047 uint32_t relative_offset; 1048 uint32_t reserved_3; 1049 uint32_t transfer_length; 1050 uint32_t reserved_4; 1051 ql_64bit_data_seg_t dseg; 1052 }s0; 1053 1054 struct { 1055 uint16_t sense_length; 1056 uint16_t flags; 1057 uint32_t residual_length; 1058 uint16_t ox_id; 1059 uint16_t scsi_status; 1060 uint16_t response_length; 1061 uint16_t reserved_2; 1062 uint8_t rsp_sense_data[24]; 1063 }s1; 1064 1065 struct { 1066 uint16_t reserved_2; 1067 uint16_t flags; 1068 uint32_t residual_length; 1069 uint16_t ox_id; 1070 uint8_t reserved_3[10]; 1071 uint32_t transfer_length; 1072 uint32_t reserved_4; 1073 ql_64bit_data_seg_t dseg; 1074 }s2; 1075 }type; 1076 } ctio_rcv_entry_t; 1077 1078 /* 1079 * ISP queue - 32-Bit DMA addressing IP entry structure definition. 1080 */ 1081 #define IP_TYPE 0x13 1082 #define IP_DATA_SEGMENTS 3 /* Number of data segments. */ 1083 typedef struct ip_entry { 1084 uint8_t entry_type; /* Entry type. */ 1085 uint8_t entry_count; /* Entry count. */ 1086 uint8_t sys_define; /* System defined. */ 1087 uint8_t entry_status; /* Entry Status. */ 1088 uint32_t handle; /* System handle */ 1089 uint8_t loop_id_l; /* device id - LSB */ 1090 uint8_t loop_id_h; /* device id - MSB */ 1091 uint16_t comp_status; /* Completion status. */ 1092 uint8_t control_flags_l; /* Control flags - LSB. */ 1093 uint8_t control_flags_h; /* Control flags - MSB. */ 1094 uint8_t reserved_1[2]; 1095 uint16_t timeout; /* Command timeout. */ 1096 uint16_t dseg_count; /* Data segment count. */ 1097 uint8_t reserved_2[16]; 1098 uint32_t byte_count; /* Total byte count. */ 1099 ql_32bit_data_seg_t dseg[3]; /* Data segments. */ 1100 } ip_entry_t; 1101 1102 /* 1103 * ISP queue - 64-Bit DMA addressing IP entry structure definition. 1104 */ 1105 #define IP_A64_TYPE 0x1B 1106 #define IP_A64_DATA_SEGMENTS 2 /* Number of data segments. */ 1107 typedef struct ip_a64_entry { 1108 uint8_t entry_type; /* Entry type. */ 1109 uint8_t entry_count; /* Entry count. */ 1110 uint8_t sys_define; /* System defined. */ 1111 uint8_t entry_status; /* Entry Status. */ 1112 uint32_t handle; /* System handle */ 1113 uint8_t reserved; 1114 uint8_t loop_id; /* Loop ID */ 1115 uint16_t comp_status; /* Completion status. */ 1116 uint8_t control_flags_l; /* Control flags - LSB. */ 1117 uint8_t control_flags_h; /* Control flags - MSB. */ 1118 uint8_t reserved_1[2]; 1119 uint16_t timeout; /* Command timeout. */ 1120 uint16_t dseg_count; /* Data segment count. */ 1121 uint8_t reserved_2[16]; 1122 uint32_t byte_count; /* Total byte count. */ 1123 ql_64bit_data_seg_t dseg[2]; /* Data segments. */ 1124 } ip_a64_entry_t; 1125 1126 /* 1127 * ISP24xx queue - IP command entry structure definition. 1128 */ 1129 #define IP_CMD_TYPE 0x3B 1130 #define IP_CMD_DATA_SEGMENTS 1 1131 typedef struct ip_cmd_entry { 1132 uint8_t entry_type; /* Entry type. */ 1133 uint8_t entry_count; /* Entry count. */ 1134 uint8_t sys_define; /* System defined. */ 1135 uint8_t entry_status; /* Entry Status. */ 1136 uint32_t handle; /* System handle. */ 1137 uint16_t hdl_status; /* N_port hdl or Completion status */ 1138 uint16_t timeout_hdl; /* N_port hdl or Command timeout */ 1139 uint16_t dseg_count; /* Data segment count. */ 1140 uint8_t reserved_1[6]; 1141 uint32_t exch_addr; 1142 uint16_t control_flags; 1143 uint16_t frame_hdr_cntrl_flgs; 1144 uint8_t reserved_2[12]; 1145 uint32_t sys_define_2; 1146 uint32_t byte_count; /* Total byte count. */ 1147 uint8_t reserved_3[4]; 1148 ql_64bit_data_seg_t dseg; /* Data segments. */ 1149 } ip_cmd_entry_t; 1150 1151 /* 1152 * IP command Control Flags. 1153 */ 1154 #define IPCF_TERMINATE_EXCH BIT_1 1155 /* 1156 * IP command Frame Header Control Flags. 1157 */ 1158 #define IPCF_FIRST_SEQ BIT_5 1159 #define IPCF_LAST_SEQ BIT_4 1160 1161 /* 1162 * ISP queue - Receive IP buffer entry structure definition. 1163 */ 1164 #define IP_RCVBUF_HANDLES 24 /* Buffer handles in entry. */ 1165 #define IP_RECEIVE_TYPE 0x23 /* IP receive entry */ 1166 typedef struct ip_rcv_entry { 1167 uint8_t entry_type; /* Entry type. */ 1168 uint8_t entry_count; /* Entry count. */ 1169 uint8_t segment_count; /* Segment count. */ 1170 uint8_t entry_status; /* Entry Status. */ 1171 uint8_t s_id[3]; /* Source ID. */ 1172 uint8_t reserved[2]; 1173 uint8_t loop_id; /* Loop ID */ 1174 uint16_t comp_status; /* Completion status. */ 1175 uint8_t class_of_srv_l; /* Class of service - LSB. */ 1176 uint8_t class_of_srv_h; /* Class of service - MSB. */ 1177 uint16_t seq_length; /* Sequence length. */ 1178 uint16_t buffer_handle[IP_RCVBUF_HANDLES]; /* Buffer handles. */ 1179 } ip_rcv_entry_t; 1180 1181 /* 1182 * ISP queue - Receive IP buffer continuation entry structure definition. 1183 */ 1184 #define IP_RCVBUF_CONT_HANDLES 30 /* Buffer handles in entry. */ 1185 #define IP_RECEIVE_CONT_TYPE 0x2B /* IP receive continuation entry */ 1186 typedef struct ip_rcv_cont_entry { 1187 uint8_t entry_type; /* Entry type. */ 1188 uint8_t entry_count; /* Entry count. */ 1189 uint8_t reserved; 1190 uint8_t entry_status; /* Entry Status. */ 1191 uint16_t buffer_handle[IP_RCVBUF_CONT_HANDLES]; /* Buf handles */ 1192 } ip_rcv_cont_entry_t; 1193 1194 /* 1195 * ISP24xx queue - Receive IP buffer entry structure definition. 1196 */ 1197 #define IP_24XX_RCVBUF_HANDLES 4 1198 #define IP_24XX_RECEIVE_TYPE 0x3c 1199 typedef struct ip_rcv_24xx_entry { 1200 uint8_t entry_type; /* Entry type. */ 1201 uint8_t entry_count; /* Entry count. */ 1202 uint8_t segment_count; /* Segment count. */ 1203 uint8_t entry_status; /* Entry Status. */ 1204 uint8_t s_id[3]; /* Source ID. */ 1205 uint8_t reserved[1]; 1206 uint16_t comp_status; /* Completion status. */ 1207 uint16_t n_port_hdl; /* Loop ID */ 1208 uint8_t class_of_srv_l; /* Class of service - LSB. */ 1209 uint8_t class_of_srv_h; /* Class of service - MSB. */ 1210 uint16_t seq_length; /* Sequence length. */ 1211 uint16_t buffer_handle[IP_24XX_RCVBUF_HANDLES]; /* Buffer handles. */ 1212 } ip_rcv_24xx_entry_t; 1213 1214 /* 1215 * ISP receive buffer container structure definition. 1216 */ 1217 typedef struct rcvbuf { 1218 uint32_t bufp[2]; /* Buffer pointer. */ 1219 uint16_t handle; /* Buffer handle. */ 1220 uint16_t reserved; 1221 } rcvbuf_t; 1222 1223 /* 1224 * ISP24xx queue - IP Load Buffer Pool entry structure definition. 1225 */ 1226 #define IP_POOL_BUFFERS 4 1227 #define IP_BUF_POOL_TYPE 0x3d 1228 typedef struct ip_buf_pool_entry { 1229 uint8_t entry_type; /* Entry type. */ 1230 uint8_t entry_count; /* Entry count. */ 1231 uint8_t sys_define; /* System defined. */ 1232 uint8_t entry_status; /* Entry Status. */ 1233 uint32_t handle; /* System handle */ 1234 uint16_t status; 1235 uint16_t buffer_pool_id; 1236 uint16_t option; 1237 uint8_t buffer_count; 1238 uint8_t buffer_count_h; 1239 rcvbuf_t buffers[IP_POOL_BUFFERS]; 1240 } ip_buf_pool_entry_t; 1241 /* 1242 * ISP2400 queue - Virtual Port Modify IOCB structure definition. 1243 */ 1244 #define VP_MODIFY_TYPE 0x31 1245 typedef struct vp_modify_entry { 1246 uint8_t entry_type; /* Entry type. */ 1247 uint8_t entry_count; /* Entry count. */ 1248 uint8_t sys_define; /* System defined. */ 1249 uint8_t entry_status; /* Entry Status. */ 1250 uint32_t handle; /* System handle */ 1251 uint16_t reserved; 1252 uint16_t status; 1253 uint8_t command; 1254 uint8_t vp_count; 1255 uint8_t first_vp_index; 1256 uint8_t second_vp_index; 1257 uint8_t first_options; 1258 uint8_t first_hard_prev_addr; 1259 uint8_t reserved_2[2]; 1260 uint8_t first_port_name[8]; 1261 uint8_t first_node_name[8]; 1262 uint8_t second_options; 1263 uint8_t second_hard_prev_addr; 1264 uint8_t reserved_3[2]; 1265 uint8_t second_port_name[8]; 1266 uint8_t second_node_name[8]; 1267 uint8_t reserved_4[6]; 1268 uint16_t fcf_index; 1269 } vp_modify_entry_t; 1270 1271 /* 1272 * ISP2400 VP modify commands 1273 */ 1274 #define VPM_MODIFY 0x0 1275 #define VPM_MODIFY_ENABLE 0x1 1276 1277 /* 1278 * ISP2400 queue - Virtual Port Control IOCB structure definition. 1279 */ 1280 #define VP_CONTROL_TYPE 0x30 1281 typedef struct vp_control_entry { 1282 uint8_t entry_type; /* Entry type. */ 1283 uint8_t entry_count; /* Entry count. */ 1284 uint8_t sys_define; /* System defined. */ 1285 uint8_t entry_status; /* Entry Status. */ 1286 uint32_t handle; /* System handle */ 1287 uint16_t vp_index_failed; 1288 uint16_t status; 1289 uint8_t command; 1290 uint8_t command_h; 1291 uint8_t vp_count; 1292 uint8_t vp_count_h; 1293 uint8_t vp_index[16]; 1294 uint8_t reserved[30]; 1295 uint16_t fcf_index; 1296 } vp_control_entry_t; 1297 1298 /* 1299 * ISP2400 VP control commands 1300 */ 1301 #define VPC_ENABLE 0x0 1302 #define VPC_DISABLE 0x8 1303 #define VPC_DISABLE_INIT 0x9 /* Only 2400 & 2500 */ 1304 #define VPC_DISABLE_LOGOUT 0xa 1305 #define VPC_DISABLE_LOGOUT_ALL 0xb 1306 1307 /* 1308 * ISP2400 queue - Report ID Acquisition IOCB structure definition. 1309 */ 1310 #define REPORT_ID_TYPE 0x32 1311 typedef struct report_id_0 { 1312 uint8_t entry_type; /* Entry type. */ 1313 uint8_t entry_count; /* Entry count. */ 1314 uint8_t sys_define; /* System defined. */ 1315 uint8_t entry_status; /* Entry Status. */ 1316 uint32_t handle; /* System handle */ 1317 uint8_t vp_acquired; 1318 uint8_t vp_setup; 1319 uint8_t reserved[2]; 1320 uint8_t port_id[3]; 1321 uint8_t format; 1322 uint8_t vp_index[16]; 1323 uint8_t reserved_1[32]; 1324 } report_id_0_t; 1325 1326 typedef struct report_id_1 { 1327 uint8_t entry_type; /* Entry type. */ 1328 uint8_t entry_count; /* Entry count. */ 1329 uint8_t sys_define; /* System defined. */ 1330 uint8_t entry_status; /* Entry Status. */ 1331 uint32_t handle; /* System handle */ 1332 uint16_t vp_count; 1333 uint8_t vp_index; 1334 uint8_t vp_status; 1335 uint8_t port_id[3]; 1336 uint8_t format; 1337 uint8_t reserved[48]; 1338 } report_id_1_t; 1339 1340 typedef struct report_id_acq { 1341 uint8_t entry_type; /* Entry type. */ 1342 uint8_t entry_count; /* Entry count. */ 1343 uint8_t sys_define; /* System defined. */ 1344 uint8_t entry_status; /* Entry Status. */ 1345 uint32_t handle; /* System handle */ 1346 uint8_t vp_acquired; 1347 uint8_t vp_setup; 1348 uint8_t vp_index; 1349 uint8_t vp_status; 1350 uint8_t port_id[3]; 1351 uint8_t format; 1352 uint8_t status_subcode; 1353 uint8_t flags; 1354 uint16_t fip_flags; 1355 uint16_t fcf_index; 1356 uint16_t mac[3]; 1357 uint8_t reserved[4]; 1358 uint8_t ls_rjt_subcode; 1359 uint8_t ls_rjt_explanation; 1360 uint8_t ls_rjt_reason_code; 1361 uint8_t reserved_1[29]; 1362 } report_id_acq_t; 1363 1364 /* 1365 * ISP2400 queue - Verify Menlo FW entry structure definition. 1366 */ 1367 #define VERIFY_MENLO_TYPE 0x1b 1368 typedef struct vfy_menlo_entry { 1369 uint8_t entry_type; /* Entry type. */ 1370 uint8_t entry_count; /* Entry count. */ 1371 uint8_t sys_define; /* System defined. */ 1372 uint8_t entry_status; /* Entry Status. */ 1373 uint32_t handle; /* System handle */ 1374 uint16_t options_status; 1375 uint16_t failure_code; 1376 uint16_t dseg_count; 1377 uint16_t reserved_1[3]; 1378 uint32_t fw_version; 1379 uint32_t exch_addr; 1380 uint32_t reserved_2[3]; 1381 uint32_t fw_size; 1382 uint32_t fw_sequence_size; 1383 uint32_t relative_offset; 1384 ql_64bit_data_seg_t dseg; /* Data segments. */ 1385 } vfy_menlo_entry_t; 1386 1387 /* 1388 * Option Flags. 1389 */ 1390 #define VMO_DSD_CHAINING BIT_15 1391 #define VM_END_OF_DATA BIT_14 1392 #define VMF_DIAGNOSTIC_FW BIT_3 1393 #define VMF_DO_NOT_RESET BIT_2 1394 #define VMF_FORCE_UPDATE_FW BIT_1 1395 #define VMF_DO_NOT_UPDATE_FW BIT_0 1396 1397 /* 1398 * ISP2400 queue - Access Menlo Data entry structure definition. 1399 */ 1400 #define MENLO_DATA_TYPE 0x2b 1401 typedef struct menlo_data_entry { 1402 uint8_t entry_type; /* Entry type. */ 1403 uint8_t entry_count; /* Entry count. */ 1404 uint8_t sys_define; /* System defined. */ 1405 uint8_t entry_status; /* Entry Status. */ 1406 uint32_t handle; /* System handle */ 1407 uint16_t options_status; 1408 uint16_t failure_code; 1409 uint16_t dseg_count; 1410 uint16_t reserved_1[3]; 1411 uint32_t parameter_1; 1412 uint32_t parameter_2; 1413 uint32_t parameter_3; 1414 uint32_t reserved_2[3]; 1415 uint32_t total_byte_count; 1416 uint32_t reserved_3; 1417 ql_64bit_data_seg_t dseg; /* Data segments. */ 1418 } menlo_data_entry_t; 1419 1420 /* 1421 * Mailbox IOCB. 1422 */ 1423 typedef union ql_mbx_iocb { 1424 cmd_entry_t cmd; 1425 cmd_3_entry_t cmd3; 1426 cmd7_24xx_entry_t cmd24; 1427 ms_entry_t ms; 1428 ct_passthru_entry_t ms24; 1429 abort_cmd_entry_t abo; 1430 task_mgmt_entry_t mgmt; 1431 sts_entry_t sts; 1432 sts_24xx_entry_t sts24; 1433 log_entry_t log; 1434 vp_control_entry_t vpc; 1435 vp_modify_entry_t vpm; 1436 vfy_menlo_entry_t mvfy; 1437 menlo_data_entry_t mdata; 1438 els_passthru_entry_t els; 1439 } ql_mbx_iocb_t; 1440 1441 /* 1442 * Global Data in ql_iocb.c source file. 1443 */ 1444 1445 /* 1446 * Global Function Prototypes in ql_iocb.c source file. 1447 */ 1448 void ql_start_iocb(ql_adapter_state_t *, ql_srb_t *); 1449 int ql_marker(ql_adapter_state_t *, uint16_t, ql_lun_t *lq, uint8_t); 1450 void ql_isp_rcvbuf(ql_adapter_state_t *); 1451 void ql_command_iocb(ql_adapter_state_t *, ql_request_q_t *, ql_srb_t *, 1452 void *); 1453 void ql_ms_iocb(ql_adapter_state_t *, ql_request_q_t *, ql_srb_t *, void *); 1454 void ql_ip_iocb(ql_adapter_state_t *, ql_request_q_t *, ql_srb_t *, void *); 1455 void ql_command_24xx_iocb(ql_adapter_state_t *, ql_request_q_t *, ql_srb_t *, 1456 void *); 1457 void ql_ms_24xx_iocb(ql_adapter_state_t *, ql_request_q_t *, ql_srb_t *, 1458 void *); 1459 void ql_ip_24xx_iocb(ql_adapter_state_t *, ql_request_q_t *, ql_srb_t *, 1460 void *); 1461 1462 #ifdef __cplusplus 1463 } 1464 #endif 1465 1466 #endif /* _QL_IOCB_H */ 1467