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.h41
1 files changed, 33 insertions, 8 deletions
diff --git a/drivers/scsi/lpfc/lpfc.h b/drivers/scsi/lpfc/lpfc.h
index aa10f7951634..565e16dd74fc 100644
--- a/drivers/scsi/lpfc/lpfc.h
+++ b/drivers/scsi/lpfc/lpfc.h
@@ -1,7 +1,7 @@
1/******************************************************************* 1/*******************************************************************
2 * This file is part of the Emulex Linux Device Driver for * 2 * This file is part of the Emulex Linux Device Driver for *
3 * Fibre Channel Host Bus Adapters. * 3 * Fibre Channel Host Bus Adapters. *
4 * Copyright (C) 2004-2009 Emulex. All rights reserved. * 4 * Copyright (C) 2004-2010 Emulex. All rights reserved. *
5 * EMULEX and SLI are trademarks of Emulex. * 5 * EMULEX and SLI are trademarks of Emulex. *
6 * www.emulex.com * 6 * www.emulex.com *
7 * Portions Copyright (C) 2004-2005 Christoph Hellwig * 7 * Portions Copyright (C) 2004-2005 Christoph Hellwig *
@@ -37,6 +37,9 @@ struct lpfc_sli2_slim;
37 the NameServer before giving up. */ 37 the NameServer before giving up. */
38#define LPFC_CMD_PER_LUN 3 /* max outstanding cmds per lun */ 38#define LPFC_CMD_PER_LUN 3 /* max outstanding cmds per lun */
39#define LPFC_DEFAULT_SG_SEG_CNT 64 /* sg element count per scsi cmnd */ 39#define LPFC_DEFAULT_SG_SEG_CNT 64 /* sg element count per scsi cmnd */
40#define LPFC_DEFAULT_MENLO_SG_SEG_CNT 128 /* sg element count per scsi
41 cmnd for menlo needs nearly twice as for firmware
42 downloads using bsg */
40#define LPFC_DEFAULT_PROT_SG_SEG_CNT 4096 /* sg protection elements count */ 43#define LPFC_DEFAULT_PROT_SG_SEG_CNT 4096 /* sg protection elements count */
41#define LPFC_MAX_SG_SEG_CNT 4096 /* sg element count per scsi cmnd */ 44#define LPFC_MAX_SG_SEG_CNT 4096 /* sg element count per scsi cmnd */
42#define LPFC_MAX_PROT_SG_SEG_CNT 4096 /* prot sg element count per scsi cmd*/ 45#define LPFC_MAX_PROT_SG_SEG_CNT 4096 /* prot sg element count per scsi cmd*/
@@ -109,7 +112,8 @@ struct hbq_dmabuf {
109 struct lpfc_dmabuf dbuf; 112 struct lpfc_dmabuf dbuf;
110 uint32_t size; 113 uint32_t size;
111 uint32_t tag; 114 uint32_t tag;
112 struct lpfc_rcqe rcqe; 115 struct lpfc_cq_event cq_event;
116 unsigned long time_stamp;
113}; 117};
114 118
115/* Priority bit. Set value to exceed low water mark in lpfc_mem. */ 119/* Priority bit. Set value to exceed low water mark in lpfc_mem. */
@@ -201,6 +205,7 @@ struct lpfc_stats {
201 uint32_t elsRcvLIRR; 205 uint32_t elsRcvLIRR;
202 uint32_t elsRcvRPS; 206 uint32_t elsRcvRPS;
203 uint32_t elsRcvRPL; 207 uint32_t elsRcvRPL;
208 uint32_t elsRcvRRQ;
204 uint32_t elsXmitFLOGI; 209 uint32_t elsXmitFLOGI;
205 uint32_t elsXmitFDISC; 210 uint32_t elsXmitFDISC;
206 uint32_t elsXmitPLOGI; 211 uint32_t elsXmitPLOGI;
@@ -289,8 +294,8 @@ struct lpfc_vport {
289 294
290 uint16_t vpi; 295 uint16_t vpi;
291 uint16_t vfi; 296 uint16_t vfi;
292 uint8_t vfi_state; 297 uint8_t vpi_state;
293#define LPFC_VFI_REGISTERED 0x1 298#define LPFC_VPI_REGISTERED 0x1
294 299
295 uint32_t fc_flag; /* FC flags */ 300 uint32_t fc_flag; /* FC flags */
296/* Several of these flags are HBA centric and should be moved to 301/* Several of these flags are HBA centric and should be moved to
@@ -313,6 +318,9 @@ struct lpfc_vport {
313#define FC_VPORT_NEEDS_REG_VPI 0x80000 /* Needs to have its vpi registered */ 318#define FC_VPORT_NEEDS_REG_VPI 0x80000 /* Needs to have its vpi registered */
314#define FC_RSCN_DEFERRED 0x100000 /* A deferred RSCN being processed */ 319#define FC_RSCN_DEFERRED 0x100000 /* A deferred RSCN being processed */
315#define FC_VPORT_NEEDS_INIT_VPI 0x200000 /* Need to INIT_VPI before FDISC */ 320#define FC_VPORT_NEEDS_INIT_VPI 0x200000 /* Need to INIT_VPI before FDISC */
321#define FC_VPORT_CVL_RCVD 0x400000 /* VLink failed due to CVL */
322#define FC_VFI_REGISTERED 0x800000 /* VFI is registered */
323#define FC_FDISC_COMPLETED 0x1000000/* FDISC completed */
316 324
317 uint32_t ct_flags; 325 uint32_t ct_flags;
318#define FC_CT_RFF_ID 0x1 /* RFF_ID accepted by switch */ 326#define FC_CT_RFF_ID 0x1 /* RFF_ID accepted by switch */
@@ -405,6 +413,7 @@ struct lpfc_vport {
405 uint8_t stat_data_enabled; 413 uint8_t stat_data_enabled;
406 uint8_t stat_data_blocked; 414 uint8_t stat_data_blocked;
407 struct list_head rcv_buffer_list; 415 struct list_head rcv_buffer_list;
416 unsigned long rcv_buffer_time_stamp;
408 uint32_t vport_flag; 417 uint32_t vport_flag;
409#define STATIC_VPORT 1 418#define STATIC_VPORT 1
410}; 419};
@@ -445,6 +454,8 @@ struct unsol_rcv_ct_ctx {
445 uint32_t ctxt_id; 454 uint32_t ctxt_id;
446 uint32_t SID; 455 uint32_t SID;
447 uint32_t oxid; 456 uint32_t oxid;
457 uint32_t flags;
458#define UNSOL_VALID 0x00000001
448}; 459};
449 460
450struct lpfc_hba { 461struct lpfc_hba {
@@ -496,7 +507,10 @@ struct lpfc_hba {
496 (struct lpfc_hba *); 507 (struct lpfc_hba *);
497 void (*lpfc_stop_port) 508 void (*lpfc_stop_port)
498 (struct lpfc_hba *); 509 (struct lpfc_hba *);
499 510 int (*lpfc_hba_init_link)
511 (struct lpfc_hba *);
512 int (*lpfc_hba_down_link)
513 (struct lpfc_hba *);
500 514
501 /* SLI4 specific HBA data structure */ 515 /* SLI4 specific HBA data structure */
502 struct lpfc_sli4_hba sli4_hba; 516 struct lpfc_sli4_hba sli4_hba;
@@ -527,13 +541,16 @@ struct lpfc_hba {
527#define HBA_ERATT_HANDLED 0x1 /* This flag is set when eratt handled */ 541#define HBA_ERATT_HANDLED 0x1 /* This flag is set when eratt handled */
528#define DEFER_ERATT 0x2 /* Deferred error attention in progress */ 542#define DEFER_ERATT 0x2 /* Deferred error attention in progress */
529#define HBA_FCOE_SUPPORT 0x4 /* HBA function supports FCOE */ 543#define HBA_FCOE_SUPPORT 0x4 /* HBA function supports FCOE */
530#define HBA_RECEIVE_BUFFER 0x8 /* Rcv buffer posted to worker thread */ 544#define HBA_SP_QUEUE_EVT 0x8 /* Slow-path qevt posted to worker thread*/
531#define HBA_POST_RECEIVE_BUFFER 0x10 /* Rcv buffers need to be posted */ 545#define HBA_POST_RECEIVE_BUFFER 0x10 /* Rcv buffers need to be posted */
532#define FCP_XRI_ABORT_EVENT 0x20 546#define FCP_XRI_ABORT_EVENT 0x20
533#define ELS_XRI_ABORT_EVENT 0x40 547#define ELS_XRI_ABORT_EVENT 0x40
534#define ASYNC_EVENT 0x80 548#define ASYNC_EVENT 0x80
535#define LINK_DISABLED 0x100 /* Link disabled by user */ 549#define LINK_DISABLED 0x100 /* Link disabled by user */
536#define FCF_DISC_INPROGRESS 0x200 /* FCF discovery in progress */ 550#define FCF_DISC_INPROGRESS 0x200 /* FCF discovery in progress */
551#define HBA_FIP_SUPPORT 0x400 /* FIP support in HBA */
552#define HBA_AER_ENABLED 0x800 /* AER enabled with HBA */
553 uint32_t fcp_ring_in_use; /* When polling test if intr-hndlr active*/
537 struct lpfc_dmabuf slim2p; 554 struct lpfc_dmabuf slim2p;
538 555
539 MAILBOX_t *mbox; 556 MAILBOX_t *mbox;
@@ -551,6 +568,7 @@ struct lpfc_hba {
551 uint8_t fc_linkspeed; /* Link speed after last READ_LA */ 568 uint8_t fc_linkspeed; /* Link speed after last READ_LA */
552 569
553 uint32_t fc_eventTag; /* event tag for link attention */ 570 uint32_t fc_eventTag; /* event tag for link attention */
571 uint32_t link_events;
554 572
555 /* These fields used to be binfo */ 573 /* These fields used to be binfo */
556 uint32_t fc_pref_DID; /* preferred D_ID */ 574 uint32_t fc_pref_DID; /* preferred D_ID */
@@ -604,8 +622,12 @@ struct lpfc_hba {
604 uint32_t cfg_enable_hba_reset; 622 uint32_t cfg_enable_hba_reset;
605 uint32_t cfg_enable_hba_heartbeat; 623 uint32_t cfg_enable_hba_heartbeat;
606 uint32_t cfg_enable_bg; 624 uint32_t cfg_enable_bg;
607 uint32_t cfg_enable_fip;
608 uint32_t cfg_log_verbose; 625 uint32_t cfg_log_verbose;
626 uint32_t cfg_aer_support;
627 uint32_t cfg_suppress_link_up;
628#define LPFC_INITIALIZE_LINK 0 /* do normal init_link mbox */
629#define LPFC_DELAY_INIT_LINK 1 /* layered driver hold off */
630#define LPFC_DELAY_INIT_LINK_INDEFINITELY 2 /* wait, manual intervention */
609 631
610 lpfc_vpd_t vpd; /* vital product data */ 632 lpfc_vpd_t vpd; /* vital product data */
611 633
@@ -783,10 +805,13 @@ struct lpfc_hba {
783 uint16_t vlan_id; 805 uint16_t vlan_id;
784 struct list_head fcf_conn_rec_list; 806 struct list_head fcf_conn_rec_list;
785 807
786 struct mutex ct_event_mutex; /* synchronize access to ct_ev_waiters */ 808 spinlock_t ct_ev_lock; /* synchronize access to ct_ev_waiters */
787 struct list_head ct_ev_waiters; 809 struct list_head ct_ev_waiters;
788 struct unsol_rcv_ct_ctx ct_ctx[64]; 810 struct unsol_rcv_ct_ctx ct_ctx[64];
789 uint32_t ctx_idx; 811 uint32_t ctx_idx;
812
813 uint8_t menlo_flag; /* menlo generic flags */
814#define HBA_MENLO_SUPPORT 0x1 /* HBA supports menlo commands */
790}; 815};
791 816
792static inline struct Scsi_Host * 817static inline struct Scsi_Host *