| .. | .. |
|---|
| 1 | 1 | /******************************************************************* |
|---|
| 2 | 2 | * This file is part of the Emulex Linux Device Driver for * |
|---|
| 3 | 3 | * 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 * |
|---|
| 5 | 5 | * “Broadcom” refers to Broadcom Inc. and/or its subsidiaries. * |
|---|
| 6 | 6 | * Copyright (C) 2004-2016 Emulex. All rights reserved. * |
|---|
| 7 | 7 | * EMULEX and SLI are trademarks of Emulex. * |
|---|
| .. | .. |
|---|
| 24 | 24 | |
|---|
| 25 | 25 | struct fc_rport; |
|---|
| 26 | 26 | struct fc_frame_header; |
|---|
| 27 | | -struct lpfc_nvmet_rcv_ctx; |
|---|
| 28 | 27 | void lpfc_down_link(struct lpfc_hba *, LPFC_MBOXQ_t *); |
|---|
| 29 | 28 | void lpfc_sli_read_link_ste(struct lpfc_hba *); |
|---|
| 30 | 29 | void lpfc_dump_mem(struct lpfc_hba *, LPFC_MBOXQ_t *, uint16_t, uint16_t); |
|---|
| .. | .. |
|---|
| 71 | 70 | void lpfc_init_vpi_cmpl(struct lpfc_hba *, LPFC_MBOXQ_t *); |
|---|
| 72 | 71 | void lpfc_cancel_all_vport_retry_delay_timer(struct lpfc_hba *); |
|---|
| 73 | 72 | void lpfc_retry_pport_discovery(struct lpfc_hba *); |
|---|
| 74 | | -void lpfc_release_rpi(struct lpfc_hba *, struct lpfc_vport *, uint16_t); |
|---|
| 75 | 73 | int lpfc_init_iocb_list(struct lpfc_hba *phba, int cnt); |
|---|
| 76 | 74 | void lpfc_free_iocb_list(struct lpfc_hba *phba); |
|---|
| 77 | 75 | int lpfc_post_rq_buffer(struct lpfc_hba *phba, struct lpfc_queue *hrq, |
|---|
| .. | .. |
|---|
| 138 | 136 | int lpfc_issue_els_adisc(struct lpfc_vport *, struct lpfc_nodelist *, uint8_t); |
|---|
| 139 | 137 | int lpfc_issue_els_logo(struct lpfc_vport *, struct lpfc_nodelist *, uint8_t); |
|---|
| 140 | 138 | 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); |
|---|
| 142 | 141 | int lpfc_issue_fabric_reglogin(struct lpfc_vport *); |
|---|
| 142 | +int lpfc_issue_els_rdf(struct lpfc_vport *vport, uint8_t retry); |
|---|
| 143 | 143 | int lpfc_els_free_iocb(struct lpfc_hba *, struct lpfc_iocbq *); |
|---|
| 144 | 144 | int lpfc_ct_free_iocb(struct lpfc_hba *, struct lpfc_iocbq *); |
|---|
| 145 | 145 | int lpfc_els_rsp_acc(struct lpfc_vport *, uint32_t, struct lpfc_iocbq *, |
|---|
| .. | .. |
|---|
| 172 | 172 | void lpfc_ct_unsol_event(struct lpfc_hba *, struct lpfc_sli_ring *, |
|---|
| 173 | 173 | struct lpfc_iocbq *); |
|---|
| 174 | 174 | int lpfc_ct_handle_unsol_abort(struct lpfc_hba *, struct hbq_dmabuf *); |
|---|
| 175 | +int lpfc_issue_gidpt(struct lpfc_vport *vport); |
|---|
| 175 | 176 | int lpfc_issue_gidft(struct lpfc_vport *vport); |
|---|
| 176 | 177 | int lpfc_get_gidft_type(struct lpfc_vport *vport, struct lpfc_iocbq *iocbq); |
|---|
| 177 | 178 | int lpfc_ns_cmd(struct lpfc_vport *, int, uint8_t, uint32_t); |
|---|
| 178 | 179 | 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); |
|---|
| 180 | 181 | void lpfc_delayed_disc_tmo(struct timer_list *); |
|---|
| 181 | 182 | void lpfc_delayed_disc_timeout_handler(struct lpfc_vport *); |
|---|
| 182 | 183 | |
|---|
| .. | .. |
|---|
| 196 | 197 | int lpfc_emptyq_wait(struct lpfc_hba *phba, struct list_head *hd, |
|---|
| 197 | 198 | spinlock_t *slock); |
|---|
| 198 | 199 | |
|---|
| 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 | | - |
|---|
| 204 | 200 | int lpfc_sli_setup(struct lpfc_hba *); |
|---|
| 205 | 201 | int lpfc_sli4_setup(struct lpfc_hba *phba); |
|---|
| 206 | 202 | void lpfc_sli_queue_init(struct lpfc_hba *phba); |
|---|
| .. | .. |
|---|
| 215 | 211 | irqreturn_t lpfc_sli_fp_intr_handler(int, void *); |
|---|
| 216 | 212 | irqreturn_t lpfc_sli4_intr_handler(int, void *); |
|---|
| 217 | 213 | 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); |
|---|
| 218 | 220 | |
|---|
| 219 | 221 | void lpfc_read_rev(struct lpfc_hba *, LPFC_MBOXQ_t *); |
|---|
| 220 | 222 | void lpfc_sli4_swap_str(struct lpfc_hba *, LPFC_MBOXQ_t *); |
|---|
| .. | .. |
|---|
| 317 | 319 | void lpfc_sli4_unreg_rpi_cmpl_clr(struct lpfc_hba *, LPFC_MBOXQ_t *); |
|---|
| 318 | 320 | int lpfc_sli_issue_iocb(struct lpfc_hba *, uint32_t, |
|---|
| 319 | 321 | 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); |
|---|
| 322 | 324 | struct lpfc_sglq *__lpfc_clear_active_sglq(struct lpfc_hba *phba, uint16_t xri); |
|---|
| 323 | 325 | struct lpfc_sglq *__lpfc_sli_get_nvmet_sglq(struct lpfc_hba *phba, |
|---|
| 324 | 326 | struct lpfc_iocbq *piocbq); |
|---|
| .. | .. |
|---|
| 327 | 329 | void lpfc_sli_abort_iocb_ring(struct lpfc_hba *, struct lpfc_sli_ring *); |
|---|
| 328 | 330 | void lpfc_sli_abort_fcp_rings(struct lpfc_hba *phba); |
|---|
| 329 | 331 | 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); |
|---|
| 331 | 333 | int lpfc_sli_ringpostbuf_put(struct lpfc_hba *, struct lpfc_sli_ring *, |
|---|
| 332 | 334 | struct lpfc_dmabuf *); |
|---|
| 333 | 335 | struct lpfc_dmabuf *lpfc_sli_ringpostbuf_get(struct lpfc_hba *, |
|---|
| .. | .. |
|---|
| 357 | 359 | struct lpfc_nodelist *lpfc_findnode_did(struct lpfc_vport *, uint32_t); |
|---|
| 358 | 360 | struct lpfc_nodelist *lpfc_findnode_wwpn(struct lpfc_vport *, |
|---|
| 359 | 361 | struct lpfc_name *); |
|---|
| 362 | +struct lpfc_nodelist *lpfc_findnode_mapped(struct lpfc_vport *vport); |
|---|
| 360 | 363 | |
|---|
| 361 | 364 | int lpfc_sli_issue_mbox_wait(struct lpfc_hba *, LPFC_MBOXQ_t *, uint32_t); |
|---|
| 362 | 365 | |
|---|
| .. | .. |
|---|
| 377 | 380 | |
|---|
| 378 | 381 | void lpfc_in_buf_free(struct lpfc_hba *, struct lpfc_dmabuf *); |
|---|
| 379 | 382 | void lpfc_rq_buf_free(struct lpfc_hba *phba, struct lpfc_dmabuf *mp); |
|---|
| 383 | +int lpfc_link_reset(struct lpfc_vport *vport); |
|---|
| 380 | 384 | |
|---|
| 381 | 385 | /* Function prototypes. */ |
|---|
| 386 | +int lpfc_check_pci_resettable(struct lpfc_hba *phba); |
|---|
| 382 | 387 | const char* lpfc_info(struct Scsi_Host *); |
|---|
| 383 | 388 | int lpfc_scan_finished(struct Scsi_Host *, unsigned long); |
|---|
| 384 | 389 | |
|---|
| .. | .. |
|---|
| 395 | 400 | extern struct device_attribute *lpfc_hba_attrs[]; |
|---|
| 396 | 401 | extern struct device_attribute *lpfc_vport_attrs[]; |
|---|
| 397 | 402 | extern struct scsi_host_template lpfc_template; |
|---|
| 398 | | -extern struct scsi_host_template lpfc_template_no_hr; |
|---|
| 399 | 403 | extern struct scsi_host_template lpfc_template_nvme; |
|---|
| 400 | | -extern struct scsi_host_template lpfc_vport_template; |
|---|
| 401 | 404 | extern struct fc_function_template lpfc_transport_functions; |
|---|
| 402 | 405 | extern struct fc_function_template lpfc_vport_transport_functions; |
|---|
| 403 | 406 | |
|---|
| .. | .. |
|---|
| 430 | 433 | uint16_t *, uint16_t *); |
|---|
| 431 | 434 | int lpfc_sli4_get_avail_extnt_rsrc(struct lpfc_hba *, uint16_t, |
|---|
| 432 | 435 | 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; |
|---|
| 444 | 436 | |
|---|
| 445 | 437 | /* Interface exported by fabric iocb scheduler */ |
|---|
| 446 | 438 | void lpfc_fabric_abort_nport(struct lpfc_nodelist *); |
|---|
| .. | .. |
|---|
| 515 | 507 | void lpfc_sli4_node_prep(struct lpfc_hba *); |
|---|
| 516 | 508 | int lpfc_sli4_els_sgl_update(struct lpfc_hba *phba); |
|---|
| 517 | 509 | 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); |
|---|
| 520 | 517 | void lpfc_free_sgl_list(struct lpfc_hba *, struct list_head *); |
|---|
| 521 | 518 | uint32_t lpfc_sli_port_speed_get(struct lpfc_hba *); |
|---|
| 522 | 519 | int lpfc_sli4_request_firmware_update(struct lpfc_hba *, uint8_t); |
|---|
| .. | .. |
|---|
| 542 | 539 | int lpfc_sli4_dump_page_a0(struct lpfc_hba *phba, struct lpfcMboxq *mbox); |
|---|
| 543 | 540 | void lpfc_mbx_cmpl_rdp_page_a0(struct lpfc_hba *phba, LPFC_MBOXQ_t *pmb); |
|---|
| 544 | 541 | |
|---|
| 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 | + |
|---|
| 545 | 550 | /* NVME interfaces. */ |
|---|
| 551 | +void lpfc_nvme_rescan_port(struct lpfc_vport *vport, |
|---|
| 552 | + struct lpfc_nodelist *ndlp); |
|---|
| 546 | 553 | void lpfc_nvme_unregister_port(struct lpfc_vport *vport, |
|---|
| 547 | 554 | struct lpfc_nodelist *ndlp); |
|---|
| 548 | 555 | int lpfc_nvme_register_port(struct lpfc_vport *vport, |
|---|
| .. | .. |
|---|
| 553 | 560 | int lpfc_nvmet_create_targetport(struct lpfc_hba *phba); |
|---|
| 554 | 561 | int lpfc_nvmet_update_targetport(struct lpfc_hba *phba); |
|---|
| 555 | 562 | 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); |
|---|
| 558 | 567 | 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); |
|---|
| 560 | 570 | 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); |
|---|
| 561 | 573 | void lpfc_nvme_abort_fcreq_cmpl(struct lpfc_hba *phba, |
|---|
| 562 | 574 | struct lpfc_iocbq *cmdiocb, |
|---|
| 563 | 575 | 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); |
|---|
| 564 | 592 | void lpfc_nvme_cmd_template(void); |
|---|
| 565 | 593 | 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); |
|---|
| 566 | 596 | extern int lpfc_enable_nvmet_cnt; |
|---|
| 567 | 597 | extern unsigned long long lpfc_enable_nvmet[]; |
|---|
| 568 | 598 | extern int lpfc_no_hba_reset_cnt; |
|---|