aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/qla2xxx/qla_def.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_def.h')
-rw-r--r--drivers/scsi/qla2xxx/qla_def.h166
1 files changed, 156 insertions, 10 deletions
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 39007f53aec0..a9725bf5527b 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -1,6 +1,6 @@
1/* 1/*
2 * QLogic Fibre Channel HBA Driver 2 * QLogic Fibre Channel HBA Driver
3 * Copyright (c) 2003-2011 QLogic Corporation 3 * Copyright (c) 2003-2012 QLogic Corporation
4 * 4 *
5 * See LICENSE.qla2xxx for copyright and licensing details. 5 * See LICENSE.qla2xxx for copyright and licensing details.
6 */ 6 */
@@ -115,6 +115,82 @@
115#define WRT_REG_DWORD(addr, data) writel(data,addr) 115#define WRT_REG_DWORD(addr, data) writel(data,addr)
116 116
117/* 117/*
118 * ISP83XX specific remote register addresses
119 */
120#define QLA83XX_LED_PORT0 0x00201320
121#define QLA83XX_LED_PORT1 0x00201328
122#define QLA83XX_IDC_DEV_STATE 0x22102384
123#define QLA83XX_IDC_MAJOR_VERSION 0x22102380
124#define QLA83XX_IDC_MINOR_VERSION 0x22102398
125#define QLA83XX_IDC_DRV_PRESENCE 0x22102388
126#define QLA83XX_IDC_DRIVER_ACK 0x2210238c
127#define QLA83XX_IDC_CONTROL 0x22102390
128#define QLA83XX_IDC_AUDIT 0x22102394
129#define QLA83XX_IDC_LOCK_RECOVERY 0x2210239c
130#define QLA83XX_DRIVER_LOCKID 0x22102104
131#define QLA83XX_DRIVER_LOCK 0x8111c028
132#define QLA83XX_DRIVER_UNLOCK 0x8111c02c
133#define QLA83XX_FLASH_LOCKID 0x22102100
134#define QLA83XX_FLASH_LOCK 0x8111c010
135#define QLA83XX_FLASH_UNLOCK 0x8111c014
136#define QLA83XX_DEV_PARTINFO1 0x221023e0
137#define QLA83XX_DEV_PARTINFO2 0x221023e4
138#define QLA83XX_FW_HEARTBEAT 0x221020b0
139#define QLA83XX_PEG_HALT_STATUS1 0x221020a8
140#define QLA83XX_PEG_HALT_STATUS2 0x221020ac
141
142/* 83XX: Macros defining 8200 AEN Reason codes */
143#define IDC_DEVICE_STATE_CHANGE BIT_0
144#define IDC_PEG_HALT_STATUS_CHANGE BIT_1
145#define IDC_NIC_FW_REPORTED_FAILURE BIT_2
146#define IDC_HEARTBEAT_FAILURE BIT_3
147
148/* 83XX: Macros defining 8200 AEN Error-levels */
149#define ERR_LEVEL_NON_FATAL 0x1
150#define ERR_LEVEL_RECOVERABLE_FATAL 0x2
151#define ERR_LEVEL_UNRECOVERABLE_FATAL 0x4
152
153/* 83XX: Macros for IDC Version */
154#define QLA83XX_SUPP_IDC_MAJOR_VERSION 0x01
155#define QLA83XX_SUPP_IDC_MINOR_VERSION 0x0
156
157/* 83XX: Macros for scheduling dpc tasks */
158#define QLA83XX_NIC_CORE_RESET 0x1
159#define QLA83XX_IDC_STATE_HANDLER 0x2
160#define QLA83XX_NIC_CORE_UNRECOVERABLE 0x3
161
162/* 83XX: Macros for defining IDC-Control bits */
163#define QLA83XX_IDC_RESET_DISABLED BIT_0
164#define QLA83XX_IDC_GRACEFUL_RESET BIT_1
165
166/* 83XX: Macros for different timeouts */
167#define QLA83XX_IDC_INITIALIZATION_TIMEOUT 30
168#define QLA83XX_IDC_RESET_ACK_TIMEOUT 10
169#define QLA83XX_MAX_LOCK_RECOVERY_WAIT (2 * HZ)
170
171/* 83XX: Macros for defining class in DEV-Partition Info register */
172#define QLA83XX_CLASS_TYPE_NONE 0x0
173#define QLA83XX_CLASS_TYPE_NIC 0x1
174#define QLA83XX_CLASS_TYPE_FCOE 0x2
175#define QLA83XX_CLASS_TYPE_ISCSI 0x3
176
177/* 83XX: Macros for IDC Lock-Recovery stages */
178#define IDC_LOCK_RECOVERY_STAGE1 0x1 /* Stage1: Intent for
179 * lock-recovery
180 */
181#define IDC_LOCK_RECOVERY_STAGE2 0x2 /* Stage2: Perform lock-recovery */
182
183/* 83XX: Macros for IDC Audit type */
184#define IDC_AUDIT_TIMESTAMP 0x0 /* IDC-AUDIT: Record timestamp of
185 * dev-state change to NEED-RESET
186 * or NEED-QUIESCENT
187 */
188#define IDC_AUDIT_COMPLETION 0x1 /* IDC-AUDIT: Record duration of
189 * reset-recovery completion is
190 * second
191 */
192
193/*
118 * The ISP2312 v2 chip cannot access the FLASH/GPIO registers via MMIO in an 194 * The ISP2312 v2 chip cannot access the FLASH/GPIO registers via MMIO in an
119 * 133Mhz slot. 195 * 133Mhz slot.
120 */ 196 */
@@ -129,6 +205,7 @@
129#define MAX_FIBRE_DEVICES_2400 2048 205#define MAX_FIBRE_DEVICES_2400 2048
130#define MAX_FIBRE_DEVICES_LOOP 128 206#define MAX_FIBRE_DEVICES_LOOP 128
131#define MAX_FIBRE_DEVICES_MAX MAX_FIBRE_DEVICES_2400 207#define MAX_FIBRE_DEVICES_MAX MAX_FIBRE_DEVICES_2400
208#define LOOPID_MAP_SIZE (ha->max_fibre_devices)
132#define MAX_FIBRE_LUNS 0xFFFF 209#define MAX_FIBRE_LUNS 0xFFFF
133#define MAX_HOST_COUNT 16 210#define MAX_HOST_COUNT 16
134 211
@@ -259,6 +336,7 @@ struct srb_iocb {
259#define SRB_ADISC_CMD 6 336#define SRB_ADISC_CMD 6
260#define SRB_TM_CMD 7 337#define SRB_TM_CMD 7
261#define SRB_SCSI_CMD 8 338#define SRB_SCSI_CMD 8
339#define SRB_BIDI_CMD 9
262 340
263typedef struct srb { 341typedef struct srb {
264 atomic_t ref_count; 342 atomic_t ref_count;
@@ -594,6 +672,20 @@ typedef struct {
594#define MBA_DISCARD_RND_FRAME 0x8048 /* discard RND frame due to error. */ 672#define MBA_DISCARD_RND_FRAME 0x8048 /* discard RND frame due to error. */
595#define MBA_REJECTED_FCP_CMD 0x8049 /* rejected FCP_CMD. */ 673#define MBA_REJECTED_FCP_CMD 0x8049 /* rejected FCP_CMD. */
596 674
675/* 83XX FCoE specific */
676#define MBA_IDC_AEN 0x8200 /* FCoE: NIC Core state change AEN */
677
678/* Interrupt type codes */
679#define INTR_ROM_MB_SUCCESS 0x1
680#define INTR_ROM_MB_FAILED 0x2
681#define INTR_MB_SUCCESS 0x10
682#define INTR_MB_FAILED 0x11
683#define INTR_ASYNC_EVENT 0x12
684#define INTR_RSP_QUE_UPDATE 0x13
685#define INTR_RSP_QUE_UPDATE_83XX 0x14
686#define INTR_ATIO_QUE_UPDATE 0x1C
687#define INTR_ATIO_RSP_QUE_UPDATE 0x1D
688
597/* ISP mailbox loopback echo diagnostic error code */ 689/* ISP mailbox loopback echo diagnostic error code */
598#define MBS_LB_RESET 0x17 690#define MBS_LB_RESET 0x17
599/* 691/*
@@ -718,6 +810,7 @@ typedef struct {
718#define MBC_SEND_RNFT_ELS 0x5e /* Send RNFT ELS request */ 810#define MBC_SEND_RNFT_ELS 0x5e /* Send RNFT ELS request */
719#define MBC_GET_LINK_PRIV_STATS 0x6d /* Get link & private data. */ 811#define MBC_GET_LINK_PRIV_STATS 0x6d /* Get link & private data. */
720#define MBC_SET_VENDOR_ID 0x76 /* Set Vendor ID. */ 812#define MBC_SET_VENDOR_ID 0x76 /* Set Vendor ID. */
813#define MBC_PORT_RESET 0x120 /* Port Reset */
721#define MBC_SET_PORT_CONFIG 0x122 /* Set port configuration */ 814#define MBC_SET_PORT_CONFIG 0x122 /* Set port configuration */
722#define MBC_GET_PORT_CONFIG 0x123 /* Get port configuration */ 815#define MBC_GET_PORT_CONFIG 0x123 /* Get port configuration */
723 816
@@ -1375,9 +1468,10 @@ typedef struct {
1375} cont_a64_entry_t; 1468} cont_a64_entry_t;
1376 1469
1377#define PO_MODE_DIF_INSERT 0 1470#define PO_MODE_DIF_INSERT 0
1378#define PO_MODE_DIF_REMOVE BIT_0 1471#define PO_MODE_DIF_REMOVE 1
1379#define PO_MODE_DIF_PASS BIT_1 1472#define PO_MODE_DIF_PASS 2
1380#define PO_MODE_DIF_REPLACE (BIT_0 + BIT_1) 1473#define PO_MODE_DIF_REPLACE 3
1474#define PO_MODE_DIF_TCP_CKSUM 6
1381#define PO_ENABLE_DIF_BUNDLING BIT_8 1475#define PO_ENABLE_DIF_BUNDLING BIT_8
1382#define PO_ENABLE_INCR_GUARD_SEED BIT_3 1476#define PO_ENABLE_INCR_GUARD_SEED BIT_3
1383#define PO_DISABLE_INCR_REF_TAG BIT_5 1477#define PO_DISABLE_INCR_REF_TAG BIT_5
@@ -1509,6 +1603,13 @@ typedef struct {
1509#define CS_RETRY 0x82 /* Driver defined */ 1603#define CS_RETRY 0x82 /* Driver defined */
1510#define CS_LOOP_DOWN_ABORT 0x83 /* Driver defined */ 1604#define CS_LOOP_DOWN_ABORT 0x83 /* Driver defined */
1511 1605
1606#define CS_BIDIR_RD_OVERRUN 0x700
1607#define CS_BIDIR_RD_WR_OVERRUN 0x707
1608#define CS_BIDIR_RD_OVERRUN_WR_UNDERRUN 0x715
1609#define CS_BIDIR_RD_UNDERRUN 0x1500
1610#define CS_BIDIR_RD_UNDERRUN_WR_OVERRUN 0x1507
1611#define CS_BIDIR_RD_WR_UNDERRUN 0x1515
1612#define CS_BIDIR_DMA 0x200
1512/* 1613/*
1513 * Status entry status flags 1614 * Status entry status flags
1514 */ 1615 */
@@ -2373,6 +2474,11 @@ struct qla_statistics {
2373 uint64_t output_bytes; 2474 uint64_t output_bytes;
2374}; 2475};
2375 2476
2477struct bidi_statistics {
2478 unsigned long long io_count;
2479 unsigned long long transfer_bytes;
2480};
2481
2376/* Multi queue support */ 2482/* Multi queue support */
2377#define MBC_INITIALIZE_MULTIQ 0x1f 2483#define MBC_INITIALIZE_MULTIQ 0x1f
2378#define QLA_QUE_PAGE 0X1000 2484#define QLA_QUE_PAGE 0X1000
@@ -2509,14 +2615,16 @@ struct qla_hw_data {
2509 uint32_t disable_msix_handshake :1; 2615 uint32_t disable_msix_handshake :1;
2510 uint32_t fcp_prio_enabled :1; 2616 uint32_t fcp_prio_enabled :1;
2511 uint32_t isp82xx_fw_hung:1; 2617 uint32_t isp82xx_fw_hung:1;
2618 uint32_t nic_core_hung:1;
2512 2619
2513 uint32_t quiesce_owner:1; 2620 uint32_t quiesce_owner:1;
2514 uint32_t thermal_supported:1; 2621 uint32_t thermal_supported:1;
2515 uint32_t isp82xx_reset_hdlr_active:1; 2622 uint32_t nic_core_reset_hdlr_active:1;
2516 uint32_t isp82xx_reset_owner:1; 2623 uint32_t nic_core_reset_owner:1;
2517 uint32_t isp82xx_no_md_cap:1; 2624 uint32_t isp82xx_no_md_cap:1;
2518 uint32_t host_shutting_down:1; 2625 uint32_t host_shutting_down:1;
2519 /* 30 bits */ 2626 uint32_t idc_compl_status:1;
2627 /* 32 bits */
2520 } flags; 2628 } flags;
2521 2629
2522 /* This spinlock is used to protect "io transactions", you must 2630 /* This spinlock is used to protect "io transactions", you must
@@ -2670,6 +2778,16 @@ struct qla_hw_data {
2670#define HAS_EXTENDED_IDS(ha) ((ha)->device_type & DT_EXTENDED_IDS) 2778#define HAS_EXTENDED_IDS(ha) ((ha)->device_type & DT_EXTENDED_IDS)
2671#define IS_CT6_SUPPORTED(ha) ((ha)->device_type & DT_CT6_SUPPORTED) 2779#define IS_CT6_SUPPORTED(ha) ((ha)->device_type & DT_CT6_SUPPORTED)
2672#define IS_MQUE_CAPABLE(ha) ((ha)->mqenable || IS_QLA83XX(ha)) 2780#define IS_MQUE_CAPABLE(ha) ((ha)->mqenable || IS_QLA83XX(ha))
2781#define IS_BIDI_CAPABLE(ha) ((IS_QLA25XX(ha) || IS_QLA2031(ha)))
2782/* Bit 21 of fw_attributes decides the MCTP capabilities */
2783#define IS_MCTP_CAPABLE(ha) (IS_QLA2031(ha) && \
2784 ((ha)->fw_attributes_ext[0] & BIT_0))
2785#define IS_PI_UNINIT_CAPABLE(ha) (IS_QLA83XX(ha))
2786#define IS_PI_IPGUARD_CAPABLE(ha) (IS_QLA83XX(ha))
2787#define IS_PI_DIFB_DIX0_CAPABLE(ha) (0)
2788#define IS_PI_SPLIT_DET_CAPABLE_HBA(ha) (IS_QLA83XX(ha))
2789#define IS_PI_SPLIT_DET_CAPABLE(ha) (IS_PI_SPLIT_DET_CAPABLE_HBA(ha) && \
2790 (((ha)->fw_attributes_h << 16 | (ha)->fw_attributes) & BIT_22))
2673 2791
2674 /* HBA serial number */ 2792 /* HBA serial number */
2675 uint8_t serial0; 2793 uint8_t serial0;
@@ -2753,6 +2871,7 @@ struct qla_hw_data {
2753 struct completion mbx_intr_comp; /* Used for completion notification */ 2871 struct completion mbx_intr_comp; /* Used for completion notification */
2754 struct completion dcbx_comp; /* For set port config notification */ 2872 struct completion dcbx_comp; /* For set port config notification */
2755 int notify_dcbx_comp; 2873 int notify_dcbx_comp;
2874 struct mutex selflogin_lock;
2756 2875
2757 /* Basic firmware related information. */ 2876 /* Basic firmware related information. */
2758 uint16_t fw_major_version; 2877 uint16_t fw_major_version;
@@ -2784,7 +2903,12 @@ struct qla_hw_data {
2784 int fw_dump_reading; 2903 int fw_dump_reading;
2785 dma_addr_t eft_dma; 2904 dma_addr_t eft_dma;
2786 void *eft; 2905 void *eft;
2787 2906/* Current size of mctp dump is 0x086064 bytes */
2907#define MCTP_DUMP_SIZE 0x086064
2908 dma_addr_t mctp_dump_dma;
2909 void *mctp_dump;
2910 int mctp_dumped;
2911 int mctp_dump_reading;
2788 uint32_t chain_offset; 2912 uint32_t chain_offset;
2789 struct dentry *dfs_dir; 2913 struct dentry *dfs_dir;
2790 struct dentry *dfs_fce; 2914 struct dentry *dfs_fce;
@@ -2896,8 +3020,8 @@ struct qla_hw_data {
2896 unsigned long mn_win_crb; 3020 unsigned long mn_win_crb;
2897 unsigned long ms_win_crb; 3021 unsigned long ms_win_crb;
2898 int qdr_sn_window; 3022 int qdr_sn_window;
2899 uint32_t nx_dev_init_timeout; 3023 uint32_t fcoe_dev_init_timeout;
2900 uint32_t nx_reset_timeout; 3024 uint32_t fcoe_reset_timeout;
2901 rwlock_t hw_lock; 3025 rwlock_t hw_lock;
2902 uint16_t portnum; /* port number */ 3026 uint16_t portnum; /* port number */
2903 int link_width; 3027 int link_width;
@@ -2918,6 +3042,20 @@ struct qla_hw_data {
2918 void *md_dump; 3042 void *md_dump;
2919 uint32_t md_dump_size; 3043 uint32_t md_dump_size;
2920 3044
3045 void *loop_id_map;
3046
3047 /* QLA83XX IDC specific fields */
3048 uint32_t idc_audit_ts;
3049
3050 /* DPC low-priority workqueue */
3051 struct workqueue_struct *dpc_lp_wq;
3052 struct work_struct idc_aen;
3053 /* DPC high-priority workqueue */
3054 struct workqueue_struct *dpc_hp_wq;
3055 struct work_struct nic_core_reset;
3056 struct work_struct idc_state_handler;
3057 struct work_struct nic_core_unrecoverable;
3058
2921 struct qlt_hw_data tgt; 3059 struct qlt_hw_data tgt;
2922}; 3060};
2923 3061
@@ -2985,6 +3123,13 @@ typedef struct scsi_qla_host {
2985 3123
2986 /* ISP configuration data. */ 3124 /* ISP configuration data. */
2987 uint16_t loop_id; /* Host adapter loop id */ 3125 uint16_t loop_id; /* Host adapter loop id */
3126 uint16_t self_login_loop_id; /* host adapter loop id
3127 * get it on self login
3128 */
3129 fc_port_t bidir_fcport; /* fcport used for bidir cmnds
3130 * no need of allocating it for
3131 * each command
3132 */
2988 3133
2989 port_id_t d_id; /* Host adapter port id */ 3134 port_id_t d_id; /* Host adapter port id */
2990 uint8_t marker_needed; 3135 uint8_t marker_needed;
@@ -3038,6 +3183,7 @@ typedef struct scsi_qla_host {
3038 int seconds_since_last_heartbeat; 3183 int seconds_since_last_heartbeat;
3039 struct fc_host_statistics fc_host_stat; 3184 struct fc_host_statistics fc_host_stat;
3040 struct qla_statistics qla_stats; 3185 struct qla_statistics qla_stats;
3186 struct bidi_statistics bidi_stats;
3041 3187
3042 atomic_t vref_count; 3188 atomic_t vref_count;
3043} scsi_qla_host_t; 3189} scsi_qla_host_t;