aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/lpfc/lpfc_sli4.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_sli4.h')
-rw-r--r--drivers/scsi/lpfc/lpfc_sli4.h82
1 files changed, 71 insertions, 11 deletions
diff --git a/drivers/scsi/lpfc/lpfc_sli4.h b/drivers/scsi/lpfc/lpfc_sli4.h
index 44e5f574236b..86308836600f 100644
--- a/drivers/scsi/lpfc/lpfc_sli4.h
+++ b/drivers/scsi/lpfc/lpfc_sli4.h
@@ -22,6 +22,10 @@
22#define LPFC_RELEASE_NOTIFICATION_INTERVAL 32 22#define LPFC_RELEASE_NOTIFICATION_INTERVAL 32
23#define LPFC_GET_QE_REL_INT 32 23#define LPFC_GET_QE_REL_INT 32
24#define LPFC_RPI_LOW_WATER_MARK 10 24#define LPFC_RPI_LOW_WATER_MARK 10
25
26/* Amount of time in seconds for waiting FCF rediscovery to complete */
27#define LPFC_FCF_REDISCOVER_WAIT_TMO 2000 /* msec */
28
25/* Number of SGL entries can be posted in a 4KB nonembedded mbox command */ 29/* Number of SGL entries can be posted in a 4KB nonembedded mbox command */
26#define LPFC_NEMBED_MBOX_SGL_CNT 254 30#define LPFC_NEMBED_MBOX_SGL_CNT 254
27 31
@@ -126,24 +130,36 @@ struct lpfc_sli4_link {
126 uint8_t status; 130 uint8_t status;
127 uint8_t physical; 131 uint8_t physical;
128 uint8_t fault; 132 uint8_t fault;
133 uint16_t logical_speed;
129}; 134};
130 135
131struct lpfc_fcf { 136struct lpfc_fcf_rec {
132 uint8_t fabric_name[8]; 137 uint8_t fabric_name[8];
133 uint8_t switch_name[8]; 138 uint8_t switch_name[8];
134 uint8_t mac_addr[6]; 139 uint8_t mac_addr[6];
135 uint16_t fcf_indx; 140 uint16_t fcf_indx;
141 uint32_t priority;
142 uint16_t vlan_id;
143 uint32_t addr_mode;
144 uint32_t flag;
145#define BOOT_ENABLE 0x01
146#define RECORD_VALID 0x02
147};
148
149struct lpfc_fcf {
136 uint16_t fcfi; 150 uint16_t fcfi;
137 uint32_t fcf_flag; 151 uint32_t fcf_flag;
138#define FCF_AVAILABLE 0x01 /* FCF available for discovery */ 152#define FCF_AVAILABLE 0x01 /* FCF available for discovery */
139#define FCF_REGISTERED 0x02 /* FCF registered with FW */ 153#define FCF_REGISTERED 0x02 /* FCF registered with FW */
140#define FCF_DISCOVERED 0x04 /* FCF discovery started */ 154#define FCF_SCAN_DONE 0x04 /* FCF table scan done */
141#define FCF_BOOT_ENABLE 0x08 /* Boot bios use this FCF */ 155#define FCF_IN_USE 0x08 /* Atleast one discovery completed */
142#define FCF_IN_USE 0x10 /* Atleast one discovery completed */ 156#define FCF_REDISC_PEND 0x10 /* FCF rediscovery pending */
143#define FCF_VALID_VLAN 0x20 /* Use the vlan id specified */ 157#define FCF_REDISC_EVT 0x20 /* FCF rediscovery event to worker thread */
144 uint32_t priority; 158#define FCF_REDISC_FOV 0x40 /* Post FCF rediscovery fast failover */
145 uint32_t addr_mode; 159 uint32_t addr_mode;
146 uint16_t vlan_id; 160 struct lpfc_fcf_rec current_rec;
161 struct lpfc_fcf_rec failover_rec;
162 struct timer_list redisc_wait;
147}; 163};
148 164
149#define LPFC_REGION23_SIGNATURE "RG23" 165#define LPFC_REGION23_SIGNATURE "RG23"
@@ -248,7 +264,10 @@ struct lpfc_bmbx {
248#define SLI4_CT_VFI 2 264#define SLI4_CT_VFI 2
249#define SLI4_CT_FCFI 3 265#define SLI4_CT_FCFI 3
250 266
251#define LPFC_SLI4_MAX_SEGMENT_SIZE 0x10000 267#define LPFC_SLI4_FL1_MAX_SEGMENT_SIZE 0x10000
268#define LPFC_SLI4_FL1_MAX_BUF_SIZE 0X2000
269#define LPFC_SLI4_MIN_BUF_SIZE 0x400
270#define LPFC_SLI4_MAX_BUF_SIZE 0x20000
252 271
253/* 272/*
254 * SLI4 specific data structures 273 * SLI4 specific data structures
@@ -282,6 +301,42 @@ struct lpfc_fcp_eq_hdl {
282 struct lpfc_hba *phba; 301 struct lpfc_hba *phba;
283}; 302};
284 303
304/* Port Capabilities for SLI4 Parameters */
305struct lpfc_pc_sli4_params {
306 uint32_t supported;
307 uint32_t if_type;
308 uint32_t sli_rev;
309 uint32_t sli_family;
310 uint32_t featurelevel_1;
311 uint32_t featurelevel_2;
312 uint32_t proto_types;
313#define LPFC_SLI4_PROTO_FCOE 0x0000001
314#define LPFC_SLI4_PROTO_FC 0x0000002
315#define LPFC_SLI4_PROTO_NIC 0x0000004
316#define LPFC_SLI4_PROTO_ISCSI 0x0000008
317#define LPFC_SLI4_PROTO_RDMA 0x0000010
318 uint32_t sge_supp_len;
319 uint32_t if_page_sz;
320 uint32_t rq_db_window;
321 uint32_t loopbk_scope;
322 uint32_t eq_pages_max;
323 uint32_t eqe_size;
324 uint32_t cq_pages_max;
325 uint32_t cqe_size;
326 uint32_t mq_pages_max;
327 uint32_t mqe_size;
328 uint32_t mq_elem_cnt;
329 uint32_t wq_pages_max;
330 uint32_t wqe_size;
331 uint32_t rq_pages_max;
332 uint32_t rqe_size;
333 uint32_t hdr_pages_max;
334 uint32_t hdr_size;
335 uint32_t hdr_pp_align;
336 uint32_t sgl_pages_max;
337 uint32_t sgl_pp_align;
338};
339
285/* SLI4 HBA data structure entries */ 340/* SLI4 HBA data structure entries */
286struct lpfc_sli4_hba { 341struct lpfc_sli4_hba {
287 void __iomem *conf_regs_memmap_p; /* Kernel memory mapped address for 342 void __iomem *conf_regs_memmap_p; /* Kernel memory mapped address for
@@ -295,7 +350,7 @@ struct lpfc_sli4_hba {
295 void __iomem *UERRHIregaddr; /* Address to UERR_STATUS_HI register */ 350 void __iomem *UERRHIregaddr; /* Address to UERR_STATUS_HI register */
296 void __iomem *UEMASKLOregaddr; /* Address to UE_MASK_LO register */ 351 void __iomem *UEMASKLOregaddr; /* Address to UE_MASK_LO register */
297 void __iomem *UEMASKHIregaddr; /* Address to UE_MASK_HI register */ 352 void __iomem *UEMASKHIregaddr; /* Address to UE_MASK_HI register */
298 void __iomem *SCRATCHPADregaddr; /* Address to scratchpad register */ 353 void __iomem *SLIINTFregaddr; /* Address to SLI_INTF register */
299 /* BAR1 FCoE function CSR register memory map */ 354 /* BAR1 FCoE function CSR register memory map */
300 void __iomem *STAregaddr; /* Address to HST_STATE register */ 355 void __iomem *STAregaddr; /* Address to HST_STATE register */
301 void __iomem *ISRregaddr; /* Address to HST_ISR register */ 356 void __iomem *ISRregaddr; /* Address to HST_ISR register */
@@ -310,6 +365,8 @@ struct lpfc_sli4_hba {
310 365
311 uint32_t ue_mask_lo; 366 uint32_t ue_mask_lo;
312 uint32_t ue_mask_hi; 367 uint32_t ue_mask_hi;
368 struct lpfc_register sli_intf;
369 struct lpfc_pc_sli4_params pc_sli4_params;
313 struct msix_entry *msix_entries; 370 struct msix_entry *msix_entries;
314 uint32_t cfg_eqn; 371 uint32_t cfg_eqn;
315 struct lpfc_fcp_eq_hdl *fcp_eq_hdl; /* FCP per-WQ handle */ 372 struct lpfc_fcp_eq_hdl *fcp_eq_hdl; /* FCP per-WQ handle */
@@ -406,6 +463,8 @@ void lpfc_sli4_mbox_cmd_free(struct lpfc_hba *, struct lpfcMboxq *);
406void lpfc_sli4_mbx_sge_set(struct lpfcMboxq *, uint32_t, dma_addr_t, uint32_t); 463void lpfc_sli4_mbx_sge_set(struct lpfcMboxq *, uint32_t, dma_addr_t, uint32_t);
407void lpfc_sli4_mbx_sge_get(struct lpfcMboxq *, uint32_t, 464void lpfc_sli4_mbx_sge_get(struct lpfcMboxq *, uint32_t,
408 struct lpfc_mbx_sge *); 465 struct lpfc_mbx_sge *);
466int lpfc_sli4_mbx_read_fcf_record(struct lpfc_hba *, struct lpfcMboxq *,
467 uint16_t);
409 468
410void lpfc_sli4_hba_reset(struct lpfc_hba *); 469void lpfc_sli4_hba_reset(struct lpfc_hba *);
411struct lpfc_queue *lpfc_sli4_queue_alloc(struct lpfc_hba *, uint32_t, 470struct lpfc_queue *lpfc_sli4_queue_alloc(struct lpfc_hba *, uint32_t,
@@ -448,6 +507,7 @@ int lpfc_sli4_alloc_rpi(struct lpfc_hba *);
448void lpfc_sli4_free_rpi(struct lpfc_hba *, int); 507void lpfc_sli4_free_rpi(struct lpfc_hba *, int);
449void lpfc_sli4_remove_rpis(struct lpfc_hba *); 508void lpfc_sli4_remove_rpis(struct lpfc_hba *);
450void lpfc_sli4_async_event_proc(struct lpfc_hba *); 509void lpfc_sli4_async_event_proc(struct lpfc_hba *);
510void lpfc_sli4_fcf_redisc_event_proc(struct lpfc_hba *);
451int lpfc_sli4_resume_rpi(struct lpfc_nodelist *); 511int lpfc_sli4_resume_rpi(struct lpfc_nodelist *);
452void lpfc_sli4_fcp_xri_abort_event_proc(struct lpfc_hba *); 512void lpfc_sli4_fcp_xri_abort_event_proc(struct lpfc_hba *);
453void lpfc_sli4_els_xri_abort_event_proc(struct lpfc_hba *); 513void lpfc_sli4_els_xri_abort_event_proc(struct lpfc_hba *);