diff options
Diffstat (limited to 'drivers/scsi/lpfc/lpfc.h')
-rw-r--r-- | drivers/scsi/lpfc/lpfc.h | 96 |
1 files changed, 74 insertions, 22 deletions
diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h index e0e018d12653..60a9e6e9384b 100644 --- a/drivers/scsi/lpfc/lpfc.h +++ b/drivers/scsi/lpfc/lpfc.h | |||
@@ -34,7 +34,14 @@ struct lpfc_sli2_slim; | |||
34 | #define LPFC_IOCB_LIST_CNT 2250 /* list of IOCBs for fast-path usage. */ | 34 | #define LPFC_IOCB_LIST_CNT 2250 /* list of IOCBs for fast-path usage. */ |
35 | #define LPFC_Q_RAMP_UP_INTERVAL 120 /* lun q_depth ramp up interval */ | 35 | #define LPFC_Q_RAMP_UP_INTERVAL 120 /* lun q_depth ramp up interval */ |
36 | #define LPFC_VNAME_LEN 100 /* vport symbolic name length */ | 36 | #define LPFC_VNAME_LEN 100 /* vport symbolic name length */ |
37 | 37 | #define LPFC_TGTQ_INTERVAL 40000 /* Min amount of time between tgt | |
38 | queue depth change in millisecs */ | ||
39 | #define LPFC_TGTQ_RAMPUP_PCENT 5 /* Target queue rampup in percentage */ | ||
40 | #define LPFC_MIN_TGT_QDEPTH 100 | ||
41 | #define LPFC_MAX_TGT_QDEPTH 0xFFFF | ||
42 | |||
43 | #define LPFC_MAX_BUCKET_COUNT 20 /* Maximum no. of buckets for stat data | ||
44 | collection. */ | ||
38 | /* | 45 | /* |
39 | * Following time intervals are used of adjusting SCSI device | 46 | * Following time intervals are used of adjusting SCSI device |
40 | * queue depths when there are driver resource error or Firmware | 47 | * queue depths when there are driver resource error or Firmware |
@@ -49,6 +56,9 @@ struct lpfc_sli2_slim; | |||
49 | #define LPFC_HB_MBOX_INTERVAL 5 /* Heart beat interval in seconds. */ | 56 | #define LPFC_HB_MBOX_INTERVAL 5 /* Heart beat interval in seconds. */ |
50 | #define LPFC_HB_MBOX_TIMEOUT 30 /* Heart beat timeout in seconds. */ | 57 | #define LPFC_HB_MBOX_TIMEOUT 30 /* Heart beat timeout in seconds. */ |
51 | 58 | ||
59 | /* Error Attention event polling interval */ | ||
60 | #define LPFC_ERATT_POLL_INTERVAL 5 /* EATT poll interval in seconds */ | ||
61 | |||
52 | /* Define macros for 64 bit support */ | 62 | /* Define macros for 64 bit support */ |
53 | #define putPaddrLow(addr) ((uint32_t) (0xffffffff & (u64)(addr))) | 63 | #define putPaddrLow(addr) ((uint32_t) (0xffffffff & (u64)(addr))) |
54 | #define putPaddrHigh(addr) ((uint32_t) (0xffffffff & (((u64)(addr))>>32))) | 64 | #define putPaddrHigh(addr) ((uint32_t) (0xffffffff & (((u64)(addr))>>32))) |
@@ -60,6 +70,9 @@ struct lpfc_sli2_slim; | |||
60 | 70 | ||
61 | #define MAX_HBAEVT 32 | 71 | #define MAX_HBAEVT 32 |
62 | 72 | ||
73 | /* Number of MSI-X vectors the driver uses */ | ||
74 | #define LPFC_MSIX_VECTORS 2 | ||
75 | |||
63 | /* lpfc wait event data ready flag */ | 76 | /* lpfc wait event data ready flag */ |
64 | #define LPFC_DATA_READY (1<<0) | 77 | #define LPFC_DATA_READY (1<<0) |
65 | 78 | ||
@@ -357,6 +370,7 @@ struct lpfc_vport { | |||
357 | uint32_t cfg_log_verbose; | 370 | uint32_t cfg_log_verbose; |
358 | uint32_t cfg_max_luns; | 371 | uint32_t cfg_max_luns; |
359 | uint32_t cfg_enable_da_id; | 372 | uint32_t cfg_enable_da_id; |
373 | uint32_t cfg_max_scsicmpl_time; | ||
360 | 374 | ||
361 | uint32_t dev_loss_tmo_changed; | 375 | uint32_t dev_loss_tmo_changed; |
362 | 376 | ||
@@ -369,6 +383,8 @@ struct lpfc_vport { | |||
369 | struct lpfc_debugfs_trc *disc_trc; | 383 | struct lpfc_debugfs_trc *disc_trc; |
370 | atomic_t disc_trc_cnt; | 384 | atomic_t disc_trc_cnt; |
371 | #endif | 385 | #endif |
386 | uint8_t stat_data_enabled; | ||
387 | uint8_t stat_data_blocked; | ||
372 | }; | 388 | }; |
373 | 389 | ||
374 | struct hbq_s { | 390 | struct hbq_s { |
@@ -407,10 +423,11 @@ struct lpfc_hba { | |||
407 | struct lpfc_sli sli; | 423 | struct lpfc_sli sli; |
408 | uint32_t sli_rev; /* SLI2 or SLI3 */ | 424 | uint32_t sli_rev; /* SLI2 or SLI3 */ |
409 | uint32_t sli3_options; /* Mask of enabled SLI3 options */ | 425 | uint32_t sli3_options; /* Mask of enabled SLI3 options */ |
410 | #define LPFC_SLI3_ENABLED 0x01 | 426 | #define LPFC_SLI3_HBQ_ENABLED 0x01 |
411 | #define LPFC_SLI3_HBQ_ENABLED 0x02 | 427 | #define LPFC_SLI3_NPIV_ENABLED 0x02 |
412 | #define LPFC_SLI3_NPIV_ENABLED 0x04 | 428 | #define LPFC_SLI3_VPORT_TEARDOWN 0x04 |
413 | #define LPFC_SLI3_VPORT_TEARDOWN 0x08 | 429 | #define LPFC_SLI3_CRP_ENABLED 0x08 |
430 | #define LPFC_SLI3_INB_ENABLED 0x10 | ||
414 | uint32_t iocb_cmd_size; | 431 | uint32_t iocb_cmd_size; |
415 | uint32_t iocb_rsp_size; | 432 | uint32_t iocb_rsp_size; |
416 | 433 | ||
@@ -422,10 +439,20 @@ struct lpfc_hba { | |||
422 | #define LS_NPIV_FAB_SUPPORTED 0x2 /* Fabric supports NPIV */ | 439 | #define LS_NPIV_FAB_SUPPORTED 0x2 /* Fabric supports NPIV */ |
423 | #define LS_IGNORE_ERATT 0x4 /* intr handler should ignore ERATT */ | 440 | #define LS_IGNORE_ERATT 0x4 /* intr handler should ignore ERATT */ |
424 | 441 | ||
425 | struct lpfc_sli2_slim *slim2p; | 442 | uint32_t hba_flag; /* hba generic flags */ |
426 | struct lpfc_dmabuf hbqslimp; | 443 | #define HBA_ERATT_HANDLED 0x1 /* This flag is set when eratt handled */ |
444 | |||
445 | struct lpfc_dmabuf slim2p; | ||
427 | 446 | ||
428 | dma_addr_t slim2p_mapping; | 447 | MAILBOX_t *mbox; |
448 | uint32_t *inb_ha_copy; | ||
449 | uint32_t *inb_counter; | ||
450 | uint32_t inb_last_counter; | ||
451 | uint32_t ha_copy; | ||
452 | struct _PCB *pcb; | ||
453 | struct _IOCB *IOCBs; | ||
454 | |||
455 | struct lpfc_dmabuf hbqslimp; | ||
429 | 456 | ||
430 | uint16_t pci_cfg_value; | 457 | uint16_t pci_cfg_value; |
431 | 458 | ||
@@ -492,7 +519,7 @@ struct lpfc_hba { | |||
492 | 519 | ||
493 | wait_queue_head_t work_waitq; | 520 | wait_queue_head_t work_waitq; |
494 | struct task_struct *worker_thread; | 521 | struct task_struct *worker_thread; |
495 | long data_flags; | 522 | unsigned long data_flags; |
496 | 523 | ||
497 | uint32_t hbq_in_use; /* HBQs in use flag */ | 524 | uint32_t hbq_in_use; /* HBQs in use flag */ |
498 | struct list_head hbqbuf_in_list; /* in-fly hbq buffer list */ | 525 | struct list_head hbqbuf_in_list; /* in-fly hbq buffer list */ |
@@ -514,6 +541,7 @@ struct lpfc_hba { | |||
514 | void __iomem *HCregaddr; /* virtual address for host ctl reg */ | 541 | void __iomem *HCregaddr; /* virtual address for host ctl reg */ |
515 | 542 | ||
516 | struct lpfc_hgp __iomem *host_gp; /* Host side get/put pointers */ | 543 | struct lpfc_hgp __iomem *host_gp; /* Host side get/put pointers */ |
544 | struct lpfc_pgp *port_gp; | ||
517 | uint32_t __iomem *hbq_put; /* Address in SLIM to HBQ put ptrs */ | 545 | uint32_t __iomem *hbq_put; /* Address in SLIM to HBQ put ptrs */ |
518 | uint32_t *hbq_get; /* Host mem address of HBQ get ptrs */ | 546 | uint32_t *hbq_get; /* Host mem address of HBQ get ptrs */ |
519 | 547 | ||
@@ -536,6 +564,7 @@ struct lpfc_hba { | |||
536 | uint8_t soft_wwn_enable; | 564 | uint8_t soft_wwn_enable; |
537 | 565 | ||
538 | struct timer_list fcp_poll_timer; | 566 | struct timer_list fcp_poll_timer; |
567 | struct timer_list eratt_poll; | ||
539 | 568 | ||
540 | /* | 569 | /* |
541 | * stat counters | 570 | * stat counters |
@@ -565,7 +594,7 @@ struct lpfc_hba { | |||
565 | 594 | ||
566 | struct fc_host_statistics link_stats; | 595 | struct fc_host_statistics link_stats; |
567 | enum intr_type_t intr_type; | 596 | enum intr_type_t intr_type; |
568 | struct msix_entry msix_entries[1]; | 597 | struct msix_entry msix_entries[LPFC_MSIX_VECTORS]; |
569 | 598 | ||
570 | struct list_head port_list; | 599 | struct list_head port_list; |
571 | struct lpfc_vport *pport; /* physical lpfc_vport pointer */ | 600 | struct lpfc_vport *pport; /* physical lpfc_vport pointer */ |
@@ -605,6 +634,7 @@ struct lpfc_hba { | |||
605 | unsigned long last_completion_time; | 634 | unsigned long last_completion_time; |
606 | struct timer_list hb_tmofunc; | 635 | struct timer_list hb_tmofunc; |
607 | uint8_t hb_outstanding; | 636 | uint8_t hb_outstanding; |
637 | enum hba_temp_state over_temp_state; | ||
608 | /* ndlp reference management */ | 638 | /* ndlp reference management */ |
609 | spinlock_t ndlp_lock; | 639 | spinlock_t ndlp_lock; |
610 | /* | 640 | /* |
@@ -613,7 +643,19 @@ struct lpfc_hba { | |||
613 | */ | 643 | */ |
614 | #define QUE_BUFTAG_BIT (1<<31) | 644 | #define QUE_BUFTAG_BIT (1<<31) |
615 | uint32_t buffer_tag_count; | 645 | uint32_t buffer_tag_count; |
616 | enum hba_temp_state over_temp_state; | 646 | int wait_4_mlo_maint_flg; |
647 | wait_queue_head_t wait_4_mlo_m_q; | ||
648 | /* data structure used for latency data collection */ | ||
649 | #define LPFC_NO_BUCKET 0 | ||
650 | #define LPFC_LINEAR_BUCKET 1 | ||
651 | #define LPFC_POWER2_BUCKET 2 | ||
652 | uint8_t bucket_type; | ||
653 | uint32_t bucket_base; | ||
654 | uint32_t bucket_step; | ||
655 | |||
656 | /* Maximum number of events that can be outstanding at any time*/ | ||
657 | #define LPFC_MAX_EVT_COUNT 512 | ||
658 | atomic_t fast_event_count; | ||
617 | }; | 659 | }; |
618 | 660 | ||
619 | static inline struct Scsi_Host * | 661 | static inline struct Scsi_Host * |
@@ -650,15 +692,25 @@ lpfc_worker_wake_up(struct lpfc_hba *phba) | |||
650 | return; | 692 | return; |
651 | } | 693 | } |
652 | 694 | ||
653 | #define FC_REG_DUMP_EVENT 0x10 /* Register for Dump events */ | 695 | static inline void |
654 | #define FC_REG_TEMPERATURE_EVENT 0x20 /* Register for temperature | 696 | lpfc_sli_read_hs(struct lpfc_hba *phba) |
655 | event */ | 697 | { |
698 | /* | ||
699 | * There was a link/board error. Read the status register to retrieve | ||
700 | * the error event and process it. | ||
701 | */ | ||
702 | phba->sli.slistat.err_attn_event++; | ||
703 | |||
704 | /* Save status info */ | ||
705 | phba->work_hs = readl(phba->HSregaddr); | ||
706 | phba->work_status[0] = readl(phba->MBslimaddr + 0xa8); | ||
707 | phba->work_status[1] = readl(phba->MBslimaddr + 0xac); | ||
708 | |||
709 | /* Clear chip Host Attention error bit */ | ||
710 | writel(HA_ERATT, phba->HAregaddr); | ||
711 | readl(phba->HAregaddr); /* flush */ | ||
712 | phba->pport->stopped = 1; | ||
713 | |||
714 | return; | ||
715 | } | ||
656 | 716 | ||
657 | struct temp_event { | ||
658 | uint32_t event_type; | ||
659 | uint32_t event_code; | ||
660 | uint32_t data; | ||
661 | }; | ||
662 | #define LPFC_CRIT_TEMP 0x1 | ||
663 | #define LPFC_THRESHOLD_TEMP 0x2 | ||
664 | #define LPFC_NORMAL_TEMP 0x3 | ||