Print this page
NEX-5717 import QLogic 16G FC drivers
Reviewed by: Steve Peng <steve.peng@nexenta.com>
Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>


   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 2010 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-2010 QLOGIC CORPORATION              **
  38  * *                    ALL RIGHTS RESERVED                             **
  39  * *                                                                    **
  40  * ***********************************************************************
  41  *
  42  */
  43 
  44 #ifdef  __cplusplus
  45 extern "C" {
  46 #endif
  47 
  48 #define INVALID_ENTRY_TYPE      0



  49 







  50 /*
  51  * ISP queue -  32-Bit DMA addressing command with extended LUN support
  52  *              entry structure definition.
  53  */
  54 #define IOCB_CMD_TYPE_2         0x11    /* Command entry */
  55 #define MAX_CMDSZ               16      /* SCSI maximum CDB size. */
  56 #define CMD_TYPE_2_DATA_SEGMENTS        3       /* Number of data segments. */
  57 typedef struct cmd_entry {
  58         uint8_t  entry_type;            /* Entry type. */
  59         uint8_t  entry_count;           /* Entry count. */
  60         uint8_t  sys_define;            /* System defined. */
  61         uint8_t  entry_status;          /* Entry Status. */
  62         uint32_t handle;                /* System handle */
  63         uint8_t  target_l;              /* SCSI ID - LSB */
  64         uint8_t  target_h;              /* SCSI ID - MSB */
  65         uint8_t  lun_l;                 /* SCSI LUN - LSB */
  66         uint8_t  lun_h;                 /* SCSI LUN - MSB */
  67         uint8_t  control_flags_l;       /* Control flags - LSB. */
  68         uint8_t  control_flags_h;       /* Control flags - MSB. */
  69         uint8_t  reserved_1[2];
  70         uint16_t timeout;               /* Command timeout. */
  71         uint16_t dseg_count;            /* Data segment count - LSB. */
  72         uint8_t  scsi_cdb[MAX_CMDSZ];   /* SCSI command words. */
  73         uint32_t byte_count;            /* Total byte count. */
  74         uint32_t dseg_0_address;        /* Data segment 0 address. */
  75         uint32_t dseg_0_length;         /* Data segment 0 length. */
  76         uint32_t dseg_1_address;        /* Data segment 1 address. */
  77         uint32_t dseg_1_length;         /* Data segment 1 length. */
  78         uint32_t dseg_2_address;        /* Data segment 2 address. */
  79         uint32_t dseg_2_length;         /* Data segment 2 length. */
  80 } cmd_entry_t, request_t;
  81 
  82 /*
  83  * Command entry control flags least significant byte.
  84  */
  85 #define CF_HTAG         BIT_1
  86 #define CF_OTAG         BIT_2
  87 #define CF_STAG         BIT_3
  88 #define CF_DATA_IN      BIT_5
  89 #define CF_DATA_OUT     BIT_6
  90 
  91 /*
  92  * ISP24xx queue - Command IOCB structure definition.
  93  */
  94 #define IOCB_CMD_TYPE_7         0x18
  95 #define CMD_TYPE_7_DATA_SEGMENTS   1    /* Number of 64 bit data segments. */
  96 typedef struct cmd7_24xx_entry {
  97         uint8_t  entry_type;            /* Entry type. */
  98         uint8_t  entry_count;           /* Entry count. */
  99         uint8_t  sys_define;            /* System defined. */
 100         uint8_t  entry_status;          /* Entry Status. */
 101         uint32_t handle;                /* System handle */
 102         uint16_t n_port_hdl;
 103         uint16_t timeout;               /* Command timeout. */
 104         uint16_t dseg_count;
 105         uint8_t  reserved_1[2];
 106         uint8_t  fcp_lun[8];            /* SCSI LUN ID. */
 107         uint8_t  control_flags;
 108         uint8_t  task_mgmt;             /* Task management flags. */
 109         uint8_t  task;                  /* Task Attributes Values. */
 110         uint8_t  crn;                   /* Command reference number. */
 111         uint8_t  scsi_cdb[MAX_CMDSZ];   /* SCSI command bytes. */
 112         uint32_t total_byte_count;
 113         uint8_t  target_id[3];          /* SCSI Target ID */
 114         uint8_t  vp_index;
 115         uint32_t dseg_0_address[2];     /* Data segment 0 address. */
 116         uint32_t dseg_0_length;         /* Data segment 0 length. */
 117 } cmd7_24xx_entry_t;
 118 
 119 /*
 120  * ISP24xx queue - Command IOCB structure definition.
 121  */
 122 #define IOCB_CMD_TYPE_6         0x48
 123 #define CMD_TYPE_6_DATA_SEGMENTS   1    /* Number of 64 bit data segments. */
 124 typedef struct cmd6_24xx_entry {
 125         uint8_t  entry_type;            /* Entry type. */
 126         uint8_t  entry_count;           /* Entry count. */
 127         uint8_t  sys_define;            /* System defined. */
 128         uint8_t  entry_status;          /* Entry Status. */
 129         uint32_t handle;                /* System handle */
 130         uint16_t n_port_hdl;
 131         uint16_t timeout;               /* Command timeout. */
 132         uint16_t dseg_count;
 133         uint16_t rsp_length;
 134         uint8_t  fcp_lun[8];            /* SCSI LUN ID. */
 135         uint16_t control_flags;
 136         uint16_t cmnd_length;
 137         uint32_t cmnd_address[2];
 138         uint32_t rsp_address[2];        /* Data segment 0 address. */
 139         uint32_t total_byte_count;
 140         uint8_t  target_id[3];          /* SCSI Target ID */
 141         uint8_t  vp_index;
 142         uint32_t dseg_0_address[2];     /* Data segment 0 address. */
 143         uint32_t dseg_0_length;         /* Data segment 0 length. */
 144 } cmd6_24xx_entry_t;
 145 
 146 typedef struct fcp_cmnd {
 147         uint8_t         fcp_lun[8];             /* SCSI LUN ID. */
 148         uint8_t         crn;                    /* Command reference number. */
 149         uint8_t         task;                   /* Task Attributes Values. */
 150         uint8_t         task_mgmt;              /* Task management flags. */
 151         uint8_t         control_flags;          /* Plus additional cdb length */
 152         uint8_t         scsi_cdb[MAX_CMDSZ];
 153         uint32_t        dl;
 154 } fcp_cmnd_t;
 155 
 156 typedef struct cmd6_2400_dma {
 157         fcp_cmnd_t      cmd;
 158         uint32_t        cookie_list[QL_DMA_SG_LIST_LENGTH + 1][3];
 159 } cmd6_2400_dma_t;
 160 
 161 /*
 162  * Task Management Flags.
 163  */


 188  */
 189 #define IOCB_CMD_TYPE_3         0x19    /* Command Type 3 entry (64 bit) */
 190 #define CMD_TYPE_3_DATA_SEGMENTS   2    /* Number of 64 bit data segments. */
 191 typedef struct cmd_3_entry {
 192         uint8_t  entry_type;            /* Entry type. */
 193         uint8_t  entry_count;           /* Entry count. */
 194         uint8_t  sys_define;            /* System defined. */
 195         uint8_t  entry_status;          /* Entry Status. */
 196         uint32_t handle;                /* System handle */
 197         uint8_t  target_l;              /* SCSI ID - LSB */
 198         uint8_t  target_h;              /* SCSI ID - MSB */
 199         uint8_t  lun_l;                 /* SCSI LUN - LSB */
 200         uint8_t  lun_h;                 /* SCSI LUN - MSB */
 201         uint8_t  control_flags_l;       /* Control flags - LSB. */
 202         uint8_t  control_flags_h;       /* Control flags - MSB. */
 203         uint8_t  reserved_1[2];
 204         uint16_t timeout;               /* Command timeout. */
 205         uint16_t dseg_count;            /* Data segment count - LSB. */
 206         uint8_t  scsi_cdb[MAX_CMDSZ];   /* SCSI command words. */
 207         uint32_t byte_count;            /* Total byte count. */
 208         uint32_t dseg_0_address[2];     /* Data segment 0 address. */
 209         uint32_t dseg_0_length;         /* Data segment 0 length. */
 210         uint32_t dseg_1_address[2];     /* Data segment 1 address. */
 211         uint32_t dseg_1_length;         /* Data segment 1 length. */
 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;


 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         uint32_t dseg_0_address;        /* Data segment 0 address. */
 256         uint32_t dseg_0_length;         /* Data segment 0 length. */
 257         uint32_t dseg_1_address;        /* Data segment 1 address. */
 258         uint32_t dseg_1_length;         /* Data segment 1 length. */
 259         uint32_t dseg_2_address;        /* Data segment 2 address. */
 260         uint32_t dseg_2_length;         /* Data segment 2 length. */
 261         uint32_t dseg_3_address;        /* Data segment 3 address. */
 262         uint32_t dseg_3_length;         /* Data segment 3 length. */
 263         uint32_t dseg_4_address;        /* Data segment 4 address. */
 264         uint32_t dseg_4_length;         /* Data segment 4 length. */
 265         uint32_t dseg_5_address;        /* Data segment 5 address. */
 266         uint32_t dseg_5_length;         /* Data segment 5 length. */
 267         uint32_t dseg_6_address;        /* Data segment 6 address. */
 268         uint32_t dseg_6_length;         /* Data segment 6 length. */
 269 } cont_entry_t;
 270 
 271 /*
 272  * ISP queue - 64-Bit addressing, continuation entry structure definition.
 273  */
 274 #define CONTINUATION_TYPE_1     0x0A    /* Continuation Type 1 entry. */
 275 #define CONT_TYPE_1_DATA_SEGMENTS  5    /* Number of 64 bit data segments. */
 276 typedef struct cont_type_1_entry {
 277         uint8_t entry_type;             /* Entry type. */
 278         uint8_t entry_count;            /* Entry count. */
 279         uint8_t sys_define;             /* System defined. */
 280         uint8_t entry_status;           /* Entry Status. */
 281         uint32_t dseg_0_address[2];     /* Data segment 0 address. */
 282         uint32_t dseg_0_length;         /* Data segment 0 length. */
 283         uint32_t dseg_1_address[2];     /* Data segment 1 address. */
 284         uint32_t dseg_1_length;         /* Data segment 1 length. */
 285         uint32_t dseg_2_address[2];     /* Data segment 2 address. */
 286         uint32_t dseg_2_length;         /* Data segment 2 length. */
 287         uint32_t dseg_3_address[2];     /* Data segment 3 address. */
 288         uint32_t dseg_3_length;         /* Data segment 3 length. */
 289         uint32_t dseg_4_address[2];     /* Data segment 4 address. */
 290         uint32_t dseg_4_length;         /* Data segment 4 length. */
 291 } cont_type_1_entry_t;
 292 
 293 /*
 294  * ISP queue - status entry structure definition.
 295  */
 296 #define STATUS_TYPE     0x03            /* Status entry. */
 297 typedef struct sts_entry {
 298         uint8_t  entry_type;            /* Entry type. */
 299         uint8_t  entry_count;           /* Entry count. */
 300         uint8_t  sys_define;            /* System defined. */
 301         uint8_t  entry_status;          /* Entry Status. */
 302         uint32_t handle;                /* System handle. */
 303         uint8_t  scsi_status_l;         /* SCSI status - LSB. */
 304         uint8_t  scsi_status_h;         /* SCSI status - MSB. */
 305         uint16_t comp_status;           /* Completion status. */
 306         uint8_t  state_flags_l;         /* State flags - LSB. */
 307         uint8_t  state_flags_h;         /* State flags. */
 308         uint8_t  status_flags_l;        /* Status flags. */
 309         uint8_t  status_flags_h;        /* Status flags - MSB. */
 310         uint16_t rsp_info_length;       /* Response Info Length. */


 368 #define CS_TRANSPORT            0x3     /* Transport error. */
 369 #define CS_RESET                0x4     /* SCSI bus reset occurred */
 370 #define CS_ABORTED              0x5     /* System aborted command. */
 371 #define CS_TIMEOUT              0x6     /* Timeout error. */
 372 #define CS_DATA_OVERRUN         0x7     /* Data overrun. */
 373 #define CS_INVALID_RX_ID        0x8     /* Invalid RX_ID. */
 374 #define CS_DATA_REASSEM_ERROR   0x11    /* Data reassembly error. */
 375 #define CS_ABTS_REC             0x13    /* ABTS from target. */
 376 #define CS_DATA_UNDERRUN        0x15    /* Data Underrun. */
 377 #define CS_QUEUE_FULL           0x1C    /* Queue Full. */
 378 #define CS_PORT_UNAVAILABLE     0x28    /* Port unavailable */
 379                                         /* (selection timeout) */
 380 #define CS_PORT_LOGGED_OUT      0x29    /* Port Logged Out */
 381 #define CS_PORT_CONFIG_CHG      0x2A    /* Port Configuration Changed */
 382 #define CS_PORT_BUSY            0x2B    /* Port Busy */
 383 #define CS_RESOUCE_UNAVAILABLE  0x2C    /* Frimware resource unavailable. */
 384 #define CS_TASK_MGMT_OVERRUN    0x30    /* Task management overrun. */
 385 #define CS_LOGIN_LOGOUT_ERROR   0x31    /* login/logout IOCB error. */
 386 #define CS_SEQ_COMPLETE         0x40    /* Sequence Complete. */
 387 #define CS_ABORTED_SEQ_REC      0x47    /* Abort sequence was received. */

 388 #define CS_INVALID_PARAMETER    0x102   /* IP invalid_parameter. */
 389 #define CS_ERROR_RESOURCE       0x103   /* IP insufficient resources. */
 390 #define CS_IP_NOT_INITIALIZED   0x104   /* IP not_initialized. */
 391 
 392 #define CS_BAD_PAYLOAD          0x180   /* Driver defined */
 393 #define CS_UNKNOWN              0x181   /* Driver defined */
 394 #define CS_CMD_FAILED           0x182   /* Driver defined */
 395 #define CS_LOOP_DOWN_ABORT      0x183   /* Driver defined */
 396 #define CS_FCP_RESPONSE_ERROR   0x184   /* Driver defined */
 397 #define CS_DEVICE_UNAVAILABLE   0x185   /* Driver defined */
 398 /*
 399  * ISP24xx queue - Status IOCB structure definition.
 400  */
 401 typedef struct sts_24xx_entry {
 402         uint8_t  entry_type;            /* Entry type. */
 403         uint8_t  entry_count;           /* Entry count. */
 404         uint8_t  sys_define;            /* System defined. */
 405         uint8_t  entry_status;          /* Entry Status. */
 406         uint32_t handle;                /* System handle. */
 407         uint16_t comp_status;           /* Completion status. */


 486 #define MS_DATA_SEGMENTS        1       /* Number of data segments. */
 487 typedef struct ms_entry {
 488         uint8_t  entry_type;            /* Entry type. */
 489         uint8_t  entry_count;           /* Entry count. */
 490         uint8_t  sys_define;            /* System defined. */
 491         uint8_t  entry_status;          /* Entry Status. */
 492         uint32_t handle;                /* System handle */
 493         uint8_t  loop_id_l;             /* device id - LSB */
 494         uint8_t  loop_id_h;             /* device id - MSB */
 495         uint16_t comp_status;           /* Completion status */
 496         uint8_t  control_flags_l;       /* Control flags - LSB. */
 497         uint8_t  control_flags_h;       /* Control flags - MSB. */
 498         uint8_t  reserved_1[2];
 499         uint16_t timeout;               /* Command timeout. */
 500         uint8_t  cmd_dseg_count_l;      /* CMD segment count - LSB. */
 501         uint8_t  cmd_dseg_count_h;      /* CMD segment count - MSB. */
 502         uint16_t total_dseg_count;      /* CMD + RESP segment count. */
 503         uint8_t  reserved_2[10];
 504         uint32_t resp_byte_count;       /* Response byte count */
 505         uint32_t cmd_byte_count;        /* Command byte count */
 506         uint32_t dseg_0_address[2];     /* Data segment 0 address. */
 507         uint32_t dseg_0_length;         /* Data segment 0 length. */
 508         uint32_t dseg_1_address[2];     /* Data segment 1 address. */
 509         uint32_t dseg_1_length;         /* Data segment 1 length. */
 510 } ms_entry_t;
 511 


 512 /*
 513  * ISP24xx queue - CT Pass-Through IOCB structure definition.
 514  */
 515 #define CT_PASSTHRU_TYPE                0x29
 516 #define CT_PASSTHRU_DATA_SEGMENTS       1       /* Number of data segments. */
 517 typedef struct ct_passthru_entry {
 518         uint8_t  entry_type;            /* Entry type. */
 519         uint8_t  entry_count;           /* Entry count. */
 520         uint8_t  sys_define;            /* System defined. */
 521         uint8_t  entry_status;          /* Entry Status. */
 522         uint32_t handle;                /* System handle */
 523         uint16_t status;
 524         uint16_t n_port_hdl;
 525         uint16_t cmd_dseg_count;
 526         uint8_t  vp_index;
 527         uint8_t  reserved;
 528         uint16_t timeout;
 529         uint16_t reserved_1;
 530         uint16_t resp_dseg_count;
 531         uint8_t  reserved_2[10];
 532         uint32_t resp_byte_count;
 533         uint32_t cmd_byte_count;
 534         uint32_t dseg_0_address[2];     /* Data segment 0 address. */
 535         uint32_t dseg_0_length;         /* Data segment 0 length. */
 536         uint32_t dseg_1_address[2];     /* Data segment 1 address. */
 537         uint32_t dseg_1_length;         /* Data segment 1 length. */
 538 } ct_passthru_entry_t;
 539 
 540 /*
 541  * ISP24xx queue - ELS Pass-Through IOCB structure definition.
 542  */
 543 #define ELS_PASSTHRU_TYPE               0x53
 544 typedef struct els_passthru_entry {
 545         uint8_t  entry_type;            /* Entry type. */
 546         uint8_t  entry_count;           /* Entry count. */
 547         uint8_t  sys_define;            /* System defined. */
 548         uint8_t  entry_status;          /* Entry Status. */
 549         uint32_t handle;                /* System handle */
 550         uint16_t reserved_8_9;
 551         uint16_t n_port_hdl;
 552         uint16_t xmt_dseg_count;        /* Only one allowed */
 553         uint8_t  vp_index;
 554         uint8_t  sof_type;
 555         uint32_t rcv_exch_address;
 556         uint16_t rcv_dseg_count;
 557         uint8_t  els_cmd_opcode;
 558         uint8_t  reserved_17;
 559         uint8_t  d_id_7_0;
 560         uint8_t  d_id_15_8;
 561         uint8_t  d_id_23_16;
 562         uint8_t  s_id_23_16;
 563         uint8_t  s_id_7_0;
 564         uint8_t  s_id_15_8;
 565         uint16_t control_flags;
 566         uint32_t rcv_payld_data_bcnt;
 567         uint32_t xmt_payld_data_bcnt;
 568         uint32_t xmt_dseg_0_address[2]; /* Tx Data segment 0 address. */
 569         uint32_t xmt_dseg_0_length;     /* Tx Data segment 0 length.  */
 570         uint32_t rcv_dseg_0_address[2]; /* Rx Data segment 0 address. */
 571         uint32_t rcv_dseg_0_length;     /* Rx Data segment 0 length.  */
 572 } els_passthru_entry_t;
 573 
 574 /*
 575  * ISP24x queue - ELS Pass-Through IOCB response.
 576  */
 577 typedef struct els_passthru_entry_rsp {
 578         uint8_t  entry_type;            /* Entry type. */
 579         uint8_t  entry_count;           /* Entry count. */
 580         uint8_t  sys_define;            /* System defined. */
 581         uint8_t  entry_status;          /* Entry Status. */
 582         uint32_t handle;                /* System handle */
 583         uint16_t comp_status;
 584         uint16_t n_port_hdl;
 585         uint16_t reserved_c_d;
 586         uint8_t  vp_index;
 587         uint8_t  sof_type;
 588         uint32_t rcv_exch_addr;
 589         uint16_t reserved_14_15;
 590         uint8_t  els_cmd_opcode;
 591         uint8_t  reserved_17;


 939         uint32_t handle;                /* System handle */
 940         uint8_t  initiator_id_l;
 941         uint8_t  initiator_id_h;
 942         uint16_t rx_id;
 943         uint8_t  flags_l;
 944         uint8_t  flags_h;
 945         uint16_t status;
 946         uint16_t timeout;
 947         uint8_t  dseg_count_l;
 948         uint8_t  dseg_count_h;
 949         uint32_t relative_offset;
 950         uint32_t residual_transfer_length;
 951         uint8_t  reserved_1[4];
 952 
 953         union {
 954                 struct {
 955                         uint8_t  reserved_2[2];
 956                         uint8_t  scsi_status_l;
 957                         uint8_t  scsi_status_h;
 958                         uint32_t byte_count;
 959                         uint32_t dseg_0_address;
 960                         uint32_t dseg_0_length;
 961                         uint32_t dseg_1_address;
 962                         uint32_t dseg_1_length;
 963                         uint32_t dseg_2_address;
 964                         uint32_t dseg_2_length;
 965                 }s0_32bit;
 966 
 967                 struct {
 968                         uint8_t  reserved_3[2];
 969                         uint8_t  scsi_status_l;
 970                         uint8_t  scsi_status_h;
 971                         uint32_t byte_count;
 972                         uint32_t dseg_0_address[2];
 973                         uint32_t dseg_0_length;
 974                         uint32_t dseg_1_address[2];
 975                         uint32_t dseg_1_length;
 976                 }s0_64bit;
 977 
 978                 struct {
 979                         uint8_t  sense_length_l;
 980                         uint8_t  sense_length_h;
 981                         uint8_t  scsi_status_l;
 982                         uint8_t  scsi_status_h;
 983                         uint8_t  response_length_l;
 984                         uint8_t  response_length_h;
 985                         uint8_t  response_info[26];
 986                 }s1;
 987 
 988                 struct {
 989                         uint8_t  reserved_4[2];
 990                         uint32_t response_length;
 991                         uint32_t response_pointer;
 992                         uint8_t  reserved[16];
 993                 }s2;
 994         }type;
 995 } ctio_entry_t;


1008         uint16_t n_port_hdl;
1009         uint16_t timeout;
1010         uint16_t dseg_count;
1011         uint8_t  vp_index;
1012         uint8_t  flags;
1013         uint8_t initiator_id[3];
1014         uint8_t  reserved_1;
1015         uint32_t receive_exchange_address;
1016 
1017         union {
1018                 struct {
1019                         uint16_t reserved_2;
1020                         uint16_t flags;
1021                         uint32_t residual_length;
1022                         uint16_t ox_id;
1023                         uint16_t scsi_status;
1024                         uint32_t relative_offset;
1025                         uint32_t reserved_3;
1026                         uint32_t transfer_length;
1027                         uint32_t reserved_4;
1028                         uint32_t dseg_0_address_l;
1029                         uint32_t dseg_0_address_h;
1030                         uint32_t dseg_0_length;
1031                 }s0;
1032 
1033                 struct {
1034                         uint16_t sense_length;
1035                         uint16_t flags;
1036                         uint32_t residual_length;
1037                         uint16_t ox_id;
1038                         uint16_t scsi_status;
1039                         uint16_t response_length;
1040                         uint16_t reserved_2;
1041                         uint8_t  rsp_sense_data[24];
1042                 }s1;
1043 
1044                 struct {
1045                         uint16_t reserved_2;
1046                         uint16_t flags;
1047                         uint32_t residual_length;
1048                         uint16_t ox_id;
1049                         uint8_t  reserved_3[10];
1050                         uint32_t transfer_length;
1051                         uint32_t reserved_4;
1052                         uint32_t dseg_0_address_l;
1053                         uint32_t dseg_0_address_h;
1054                         uint32_t dseg_0_length;
1055                 }s2;
1056         }type;
1057 } ctio_snd_entry_t;
1058 
1059 /*
1060  * ISP24xx queue -      Continue Target I/O IOCBs from the ISP24xx
1061  *              Firmware structure definition.
1062  */
1063 typedef struct ctio_rcv_entry {
1064         uint8_t  entry_type;            /* Entry type. */
1065         uint8_t  entry_count;           /* Entry count. */
1066         uint8_t  sys_define;            /* System defined. */
1067         uint8_t  entry_status;          /* Entry Status. */
1068         uint32_t handle;
1069         uint16_t status;
1070         uint16_t timeout;
1071         uint16_t dseg_count;
1072         uint8_t  reserved[6];
1073 
1074         uint8_t  vp_index;
1075         uint8_t  flags;
1076         uint8_t initiator_id[3];
1077         uint8_t  reserved_1;
1078         uint32_t receive_exchange_address;
1079 
1080         union {
1081                 struct {
1082                         uint16_t reserved_2;
1083                         uint16_t flags;
1084                         uint32_t residual_length;
1085                         uint16_t ox_id;
1086                         uint16_t scsi_status;
1087                         uint32_t relative_offset;
1088                         uint32_t reserved_3;
1089                         uint32_t transfer_length;
1090                         uint32_t reserved_4;
1091                         uint32_t dseg_0_address_l;
1092                         uint32_t dseg_0_address_h;
1093                         uint32_t dseg_0_length;
1094                 }s0;
1095 
1096                 struct {
1097                         uint16_t sense_length;
1098                         uint16_t flags;
1099                         uint32_t residual_length;
1100                         uint16_t ox_id;
1101                         uint16_t scsi_status;
1102                         uint16_t response_length;
1103                         uint16_t reserved_2;
1104                         uint8_t  rsp_sense_data[24];
1105                 }s1;
1106 
1107                 struct {
1108                         uint16_t reserved_2;
1109                         uint16_t flags;
1110                         uint32_t residual_length;
1111                         uint16_t ox_id;
1112                         uint8_t  reserved_3[10];
1113                         uint32_t transfer_length;
1114                         uint32_t reserved_4;
1115                         uint32_t dseg_0_address_l;
1116                         uint32_t dseg_0_address_h;
1117                         uint32_t dseg_0_length;
1118                 }s2;
1119         }type;
1120 } ctio_rcv_entry_t;
1121 
1122 /*
1123  * ISP queue -  32-Bit DMA addressing IP entry structure definition.
1124  */
1125 #define IP_TYPE                 0x13
1126 #define IP_DATA_SEGMENTS        3       /* Number of data segments. */
1127 typedef struct ip_entry {
1128         uint8_t  entry_type;            /* Entry type. */
1129         uint8_t  entry_count;           /* Entry count. */
1130         uint8_t  sys_define;            /* System defined. */
1131         uint8_t  entry_status;          /* Entry Status. */
1132         uint32_t handle;                /* System handle */
1133         uint8_t  loop_id_l;             /* device id - LSB */
1134         uint8_t  loop_id_h;             /* device id - MSB */
1135         uint16_t comp_status;           /* Completion status. */
1136         uint8_t  control_flags_l;       /* Control flags - LSB. */
1137         uint8_t  control_flags_h;       /* Control flags - MSB. */
1138         uint8_t  reserved_1[2];
1139         uint16_t timeout;               /* Command timeout. */
1140         uint16_t dseg_count;            /* Data segment count. */
1141         uint8_t  reserved_2[16];
1142         uint32_t byte_count;            /* Total byte count. */
1143         uint32_t dseg_0_address;        /* Data segment 0 address. */
1144         uint32_t dseg_0_length;         /* Data segment 0 length. */
1145         uint32_t dseg_1_address;        /* Data segment 1 address. */
1146         uint32_t dseg_1_length;         /* Data segment 1 length. */
1147         uint32_t dseg_2_address;        /* Data segment 2 address. */
1148         uint32_t dseg_2_length;         /* Data segment 2 length. */
1149 } ip_entry_t;
1150 
1151 /*
1152  * ISP queue -  64-Bit DMA addressing IP entry structure definition.
1153  */
1154 #define IP_A64_TYPE             0x1B
1155 #define IP_A64_DATA_SEGMENTS    2       /* Number of data segments. */
1156 typedef struct ip_a64_entry {
1157         uint8_t  entry_type;            /* Entry type. */
1158         uint8_t  entry_count;           /* Entry count. */
1159         uint8_t  sys_define;            /* System defined. */
1160         uint8_t  entry_status;          /* Entry Status. */
1161         uint32_t handle;                /* System handle */
1162         uint8_t  reserved;
1163         uint8_t  loop_id;               /* Loop ID */
1164         uint16_t comp_status;           /* Completion status. */
1165         uint8_t  control_flags_l;       /* Control flags - LSB. */
1166         uint8_t  control_flags_h;       /* Control flags - MSB. */
1167         uint8_t  reserved_1[2];
1168         uint16_t timeout;               /* Command timeout. */
1169         uint16_t dseg_count;            /* Data segment count. */
1170         uint8_t  reserved_2[16];
1171         uint32_t byte_count;            /* Total byte count. */
1172         uint32_t dseg_0_address[2];     /* Data segment 0 address. */
1173         uint32_t dseg_0_length;         /* Data segment 0 length. */
1174         uint32_t dseg_1_address[2];     /* Data segment 1 address. */
1175         uint32_t dseg_1_length;         /* Data segment 1 length. */
1176 } ip_a64_entry_t;
1177 
1178 /*
1179  * ISP24xx queue - IP command entry structure definition.
1180  */
1181 #define IP_CMD_TYPE             0x3B
1182 #define IP_CMD_DATA_SEGMENTS    1
1183 typedef struct ip_cmd_entry {
1184         uint8_t  entry_type;            /* Entry type. */
1185         uint8_t  entry_count;           /* Entry count. */
1186         uint8_t  sys_define;            /* System defined. */
1187         uint8_t  entry_status;          /* Entry Status. */
1188         uint32_t handle;                /* System handle. */
1189         uint16_t hdl_status;            /* N_port hdl or Completion status */
1190         uint16_t timeout_hdl;           /* N_port hdl or Command timeout */
1191         uint16_t dseg_count;            /* Data segment count. */
1192         uint8_t  reserved_1[6];
1193         uint32_t exch_addr;
1194         uint16_t control_flags;
1195         uint16_t frame_hdr_cntrl_flgs;
1196         uint8_t  reserved_2[12];
1197         uint32_t sys_define_2;
1198         uint32_t byte_count;            /* Total byte count. */
1199         uint8_t  reserved_3[4];
1200         uint32_t dseg_0_address[2];     /* Data segment 0 address. */
1201         uint32_t dseg_0_length;         /* Data segment 0 length. */
1202 } ip_cmd_entry_t;
1203 
1204 /*
1205  * IP command Control Flags.
1206  */
1207 #define IPCF_TERMINATE_EXCH     BIT_1
1208 /*
1209  * IP command Frame Header Control Flags.
1210  */
1211 #define IPCF_FIRST_SEQ          BIT_5
1212 #define IPCF_LAST_SEQ           BIT_4
1213 
1214 /*
1215  * ISP queue - Receive IP buffer entry structure definition.
1216  */
1217 #define IP_RCVBUF_HANDLES       24      /* Buffer handles in entry. */
1218 #define IP_RECEIVE_TYPE         0x23    /* IP receive entry */
1219 typedef struct ip_rcv_entry {
1220         uint8_t  entry_type;            /* Entry type. */
1221         uint8_t  entry_count;           /* Entry count. */


1350 
1351 /*
1352  * ISP2400 VP control commands
1353  */
1354 #define VPC_ENABLE              0x0
1355 #define VPC_DISABLE             0x8
1356 #define VPC_DISABLE_INIT        0x9     /* Only 2400 & 2500 */
1357 #define VPC_DISABLE_LOGOUT      0xa
1358 #define VPC_DISABLE_LOGOUT_ALL  0xb
1359 
1360 /*
1361  * ISP2400 queue - Report ID Acquisition IOCB structure definition.
1362  */
1363 #define REPORT_ID_TYPE          0x32
1364 typedef struct report_id_0 {
1365         uint8_t  entry_type;            /* Entry type. */
1366         uint8_t  entry_count;           /* Entry count. */
1367         uint8_t  sys_define;            /* System defined. */
1368         uint8_t  entry_status;          /* Entry Status. */
1369         uint32_t handle;                /* System handle */
1370         uint8_t  acq_cnt;               /* format 0 acquired, format 1 count */
1371         uint8_t  setup;                 /* format 0 */
1372         uint8_t  reserved[2];
1373         uint8_t  port_id[3];
1374         uint8_t  format;
1375         uint8_t  vp_index[16];
1376         uint8_t  reserved_1[32];
1377 } report_id_0_t;
1378 
1379 typedef struct report_id_1 {
1380         uint8_t  entry_type;            /* Entry type. */
1381         uint8_t  entry_count;           /* Entry count. */
1382         uint8_t  sys_define;            /* System defined. */
1383         uint8_t  entry_status;          /* Entry Status. */
1384         uint32_t handle;                /* System handle */
1385         uint16_t vp_count;
1386         uint8_t  vp_index;
1387         uint8_t  status;
1388         uint8_t  port_id[3];
1389         uint8_t  format;
1390         uint8_t  reserved[48];
1391 } report_id_1_t;
1392 
























1393 /*
1394  * ISP2400 queue - Verify Menlo FW entry structure definition.
1395  */
1396 #define VERIFY_MENLO_TYPE       0x1b
1397 typedef struct vfy_menlo_entry {
1398         uint8_t  entry_type;            /* Entry type. */
1399         uint8_t  entry_count;           /* Entry count. */
1400         uint8_t  sys_define;            /* System defined. */
1401         uint8_t  entry_status;          /* Entry Status. */
1402         uint32_t handle;                /* System handle */
1403         uint16_t options_status;
1404         uint16_t failure_code;
1405         uint16_t dseg_count;
1406         uint16_t reserved_1[3];
1407         uint32_t fw_version;
1408         uint32_t exch_addr;
1409         uint32_t reserved_2[3];
1410         uint32_t fw_size;
1411         uint32_t fw_sequence_size;
1412         uint32_t relative_offset;
1413         uint32_t dseg_0_address[2];     /* Data segment 0 address. */
1414         uint32_t dseg_0_length;         /* Data segment 0 length. */
1415 } vfy_menlo_entry_t;
1416 
1417 /*
1418  * Option Flags.
1419  */
1420 #define VMO_DSD_CHAINING        BIT_15
1421 #define VM_END_OF_DATA          BIT_14
1422 #define VMF_DIAGNOSTIC_FW       BIT_3
1423 #define VMF_DO_NOT_RESET        BIT_2
1424 #define VMF_FORCE_UPDATE_FW     BIT_1
1425 #define VMF_DO_NOT_UPDATE_FW    BIT_0
1426 
1427 /*
1428  * ISP2400 queue - Access Menlo Data entry structure definition.
1429  */
1430 #define MENLO_DATA_TYPE         0x2b
1431 typedef struct menlo_data_entry {
1432         uint8_t  entry_type;            /* Entry type. */
1433         uint8_t  entry_count;           /* Entry count. */
1434         uint8_t  sys_define;            /* System defined. */
1435         uint8_t  entry_status;          /* Entry Status. */
1436         uint32_t handle;                /* System handle */
1437         uint16_t options_status;
1438         uint16_t failure_code;
1439         uint16_t dseg_count;
1440         uint16_t reserved_1[3];
1441         uint32_t parameter_1;
1442         uint32_t parameter_2;
1443         uint32_t parameter_3;
1444         uint32_t reserved_2[3];
1445         uint32_t total_byte_count;
1446         uint32_t reserved_3;
1447         uint32_t dseg_0_address[2];     /* Data segment 0 address. */
1448         uint32_t dseg_0_length;         /* Data segment 0 length. */
1449 } menlo_data_entry_t;
1450 
1451 /*
1452  * Mailbox IOCB.
1453  */
1454 typedef union ql_mbx_iocb {
1455         cmd_entry_t             cmd;
1456         cmd_3_entry_t           cmd3;
1457         cmd7_24xx_entry_t       cmd24;
1458         ms_entry_t              ms;
1459         ct_passthru_entry_t     ms24;
1460         abort_cmd_entry_t       abo;
1461         task_mgmt_entry_t       mgmt;
1462         sts_entry_t             sts;
1463         sts_24xx_entry_t        sts24;
1464         log_entry_t             log;
1465         vp_control_entry_t      vpc;
1466         vp_modify_entry_t       vpm;
1467         vfy_menlo_entry_t       mvfy;
1468         menlo_data_entry_t      mdata;

1469 } ql_mbx_iocb_t;
1470 
1471 /*
1472  * Global Data in ql_iocb.c source file.
1473  */
1474 
1475 /*
1476  * Global Function Prototypes in ql_iocb.c source file.
1477  */
1478 void ql_start_iocb(ql_adapter_state_t *, ql_srb_t *);
1479 void ql_isp_cmd(ql_adapter_state_t *);
1480 int ql_marker(ql_adapter_state_t *, uint16_t, uint16_t, uint8_t);
1481 void ql_isp_rcvbuf(ql_adapter_state_t *);
1482 void ql_command_iocb(ql_adapter_state_t *, ql_srb_t *, void *);
1483 void ql_ms_iocb(ql_adapter_state_t *, ql_srb_t *, void *);
1484 void ql_ip_iocb(ql_adapter_state_t *, ql_srb_t *, void *);
1485 void ql_command_24xx_iocb(ql_adapter_state_t *, ql_srb_t *, void *);
1486 void ql_ms_24xx_iocb(ql_adapter_state_t *, ql_srb_t *, void *);
1487 void ql_ip_24xx_iocb(ql_adapter_state_t *, ql_srb_t *, void *);
1488 void ql_els_24xx_iocb(ql_adapter_state_t *, ql_srb_t *, void *);



1489 
1490 #ifdef  __cplusplus
1491 }
1492 #endif
1493 
1494 #endif /* _QL_IOCB_H */


   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  */


 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;


 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. */


 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. */


 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;


 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;


 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. */


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 */