]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/scsi/qla2xxx/qla_def.h
[SCSI] qla2xxx: Correct queue-creation bug when driver loaded in QoS mode.
[net-next-2.6.git] / drivers / scsi / qla2xxx / qla_def.h
index 261c869dda2278886f1da00fb58d74a105383156..4e846ae928aa70726a12943c13af58497402d48d 100644 (file)
@@ -93,6 +93,7 @@
 #define LSD(x) ((uint32_t)((uint64_t)(x)))
 #define MSD(x) ((uint32_t)((((uint64_t)(x)) >> 16) >> 16))
 
+#define MAKE_HANDLE(x, y) ((uint32_t)((((uint32_t)(x)) << 16) | (uint32_t)(y)))
 
 /*
  * I/O register
 /* ISP request and response entry counts (37-65535) */
 #define REQUEST_ENTRY_CNT_2100         128     /* Number of request entries. */
 #define REQUEST_ENTRY_CNT_2200         2048    /* Number of request entries. */
-#define REQUEST_ENTRY_CNT_2XXX_EXT_MEM 4096    /* Number of request entries. */
-#define REQUEST_ENTRY_CNT_24XX         4096    /* Number of request entries. */
+#define REQUEST_ENTRY_CNT_24XX         2048    /* Number of request entries. */
 #define RESPONSE_ENTRY_CNT_2100                64      /* Number of response entries.*/
 #define RESPONSE_ENTRY_CNT_2300                512     /* Number of response entries.*/
+#define RESPONSE_ENTRY_CNT_MQ          128     /* Number of response entries.*/
 
 struct req_que;
 
@@ -187,7 +188,6 @@ struct req_que;
  * SCSI Request Block
  */
 typedef struct srb {
-       struct req_que *que;
        struct fc_port *fcport;
 
        struct scsi_cmnd *cmd;          /* Linux SCSI command pkt */
@@ -201,20 +201,7 @@ typedef struct srb {
 /*
  * SRB flag definitions
  */
-#define SRB_TIMEOUT            BIT_0   /* Command timed out */
-#define SRB_DMA_VALID          BIT_1   /* Command sent to ISP */
-#define SRB_WATCHDOG           BIT_2   /* Command on watchdog list */
-#define SRB_ABORT_PENDING      BIT_3   /* Command abort sent to device */
-
-#define SRB_ABORTED            BIT_4   /* Command aborted command already */
-#define SRB_RETRY              BIT_5   /* Command needs retrying */
-#define SRB_GOT_SENSE          BIT_6   /* Command has sense data */
-#define SRB_FAILOVER           BIT_7   /* Command in failover state */
-
-#define SRB_BUSY               BIT_8   /* Command is in busy retry state */
-#define SRB_FO_CANCEL          BIT_9   /* Command don't need to do failover */
-#define SRB_IOCTL              BIT_10  /* IOCTL command. */
-#define SRB_TAPE               BIT_11  /* FCP2 (Tape) command. */
+#define SRB_DMA_VALID          BIT_0   /* Command sent to ISP */
 
 /*
  * ISP I/O Register Set structure definitions.
@@ -620,6 +607,7 @@ typedef struct {
 #define MBC_GET_TIMEOUT_PARAMS         0x22    /* Get FW timeouts. */
 #define MBC_TRACE_CONTROL              0x27    /* Trace control command. */
 #define MBC_GEN_SYSTEM_ERROR           0x2a    /* Generate System Error. */
+#define MBC_WRITE_SFP                  0x30    /* Write SFP Data. */
 #define MBC_READ_SFP                   0x31    /* Read SFP Data. */
 #define MBC_SET_TIMEOUT_PARAMS         0x32    /* Set FW timeouts. */
 #define MBC_MID_INITIALIZE_FIRMWARE    0x48    /* MID Initialize firmware. */
@@ -1570,39 +1558,13 @@ typedef struct fc_port {
 #define FCS_DEVICE_DEAD                2
 #define FCS_DEVICE_LOST                3
 #define FCS_ONLINE             4
-#define FCS_NOT_SUPPORTED      5
-#define FCS_FAILOVER           6
-#define FCS_FAILOVER_FAILED    7
 
 /*
  * FC port flags.
  */
 #define FCF_FABRIC_DEVICE      BIT_0
 #define FCF_LOGIN_NEEDED       BIT_1
-#define FCF_FO_MASKED          BIT_2
-#define FCF_FAILOVER_NEEDED    BIT_3
-#define FCF_RESET_NEEDED       BIT_4
-#define FCF_PERSISTENT_BOUND   BIT_5
-#define FCF_TAPE_PRESENT       BIT_6
-#define FCF_FARP_DONE          BIT_7
-#define FCF_FARP_FAILED                BIT_8
-#define FCF_FARP_REPLY_NEEDED  BIT_9
-#define FCF_AUTH_REQ           BIT_10
-#define FCF_SEND_AUTH_REQ      BIT_11
-#define FCF_RECEIVE_AUTH_REQ   BIT_12
-#define FCF_AUTH_SUCCESS       BIT_13
-#define FCF_RLC_SUPPORT                BIT_14
-#define FCF_CONFIG             BIT_15  /* Needed? */
-#define FCF_RESCAN_NEEDED      BIT_16
-#define FCF_XP_DEVICE          BIT_17
-#define FCF_MSA_DEVICE         BIT_18
-#define FCF_EVA_DEVICE         BIT_19
-#define FCF_MSA_PORT_ACTIVE    BIT_20
-#define FCF_FAILBACK_DISABLE   BIT_21
-#define FCF_FAILOVER_DISABLE   BIT_22
-#define FCF_DSXXX_DEVICE       BIT_23
-#define FCF_AA_EVA_DEVICE      BIT_24
-#define FCF_AA_MSA_DEVICE      BIT_25
+#define FCF_TAPE_PRESENT       BIT_2
 
 /* No loop ID flag. */
 #define FC_NO_LOOP_ID          0x1000
@@ -2047,7 +2009,7 @@ typedef struct vport_params {
 #define VP_RET_CODE_NOT_FOUND          6
 
 struct qla_hw_data;
-
+struct rsp_que;
 /*
  * ISP operations
  */
@@ -2069,10 +2031,9 @@ struct isp_operations {
        void (*enable_intrs) (struct qla_hw_data *);
        void (*disable_intrs) (struct qla_hw_data *);
 
-       int (*abort_command) (struct scsi_qla_host *, srb_t *,
-               struct req_que *);
-       int (*target_reset) (struct fc_port *, unsigned int);
-       int (*lun_reset) (struct fc_port *, unsigned int);
+       int (*abort_command) (srb_t *);
+       int (*target_reset) (struct fc_port *, unsigned int, int);
+       int (*lun_reset) (struct fc_port *, unsigned int, int);
        int (*fabric_login) (struct scsi_qla_host *, uint16_t, uint8_t,
                uint8_t, uint8_t, uint16_t *, uint8_t);
        int (*fabric_logout) (struct scsi_qla_host *, uint16_t, uint8_t,
@@ -2118,7 +2079,6 @@ struct isp_operations {
 #define QLA_PCI_MSIX_CONTROL   0xa2
 
 struct scsi_qla_host;
-struct rsp_que;
 
 struct qla_msix_entry {
        int have_irq;
@@ -2179,7 +2139,6 @@ struct qla_statistics {
 #define MBC_INITIALIZE_MULTIQ 0x1f
 #define QLA_QUE_PAGE 0X1000
 #define QLA_MQ_SIZE 32
-#define QLA_MAX_HOST_QUES 16
 #define QLA_MAX_QUEUES 256
 #define ISP_QUE_REG(ha, id) \
        ((ha->mqenable) ? \
@@ -2209,6 +2168,8 @@ struct rsp_que {
        struct qla_hw_data *hw;
        struct qla_msix_entry *msix;
        struct req_que *req;
+       srb_t *status_srb; /* status continuation entry */
+       struct work_struct q_work;
 };
 
 /* Request queue data structure */
@@ -2257,10 +2218,11 @@ struct qla_hw_data {
                uint32_t        msix_enabled            :1;
                uint32_t        disable_serdes          :1;
                uint32_t        gpsc_supported          :1;
-               uint32_t        vsan_enabled            :1;
                uint32_t        npiv_supported          :1;
                uint32_t        fce_enabled             :1;
-               uint32_t        hw_event_marker_found:1;
+               uint32_t        fac_supported           :1;
+               uint32_t        chip_reset_done         :1;
+               uint32_t        port0                   :1;
        } flags;
 
        /* This spinlock is used to protect "io transactions", you must
@@ -2285,7 +2247,8 @@ struct qla_hw_data {
        struct rsp_que **rsp_q_map;
        unsigned long req_qid_map[(QLA_MAX_QUEUES / 8) / sizeof(unsigned long)];
        unsigned long rsp_qid_map[(QLA_MAX_QUEUES / 8) / sizeof(unsigned long)];
-       uint16_t        max_queues;
+       uint8_t         max_req_queues;
+       uint8_t         max_rsp_queues;
        struct qla_npiv_entry *npiv_info;
        uint16_t        nvram_npiv_size;
 
@@ -2294,6 +2257,9 @@ struct qla_hw_data {
 #define FLOGI_MID_SUPPORT       BIT_10
 #define FLOGI_VSAN_SUPPORT      BIT_12
 #define FLOGI_SP_SUPPORT        BIT_13
+
+       uint8_t         port_no;                /* Physical port of adapter */
+
        /* Timeout timers. */
        uint8_t         loop_down_abort_time;    /* port down timer */
        atomic_t        loop_down_timer;         /* loop down timer */
@@ -2301,7 +2267,6 @@ struct qla_hw_data {
        uint16_t        max_loop_id;
 
        uint16_t        fb_rev;
-       uint16_t        max_public_loop_ids;
        uint16_t        min_external_loopid;    /* First external loop Id */
 
 #define PORT_SPEED_UNKNOWN 0xFFFF
@@ -2382,6 +2347,8 @@ struct qla_hw_data {
                                IS_QLA25XX(ha) || IS_QLA81XX(ha))
 #define IS_NOPOLLING_TYPE(ha)  ((IS_QLA25XX(ha) || IS_QLA81XX(ha)) && \
                                (ha)->flags.msix_enabled)
+#define IS_FAC_REQUIRED(ha)    (IS_QLA81XX(ha))
+#define IS_NOCACHE_VPD_TYPE(ha)        (IS_QLA81XX(ha))
 
 #define IS_IIDMA_CAPABLE(ha)    ((ha)->device_type & DT_IIDMA)
 #define IS_FWI2_CAPABLE(ha)     ((ha)->device_type & DT_FWI2)
@@ -2426,6 +2393,18 @@ struct qla_hw_data {
        void            *sfp_data;
        dma_addr_t      sfp_data_dma;
 
+       uint8_t         *edc_data;
+       dma_addr_t      edc_data_dma;
+       uint16_t        edc_data_len;
+
+#define XGMAC_DATA_SIZE        PAGE_SIZE
+       void            *xgmac_data;
+       dma_addr_t      xgmac_data_dma;
+
+#define DCBX_TLV_DATA_SIZE PAGE_SIZE
+       void            *dcbx_tlv;
+       dma_addr_t      dcbx_tlv_dma;
+
        struct task_struct      *dpc_thread;
        uint8_t dpc_active;                  /* DPC routine is active */
 
@@ -2456,15 +2435,6 @@ struct qla_hw_data {
        struct completion mbx_cmd_comp; /* Serialize mbx access */
        struct completion mbx_intr_comp;  /* Used for completion notification */
 
-       uint32_t        mbx_flags;
-#define  MBX_IN_PROGRESS       BIT_0
-#define  MBX_BUSY              BIT_1   /* Got the Access */
-#define  MBX_SLEEPING_ON_SEM   BIT_2
-#define  MBX_POLLING_FOR_COMP  BIT_3
-#define  MBX_COMPLETED         BIT_4
-#define  MBX_TIMEDOUT          BIT_5
-#define  MBX_ACCESS_TIMEDOUT   BIT_6
-
        /* Basic firmware related information. */
        uint16_t        fw_major_version;
        uint16_t        fw_minor_version;
@@ -2476,6 +2446,7 @@ struct qla_hw_data {
 #define RISC_START_ADDRESS_2100 0x1000
 #define RISC_START_ADDRESS_2300 0x800
 #define RISC_START_ADDRESS_2400 0x100000
+       uint16_t        fw_xcb_count;
 
        uint16_t        fw_options[16];         /* slots: 1,2,3,10,11 */
        uint8_t         fw_seriallink_options[4];
@@ -2549,6 +2520,8 @@ struct qla_hw_data {
        uint32_t        flt_region_boot;
        uint32_t        flt_region_fw;
        uint32_t        flt_region_vpd_nvram;
+       uint32_t        flt_region_vpd;
+       uint32_t        flt_region_nvram;
        uint32_t        flt_region_npiv_conf;
 
        /* Needed for BEACON */
@@ -2576,6 +2549,7 @@ struct qla_hw_data {
        struct qla_chip_state_84xx *cs84xx;
        struct qla_statistics qla_stats;
        struct isp_operations *isp_ops;
+       struct workqueue_struct *wq;
 };
 
 /*
@@ -2617,38 +2591,19 @@ typedef struct scsi_qla_host {
 #define LOOP_RESYNC_ACTIVE     5
 #define LOCAL_LOOP_UPDATE      6       /* Perform a local loop update. */
 #define RSCN_UPDATE            7       /* Perform an RSCN update. */
-#define MAILBOX_RETRY          8
-#define ISP_RESET_NEEDED       9       /* Initiate a ISP reset. */
-#define FAILOVER_EVENT_NEEDED  10
-#define FAILOVER_EVENT         11
-#define FAILOVER_NEEDED                12
-#define SCSI_RESTART_NEEDED    13      /* Processes SCSI retry queue. */
-#define PORT_RESTART_NEEDED    14      /* Processes Retry queue. */
-#define RESTART_QUEUES_NEEDED  15      /* Restarts the Lun queue. */
-#define ABORT_QUEUES_NEEDED    16
-#define RELOGIN_NEEDED         17
-#define LOGIN_RETRY_NEEDED     18      /* Initiate required fabric logins. */
-#define REGISTER_FC4_NEEDED    19      /* SNS FC4 registration required. */
-#define ISP_ABORT_RETRY                20      /* ISP aborted. */
-#define FCPORT_RESCAN_NEEDED   21      /* IO descriptor processing needed */
-#define IODESC_PROCESS_NEEDED  22      /* IO descriptor processing needed */
-#define IOCTL_ERROR_RECOVERY   23
-#define LOOP_RESET_NEEDED      24
-#define BEACON_BLINK_NEEDED    25
-#define REGISTER_FDMI_NEEDED   26
-#define FCPORT_UPDATE_NEEDED   27
-#define VP_DPC_NEEDED          28      /* wake up for VP dpc handling */
-#define UNLOADING              29
-#define NPIV_CONFIG_NEEDED     30
+#define RELOGIN_NEEDED         8
+#define REGISTER_FC4_NEEDED    9       /* SNS FC4 registration required. */
+#define ISP_ABORT_RETRY                10      /* ISP aborted. */
+#define BEACON_BLINK_NEEDED    11
+#define REGISTER_FDMI_NEEDED   12
+#define FCPORT_UPDATE_NEEDED   13
+#define VP_DPC_NEEDED          14      /* wake up for VP dpc handling */
+#define UNLOADING              15
+#define NPIV_CONFIG_NEEDED     16
 
        uint32_t        device_flags;
-#define DFLG_LOCAL_DEVICES             BIT_0
-#define DFLG_RETRY_LOCAL_DEVICES       BIT_1
-#define DFLG_FABRIC_DEVICES            BIT_2
-#define SWITCH_FOUND                   BIT_3
-#define DFLG_NO_CABLE                  BIT_4
-
-       srb_t           *status_srb;    /* Status continuation entry. */
+#define SWITCH_FOUND           BIT_0
+#define DFLG_NO_CABLE          BIT_1
 
        /* ISP configuration data. */
        uint16_t        loop_id;                /* Host adapter loop id */
@@ -2675,6 +2630,11 @@ typedef struct scsi_qla_host {
        uint8_t         node_name[WWN_SIZE];
        uint8_t         port_name[WWN_SIZE];
        uint8_t         fabric_node_name[WWN_SIZE];
+
+       uint16_t        fcoe_vlan_id;
+       uint16_t        fcoe_fcf_idx;
+       uint8_t         fcoe_vn_port_mac[6];
+
        uint32_t        vp_abort_cnt;
 
        struct fc_vport *fc_vport;      /* holds fc_vport * for each vport */
@@ -2700,7 +2660,7 @@ typedef struct scsi_qla_host {
 #define VP_ERR_FAB_LOGOUT      4
 #define VP_ERR_ADAP_NORESOURCES        5
        struct qla_hw_data *hw;
-       int     req_ques[QLA_MAX_HOST_QUES];
+       struct req_que *req;
 } scsi_qla_host_t;
 
 /*
@@ -2759,10 +2719,5 @@ typedef struct scsi_qla_host {
 #include "qla_inline.h"
 
 #define CMD_SP(Cmnd)           ((Cmnd)->SCp.ptr)
-#define CMD_COMPL_STATUS(Cmnd)  ((Cmnd)->SCp.this_residual)
-#define CMD_RESID_LEN(Cmnd)    ((Cmnd)->SCp.buffers_residual)
-#define CMD_SCSI_STATUS(Cmnd)  ((Cmnd)->SCp.Status)
-#define CMD_ACTUAL_SNSLEN(Cmnd)        ((Cmnd)->SCp.Message)
-#define CMD_ENTRY_STATUS(Cmnd) ((Cmnd)->SCp.have_data_in)
 
 #endif