hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/drivers/scsi/lpfc/lpfc_crtn.h
....@@ -1,7 +1,7 @@
11 /*******************************************************************
22 * This file is part of the Emulex Linux Device Driver for *
33 * Fibre Channel Host Bus Adapters. *
4
- * Copyright (C) 2017-2018 Broadcom. All Rights Reserved. The term *
4
+ * Copyright (C) 2017-2019 Broadcom. All Rights Reserved. The term *
55 * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. *
66 * Copyright (C) 2004-2016 Emulex. All rights reserved. *
77 * EMULEX and SLI are trademarks of Emulex. *
....@@ -24,7 +24,6 @@
2424
2525 struct fc_rport;
2626 struct fc_frame_header;
27
-struct lpfc_nvmet_rcv_ctx;
2827 void lpfc_down_link(struct lpfc_hba *, LPFC_MBOXQ_t *);
2928 void lpfc_sli_read_link_ste(struct lpfc_hba *);
3029 void lpfc_dump_mem(struct lpfc_hba *, LPFC_MBOXQ_t *, uint16_t, uint16_t);
....@@ -71,7 +70,6 @@
7170 void lpfc_init_vpi_cmpl(struct lpfc_hba *, LPFC_MBOXQ_t *);
7271 void lpfc_cancel_all_vport_retry_delay_timer(struct lpfc_hba *);
7372 void lpfc_retry_pport_discovery(struct lpfc_hba *);
74
-void lpfc_release_rpi(struct lpfc_hba *, struct lpfc_vport *, uint16_t);
7573 int lpfc_init_iocb_list(struct lpfc_hba *phba, int cnt);
7674 void lpfc_free_iocb_list(struct lpfc_hba *phba);
7775 int lpfc_post_rq_buffer(struct lpfc_hba *phba, struct lpfc_queue *hrq,
....@@ -138,8 +136,10 @@
138136 int lpfc_issue_els_adisc(struct lpfc_vport *, struct lpfc_nodelist *, uint8_t);
139137 int lpfc_issue_els_logo(struct lpfc_vport *, struct lpfc_nodelist *, uint8_t);
140138 int lpfc_issue_els_npiv_logo(struct lpfc_vport *, struct lpfc_nodelist *);
141
-int lpfc_issue_els_scr(struct lpfc_vport *, uint32_t, uint8_t);
139
+int lpfc_issue_els_scr(struct lpfc_vport *vport, uint8_t retry);
140
+int lpfc_issue_els_rscn(struct lpfc_vport *vport, uint8_t retry);
142141 int lpfc_issue_fabric_reglogin(struct lpfc_vport *);
142
+int lpfc_issue_els_rdf(struct lpfc_vport *vport, uint8_t retry);
143143 int lpfc_els_free_iocb(struct lpfc_hba *, struct lpfc_iocbq *);
144144 int lpfc_ct_free_iocb(struct lpfc_hba *, struct lpfc_iocbq *);
145145 int lpfc_els_rsp_acc(struct lpfc_vport *, uint32_t, struct lpfc_iocbq *,
....@@ -172,11 +172,12 @@
172172 void lpfc_ct_unsol_event(struct lpfc_hba *, struct lpfc_sli_ring *,
173173 struct lpfc_iocbq *);
174174 int lpfc_ct_handle_unsol_abort(struct lpfc_hba *, struct hbq_dmabuf *);
175
+int lpfc_issue_gidpt(struct lpfc_vport *vport);
175176 int lpfc_issue_gidft(struct lpfc_vport *vport);
176177 int lpfc_get_gidft_type(struct lpfc_vport *vport, struct lpfc_iocbq *iocbq);
177178 int lpfc_ns_cmd(struct lpfc_vport *, int, uint8_t, uint32_t);
178179 int lpfc_fdmi_cmd(struct lpfc_vport *, struct lpfc_nodelist *, int, uint32_t);
179
-void lpfc_fdmi_num_disc_check(struct lpfc_vport *);
180
+void lpfc_fdmi_change_check(struct lpfc_vport *vport);
180181 void lpfc_delayed_disc_tmo(struct timer_list *);
181182 void lpfc_delayed_disc_timeout_handler(struct lpfc_vport *);
182183
....@@ -196,11 +197,6 @@
196197 int lpfc_emptyq_wait(struct lpfc_hba *phba, struct list_head *hd,
197198 spinlock_t *slock);
198199
199
-int lpfc_fof_queue_create(struct lpfc_hba *);
200
-int lpfc_fof_queue_setup(struct lpfc_hba *);
201
-int lpfc_fof_queue_destroy(struct lpfc_hba *);
202
-irqreturn_t lpfc_sli4_fof_intr_handler(int, void *);
203
-
204200 int lpfc_sli_setup(struct lpfc_hba *);
205201 int lpfc_sli4_setup(struct lpfc_hba *phba);
206202 void lpfc_sli_queue_init(struct lpfc_hba *phba);
....@@ -215,6 +211,12 @@
215211 irqreturn_t lpfc_sli_fp_intr_handler(int, void *);
216212 irqreturn_t lpfc_sli4_intr_handler(int, void *);
217213 irqreturn_t lpfc_sli4_hba_intr_handler(int, void *);
214
+
215
+void lpfc_sli4_cleanup_poll_list(struct lpfc_hba *phba);
216
+int lpfc_sli4_poll_eq(struct lpfc_queue *q, uint8_t path);
217
+void lpfc_sli4_poll_hbtimer(struct timer_list *t);
218
+void lpfc_sli4_start_polling(struct lpfc_queue *q);
219
+void lpfc_sli4_stop_polling(struct lpfc_queue *q);
218220
219221 void lpfc_read_rev(struct lpfc_hba *, LPFC_MBOXQ_t *);
220222 void lpfc_sli4_swap_str(struct lpfc_hba *, LPFC_MBOXQ_t *);
....@@ -317,8 +319,8 @@
317319 void lpfc_sli4_unreg_rpi_cmpl_clr(struct lpfc_hba *, LPFC_MBOXQ_t *);
318320 int lpfc_sli_issue_iocb(struct lpfc_hba *, uint32_t,
319321 struct lpfc_iocbq *, uint32_t);
320
-int lpfc_sli4_issue_wqe(struct lpfc_hba *phba, uint32_t rnum,
321
- struct lpfc_iocbq *iocbq);
322
+int lpfc_sli4_issue_wqe(struct lpfc_hba *phba, struct lpfc_sli4_hdw_queue *qp,
323
+ struct lpfc_iocbq *pwqe);
322324 struct lpfc_sglq *__lpfc_clear_active_sglq(struct lpfc_hba *phba, uint16_t xri);
323325 struct lpfc_sglq *__lpfc_sli_get_nvmet_sglq(struct lpfc_hba *phba,
324326 struct lpfc_iocbq *piocbq);
....@@ -327,7 +329,7 @@
327329 void lpfc_sli_abort_iocb_ring(struct lpfc_hba *, struct lpfc_sli_ring *);
328330 void lpfc_sli_abort_fcp_rings(struct lpfc_hba *phba);
329331 void lpfc_sli_hba_iocb_abort(struct lpfc_hba *);
330
-void lpfc_sli_flush_fcp_rings(struct lpfc_hba *);
332
+void lpfc_sli_flush_io_rings(struct lpfc_hba *phba);
331333 int lpfc_sli_ringpostbuf_put(struct lpfc_hba *, struct lpfc_sli_ring *,
332334 struct lpfc_dmabuf *);
333335 struct lpfc_dmabuf *lpfc_sli_ringpostbuf_get(struct lpfc_hba *,
....@@ -357,6 +359,7 @@
357359 struct lpfc_nodelist *lpfc_findnode_did(struct lpfc_vport *, uint32_t);
358360 struct lpfc_nodelist *lpfc_findnode_wwpn(struct lpfc_vport *,
359361 struct lpfc_name *);
362
+struct lpfc_nodelist *lpfc_findnode_mapped(struct lpfc_vport *vport);
360363
361364 int lpfc_sli_issue_mbox_wait(struct lpfc_hba *, LPFC_MBOXQ_t *, uint32_t);
362365
....@@ -377,8 +380,10 @@
377380
378381 void lpfc_in_buf_free(struct lpfc_hba *, struct lpfc_dmabuf *);
379382 void lpfc_rq_buf_free(struct lpfc_hba *phba, struct lpfc_dmabuf *mp);
383
+int lpfc_link_reset(struct lpfc_vport *vport);
380384
381385 /* Function prototypes. */
386
+int lpfc_check_pci_resettable(struct lpfc_hba *phba);
382387 const char* lpfc_info(struct Scsi_Host *);
383388 int lpfc_scan_finished(struct Scsi_Host *, unsigned long);
384389
....@@ -395,9 +400,7 @@
395400 extern struct device_attribute *lpfc_hba_attrs[];
396401 extern struct device_attribute *lpfc_vport_attrs[];
397402 extern struct scsi_host_template lpfc_template;
398
-extern struct scsi_host_template lpfc_template_no_hr;
399403 extern struct scsi_host_template lpfc_template_nvme;
400
-extern struct scsi_host_template lpfc_vport_template;
401404 extern struct fc_function_template lpfc_transport_functions;
402405 extern struct fc_function_template lpfc_vport_transport_functions;
403406
....@@ -430,17 +433,6 @@
430433 uint16_t *, uint16_t *);
431434 int lpfc_sli4_get_avail_extnt_rsrc(struct lpfc_hba *, uint16_t,
432435 uint16_t *, uint16_t *);
433
-
434
-/* externs BlockGuard */
435
-extern char *_dump_buf_data;
436
-extern unsigned long _dump_buf_data_order;
437
-extern char *_dump_buf_dif;
438
-extern unsigned long _dump_buf_dif_order;
439
-extern spinlock_t _dump_buf_lock;
440
-extern int _dump_buf_done;
441
-extern spinlock_t pgcnt_lock;
442
-extern unsigned int pgcnt;
443
-extern unsigned int lpfc_fcp_look_ahead;
444436
445437 /* Interface exported by fabric iocb scheduler */
446438 void lpfc_fabric_abort_nport(struct lpfc_nodelist *);
....@@ -515,8 +507,13 @@
515507 void lpfc_sli4_node_prep(struct lpfc_hba *);
516508 int lpfc_sli4_els_sgl_update(struct lpfc_hba *phba);
517509 int lpfc_sli4_nvmet_sgl_update(struct lpfc_hba *phba);
518
-int lpfc_sli4_scsi_sgl_update(struct lpfc_hba *phba);
519
-int lpfc_sli4_nvme_sgl_update(struct lpfc_hba *phba);
510
+int lpfc_io_buf_flush(struct lpfc_hba *phba, struct list_head *sglist);
511
+int lpfc_io_buf_replenish(struct lpfc_hba *phba, struct list_head *cbuf);
512
+int lpfc_sli4_io_sgl_update(struct lpfc_hba *phba);
513
+int lpfc_sli4_post_io_sgl_list(struct lpfc_hba *phba,
514
+ struct list_head *blist, int xricnt);
515
+int lpfc_new_io_buf(struct lpfc_hba *phba, int num_to_alloc);
516
+void lpfc_io_free(struct lpfc_hba *phba);
520517 void lpfc_free_sgl_list(struct lpfc_hba *, struct list_head *);
521518 uint32_t lpfc_sli_port_speed_get(struct lpfc_hba *);
522519 int lpfc_sli4_request_firmware_update(struct lpfc_hba *, uint8_t);
....@@ -542,7 +539,17 @@
542539 int lpfc_sli4_dump_page_a0(struct lpfc_hba *phba, struct lpfcMboxq *mbox);
543540 void lpfc_mbx_cmpl_rdp_page_a0(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb);
544541
542
+/* RAS Interface */
543
+void lpfc_sli4_ras_init(struct lpfc_hba *phba);
544
+void lpfc_sli4_ras_setup(struct lpfc_hba *phba);
545
+int lpfc_sli4_ras_fwlog_init(struct lpfc_hba *phba, uint32_t fwlog_level,
546
+ uint32_t fwlog_enable);
547
+void lpfc_ras_stop_fwlog(struct lpfc_hba *phba);
548
+int lpfc_check_fwlog_support(struct lpfc_hba *phba);
549
+
545550 /* NVME interfaces. */
551
+void lpfc_nvme_rescan_port(struct lpfc_vport *vport,
552
+ struct lpfc_nodelist *ndlp);
546553 void lpfc_nvme_unregister_port(struct lpfc_vport *vport,
547554 struct lpfc_nodelist *ndlp);
548555 int lpfc_nvme_register_port(struct lpfc_vport *vport,
....@@ -553,16 +560,39 @@
553560 int lpfc_nvmet_create_targetport(struct lpfc_hba *phba);
554561 int lpfc_nvmet_update_targetport(struct lpfc_hba *phba);
555562 void lpfc_nvmet_destroy_targetport(struct lpfc_hba *phba);
556
-void lpfc_nvmet_unsol_ls_event(struct lpfc_hba *phba,
557
- struct lpfc_sli_ring *pring, struct lpfc_iocbq *piocb);
563
+int lpfc_nvme_handle_lsreq(struct lpfc_hba *phba,
564
+ struct lpfc_async_xchg_ctx *axchg);
565
+int lpfc_nvmet_handle_lsreq(struct lpfc_hba *phba,
566
+ struct lpfc_async_xchg_ctx *axchg);
558567 void lpfc_nvmet_unsol_fcp_event(struct lpfc_hba *phba, uint32_t idx,
559
- struct rqb_dmabuf *nvmebuf, uint64_t isr_ts);
568
+ struct rqb_dmabuf *nvmebuf, uint64_t isr_ts,
569
+ uint8_t cqflag);
560570 void lpfc_nvme_mod_param_dep(struct lpfc_hba *phba);
571
+void lpfc_nvmet_invalidate_host(struct lpfc_hba *phba,
572
+ struct lpfc_nodelist *ndlp);
561573 void lpfc_nvme_abort_fcreq_cmpl(struct lpfc_hba *phba,
562574 struct lpfc_iocbq *cmdiocb,
563575 struct lpfc_wcqe_complete *abts_cmpl);
576
+void lpfc_create_multixri_pools(struct lpfc_hba *phba);
577
+void lpfc_create_destroy_pools(struct lpfc_hba *phba);
578
+void lpfc_move_xri_pvt_to_pbl(struct lpfc_hba *phba, u32 hwqid);
579
+void lpfc_move_xri_pbl_to_pvt(struct lpfc_hba *phba, u32 hwqid, u32 cnt);
580
+void lpfc_adjust_high_watermark(struct lpfc_hba *phba, u32 hwqid);
581
+void lpfc_keep_pvt_pool_above_lowwm(struct lpfc_hba *phba, u32 hwqid);
582
+void lpfc_adjust_pvt_pool_count(struct lpfc_hba *phba, u32 hwqid);
583
+#ifdef LPFC_MXP_STAT
584
+void lpfc_snapshot_mxp(struct lpfc_hba *, u32);
585
+#endif
586
+struct lpfc_io_buf *lpfc_get_io_buf(struct lpfc_hba *phba,
587
+ struct lpfc_nodelist *ndlp, u32 hwqid,
588
+ int);
589
+void lpfc_release_io_buf(struct lpfc_hba *phba, struct lpfc_io_buf *ncmd,
590
+ struct lpfc_sli4_hdw_queue *qp);
591
+void lpfc_io_ktime(struct lpfc_hba *phba, struct lpfc_io_buf *ncmd);
564592 void lpfc_nvme_cmd_template(void);
565593 void lpfc_nvmet_cmd_template(void);
594
+void lpfc_nvme_cancel_iocb(struct lpfc_hba *phba, struct lpfc_iocbq *pwqeIn);
595
+void lpfc_nvme_prep_abort_wqe(struct lpfc_iocbq *pwqeq, u16 xritag, u8 opt);
566596 extern int lpfc_enable_nvmet_cnt;
567597 extern unsigned long long lpfc_enable_nvmet[];
568598 extern int lpfc_no_hba_reset_cnt;