aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/lpfc/lpfc.h')
-rw-r--r--drivers/scsi/lpfc/lpfc.h35
1 files changed, 34 insertions, 1 deletions
diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h
index aee5444b63d9..181538466117 100644
--- a/drivers/scsi/lpfc/lpfc.h
+++ b/drivers/scsi/lpfc/lpfc.h
@@ -49,6 +49,9 @@ struct lpfc_sli2_slim;
49#define LPFC_HB_MBOX_INTERVAL 5 /* Heart beat interval in seconds. */ 49#define LPFC_HB_MBOX_INTERVAL 5 /* Heart beat interval in seconds. */
50#define LPFC_HB_MBOX_TIMEOUT 30 /* Heart beat timeout in seconds. */ 50#define LPFC_HB_MBOX_TIMEOUT 30 /* Heart beat timeout in seconds. */
51 51
52/* Error Attention event polling interval */
53#define LPFC_ERATT_POLL_INTERVAL 5 /* EATT poll interval in seconds */
54
52/* Define macros for 64 bit support */ 55/* Define macros for 64 bit support */
53#define putPaddrLow(addr) ((uint32_t) (0xffffffff & (u64)(addr))) 56#define putPaddrLow(addr) ((uint32_t) (0xffffffff & (u64)(addr)))
54#define putPaddrHigh(addr) ((uint32_t) (0xffffffff & (((u64)(addr))>>32))) 57#define putPaddrHigh(addr) ((uint32_t) (0xffffffff & (((u64)(addr))>>32)))
@@ -60,6 +63,9 @@ struct lpfc_sli2_slim;
60 63
61#define MAX_HBAEVT 32 64#define MAX_HBAEVT 32
62 65
66/* Number of MSI-X vectors the driver uses */
67#define LPFC_MSIX_VECTORS 2
68
63/* lpfc wait event data ready flag */ 69/* lpfc wait event data ready flag */
64#define LPFC_DATA_READY (1<<0) 70#define LPFC_DATA_READY (1<<0)
65 71
@@ -423,12 +429,16 @@ struct lpfc_hba {
423#define LS_NPIV_FAB_SUPPORTED 0x2 /* Fabric supports NPIV */ 429#define LS_NPIV_FAB_SUPPORTED 0x2 /* Fabric supports NPIV */
424#define LS_IGNORE_ERATT 0x4 /* intr handler should ignore ERATT */ 430#define LS_IGNORE_ERATT 0x4 /* intr handler should ignore ERATT */
425 431
432 uint32_t hba_flag; /* hba generic flags */
433#define HBA_ERATT_HANDLED 0x1 /* This flag is set when eratt handled */
434
426 struct lpfc_dmabuf slim2p; 435 struct lpfc_dmabuf slim2p;
427 436
428 MAILBOX_t *mbox; 437 MAILBOX_t *mbox;
429 uint32_t *inb_ha_copy; 438 uint32_t *inb_ha_copy;
430 uint32_t *inb_counter; 439 uint32_t *inb_counter;
431 uint32_t inb_last_counter; 440 uint32_t inb_last_counter;
441 uint32_t ha_copy;
432 struct _PCB *pcb; 442 struct _PCB *pcb;
433 struct _IOCB *IOCBs; 443 struct _IOCB *IOCBs;
434 444
@@ -544,6 +554,7 @@ struct lpfc_hba {
544 uint8_t soft_wwn_enable; 554 uint8_t soft_wwn_enable;
545 555
546 struct timer_list fcp_poll_timer; 556 struct timer_list fcp_poll_timer;
557 struct timer_list eratt_poll;
547 558
548 /* 559 /*
549 * stat counters 560 * stat counters
@@ -573,7 +584,7 @@ struct lpfc_hba {
573 584
574 struct fc_host_statistics link_stats; 585 struct fc_host_statistics link_stats;
575 enum intr_type_t intr_type; 586 enum intr_type_t intr_type;
576 struct msix_entry msix_entries[1]; 587 struct msix_entry msix_entries[LPFC_MSIX_VECTORS];
577 588
578 struct list_head port_list; 589 struct list_head port_list;
579 struct lpfc_vport *pport; /* physical lpfc_vport pointer */ 590 struct lpfc_vport *pport; /* physical lpfc_vport pointer */
@@ -660,6 +671,28 @@ lpfc_worker_wake_up(struct lpfc_hba *phba)
660 return; 671 return;
661} 672}
662 673
674static inline void
675lpfc_sli_read_hs(struct lpfc_hba *phba)
676{
677 /*
678 * There was a link/board error. Read the status register to retrieve
679 * the error event and process it.
680 */
681 phba->sli.slistat.err_attn_event++;
682
683 /* Save status info */
684 phba->work_hs = readl(phba->HSregaddr);
685 phba->work_status[0] = readl(phba->MBslimaddr + 0xa8);
686 phba->work_status[1] = readl(phba->MBslimaddr + 0xac);
687
688 /* Clear chip Host Attention error bit */
689 writel(HA_ERATT, phba->HAregaddr);
690 readl(phba->HAregaddr); /* flush */
691 phba->pport->stopped = 1;
692
693 return;
694}
695
663#define FC_REG_DUMP_EVENT 0x10 /* Register for Dump events */ 696#define FC_REG_DUMP_EVENT 0x10 /* Register for Dump events */
664#define FC_REG_TEMPERATURE_EVENT 0x20 /* Register for temperature 697#define FC_REG_TEMPERATURE_EVENT 0x20 /* Register for temperature
665 event */ 698 event */