diff options
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_def.h')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_def.h | 343 |
1 files changed, 194 insertions, 149 deletions
diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h index afa95614aaf..83961090901 100644 --- a/drivers/scsi/qla2xxx/qla_def.h +++ b/drivers/scsi/qla2xxx/qla_def.h | |||
@@ -33,7 +33,10 @@ | |||
33 | #include <scsi/scsi_transport_fc.h> | 33 | #include <scsi/scsi_transport_fc.h> |
34 | #include <scsi/scsi_bsg_fc.h> | 34 | #include <scsi/scsi_bsg_fc.h> |
35 | 35 | ||
36 | #define QLA2XXX_DRIVER_NAME "qla2xxx" | 36 | #include "qla_bsg.h" |
37 | #include "qla_nx.h" | ||
38 | #define QLA2XXX_DRIVER_NAME "qla2xxx" | ||
39 | #define QLA2XXX_APIDEV "ql2xapidev" | ||
37 | 40 | ||
38 | /* | 41 | /* |
39 | * We have MAILBOX_REGISTER_COUNT sized arrays in a few places, | 42 | * We have MAILBOX_REGISTER_COUNT sized arrays in a few places, |
@@ -186,6 +189,16 @@ | |||
186 | struct req_que; | 189 | struct req_que; |
187 | 190 | ||
188 | /* | 191 | /* |
192 | * (sd.h is not exported, hence local inclusion) | ||
193 | * Data Integrity Field tuple. | ||
194 | */ | ||
195 | struct sd_dif_tuple { | ||
196 | __be16 guard_tag; /* Checksum */ | ||
197 | __be16 app_tag; /* Opaque storage */ | ||
198 | __be32 ref_tag; /* Target LBA or indirect LBA */ | ||
199 | }; | ||
200 | |||
201 | /* | ||
189 | * SCSI Request Block | 202 | * SCSI Request Block |
190 | */ | 203 | */ |
191 | typedef struct srb { | 204 | typedef struct srb { |
@@ -205,40 +218,73 @@ typedef struct srb { | |||
205 | /* | 218 | /* |
206 | * SRB flag definitions | 219 | * SRB flag definitions |
207 | */ | 220 | */ |
208 | #define SRB_DMA_VALID BIT_0 /* Command sent to ISP */ | 221 | #define SRB_DMA_VALID BIT_0 /* Command sent to ISP */ |
222 | #define SRB_FCP_CMND_DMA_VALID BIT_12 /* DIF: DSD List valid */ | ||
223 | #define SRB_CRC_CTX_DMA_VALID BIT_2 /* DIF: context DMA valid */ | ||
224 | #define SRB_CRC_PROT_DMA_VALID BIT_4 /* DIF: prot DMA valid */ | ||
225 | #define SRB_CRC_CTX_DSD_VALID BIT_5 /* DIF: dsd_list valid */ | ||
226 | |||
227 | /* To identify if a srb is of T10-CRC type. @sp => srb_t pointer */ | ||
228 | #define IS_PROT_IO(sp) (sp->flags & SRB_CRC_CTX_DSD_VALID) | ||
209 | 229 | ||
210 | /* | 230 | /* |
211 | * SRB extensions. | 231 | * SRB extensions. |
212 | */ | 232 | */ |
213 | struct srb_ctx { | 233 | struct srb_iocb { |
214 | #define SRB_LOGIN_CMD 1 | 234 | union { |
215 | #define SRB_LOGOUT_CMD 2 | 235 | struct { |
216 | uint16_t type; | 236 | uint16_t flags; |
217 | struct timer_list timer; | ||
218 | |||
219 | void (*free)(srb_t *sp); | ||
220 | void (*timeout)(srb_t *sp); | ||
221 | }; | ||
222 | |||
223 | struct srb_logio { | ||
224 | struct srb_ctx ctx; | ||
225 | |||
226 | #define SRB_LOGIN_RETRIED BIT_0 | 237 | #define SRB_LOGIN_RETRIED BIT_0 |
227 | #define SRB_LOGIN_COND_PLOGI BIT_1 | 238 | #define SRB_LOGIN_COND_PLOGI BIT_1 |
228 | #define SRB_LOGIN_SKIP_PRLI BIT_2 | 239 | #define SRB_LOGIN_SKIP_PRLI BIT_2 |
229 | uint16_t flags; | 240 | uint16_t data[2]; |
241 | } logio; | ||
242 | struct { | ||
243 | /* | ||
244 | * Values for flags field below are as | ||
245 | * defined in tsk_mgmt_entry struct | ||
246 | * for control_flags field in qla_fw.h. | ||
247 | */ | ||
248 | uint32_t flags; | ||
249 | uint32_t lun; | ||
250 | uint32_t data; | ||
251 | } tmf; | ||
252 | struct { | ||
253 | /* | ||
254 | * values for modif field below are as | ||
255 | * defined in mrk_entry_24xx struct | ||
256 | * for the modifier field in qla_fw.h. | ||
257 | */ | ||
258 | uint8_t modif; | ||
259 | uint16_t lun; | ||
260 | uint32_t data; | ||
261 | } marker; | ||
262 | } u; | ||
263 | |||
264 | struct timer_list timer; | ||
265 | |||
266 | void (*done)(srb_t *); | ||
267 | void (*free)(srb_t *); | ||
268 | void (*timeout)(srb_t *); | ||
230 | }; | 269 | }; |
231 | 270 | ||
232 | struct srb_bsg_ctx { | 271 | /* Values for srb_ctx type */ |
272 | #define SRB_LOGIN_CMD 1 | ||
273 | #define SRB_LOGOUT_CMD 2 | ||
233 | #define SRB_ELS_CMD_RPT 3 | 274 | #define SRB_ELS_CMD_RPT 3 |
234 | #define SRB_ELS_CMD_HST 4 | 275 | #define SRB_ELS_CMD_HST 4 |
235 | #define SRB_CT_CMD 5 | 276 | #define SRB_CT_CMD 5 |
236 | uint16_t type; | 277 | #define SRB_ADISC_CMD 6 |
237 | }; | 278 | #define SRB_TM_CMD 7 |
279 | #define SRB_MARKER_CMD 8 | ||
238 | 280 | ||
239 | struct srb_bsg { | 281 | struct srb_ctx { |
240 | struct srb_bsg_ctx ctx; | 282 | uint16_t type; |
241 | struct fc_bsg_job *bsg_job; | 283 | char *name; |
284 | union { | ||
285 | struct srb_iocb *iocb_cmd; | ||
286 | struct fc_bsg_job *bsg_job; | ||
287 | } u; | ||
242 | }; | 288 | }; |
243 | 289 | ||
244 | struct msg_echo_lb { | 290 | struct msg_echo_lb { |
@@ -416,6 +462,7 @@ typedef union { | |||
416 | struct device_reg_2xxx isp; | 462 | struct device_reg_2xxx isp; |
417 | struct device_reg_24xx isp24; | 463 | struct device_reg_24xx isp24; |
418 | struct device_reg_25xxmq isp25mq; | 464 | struct device_reg_25xxmq isp25mq; |
465 | struct device_reg_82xx isp82; | ||
419 | } device_reg_t; | 466 | } device_reg_t; |
420 | 467 | ||
421 | #define ISP_REQ_Q_IN(ha, reg) \ | 468 | #define ISP_REQ_Q_IN(ha, reg) \ |
@@ -1299,6 +1346,66 @@ typedef struct { | |||
1299 | uint32_t dseg_4_length; /* Data segment 4 length. */ | 1346 | uint32_t dseg_4_length; /* Data segment 4 length. */ |
1300 | } cont_a64_entry_t; | 1347 | } cont_a64_entry_t; |
1301 | 1348 | ||
1349 | #define PO_MODE_DIF_INSERT 0 | ||
1350 | #define PO_MODE_DIF_REMOVE BIT_0 | ||
1351 | #define PO_MODE_DIF_PASS BIT_1 | ||
1352 | #define PO_MODE_DIF_REPLACE (BIT_0 + BIT_1) | ||
1353 | #define PO_ENABLE_DIF_BUNDLING BIT_8 | ||
1354 | #define PO_ENABLE_INCR_GUARD_SEED BIT_3 | ||
1355 | #define PO_DISABLE_INCR_REF_TAG BIT_5 | ||
1356 | #define PO_DISABLE_GUARD_CHECK BIT_4 | ||
1357 | /* | ||
1358 | * ISP queue - 64-Bit addressing, continuation crc entry structure definition. | ||
1359 | */ | ||
1360 | struct crc_context { | ||
1361 | uint32_t handle; /* System handle. */ | ||
1362 | uint32_t ref_tag; | ||
1363 | uint16_t app_tag; | ||
1364 | uint8_t ref_tag_mask[4]; /* Validation/Replacement Mask*/ | ||
1365 | uint8_t app_tag_mask[2]; /* Validation/Replacement Mask*/ | ||
1366 | uint16_t guard_seed; /* Initial Guard Seed */ | ||
1367 | uint16_t prot_opts; /* Requested Data Protection Mode */ | ||
1368 | uint16_t blk_size; /* Data size in bytes */ | ||
1369 | uint16_t runt_blk_guard; /* Guard value for runt block (tape | ||
1370 | * only) */ | ||
1371 | uint32_t byte_count; /* Total byte count/ total data | ||
1372 | * transfer count */ | ||
1373 | union { | ||
1374 | struct { | ||
1375 | uint32_t reserved_1; | ||
1376 | uint16_t reserved_2; | ||
1377 | uint16_t reserved_3; | ||
1378 | uint32_t reserved_4; | ||
1379 | uint32_t data_address[2]; | ||
1380 | uint32_t data_length; | ||
1381 | uint32_t reserved_5[2]; | ||
1382 | uint32_t reserved_6; | ||
1383 | } nobundling; | ||
1384 | struct { | ||
1385 | uint32_t dif_byte_count; /* Total DIF byte | ||
1386 | * count */ | ||
1387 | uint16_t reserved_1; | ||
1388 | uint16_t dseg_count; /* Data segment count */ | ||
1389 | uint32_t reserved_2; | ||
1390 | uint32_t data_address[2]; | ||
1391 | uint32_t data_length; | ||
1392 | uint32_t dif_address[2]; | ||
1393 | uint32_t dif_length; /* Data segment 0 | ||
1394 | * length */ | ||
1395 | } bundling; | ||
1396 | } u; | ||
1397 | |||
1398 | struct fcp_cmnd fcp_cmnd; | ||
1399 | dma_addr_t crc_ctx_dma; | ||
1400 | /* List of DMA context transfers */ | ||
1401 | struct list_head dsd_list; | ||
1402 | |||
1403 | /* This structure should not exceed 512 bytes */ | ||
1404 | }; | ||
1405 | |||
1406 | #define CRC_CONTEXT_LEN_FW (offsetof(struct crc_context, fcp_cmnd.lun)) | ||
1407 | #define CRC_CONTEXT_FCPCMND_OFF (offsetof(struct crc_context, fcp_cmnd.lun)) | ||
1408 | |||
1302 | /* | 1409 | /* |
1303 | * ISP queue - status entry structure definition. | 1410 | * ISP queue - status entry structure definition. |
1304 | */ | 1411 | */ |
@@ -1359,6 +1466,7 @@ typedef struct { | |||
1359 | #define CS_ABORTED 0x5 /* System aborted command. */ | 1466 | #define CS_ABORTED 0x5 /* System aborted command. */ |
1360 | #define CS_TIMEOUT 0x6 /* Timeout error. */ | 1467 | #define CS_TIMEOUT 0x6 /* Timeout error. */ |
1361 | #define CS_DATA_OVERRUN 0x7 /* Data overrun. */ | 1468 | #define CS_DATA_OVERRUN 0x7 /* Data overrun. */ |
1469 | #define CS_DIF_ERROR 0xC /* DIF error detected */ | ||
1362 | 1470 | ||
1363 | #define CS_DATA_UNDERRUN 0x15 /* Data Underrun. */ | 1471 | #define CS_DATA_UNDERRUN 0x15 /* Data Underrun. */ |
1364 | #define CS_QUEUE_FULL 0x1C /* Queue Full. */ | 1472 | #define CS_QUEUE_FULL 0x1C /* Queue Full. */ |
@@ -1579,6 +1687,8 @@ typedef struct fc_port { | |||
1579 | uint16_t loop_id; | 1687 | uint16_t loop_id; |
1580 | uint16_t old_loop_id; | 1688 | uint16_t old_loop_id; |
1581 | 1689 | ||
1690 | uint8_t fcp_prio; | ||
1691 | |||
1582 | uint8_t fabric_port_name[WWN_SIZE]; | 1692 | uint8_t fabric_port_name[WWN_SIZE]; |
1583 | uint16_t fp_speed; | 1693 | uint16_t fp_speed; |
1584 | 1694 | ||
@@ -1611,6 +1721,7 @@ typedef struct fc_port { | |||
1611 | #define FCF_FABRIC_DEVICE BIT_0 | 1721 | #define FCF_FABRIC_DEVICE BIT_0 |
1612 | #define FCF_LOGIN_NEEDED BIT_1 | 1722 | #define FCF_LOGIN_NEEDED BIT_1 |
1613 | #define FCF_FCP2_DEVICE BIT_2 | 1723 | #define FCF_FCP2_DEVICE BIT_2 |
1724 | #define FCF_ASYNC_SENT BIT_3 | ||
1614 | 1725 | ||
1615 | /* No loop ID flag. */ | 1726 | /* No loop ID flag. */ |
1616 | #define FC_NO_LOOP_ID 0x1000 | 1727 | #define FC_NO_LOOP_ID 0x1000 |
@@ -2109,6 +2220,7 @@ struct isp_operations { | |||
2109 | 2220 | ||
2110 | int (*get_flash_version) (struct scsi_qla_host *, void *); | 2221 | int (*get_flash_version) (struct scsi_qla_host *, void *); |
2111 | int (*start_scsi) (srb_t *); | 2222 | int (*start_scsi) (srb_t *); |
2223 | int (*abort_isp) (struct scsi_qla_host *); | ||
2112 | }; | 2224 | }; |
2113 | 2225 | ||
2114 | /* MSI-X Support *************************************************************/ | 2226 | /* MSI-X Support *************************************************************/ |
@@ -2143,6 +2255,8 @@ enum qla_work_type { | |||
2143 | QLA_EVT_ASYNC_LOGIN_DONE, | 2255 | QLA_EVT_ASYNC_LOGIN_DONE, |
2144 | QLA_EVT_ASYNC_LOGOUT, | 2256 | QLA_EVT_ASYNC_LOGOUT, |
2145 | QLA_EVT_ASYNC_LOGOUT_DONE, | 2257 | QLA_EVT_ASYNC_LOGOUT_DONE, |
2258 | QLA_EVT_ASYNC_ADISC, | ||
2259 | QLA_EVT_ASYNC_ADISC_DONE, | ||
2146 | QLA_EVT_UEVENT, | 2260 | QLA_EVT_UEVENT, |
2147 | }; | 2261 | }; |
2148 | 2262 | ||
@@ -2295,6 +2409,7 @@ struct qla_hw_data { | |||
2295 | uint32_t eeh_busy :1; | 2409 | uint32_t eeh_busy :1; |
2296 | uint32_t cpu_affinity_enabled :1; | 2410 | uint32_t cpu_affinity_enabled :1; |
2297 | uint32_t disable_msix_handshake :1; | 2411 | uint32_t disable_msix_handshake :1; |
2412 | uint32_t fcp_prio_enabled :1; | ||
2298 | } flags; | 2413 | } flags; |
2299 | 2414 | ||
2300 | /* This spinlock is used to protect "io transactions", you must | 2415 | /* This spinlock is used to protect "io transactions", you must |
@@ -2382,7 +2497,8 @@ struct qla_hw_data { | |||
2382 | #define DT_ISP2532 BIT_11 | 2497 | #define DT_ISP2532 BIT_11 |
2383 | #define DT_ISP8432 BIT_12 | 2498 | #define DT_ISP8432 BIT_12 |
2384 | #define DT_ISP8001 BIT_13 | 2499 | #define DT_ISP8001 BIT_13 |
2385 | #define DT_ISP_LAST (DT_ISP8001 << 1) | 2500 | #define DT_ISP8021 BIT_14 |
2501 | #define DT_ISP_LAST (DT_ISP8021 << 1) | ||
2386 | 2502 | ||
2387 | #define DT_IIDMA BIT_26 | 2503 | #define DT_IIDMA BIT_26 |
2388 | #define DT_FWI2 BIT_27 | 2504 | #define DT_FWI2 BIT_27 |
@@ -2405,6 +2521,7 @@ struct qla_hw_data { | |||
2405 | #define IS_QLA2532(ha) (DT_MASK(ha) & DT_ISP2532) | 2521 | #define IS_QLA2532(ha) (DT_MASK(ha) & DT_ISP2532) |
2406 | #define IS_QLA8432(ha) (DT_MASK(ha) & DT_ISP8432) | 2522 | #define IS_QLA8432(ha) (DT_MASK(ha) & DT_ISP8432) |
2407 | #define IS_QLA8001(ha) (DT_MASK(ha) & DT_ISP8001) | 2523 | #define IS_QLA8001(ha) (DT_MASK(ha) & DT_ISP8001) |
2524 | #define IS_QLA82XX(ha) (DT_MASK(ha) & DT_ISP8021) | ||
2408 | 2525 | ||
2409 | #define IS_QLA23XX(ha) (IS_QLA2300(ha) || IS_QLA2312(ha) || IS_QLA2322(ha) || \ | 2526 | #define IS_QLA23XX(ha) (IS_QLA2300(ha) || IS_QLA2312(ha) || IS_QLA2322(ha) || \ |
2410 | IS_QLA6312(ha) || IS_QLA6322(ha)) | 2527 | IS_QLA6312(ha) || IS_QLA6322(ha)) |
@@ -2415,8 +2532,10 @@ struct qla_hw_data { | |||
2415 | #define IS_QLA24XX_TYPE(ha) (IS_QLA24XX(ha) || IS_QLA54XX(ha) || \ | 2532 | #define IS_QLA24XX_TYPE(ha) (IS_QLA24XX(ha) || IS_QLA54XX(ha) || \ |
2416 | IS_QLA84XX(ha)) | 2533 | IS_QLA84XX(ha)) |
2417 | #define IS_QLA81XX(ha) (IS_QLA8001(ha)) | 2534 | #define IS_QLA81XX(ha) (IS_QLA8001(ha)) |
2535 | #define IS_QLA8XXX_TYPE(ha) (IS_QLA81XX(ha) || IS_QLA82XX(ha)) | ||
2418 | #define IS_QLA2XXX_MIDTYPE(ha) (IS_QLA24XX(ha) || IS_QLA84XX(ha) || \ | 2536 | #define IS_QLA2XXX_MIDTYPE(ha) (IS_QLA24XX(ha) || IS_QLA84XX(ha) || \ |
2419 | IS_QLA25XX(ha) || IS_QLA81XX(ha)) | 2537 | IS_QLA25XX(ha) || IS_QLA81XX(ha) || \ |
2538 | IS_QLA82XX(ha)) | ||
2420 | #define IS_MSIX_NACK_CAPABLE(ha) (IS_QLA81XX(ha)) | 2539 | #define IS_MSIX_NACK_CAPABLE(ha) (IS_QLA81XX(ha)) |
2421 | #define IS_NOPOLLING_TYPE(ha) ((IS_QLA25XX(ha) || IS_QLA81XX(ha)) && \ | 2540 | #define IS_NOPOLLING_TYPE(ha) ((IS_QLA25XX(ha) || IS_QLA81XX(ha)) && \ |
2422 | (ha)->flags.msix_enabled) | 2541 | (ha)->flags.msix_enabled) |
@@ -2496,6 +2615,9 @@ struct qla_hw_data { | |||
2496 | dma_addr_t ex_init_cb_dma; | 2615 | dma_addr_t ex_init_cb_dma; |
2497 | struct ex_init_cb_81xx *ex_init_cb; | 2616 | struct ex_init_cb_81xx *ex_init_cb; |
2498 | 2617 | ||
2618 | void *async_pd; | ||
2619 | dma_addr_t async_pd_dma; | ||
2620 | |||
2499 | /* These are used by mailbox operations. */ | 2621 | /* These are used by mailbox operations. */ |
2500 | volatile uint16_t mailbox_out[MAILBOX_REGISTER_COUNT]; | 2622 | volatile uint16_t mailbox_out[MAILBOX_REGISTER_COUNT]; |
2501 | 2623 | ||
@@ -2598,6 +2720,8 @@ struct qla_hw_data { | |||
2598 | uint32_t flt_region_nvram; | 2720 | uint32_t flt_region_nvram; |
2599 | uint32_t flt_region_npiv_conf; | 2721 | uint32_t flt_region_npiv_conf; |
2600 | uint32_t flt_region_gold_fw; | 2722 | uint32_t flt_region_gold_fw; |
2723 | uint32_t flt_region_fcp_prio; | ||
2724 | uint32_t flt_region_bootload; | ||
2601 | 2725 | ||
2602 | /* Needed for BEACON */ | 2726 | /* Needed for BEACON */ |
2603 | uint16_t beacon_blink_led; | 2727 | uint16_t beacon_blink_led; |
@@ -2626,6 +2750,39 @@ struct qla_hw_data { | |||
2626 | struct isp_operations *isp_ops; | 2750 | struct isp_operations *isp_ops; |
2627 | struct workqueue_struct *wq; | 2751 | struct workqueue_struct *wq; |
2628 | struct qlfc_fw fw_buf; | 2752 | struct qlfc_fw fw_buf; |
2753 | |||
2754 | /* FCP_CMND priority support */ | ||
2755 | struct qla_fcp_prio_cfg *fcp_prio_cfg; | ||
2756 | |||
2757 | struct dma_pool *dl_dma_pool; | ||
2758 | #define DSD_LIST_DMA_POOL_SIZE 512 | ||
2759 | |||
2760 | struct dma_pool *fcp_cmnd_dma_pool; | ||
2761 | mempool_t *ctx_mempool; | ||
2762 | #define FCP_CMND_DMA_POOL_SIZE 512 | ||
2763 | |||
2764 | unsigned long nx_pcibase; /* Base I/O address */ | ||
2765 | uint8_t *nxdb_rd_ptr; /* Doorbell read pointer */ | ||
2766 | unsigned long nxdb_wr_ptr; /* Door bell write pointer */ | ||
2767 | |||
2768 | uint32_t crb_win; | ||
2769 | uint32_t curr_window; | ||
2770 | uint32_t ddr_mn_window; | ||
2771 | unsigned long mn_win_crb; | ||
2772 | unsigned long ms_win_crb; | ||
2773 | int qdr_sn_window; | ||
2774 | uint32_t nx_dev_init_timeout; | ||
2775 | uint32_t nx_reset_timeout; | ||
2776 | rwlock_t hw_lock; | ||
2777 | uint16_t portnum; /* port number */ | ||
2778 | int link_width; | ||
2779 | struct fw_blob *hablob; | ||
2780 | struct qla82xx_legacy_intr_set nx_legacy_intr; | ||
2781 | |||
2782 | uint16_t gbl_dsd_inuse; | ||
2783 | uint16_t gbl_dsd_avail; | ||
2784 | struct list_head gbl_dsd_list; | ||
2785 | #define NUM_DSD_CHAIN 4096 | ||
2629 | }; | 2786 | }; |
2630 | 2787 | ||
2631 | /* | 2788 | /* |
@@ -2650,6 +2807,7 @@ typedef struct scsi_qla_host { | |||
2650 | 2807 | ||
2651 | uint32_t management_server_logged_in :1; | 2808 | uint32_t management_server_logged_in :1; |
2652 | uint32_t process_response_queue :1; | 2809 | uint32_t process_response_queue :1; |
2810 | uint32_t difdix_supported:1; | ||
2653 | } flags; | 2811 | } flags; |
2654 | 2812 | ||
2655 | atomic_t loop_state; | 2813 | atomic_t loop_state; |
@@ -2678,10 +2836,13 @@ typedef struct scsi_qla_host { | |||
2678 | #define VP_DPC_NEEDED 14 /* wake up for VP dpc handling */ | 2836 | #define VP_DPC_NEEDED 14 /* wake up for VP dpc handling */ |
2679 | #define UNLOADING 15 | 2837 | #define UNLOADING 15 |
2680 | #define NPIV_CONFIG_NEEDED 16 | 2838 | #define NPIV_CONFIG_NEEDED 16 |
2839 | #define ISP_UNRECOVERABLE 17 | ||
2840 | #define FCOE_CTX_RESET_NEEDED 18 /* Initiate FCoE context reset */ | ||
2681 | 2841 | ||
2682 | uint32_t device_flags; | 2842 | uint32_t device_flags; |
2683 | #define SWITCH_FOUND BIT_0 | 2843 | #define SWITCH_FOUND BIT_0 |
2684 | #define DFLG_NO_CABLE BIT_1 | 2844 | #define DFLG_NO_CABLE BIT_1 |
2845 | #define DFLG_DEV_FAILED BIT_5 | ||
2685 | 2846 | ||
2686 | /* ISP configuration data. */ | 2847 | /* ISP configuration data. */ |
2687 | uint16_t loop_id; /* Host adapter loop id */ | 2848 | uint16_t loop_id; /* Host adapter loop id */ |
@@ -2739,6 +2900,8 @@ typedef struct scsi_qla_host { | |||
2739 | #define VP_ERR_ADAP_NORESOURCES 5 | 2900 | #define VP_ERR_ADAP_NORESOURCES 5 |
2740 | struct qla_hw_data *hw; | 2901 | struct qla_hw_data *hw; |
2741 | struct req_que *req; | 2902 | struct req_que *req; |
2903 | int fw_heartbeat_counter; | ||
2904 | int seconds_since_last_heartbeat; | ||
2742 | } scsi_qla_host_t; | 2905 | } scsi_qla_host_t; |
2743 | 2906 | ||
2744 | /* | 2907 | /* |
@@ -2791,134 +2954,16 @@ typedef struct scsi_qla_host { | |||
2791 | #define OPTROM_SIZE_24XX 0x100000 | 2954 | #define OPTROM_SIZE_24XX 0x100000 |
2792 | #define OPTROM_SIZE_25XX 0x200000 | 2955 | #define OPTROM_SIZE_25XX 0x200000 |
2793 | #define OPTROM_SIZE_81XX 0x400000 | 2956 | #define OPTROM_SIZE_81XX 0x400000 |
2957 | #define OPTROM_SIZE_82XX 0x800000 | ||
2958 | |||
2959 | #define OPTROM_BURST_SIZE 0x1000 | ||
2960 | #define OPTROM_BURST_DWORDS (OPTROM_BURST_SIZE / 4) | ||
2961 | |||
2962 | #define QLA_DSDS_PER_IOCB 37 | ||
2794 | 2963 | ||
2795 | #include "qla_gbl.h" | 2964 | #include "qla_gbl.h" |
2796 | #include "qla_dbg.h" | 2965 | #include "qla_dbg.h" |
2797 | #include "qla_inline.h" | 2966 | #include "qla_inline.h" |
2798 | 2967 | ||
2799 | #define CMD_SP(Cmnd) ((Cmnd)->SCp.ptr) | 2968 | #define CMD_SP(Cmnd) ((Cmnd)->SCp.ptr) |
2800 | |||
2801 | /* | ||
2802 | * BSG Vendor specific commands | ||
2803 | */ | ||
2804 | |||
2805 | #define QL_VND_LOOPBACK 0x01 | ||
2806 | #define QLA84_RESET 0x02 | ||
2807 | #define QLA84_UPDATE_FW 0x03 | ||
2808 | #define QLA84_MGMT_CMD 0x04 | ||
2809 | |||
2810 | /* BSG definations for interpreting CommandSent field */ | ||
2811 | #define INT_DEF_LB_LOOPBACK_CMD 0 | ||
2812 | #define INT_DEF_LB_ECHO_CMD 1 | ||
2813 | |||
2814 | /* BSG Vendor specific definations */ | ||
2815 | typedef struct _A84_RESET { | ||
2816 | uint16_t Flags; | ||
2817 | uint16_t Reserved; | ||
2818 | #define A84_RESET_FLAG_ENABLE_DIAG_FW 1 | ||
2819 | } __attribute__((packed)) A84_RESET, *PA84_RESET; | ||
2820 | |||
2821 | #define A84_ISSUE_WRITE_TYPE_CMD 0 | ||
2822 | #define A84_ISSUE_READ_TYPE_CMD 1 | ||
2823 | #define A84_CLEANUP_CMD 2 | ||
2824 | #define A84_ISSUE_RESET_OP_FW 3 | ||
2825 | #define A84_ISSUE_RESET_DIAG_FW 4 | ||
2826 | #define A84_ISSUE_UPDATE_OPFW_CMD 5 | ||
2827 | #define A84_ISSUE_UPDATE_DIAGFW_CMD 6 | ||
2828 | |||
2829 | struct qla84_mgmt_param { | ||
2830 | union { | ||
2831 | struct { | ||
2832 | uint32_t start_addr; | ||
2833 | } mem; /* for QLA84_MGMT_READ/WRITE_MEM */ | ||
2834 | struct { | ||
2835 | uint32_t id; | ||
2836 | #define QLA84_MGMT_CONFIG_ID_UIF 1 | ||
2837 | #define QLA84_MGMT_CONFIG_ID_FCOE_COS 2 | ||
2838 | #define QLA84_MGMT_CONFIG_ID_PAUSE 3 | ||
2839 | #define QLA84_MGMT_CONFIG_ID_TIMEOUTS 4 | ||
2840 | |||
2841 | uint32_t param0; | ||
2842 | uint32_t param1; | ||
2843 | } config; /* for QLA84_MGMT_CHNG_CONFIG */ | ||
2844 | |||
2845 | struct { | ||
2846 | uint32_t type; | ||
2847 | #define QLA84_MGMT_INFO_CONFIG_LOG_DATA 1 /* Get Config Log Data */ | ||
2848 | #define QLA84_MGMT_INFO_LOG_DATA 2 /* Get Log Data */ | ||
2849 | #define QLA84_MGMT_INFO_PORT_STAT 3 /* Get Port Statistics */ | ||
2850 | #define QLA84_MGMT_INFO_LIF_STAT 4 /* Get LIF Statistics */ | ||
2851 | #define QLA84_MGMT_INFO_ASIC_STAT 5 /* Get ASIC Statistics */ | ||
2852 | #define QLA84_MGMT_INFO_CONFIG_PARAMS 6 /* Get Config Parameters */ | ||
2853 | #define QLA84_MGMT_INFO_PANIC_LOG 7 /* Get Panic Log */ | ||
2854 | |||
2855 | uint32_t context; | ||
2856 | /* | ||
2857 | * context definitions for QLA84_MGMT_INFO_CONFIG_LOG_DATA | ||
2858 | */ | ||
2859 | #define IC_LOG_DATA_LOG_ID_DEBUG_LOG 0 | ||
2860 | #define IC_LOG_DATA_LOG_ID_LEARN_LOG 1 | ||
2861 | #define IC_LOG_DATA_LOG_ID_FC_ACL_INGRESS_LOG 2 | ||
2862 | #define IC_LOG_DATA_LOG_ID_FC_ACL_EGRESS_LOG 3 | ||
2863 | #define IC_LOG_DATA_LOG_ID_ETHERNET_ACL_INGRESS_LOG 4 | ||
2864 | #define IC_LOG_DATA_LOG_ID_ETHERNET_ACL_EGRESS_LOG 5 | ||
2865 | #define IC_LOG_DATA_LOG_ID_MESSAGE_TRANSMIT_LOG 6 | ||
2866 | #define IC_LOG_DATA_LOG_ID_MESSAGE_RECEIVE_LOG 7 | ||
2867 | #define IC_LOG_DATA_LOG_ID_LINK_EVENT_LOG 8 | ||
2868 | #define IC_LOG_DATA_LOG_ID_DCX_LOG 9 | ||
2869 | |||
2870 | /* | ||
2871 | * context definitions for QLA84_MGMT_INFO_PORT_STAT | ||
2872 | */ | ||
2873 | #define IC_PORT_STATISTICS_PORT_NUMBER_ETHERNET_PORT0 0 | ||
2874 | #define IC_PORT_STATISTICS_PORT_NUMBER_ETHERNET_PORT1 1 | ||
2875 | #define IC_PORT_STATISTICS_PORT_NUMBER_NSL_PORT0 2 | ||
2876 | #define IC_PORT_STATISTICS_PORT_NUMBER_NSL_PORT1 3 | ||
2877 | #define IC_PORT_STATISTICS_PORT_NUMBER_FC_PORT0 4 | ||
2878 | #define IC_PORT_STATISTICS_PORT_NUMBER_FC_PORT1 5 | ||
2879 | |||
2880 | |||
2881 | /* | ||
2882 | * context definitions for QLA84_MGMT_INFO_LIF_STAT | ||
2883 | */ | ||
2884 | #define IC_LIF_STATISTICS_LIF_NUMBER_ETHERNET_PORT0 0 | ||
2885 | #define IC_LIF_STATISTICS_LIF_NUMBER_ETHERNET_PORT1 1 | ||
2886 | #define IC_LIF_STATISTICS_LIF_NUMBER_FC_PORT0 2 | ||
2887 | #define IC_LIF_STATISTICS_LIF_NUMBER_FC_PORT1 3 | ||
2888 | #define IC_LIF_STATISTICS_LIF_NUMBER_CPU 6 | ||
2889 | |||
2890 | } info; /* for QLA84_MGMT_GET_INFO */ | ||
2891 | } u; | ||
2892 | }; | ||
2893 | |||
2894 | struct qla84_msg_mgmt { | ||
2895 | uint16_t cmd; | ||
2896 | #define QLA84_MGMT_READ_MEM 0x00 | ||
2897 | #define QLA84_MGMT_WRITE_MEM 0x01 | ||
2898 | #define QLA84_MGMT_CHNG_CONFIG 0x02 | ||
2899 | #define QLA84_MGMT_GET_INFO 0x03 | ||
2900 | uint16_t rsrvd; | ||
2901 | struct qla84_mgmt_param mgmtp;/* parameters for cmd */ | ||
2902 | uint32_t len; /* bytes in payload following this struct */ | ||
2903 | uint8_t payload[0]; /* payload for cmd */ | ||
2904 | }; | ||
2905 | |||
2906 | struct msg_update_fw { | ||
2907 | /* | ||
2908 | * diag_fw = 0 operational fw | ||
2909 | * otherwise diagnostic fw | ||
2910 | * offset, len, fw_len are present to overcome the current limitation | ||
2911 | * of 128Kb xfer size. The fw is sent in smaller chunks. Each chunk | ||
2912 | * specifies the byte "offset" where it fits in the fw buffer. The | ||
2913 | * number of bytes in each chunk is specified in "len". "fw_len" | ||
2914 | * is the total size of fw. The first chunk should start at offset = 0. | ||
2915 | * When offset+len == fw_len, the fw is written to the HBA. | ||
2916 | */ | ||
2917 | uint32_t diag_fw; | ||
2918 | uint32_t offset;/* start offset */ | ||
2919 | uint32_t len; /* num bytes in cur xfer */ | ||
2920 | uint32_t fw_len; /* size of fw in bytes */ | ||
2921 | uint8_t fw_bytes[0]; | ||
2922 | }; | ||
2923 | |||
2924 | #endif | 2969 | #endif |