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.h136
1 files changed, 39 insertions, 97 deletions
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index e0c5bb54b258..714ee67567e1 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -176,8 +176,7 @@
176/* ISP request and response entry counts (37-65535) */ 176/* ISP request and response entry counts (37-65535) */
177#define REQUEST_ENTRY_CNT_2100 128 /* Number of request entries. */ 177#define REQUEST_ENTRY_CNT_2100 128 /* Number of request entries. */
178#define REQUEST_ENTRY_CNT_2200 2048 /* Number of request entries. */ 178#define REQUEST_ENTRY_CNT_2200 2048 /* Number of request entries. */
179#define REQUEST_ENTRY_CNT_2XXX_EXT_MEM 4096 /* Number of request entries. */ 179#define REQUEST_ENTRY_CNT_24XX 2048 /* Number of request entries. */
180#define REQUEST_ENTRY_CNT_24XX 4096 /* Number of request entries. */
181#define RESPONSE_ENTRY_CNT_2100 64 /* Number of response entries.*/ 180#define RESPONSE_ENTRY_CNT_2100 64 /* Number of response entries.*/
182#define RESPONSE_ENTRY_CNT_2300 512 /* Number of response entries.*/ 181#define RESPONSE_ENTRY_CNT_2300 512 /* Number of response entries.*/
183 182
@@ -201,20 +200,7 @@ typedef struct srb {
201/* 200/*
202 * SRB flag definitions 201 * SRB flag definitions
203 */ 202 */
204#define SRB_TIMEOUT BIT_0 /* Command timed out */ 203#define SRB_DMA_VALID BIT_0 /* Command sent to ISP */
205#define SRB_DMA_VALID BIT_1 /* Command sent to ISP */
206#define SRB_WATCHDOG BIT_2 /* Command on watchdog list */
207#define SRB_ABORT_PENDING BIT_3 /* Command abort sent to device */
208
209#define SRB_ABORTED BIT_4 /* Command aborted command already */
210#define SRB_RETRY BIT_5 /* Command needs retrying */
211#define SRB_GOT_SENSE BIT_6 /* Command has sense data */
212#define SRB_FAILOVER BIT_7 /* Command in failover state */
213
214#define SRB_BUSY BIT_8 /* Command is in busy retry state */
215#define SRB_FO_CANCEL BIT_9 /* Command don't need to do failover */
216#define SRB_IOCTL BIT_10 /* IOCTL command. */
217#define SRB_TAPE BIT_11 /* FCP2 (Tape) command. */
218 204
219/* 205/*
220 * ISP I/O Register Set structure definitions. 206 * ISP I/O Register Set structure definitions.
@@ -372,10 +358,10 @@ struct device_reg_2xxx {
372}; 358};
373 359
374struct device_reg_25xxmq { 360struct device_reg_25xxmq {
375 volatile uint32_t req_q_in; 361 uint32_t req_q_in;
376 volatile uint32_t req_q_out; 362 uint32_t req_q_out;
377 volatile uint32_t rsp_q_in; 363 uint32_t rsp_q_in;
378 volatile uint32_t rsp_q_out; 364 uint32_t rsp_q_out;
379}; 365};
380 366
381typedef union { 367typedef union {
@@ -620,6 +606,7 @@ typedef struct {
620#define MBC_GET_TIMEOUT_PARAMS 0x22 /* Get FW timeouts. */ 606#define MBC_GET_TIMEOUT_PARAMS 0x22 /* Get FW timeouts. */
621#define MBC_TRACE_CONTROL 0x27 /* Trace control command. */ 607#define MBC_TRACE_CONTROL 0x27 /* Trace control command. */
622#define MBC_GEN_SYSTEM_ERROR 0x2a /* Generate System Error. */ 608#define MBC_GEN_SYSTEM_ERROR 0x2a /* Generate System Error. */
609#define MBC_WRITE_SFP 0x30 /* Write SFP Data. */
623#define MBC_READ_SFP 0x31 /* Read SFP Data. */ 610#define MBC_READ_SFP 0x31 /* Read SFP Data. */
624#define MBC_SET_TIMEOUT_PARAMS 0x32 /* Set FW timeouts. */ 611#define MBC_SET_TIMEOUT_PARAMS 0x32 /* Set FW timeouts. */
625#define MBC_MID_INITIALIZE_FIRMWARE 0x48 /* MID Initialize firmware. */ 612#define MBC_MID_INITIALIZE_FIRMWARE 0x48 /* MID Initialize firmware. */
@@ -1570,39 +1557,13 @@ typedef struct fc_port {
1570#define FCS_DEVICE_DEAD 2 1557#define FCS_DEVICE_DEAD 2
1571#define FCS_DEVICE_LOST 3 1558#define FCS_DEVICE_LOST 3
1572#define FCS_ONLINE 4 1559#define FCS_ONLINE 4
1573#define FCS_NOT_SUPPORTED 5
1574#define FCS_FAILOVER 6
1575#define FCS_FAILOVER_FAILED 7
1576 1560
1577/* 1561/*
1578 * FC port flags. 1562 * FC port flags.
1579 */ 1563 */
1580#define FCF_FABRIC_DEVICE BIT_0 1564#define FCF_FABRIC_DEVICE BIT_0
1581#define FCF_LOGIN_NEEDED BIT_1 1565#define FCF_LOGIN_NEEDED BIT_1
1582#define FCF_FO_MASKED BIT_2 1566#define FCF_TAPE_PRESENT BIT_2
1583#define FCF_FAILOVER_NEEDED BIT_3
1584#define FCF_RESET_NEEDED BIT_4
1585#define FCF_PERSISTENT_BOUND BIT_5
1586#define FCF_TAPE_PRESENT BIT_6
1587#define FCF_FARP_DONE BIT_7
1588#define FCF_FARP_FAILED BIT_8
1589#define FCF_FARP_REPLY_NEEDED BIT_9
1590#define FCF_AUTH_REQ BIT_10
1591#define FCF_SEND_AUTH_REQ BIT_11
1592#define FCF_RECEIVE_AUTH_REQ BIT_12
1593#define FCF_AUTH_SUCCESS BIT_13
1594#define FCF_RLC_SUPPORT BIT_14
1595#define FCF_CONFIG BIT_15 /* Needed? */
1596#define FCF_RESCAN_NEEDED BIT_16
1597#define FCF_XP_DEVICE BIT_17
1598#define FCF_MSA_DEVICE BIT_18
1599#define FCF_EVA_DEVICE BIT_19
1600#define FCF_MSA_PORT_ACTIVE BIT_20
1601#define FCF_FAILBACK_DISABLE BIT_21
1602#define FCF_FAILOVER_DISABLE BIT_22
1603#define FCF_DSXXX_DEVICE BIT_23
1604#define FCF_AA_EVA_DEVICE BIT_24
1605#define FCF_AA_MSA_DEVICE BIT_25
1606 1567
1607/* No loop ID flag. */ 1568/* No loop ID flag. */
1608#define FC_NO_LOOP_ID 0x1000 1569#define FC_NO_LOOP_ID 0x1000
@@ -2102,9 +2063,6 @@ struct isp_operations {
2102 2063
2103 int (*get_flash_version) (struct scsi_qla_host *, void *); 2064 int (*get_flash_version) (struct scsi_qla_host *, void *);
2104 int (*start_scsi) (srb_t *); 2065 int (*start_scsi) (srb_t *);
2105 void (*wrt_req_reg) (struct qla_hw_data *, uint16_t, uint16_t);
2106 void (*wrt_rsp_reg) (struct qla_hw_data *, uint16_t, uint16_t);
2107 uint16_t (*rd_req_reg) (struct qla_hw_data *, uint16_t);
2108}; 2066};
2109 2067
2110/* MSI-X Support *************************************************************/ 2068/* MSI-X Support *************************************************************/
@@ -2200,6 +2158,8 @@ struct rsp_que {
2200 dma_addr_t dma; 2158 dma_addr_t dma;
2201 response_t *ring; 2159 response_t *ring;
2202 response_t *ring_ptr; 2160 response_t *ring_ptr;
2161 uint32_t __iomem *rsp_q_in; /* FWI2-capable only. */
2162 uint32_t __iomem *rsp_q_out;
2203 uint16_t ring_index; 2163 uint16_t ring_index;
2204 uint16_t out_ptr; 2164 uint16_t out_ptr;
2205 uint16_t length; 2165 uint16_t length;
@@ -2217,6 +2177,8 @@ struct req_que {
2217 dma_addr_t dma; 2177 dma_addr_t dma;
2218 request_t *ring; 2178 request_t *ring;
2219 request_t *ring_ptr; 2179 request_t *ring_ptr;
2180 uint32_t __iomem *req_q_in; /* FWI2-capable only. */
2181 uint32_t __iomem *req_q_out;
2220 uint16_t ring_index; 2182 uint16_t ring_index;
2221 uint16_t in_ptr; 2183 uint16_t in_ptr;
2222 uint16_t cnt; 2184 uint16_t cnt;
@@ -2256,10 +2218,10 @@ struct qla_hw_data {
2256 uint32_t msix_enabled :1; 2218 uint32_t msix_enabled :1;
2257 uint32_t disable_serdes :1; 2219 uint32_t disable_serdes :1;
2258 uint32_t gpsc_supported :1; 2220 uint32_t gpsc_supported :1;
2259 uint32_t vsan_enabled :1;
2260 uint32_t npiv_supported :1; 2221 uint32_t npiv_supported :1;
2261 uint32_t fce_enabled :1; 2222 uint32_t fce_enabled :1;
2262 uint32_t hw_event_marker_found:1; 2223 uint32_t fac_supported :1;
2224 uint32_t chip_reset_done :1;
2263 } flags; 2225 } flags;
2264 2226
2265 /* This spinlock is used to protect "io transactions", you must 2227 /* This spinlock is used to protect "io transactions", you must
@@ -2277,7 +2239,7 @@ struct qla_hw_data {
2277 2239
2278#define MIN_IOBASE_LEN 0x100 2240#define MIN_IOBASE_LEN 0x100
2279/* Multi queue data structs */ 2241/* Multi queue data structs */
2280 device_reg_t *mqiobase; 2242 device_reg_t __iomem *mqiobase;
2281 uint16_t msix_count; 2243 uint16_t msix_count;
2282 uint8_t mqenable; 2244 uint8_t mqenable;
2283 struct req_que **req_q_map; 2245 struct req_que **req_q_map;
@@ -2300,7 +2262,6 @@ struct qla_hw_data {
2300 uint16_t max_loop_id; 2262 uint16_t max_loop_id;
2301 2263
2302 uint16_t fb_rev; 2264 uint16_t fb_rev;
2303 uint16_t max_public_loop_ids;
2304 uint16_t min_external_loopid; /* First external loop Id */ 2265 uint16_t min_external_loopid; /* First external loop Id */
2305 2266
2306#define PORT_SPEED_UNKNOWN 0xFFFF 2267#define PORT_SPEED_UNKNOWN 0xFFFF
@@ -2381,6 +2342,8 @@ struct qla_hw_data {
2381 IS_QLA25XX(ha) || IS_QLA81XX(ha)) 2342 IS_QLA25XX(ha) || IS_QLA81XX(ha))
2382#define IS_NOPOLLING_TYPE(ha) ((IS_QLA25XX(ha) || IS_QLA81XX(ha)) && \ 2343#define IS_NOPOLLING_TYPE(ha) ((IS_QLA25XX(ha) || IS_QLA81XX(ha)) && \
2383 (ha)->flags.msix_enabled) 2344 (ha)->flags.msix_enabled)
2345#define IS_FAC_REQUIRED(ha) (IS_QLA81XX(ha))
2346#define IS_NOCACHE_VPD_TYPE(ha) (IS_QLA81XX(ha))
2384 2347
2385#define IS_IIDMA_CAPABLE(ha) ((ha)->device_type & DT_IIDMA) 2348#define IS_IIDMA_CAPABLE(ha) ((ha)->device_type & DT_IIDMA)
2386#define IS_FWI2_CAPABLE(ha) ((ha)->device_type & DT_FWI2) 2349#define IS_FWI2_CAPABLE(ha) ((ha)->device_type & DT_FWI2)
@@ -2425,6 +2388,10 @@ struct qla_hw_data {
2425 void *sfp_data; 2388 void *sfp_data;
2426 dma_addr_t sfp_data_dma; 2389 dma_addr_t sfp_data_dma;
2427 2390
2391 uint8_t *edc_data;
2392 dma_addr_t edc_data_dma;
2393 uint16_t edc_data_len;
2394
2428 struct task_struct *dpc_thread; 2395 struct task_struct *dpc_thread;
2429 uint8_t dpc_active; /* DPC routine is active */ 2396 uint8_t dpc_active; /* DPC routine is active */
2430 2397
@@ -2439,6 +2406,8 @@ struct qla_hw_data {
2439 dma_addr_t init_cb_dma; 2406 dma_addr_t init_cb_dma;
2440 init_cb_t *init_cb; 2407 init_cb_t *init_cb;
2441 int init_cb_size; 2408 int init_cb_size;
2409 dma_addr_t ex_init_cb_dma;
2410 struct ex_init_cb_81xx *ex_init_cb;
2442 2411
2443 /* These are used by mailbox operations. */ 2412 /* These are used by mailbox operations. */
2444 volatile uint16_t mailbox_out[MAILBOX_REGISTER_COUNT]; 2413 volatile uint16_t mailbox_out[MAILBOX_REGISTER_COUNT];
@@ -2453,15 +2422,6 @@ struct qla_hw_data {
2453 struct completion mbx_cmd_comp; /* Serialize mbx access */ 2422 struct completion mbx_cmd_comp; /* Serialize mbx access */
2454 struct completion mbx_intr_comp; /* Used for completion notification */ 2423 struct completion mbx_intr_comp; /* Used for completion notification */
2455 2424
2456 uint32_t mbx_flags;
2457#define MBX_IN_PROGRESS BIT_0
2458#define MBX_BUSY BIT_1 /* Got the Access */
2459#define MBX_SLEEPING_ON_SEM BIT_2
2460#define MBX_POLLING_FOR_COMP BIT_3
2461#define MBX_COMPLETED BIT_4
2462#define MBX_TIMEDOUT BIT_5
2463#define MBX_ACCESS_TIMEDOUT BIT_6
2464
2465 /* Basic firmware related information. */ 2425 /* Basic firmware related information. */
2466 uint16_t fw_major_version; 2426 uint16_t fw_major_version;
2467 uint16_t fw_minor_version; 2427 uint16_t fw_minor_version;
@@ -2473,13 +2433,15 @@ struct qla_hw_data {
2473#define RISC_START_ADDRESS_2100 0x1000 2433#define RISC_START_ADDRESS_2100 0x1000
2474#define RISC_START_ADDRESS_2300 0x800 2434#define RISC_START_ADDRESS_2300 0x800
2475#define RISC_START_ADDRESS_2400 0x100000 2435#define RISC_START_ADDRESS_2400 0x100000
2436 uint16_t fw_xcb_count;
2476 2437
2477 uint16_t fw_options[16]; /* slots: 1,2,3,10,11 */ 2438 uint16_t fw_options[16]; /* slots: 1,2,3,10,11 */
2478 uint8_t fw_seriallink_options[4]; 2439 uint8_t fw_seriallink_options[4];
2479 uint16_t fw_seriallink_options24[4]; 2440 uint16_t fw_seriallink_options24[4];
2480 2441
2481 uint8_t mpi_version[4]; 2442 uint8_t mpi_version[3];
2482 uint32_t mpi_capabilities; 2443 uint32_t mpi_capabilities;
2444 uint8_t phy_version[3];
2483 2445
2484 /* Firmware dump information. */ 2446 /* Firmware dump information. */
2485 struct qla2xxx_fw_dump *fw_dump; 2447 struct qla2xxx_fw_dump *fw_dump;
@@ -2545,6 +2507,8 @@ struct qla_hw_data {
2545 uint32_t flt_region_boot; 2507 uint32_t flt_region_boot;
2546 uint32_t flt_region_fw; 2508 uint32_t flt_region_fw;
2547 uint32_t flt_region_vpd_nvram; 2509 uint32_t flt_region_vpd_nvram;
2510 uint32_t flt_region_vpd;
2511 uint32_t flt_region_nvram;
2548 uint32_t flt_region_npiv_conf; 2512 uint32_t flt_region_npiv_conf;
2549 2513
2550 /* Needed for BEACON */ 2514 /* Needed for BEACON */
@@ -2613,36 +2577,19 @@ typedef struct scsi_qla_host {
2613#define LOOP_RESYNC_ACTIVE 5 2577#define LOOP_RESYNC_ACTIVE 5
2614#define LOCAL_LOOP_UPDATE 6 /* Perform a local loop update. */ 2578#define LOCAL_LOOP_UPDATE 6 /* Perform a local loop update. */
2615#define RSCN_UPDATE 7 /* Perform an RSCN update. */ 2579#define RSCN_UPDATE 7 /* Perform an RSCN update. */
2616#define MAILBOX_RETRY 8 2580#define RELOGIN_NEEDED 8
2617#define ISP_RESET_NEEDED 9 /* Initiate a ISP reset. */ 2581#define REGISTER_FC4_NEEDED 9 /* SNS FC4 registration required. */
2618#define FAILOVER_EVENT_NEEDED 10 2582#define ISP_ABORT_RETRY 10 /* ISP aborted. */
2619#define FAILOVER_EVENT 11 2583#define BEACON_BLINK_NEEDED 11
2620#define FAILOVER_NEEDED 12 2584#define REGISTER_FDMI_NEEDED 12
2621#define SCSI_RESTART_NEEDED 13 /* Processes SCSI retry queue. */ 2585#define FCPORT_UPDATE_NEEDED 13
2622#define PORT_RESTART_NEEDED 14 /* Processes Retry queue. */ 2586#define VP_DPC_NEEDED 14 /* wake up for VP dpc handling */
2623#define RESTART_QUEUES_NEEDED 15 /* Restarts the Lun queue. */ 2587#define UNLOADING 15
2624#define ABORT_QUEUES_NEEDED 16 2588#define NPIV_CONFIG_NEEDED 16
2625#define RELOGIN_NEEDED 17
2626#define LOGIN_RETRY_NEEDED 18 /* Initiate required fabric logins. */
2627#define REGISTER_FC4_NEEDED 19 /* SNS FC4 registration required. */
2628#define ISP_ABORT_RETRY 20 /* ISP aborted. */
2629#define FCPORT_RESCAN_NEEDED 21 /* IO descriptor processing needed */
2630#define IODESC_PROCESS_NEEDED 22 /* IO descriptor processing needed */
2631#define IOCTL_ERROR_RECOVERY 23
2632#define LOOP_RESET_NEEDED 24
2633#define BEACON_BLINK_NEEDED 25
2634#define REGISTER_FDMI_NEEDED 26
2635#define FCPORT_UPDATE_NEEDED 27
2636#define VP_DPC_NEEDED 28 /* wake up for VP dpc handling */
2637#define UNLOADING 29
2638#define NPIV_CONFIG_NEEDED 30
2639 2589
2640 uint32_t device_flags; 2590 uint32_t device_flags;
2641#define DFLG_LOCAL_DEVICES BIT_0 2591#define SWITCH_FOUND BIT_0
2642#define DFLG_RETRY_LOCAL_DEVICES BIT_1 2592#define DFLG_NO_CABLE BIT_1
2643#define DFLG_FABRIC_DEVICES BIT_2
2644#define SWITCH_FOUND BIT_3
2645#define DFLG_NO_CABLE BIT_4
2646 2593
2647 srb_t *status_srb; /* Status continuation entry. */ 2594 srb_t *status_srb; /* Status continuation entry. */
2648 2595
@@ -2755,10 +2702,5 @@ typedef struct scsi_qla_host {
2755#include "qla_inline.h" 2702#include "qla_inline.h"
2756 2703
2757#define CMD_SP(Cmnd) ((Cmnd)->SCp.ptr) 2704#define CMD_SP(Cmnd) ((Cmnd)->SCp.ptr)
2758#define CMD_COMPL_STATUS(Cmnd) ((Cmnd)->SCp.this_residual)
2759#define CMD_RESID_LEN(Cmnd) ((Cmnd)->SCp.buffers_residual)
2760#define CMD_SCSI_STATUS(Cmnd) ((Cmnd)->SCp.Status)
2761#define CMD_ACTUAL_SNSLEN(Cmnd) ((Cmnd)->SCp.Message)
2762#define CMD_ENTRY_STATUS(Cmnd) ((Cmnd)->SCp.have_data_in)
2763 2705
2764#endif 2706#endif