Lines Matching +full:timeout +full:- +full:lta

4  * Copyright (C) 2017-2025 Broadcom. All Rights Reserved. The term *
6 * Copyright (C) 2004-2016 Emulex. All rights reserved. *
9 * Portions Copyright (C) 2004-2005 Christoph Hellwig *
17 * FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT, ARE *
72 " trunk - link was \"low\" speed",
74 " existing trunk - link was \"middle\" speed",
76 " trunk - link was \"high\" speed",
77 "Attached to non-trunking port - F_Port",
78 "Attached to non-trunking port - N_Port",
79 "FLOGI response timeout",
80 "non-FLOGI frame received",
87 * lpfc_jedec_to_ascii - Hex to ascii convertor according to JEDEC rules
95 * Hex 0-9 becomes ascii '0' to '9'.
96 * Hex a-f becomes ascii '=' to 'B' capital B.
108 hdw[7 - i] = 0x30 + j; in lpfc_jedec_to_ascii()
110 hdw[7 - i] = 0x61 + j - 10; in lpfc_jedec_to_ascii()
122 struct lpfc_vport *vport = (struct lpfc_vport *)shost->hostdata; in lpfc_cmf_info_show()
123 struct lpfc_hba *phba = vport->phba; in lpfc_cmf_info_show()
131 if (phba->cgn_i) in lpfc_cmf_info_show()
132 cp = (struct lpfc_cgn_info *)phba->cgn_i->virt; in lpfc_cmf_info_show()
137 phba->sli4_hba.pc_sli4_params.mi_cap, in lpfc_cmf_info_show()
138 cp ? cp->cgn_info_version : 0, in lpfc_cmf_info_show()
139 phba->sli4_hba.pc_sli4_params.cmf, phba->cmf_timer_cnt); in lpfc_cmf_info_show()
144 if (!phba->sli4_hba.pc_sli4_params.cmf) in lpfc_cmf_info_show()
147 switch (phba->cgn_init_reg_signal) { in lpfc_cmf_info_show()
164 switch (phba->cgn_init_reg_fpin) { in lpfc_cmf_info_show()
185 switch (phba->cgn_reg_signal) { in lpfc_cmf_info_show()
202 switch (phba->cgn_reg_fpin) { in lpfc_cmf_info_show()
205 "FPIN:WARN ACQEcnt:%d\n", phba->cgn_acqe_cnt); in lpfc_cmf_info_show()
209 "FPIN:ALARM ACQEcnt:%d\n", phba->cgn_acqe_cnt); in lpfc_cmf_info_show()
213 "FPIN:WARN|ALARM ACQEcnt:%d\n", phba->cgn_acqe_cnt); in lpfc_cmf_info_show()
217 "FPIN:NONE ACQEcnt:%d\n", phba->cgn_acqe_cnt); in lpfc_cmf_info_show()
223 if (phba->cmf_active_mode != phba->cgn_p.cgn_param_mode) { in lpfc_cmf_info_show()
224 switch (phba->cmf_active_mode) { in lpfc_cmf_info_show()
241 switch (phba->cgn_p.cgn_param_mode) { in lpfc_cmf_info_show()
260 cgs = per_cpu_ptr(phba->cmf_stat, cpu); in lpfc_cmf_info_show()
261 total += atomic64_read(&cgs->total_bytes); in lpfc_cmf_info_show()
262 rcv += atomic64_read(&cgs->rcv_bytes); in lpfc_cmf_info_show()
267 atomic_read(&phba->cmf_busy), in lpfc_cmf_info_show()
268 phba->cmf_active_info, rcv, total); in lpfc_cmf_info_show()
276 (unsigned long)phba->cmf_link_byte_count, in lpfc_cmf_info_show()
277 (unsigned long)phba->cmf_max_bytes_per_interval); in lpfc_cmf_info_show()
283 if (unlikely(len >= (PAGE_SIZE - 1))) { in lpfc_cmf_info_show()
288 strscpy(buf + PAGE_SIZE - 1 - sizeof(LPFC_INFO_MORE_STR), in lpfc_cmf_info_show()
299 struct lpfc_vport *vport = (struct lpfc_vport *)shost->hostdata; in lpfc_vmid_info_show()
300 struct lpfc_hba *phba = vport->phba; in lpfc_vmid_info_show()
306 u64 *lta, rct_acc = 0, max_lta = 0; in lpfc_vmid_info_show() local
311 len += scnprintf(buf + len, PAGE_SIZE - len, "Key 'vmid':\n"); in lpfc_vmid_info_show()
315 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_vmid_info_show()
318 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_vmid_info_show()
324 if (vport->phba->pport->vmid_flag & LPFC_VMID_TYPE_PRIO) { in lpfc_vmid_info_show()
325 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_vmid_info_show()
327 vr = vport->vmid_priority.vmid_range; in lpfc_vmid_info_show()
328 for (i = 0; i < vport->vmid_priority.num_descriptors; ++i) { in lpfc_vmid_info_show()
329 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_vmid_info_show()
330 "\t[x%x - x%x], qos: x%x\n", in lpfc_vmid_info_show()
331 vr->low, vr->high, vr->qos); in lpfc_vmid_info_show()
336 for (i = 0; i < phba->cfg_max_vmid; i++) { in lpfc_vmid_info_show()
337 vmp = &vport->vmid[i]; in lpfc_vmid_info_show()
341 if (!(vmp->flag & LPFC_VMID_SLOT_USED) || in lpfc_vmid_info_show()
342 !(vmp->flag & LPFC_VMID_REGISTERED)) in lpfc_vmid_info_show()
346 if (vport->phba->pport->vmid_flag & LPFC_VMID_TYPE_PRIO) { in lpfc_vmid_info_show()
347 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_vmid_info_show()
351 vport->lpfc_vmid_host_uuid[0], in lpfc_vmid_info_show()
352 vport->lpfc_vmid_host_uuid[1], in lpfc_vmid_info_show()
353 vport->lpfc_vmid_host_uuid[2], in lpfc_vmid_info_show()
354 vport->lpfc_vmid_host_uuid[3], in lpfc_vmid_info_show()
355 vport->lpfc_vmid_host_uuid[4], in lpfc_vmid_info_show()
356 vport->lpfc_vmid_host_uuid[5], in lpfc_vmid_info_show()
357 vport->lpfc_vmid_host_uuid[6], in lpfc_vmid_info_show()
358 vport->lpfc_vmid_host_uuid[7], in lpfc_vmid_info_show()
359 vport->lpfc_vmid_host_uuid[8], in lpfc_vmid_info_show()
360 vport->lpfc_vmid_host_uuid[9], in lpfc_vmid_info_show()
361 vport->lpfc_vmid_host_uuid[10], in lpfc_vmid_info_show()
362 vport->lpfc_vmid_host_uuid[11], in lpfc_vmid_info_show()
363 vport->lpfc_vmid_host_uuid[12], in lpfc_vmid_info_show()
364 vport->lpfc_vmid_host_uuid[13], in lpfc_vmid_info_show()
365 vport->lpfc_vmid_host_uuid[14], in lpfc_vmid_info_show()
366 vport->lpfc_vmid_host_uuid[15]); in lpfc_vmid_info_show()
370 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_vmid_info_show()
372 vmp->io_rd_cnt, in lpfc_vmid_info_show()
373 vmp->io_wr_cnt); in lpfc_vmid_info_show()
374 for (j = 0, k = 0; j < strlen(vmp->host_vmid); j++, k += 3) in lpfc_vmid_info_show()
375 sprintf((char *)(hxstr + k), "%2x ", vmp->host_vmid[j]); in lpfc_vmid_info_show()
377 len += scnprintf(buf + len, PAGE_SIZE - len, "UUID:\n"); in lpfc_vmid_info_show()
378 len += scnprintf(buf + len, PAGE_SIZE - len, "%s\n", hxstr); in lpfc_vmid_info_show()
380 len += scnprintf(buf + len, PAGE_SIZE - len, "String (%s)\n", in lpfc_vmid_info_show()
381 vmp->host_vmid); in lpfc_vmid_info_show()
383 if (vport->phba->pport->vmid_flag & LPFC_VMID_TYPE_PRIO) in lpfc_vmid_info_show()
384 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_vmid_info_show()
386 vmp->un.cs_ctl_vmid); in lpfc_vmid_info_show()
388 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_vmid_info_show()
390 vmp->un.app_id); in lpfc_vmid_info_show()
394 lta = per_cpu_ptr(vmp->last_io_time, cpu); in lpfc_vmid_info_show()
395 if (!lta) in lpfc_vmid_info_show()
398 /* if last access time is less than timeout */ in lpfc_vmid_info_show()
399 if (time_after((unsigned long)*lta, jiffies)) in lpfc_vmid_info_show()
402 if (*lta > max_lta) in lpfc_vmid_info_show()
403 max_lta = *lta; in lpfc_vmid_info_show()
406 rct_acc = jiffies_to_msecs(jiffies - max_lta) / 1000; in lpfc_vmid_info_show()
409 -(sys_tz.tz_minuteswest * 60) - rct_acc, &tm_val); in lpfc_vmid_info_show()
411 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_vmid_info_show()
413 "%ld-%d-%dT%02d:%02d:%02d\n\n", in lpfc_vmid_info_show()
427 * lpfc_drvr_version_show - Return the Emulex driver string with version number
442 * lpfc_enable_fip_show - Return the fip mode of the HBA
454 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_enable_fip_show()
455 struct lpfc_hba *phba = vport->phba; in lpfc_enable_fip_show()
457 if (test_bit(HBA_FIP_SUPPORT, &phba->hba_flag)) in lpfc_enable_fip_show()
469 struct lpfc_hba *phba = vport->phba; in lpfc_nvme_info_show()
485 if (!(vport->cfg_enable_fc4_type & LPFC_ENABLE_NVME)) { in lpfc_nvme_info_show()
489 if (phba->nvmet_support) { in lpfc_nvme_info_show()
490 if (!phba->targetport) { in lpfc_nvme_info_show()
493 wwn_to_u64(vport->fc_portname.u.wwn)); in lpfc_nvme_info_show()
497 if (phba->targetport->port_id) in lpfc_nvme_info_show()
510 phba->brd_no, in lpfc_nvme_info_show()
511 wwn_to_u64(vport->fc_portname.u.wwn), in lpfc_nvme_info_show()
512 wwn_to_u64(vport->fc_nodename.u.wwn), in lpfc_nvme_info_show()
513 phba->targetport->port_id); in lpfc_nvme_info_show()
521 tgtp = (struct lpfc_nvmet_tgtport *)phba->targetport->private; in lpfc_nvme_info_show()
524 atomic_read(&tgtp->rcv_ls_req_in), in lpfc_nvme_info_show()
525 atomic_read(&tgtp->rcv_ls_req_drop), in lpfc_nvme_info_show()
526 atomic_read(&tgtp->xmt_ls_abort)); in lpfc_nvme_info_show()
530 if (atomic_read(&tgtp->rcv_ls_req_in) != in lpfc_nvme_info_show()
531 atomic_read(&tgtp->rcv_ls_req_out)) { in lpfc_nvme_info_show()
534 atomic_read(&tgtp->rcv_ls_req_in), in lpfc_nvme_info_show()
535 atomic_read(&tgtp->rcv_ls_req_out)); in lpfc_nvme_info_show()
542 atomic_read(&tgtp->xmt_ls_rsp), in lpfc_nvme_info_show()
543 atomic_read(&tgtp->xmt_ls_drop), in lpfc_nvme_info_show()
544 atomic_read(&tgtp->xmt_ls_rsp_cmpl)); in lpfc_nvme_info_show()
550 atomic_read(&tgtp->xmt_ls_rsp_aborted), in lpfc_nvme_info_show()
551 atomic_read(&tgtp->xmt_ls_rsp_xb_set), in lpfc_nvme_info_show()
552 atomic_read(&tgtp->xmt_ls_rsp_error)); in lpfc_nvme_info_show()
559 atomic_read(&tgtp->rcv_fcp_cmd_in), in lpfc_nvme_info_show()
560 atomic_read(&tgtp->rcv_fcp_cmd_defer), in lpfc_nvme_info_show()
561 atomic_read(&tgtp->xmt_fcp_release), in lpfc_nvme_info_show()
562 atomic_read(&tgtp->rcv_fcp_cmd_drop)); in lpfc_nvme_info_show()
566 if (atomic_read(&tgtp->rcv_fcp_cmd_in) != in lpfc_nvme_info_show()
567 atomic_read(&tgtp->rcv_fcp_cmd_out)) { in lpfc_nvme_info_show()
570 atomic_read(&tgtp->rcv_fcp_cmd_in), in lpfc_nvme_info_show()
571 atomic_read(&tgtp->rcv_fcp_cmd_out)); in lpfc_nvme_info_show()
579 atomic_read(&tgtp->xmt_fcp_read), in lpfc_nvme_info_show()
580 atomic_read(&tgtp->xmt_fcp_read_rsp), in lpfc_nvme_info_show()
581 atomic_read(&tgtp->xmt_fcp_write), in lpfc_nvme_info_show()
582 atomic_read(&tgtp->xmt_fcp_rsp), in lpfc_nvme_info_show()
583 atomic_read(&tgtp->xmt_fcp_drop)); in lpfc_nvme_info_show()
589 atomic_read(&tgtp->xmt_fcp_rsp_cmpl), in lpfc_nvme_info_show()
590 atomic_read(&tgtp->xmt_fcp_rsp_error), in lpfc_nvme_info_show()
591 atomic_read(&tgtp->xmt_fcp_rsp_drop)); in lpfc_nvme_info_show()
597 atomic_read(&tgtp->xmt_fcp_rsp_aborted), in lpfc_nvme_info_show()
598 atomic_read(&tgtp->xmt_fcp_rsp_xb_set), in lpfc_nvme_info_show()
599 atomic_read(&tgtp->xmt_fcp_xri_abort_cqe)); in lpfc_nvme_info_show()
605 atomic_read(&tgtp->xmt_fcp_abort), in lpfc_nvme_info_show()
606 atomic_read(&tgtp->xmt_fcp_abort_cmpl)); in lpfc_nvme_info_show()
612 atomic_read(&tgtp->xmt_abort_sol), in lpfc_nvme_info_show()
613 atomic_read(&tgtp->xmt_abort_unsol), in lpfc_nvme_info_show()
614 atomic_read(&tgtp->xmt_abort_rsp), in lpfc_nvme_info_show()
615 atomic_read(&tgtp->xmt_abort_rsp_error)); in lpfc_nvme_info_show()
621 atomic_read(&tgtp->defer_ctx), in lpfc_nvme_info_show()
622 atomic_read(&tgtp->defer_fod), in lpfc_nvme_info_show()
623 atomic_read(&tgtp->defer_wqfull)); in lpfc_nvme_info_show()
628 tot = atomic_read(&tgtp->rcv_fcp_cmd_drop); in lpfc_nvme_info_show()
629 tot += atomic_read(&tgtp->xmt_fcp_release); in lpfc_nvme_info_show()
630 tot = atomic_read(&tgtp->rcv_fcp_cmd_in) - tot; in lpfc_nvme_info_show()
635 phba->sli4_hba.nvmet_xri_cnt, in lpfc_nvme_info_show()
636 phba->sli4_hba.nvmet_io_wait_cnt, in lpfc_nvme_info_show()
637 phba->sli4_hba.nvmet_io_wait_total, in lpfc_nvme_info_show()
643 localport = vport->localport; in lpfc_nvme_info_show()
647 wwn_to_u64(vport->fc_portname.u.wwn)); in lpfc_nvme_info_show()
650 lport = (struct lpfc_nvme_lport *)localport->private; in lpfc_nvme_info_show()
656 phba->brd_no, in lpfc_nvme_info_show()
657 phba->sli4_hba.max_cfg_param.max_xri, in lpfc_nvme_info_show()
658 phba->sli4_hba.io_xri_max, in lpfc_nvme_info_show()
664 if (localport->port_id) in lpfc_nvme_info_show()
672 phba->brd_no, in lpfc_nvme_info_show()
673 wwn_to_u64(vport->fc_portname.u.wwn), in lpfc_nvme_info_show()
674 wwn_to_u64(vport->fc_nodename.u.wwn), in lpfc_nvme_info_show()
675 localport->port_id, statep); in lpfc_nvme_info_show()
679 spin_lock_irqsave(&vport->fc_nodes_list_lock, iflags); in lpfc_nvme_info_show()
681 list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) { in lpfc_nvme_info_show()
683 spin_lock(&ndlp->lock); in lpfc_nvme_info_show()
686 nrport = rport->remoteport; in lpfc_nvme_info_show()
687 spin_unlock(&ndlp->lock); in lpfc_nvme_info_show()
692 switch (nrport->port_state) { in lpfc_nvme_info_show()
707 if (phba->brd_no >= 10) { in lpfc_nvme_info_show()
713 nrport->port_name); in lpfc_nvme_info_show()
718 nrport->node_name); in lpfc_nvme_info_show()
723 nrport->port_id); in lpfc_nvme_info_show()
728 if (nrport->port_role & FC_PORT_ROLE_NVME_INITIATOR) { in lpfc_nvme_info_show()
732 if (nrport->port_role & FC_PORT_ROLE_NVME_TARGET) { in lpfc_nvme_info_show()
736 if (nrport->port_role & FC_PORT_ROLE_NVME_DISCOVERY) { in lpfc_nvme_info_show()
740 if (nrport->port_role & ~(FC_PORT_ROLE_NVME_INITIATOR | in lpfc_nvme_info_show()
744 nrport->port_role); in lpfc_nvme_info_show()
753 spin_unlock_irqrestore(&vport->fc_nodes_list_lock, iflags); in lpfc_nvme_info_show()
763 atomic_read(&lport->fc4NvmeLsRequests), in lpfc_nvme_info_show()
764 atomic_read(&lport->fc4NvmeLsCmpls), in lpfc_nvme_info_show()
765 atomic_read(&lport->xmt_ls_abort)); in lpfc_nvme_info_show()
771 atomic_read(&lport->xmt_ls_err), in lpfc_nvme_info_show()
772 atomic_read(&lport->cmpl_ls_xb), in lpfc_nvme_info_show()
773 atomic_read(&lport->cmpl_ls_err)); in lpfc_nvme_info_show()
779 for (i = 0; i < phba->cfg_hdw_queue; i++) { in lpfc_nvme_info_show()
780 cstat = &phba->sli4_hba.hdwq[i].nvme_cstat; in lpfc_nvme_info_show()
781 tot = cstat->io_cmpls; in lpfc_nvme_info_show()
783 data1 = cstat->input_requests; in lpfc_nvme_info_show()
784 data2 = cstat->output_requests; in lpfc_nvme_info_show()
785 data3 = cstat->control_requests; in lpfc_nvme_info_show()
791 totin, totout, totout - totin); in lpfc_nvme_info_show()
798 atomic_read(&lport->xmt_fcp_abort), in lpfc_nvme_info_show()
799 atomic_read(&lport->xmt_fcp_noxri), in lpfc_nvme_info_show()
800 atomic_read(&lport->xmt_fcp_bad_ndlp), in lpfc_nvme_info_show()
801 atomic_read(&lport->xmt_fcp_qdepth), in lpfc_nvme_info_show()
802 atomic_read(&lport->xmt_fcp_wqerr), in lpfc_nvme_info_show()
803 atomic_read(&lport->xmt_fcp_err)); in lpfc_nvme_info_show()
809 atomic_read(&lport->cmpl_fcp_xb), in lpfc_nvme_info_show()
810 atomic_read(&lport->cmpl_fcp_err)); in lpfc_nvme_info_show()
817 spin_unlock_irqrestore(&vport->fc_nodes_list_lock, iflags); in lpfc_nvme_info_show()
822 if (unlikely(len >= (PAGE_SIZE - 1))) { in lpfc_nvme_info_show()
827 strscpy(buf + PAGE_SIZE - 1 - sizeof(LPFC_INFO_MORE_STR), in lpfc_nvme_info_show()
841 struct lpfc_hba *phba = vport->phba; in lpfc_scsi_stat_show()
849 if (!(vport->cfg_enable_fc4_type & LPFC_ENABLE_FCP) || in lpfc_scsi_stat_show()
850 (phba->sli_rev != LPFC_SLI_REV4)) in lpfc_scsi_stat_show()
857 for (i = 0; i < phba->cfg_hdw_queue; i++) { in lpfc_scsi_stat_show()
858 cstat = &phba->sli4_hba.hdwq[i].scsi_cstat; in lpfc_scsi_stat_show()
859 tot = cstat->io_cmpls; in lpfc_scsi_stat_show()
861 data1 = cstat->input_requests; in lpfc_scsi_stat_show()
862 data2 = cstat->output_requests; in lpfc_scsi_stat_show()
863 data3 = cstat->control_requests; in lpfc_scsi_stat_show()
872 tot, ((data1 + data2 + data3) - tot)); in lpfc_scsi_stat_show()
877 "OutIO %016llx\n", totin, totout, totout - totin); in lpfc_scsi_stat_show()
891 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_bg_info_show()
892 struct lpfc_hba *phba = vport->phba; in lpfc_bg_info_show()
894 if (phba->cfg_enable_bg) { in lpfc_bg_info_show()
895 if (phba->sli3_options & LPFC_SLI3_BG_ENABLED) in lpfc_bg_info_show()
911 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_bg_guard_err_show()
912 struct lpfc_hba *phba = vport->phba; in lpfc_bg_guard_err_show()
915 (unsigned long long)phba->bg_guard_err_cnt); in lpfc_bg_guard_err_show()
923 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_bg_apptag_err_show()
924 struct lpfc_hba *phba = vport->phba; in lpfc_bg_apptag_err_show()
927 (unsigned long long)phba->bg_apptag_err_cnt); in lpfc_bg_apptag_err_show()
935 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_bg_reftag_err_show()
936 struct lpfc_hba *phba = vport->phba; in lpfc_bg_reftag_err_show()
939 (unsigned long long)phba->bg_reftag_err_cnt); in lpfc_bg_reftag_err_show()
943 * lpfc_info_show - Return some pci info about the host in ascii
960 * lpfc_serialnum_show - Return the hba serial number in ascii
972 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_serialnum_show()
973 struct lpfc_hba *phba = vport->phba; in lpfc_serialnum_show()
975 return scnprintf(buf, PAGE_SIZE, "%s\n", phba->SerialNumber); in lpfc_serialnum_show()
979 * lpfc_temp_sensor_show - Return the temperature sensor level
995 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_temp_sensor_show()
996 struct lpfc_hba *phba = vport->phba; in lpfc_temp_sensor_show()
997 return scnprintf(buf, PAGE_SIZE, "%d\n", phba->temp_sensor_support); in lpfc_temp_sensor_show()
1001 * lpfc_modeldesc_show - Return the model description of the hba
1013 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_modeldesc_show()
1014 struct lpfc_hba *phba = vport->phba; in lpfc_modeldesc_show()
1016 return scnprintf(buf, PAGE_SIZE, "%s\n", phba->ModelDesc); in lpfc_modeldesc_show()
1020 * lpfc_modelname_show - Return the model name of the hba
1032 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_modelname_show()
1033 struct lpfc_hba *phba = vport->phba; in lpfc_modelname_show()
1035 return scnprintf(buf, PAGE_SIZE, "%s\n", phba->ModelName); in lpfc_modelname_show()
1039 * lpfc_programtype_show - Return the program type of the hba
1051 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_programtype_show()
1052 struct lpfc_hba *phba = vport->phba; in lpfc_programtype_show()
1054 return scnprintf(buf, PAGE_SIZE, "%s\n", phba->ProgramType); in lpfc_programtype_show()
1058 * lpfc_vportnum_show - Return the port number in ascii of the hba
1070 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_vportnum_show()
1071 struct lpfc_hba *phba = vport->phba; in lpfc_vportnum_show()
1073 return scnprintf(buf, PAGE_SIZE, "%s\n", phba->Port); in lpfc_vportnum_show()
1077 * lpfc_fwrev_show - Return the firmware rev running in the hba
1089 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_fwrev_show()
1090 struct lpfc_hba *phba = vport->phba; in lpfc_fwrev_show()
1097 if_type = phba->sli4_hba.pc_sli4_params.if_type; in lpfc_fwrev_show()
1098 sli_family = phba->sli4_hba.pc_sli4_params.sli_family; in lpfc_fwrev_show()
1100 if (phba->sli_rev < LPFC_SLI_REV4) in lpfc_fwrev_show()
1101 len = scnprintf(buf, PAGE_SIZE, "%s, sli-%d\n", in lpfc_fwrev_show()
1102 fwrev, phba->sli_rev); in lpfc_fwrev_show()
1104 len = scnprintf(buf, PAGE_SIZE, "%s, sli-%d:%d:%x\n", in lpfc_fwrev_show()
1105 fwrev, phba->sli_rev, if_type, sli_family); in lpfc_fwrev_show()
1111 * lpfc_hdw_show - Return the jedec information about the hba
1123 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_hdw_show()
1124 struct lpfc_hba *phba = vport->phba; in lpfc_hdw_show()
1125 lpfc_vpd_t *vp = &phba->vpd; in lpfc_hdw_show()
1127 lpfc_jedec_to_ascii(vp->rev.biuRev, hdw); in lpfc_hdw_show()
1129 vp->rev.smRev, vp->rev.smFwRev); in lpfc_hdw_show()
1133 * lpfc_option_rom_version_show - Return the adapter ROM FCode version
1145 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_option_rom_version_show()
1146 struct lpfc_hba *phba = vport->phba; in lpfc_option_rom_version_show()
1149 if (phba->sli_rev < LPFC_SLI_REV4) in lpfc_option_rom_version_show()
1151 phba->OptionROMVersion); in lpfc_option_rom_version_show()
1158 * lpfc_link_state_show - Return the link state of the port
1173 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_link_state_show()
1174 struct lpfc_hba *phba = vport->phba; in lpfc_link_state_show()
1177 switch (phba->link_state) { in lpfc_link_state_show()
1184 if (test_bit(LINK_DISABLED, &phba->hba_flag)) in lpfc_link_state_show()
1185 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_link_state_show()
1186 "Link Down - User disabled\n"); in lpfc_link_state_show()
1188 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_link_state_show()
1194 len += scnprintf(buf + len, PAGE_SIZE-len, "Link Up - "); in lpfc_link_state_show()
1196 switch (vport->port_state) { in lpfc_link_state_show()
1198 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_link_state_show()
1208 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_link_state_show()
1212 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_link_state_show()
1217 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_link_state_show()
1222 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_link_state_show()
1226 if (phba->fc_topology == LPFC_TOPOLOGY_LOOP) { in lpfc_link_state_show()
1227 if (test_bit(FC_PUBLIC_LOOP, &vport->fc_flag)) in lpfc_link_state_show()
1228 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_link_state_show()
1231 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_link_state_show()
1234 if (test_bit(FC_FABRIC, &vport->fc_flag)) { in lpfc_link_state_show()
1235 if (phba->sli_rev == LPFC_SLI_REV4 && in lpfc_link_state_show()
1236 vport->port_type == LPFC_PHYSICAL_PORT && in lpfc_link_state_show()
1237 phba->sli4_hba.fawwpn_flag & in lpfc_link_state_show()
1240 PAGE_SIZE - len, in lpfc_link_state_show()
1241 " Fabric FA-PWWN\n"); in lpfc_link_state_show()
1244 PAGE_SIZE - len, in lpfc_link_state_show()
1247 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_link_state_show()
1248 " Point-2-Point\n"); in lpfc_link_state_show()
1253 if ((phba->sli_rev == LPFC_SLI_REV4) && in lpfc_link_state_show()
1255 &phba->sli4_hba.sli_intf) == in lpfc_link_state_show()
1257 struct lpfc_trunk_link link = phba->trunk_link; in lpfc_link_state_show()
1259 if (bf_get(lpfc_conf_trunk_port0, &phba->sli4_hba)) in lpfc_link_state_show()
1260 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_link_state_show()
1266 if (bf_get(lpfc_conf_trunk_port1, &phba->sli4_hba)) in lpfc_link_state_show()
1267 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_link_state_show()
1273 if (bf_get(lpfc_conf_trunk_port2, &phba->sli4_hba)) in lpfc_link_state_show()
1274 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_link_state_show()
1280 if (bf_get(lpfc_conf_trunk_port3, &phba->sli4_hba)) in lpfc_link_state_show()
1281 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_link_state_show()
1293 * lpfc_sli4_protocol_show - Return the fip mode of the HBA
1305 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_sli4_protocol_show()
1306 struct lpfc_hba *phba = vport->phba; in lpfc_sli4_protocol_show()
1308 if (phba->sli_rev < LPFC_SLI_REV4) in lpfc_sli4_protocol_show()
1311 if (phba->sli4_hba.lnk_info.lnk_dv == LPFC_LNK_DAT_VAL) { in lpfc_sli4_protocol_show()
1312 if (phba->sli4_hba.lnk_info.lnk_tp == LPFC_LNK_TYPE_GE) in lpfc_sli4_protocol_show()
1314 if (phba->sli4_hba.lnk_info.lnk_tp == LPFC_LNK_TYPE_FC) in lpfc_sli4_protocol_show()
1321 * lpfc_oas_supported_show - Return whether or not Optimized Access Storage
1334 struct lpfc_vport *vport = (struct lpfc_vport *)shost->hostdata; in lpfc_oas_supported_show()
1335 struct lpfc_hba *phba = vport->phba; in lpfc_oas_supported_show()
1338 phba->sli4_hba.pc_sli4_params.oas_supported); in lpfc_oas_supported_show()
1342 * lpfc_link_state_store - Transition the link_state on an HBA port
1349 * -EINVAL if the buffer is not "up" or "down"
1350 * return from link state change function if non-zero
1358 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_link_state_store()
1359 struct lpfc_hba *phba = vport->phba; in lpfc_link_state_store()
1361 int status = -EINVAL; in lpfc_link_state_store()
1363 if ((strncmp(buf, "up", sizeof("up") - 1) == 0) && in lpfc_link_state_store()
1364 (phba->link_state == LPFC_LINK_DOWN)) in lpfc_link_state_store()
1365 status = phba->lpfc_hba_init_link(phba, MBX_NOWAIT); in lpfc_link_state_store()
1366 else if ((strncmp(buf, "down", sizeof("down") - 1) == 0) && in lpfc_link_state_store()
1367 (phba->link_state >= LPFC_LINK_UP)) in lpfc_link_state_store()
1368 status = phba->lpfc_hba_down_link(phba, MBX_NOWAIT); in lpfc_link_state_store()
1377 * lpfc_num_discovered_ports_show - Return sum of mapped and unmapped vports
1393 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_num_discovered_ports_show()
1396 atomic_read(&vport->fc_map_cnt) + in lpfc_num_discovered_ports_show()
1397 atomic_read(&vport->fc_unmap_cnt)); in lpfc_num_discovered_ports_show()
1401 * lpfc_issue_lip - Misnomer, name carried over from long ago
1405 * Bring the link down gracefully then re-init the link. The firmware will
1406 * re-init the fiber channel interface as required. Does not issue a LIP.
1409 * -EPERM port offline or management commands are being blocked
1410 * -ENOMEM cannot allocate memory for the mailbox command
1411 * -EIO error sending the mailbox command
1417 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_issue_lip()
1418 struct lpfc_hba *phba = vport->phba; in lpfc_issue_lip()
1426 if (test_bit(FC_OFFLINE_MODE, &vport->fc_flag) || in lpfc_issue_lip()
1427 test_bit(LINK_DISABLED, &phba->hba_flag) || in lpfc_issue_lip()
1428 (phba->sli.sli_flag & LPFC_BLOCK_MGMT_IO)) in lpfc_issue_lip()
1429 return -EPERM; in lpfc_issue_lip()
1431 pmboxq = mempool_alloc(phba->mbox_mem_pool,GFP_KERNEL); in lpfc_issue_lip()
1434 return -ENOMEM; in lpfc_issue_lip()
1437 pmboxq->u.mb.mbxCommand = MBX_DOWN_LINK; in lpfc_issue_lip()
1438 pmboxq->u.mb.mbxOwner = OWN_HOST; in lpfc_issue_lip()
1440 if (test_bit(FC_PT2PT, &vport->fc_flag)) in lpfc_issue_lip()
1441 clear_bit(FC_PT2PT_NO_NVME, &vport->fc_flag); in lpfc_issue_lip()
1446 (pmboxq->u.mb.mbxStatus == 0 || in lpfc_issue_lip()
1447 pmboxq->u.mb.mbxStatus == MBXERR_LINK_DOWN)) { in lpfc_issue_lip()
1449 lpfc_init_link(phba, pmboxq, phba->cfg_topology, in lpfc_issue_lip()
1450 phba->cfg_link_speed); in lpfc_issue_lip()
1452 phba->fc_ratov * 2); in lpfc_issue_lip()
1454 (pmboxq->u.mb.mbxStatus == MBXERR_SEC_NO_PERMISSION)) in lpfc_issue_lip()
1462 mempool_free(pmboxq, phba->mbox_mem_pool); in lpfc_issue_lip()
1465 return -EIO; in lpfc_issue_lip()
1492 * lpfc_do_offline - Issues a mailbox command to bring the link down
1500 * lpfc_workq_post_event() returns a non-zero return code if call fails.
1503 * -EIO error posting the event
1521 return -ENOMEM; in lpfc_do_offline()
1526 return -EIO; in lpfc_do_offline()
1528 psli = &phba->sli; in lpfc_do_offline()
1535 spin_lock_irq(&phba->hbalock); in lpfc_do_offline()
1536 if (!(psli->sli_flag & LPFC_QUEUE_FREE_INIT)) { in lpfc_do_offline()
1537 psli->sli_flag |= LPFC_QUEUE_FREE_WAIT; in lpfc_do_offline()
1539 spin_unlock_irq(&phba->hbalock); in lpfc_do_offline()
1542 spin_unlock_irq(&phba->hbalock); in lpfc_do_offline()
1545 * long enough for dev loss timeout to expire. in lpfc_do_offline()
1547 if (phba->sli_rev != LPFC_SLI_REV4) { in lpfc_do_offline()
1548 for (i = 0; i < psli->num_rings; i++) { in lpfc_do_offline()
1549 pring = &psli->sli3_ring[i]; in lpfc_do_offline()
1550 if (!lpfc_emptyq_wait(phba, &pring->txcmplq, in lpfc_do_offline()
1551 &phba->hbalock)) in lpfc_do_offline()
1555 list_for_each_entry(qp, &phba->sli4_hba.lpfc_wq_list, wq_list) { in lpfc_do_offline()
1556 pring = qp->pring; in lpfc_do_offline()
1559 if (!lpfc_emptyq_wait(phba, &pring->txcmplq, in lpfc_do_offline()
1560 &pring->ring_lock)) in lpfc_do_offline()
1565 spin_lock_irq(&phba->hbalock); in lpfc_do_offline()
1566 psli->sli_flag &= ~LPFC_QUEUE_FREE_WAIT; in lpfc_do_offline()
1567 spin_unlock_irq(&phba->hbalock); in lpfc_do_offline()
1573 return -ENOMEM; in lpfc_do_offline()
1578 return -EIO; in lpfc_do_offline()
1584 * lpfc_reset_pci_bus - resets PCI bridge controller's secondary bus of an HBA
1588 * Issues a PCI secondary bus reset for the phba->pcidev.
1597 * -ENOTSUPP, cfg_enable_hba_reset must be of value 2
1598 * -ENODEV, NULL ptr to pcidev
1599 * -EBADSLT, detected invalid device
1600 * -EBUSY, port is not in offline state
1606 struct pci_dev *pdev = phba->pcidev; in lpfc_reset_pci_bus()
1612 if (phba->cfg_enable_hba_reset != 2) in lpfc_reset_pci_bus()
1613 return -ENOTSUPP; in lpfc_reset_pci_bus()
1617 return -ENODEV; in lpfc_reset_pci_bus()
1625 list_for_each_entry(ptr, &pdev->bus->devices, bus_list) { in lpfc_reset_pci_bus()
1630 ((struct lpfc_vport *)shost->hostdata)->phba; in lpfc_reset_pci_bus()
1632 &phba_other->pport->fc_flag)) { in lpfc_reset_pci_bus()
1637 phba_other->wwpn[0], in lpfc_reset_pci_bus()
1638 phba_other->wwpn[1], in lpfc_reset_pci_bus()
1639 phba_other->wwpn[2], in lpfc_reset_pci_bus()
1640 phba_other->wwpn[3], in lpfc_reset_pci_bus()
1641 phba_other->wwpn[4], in lpfc_reset_pci_bus()
1642 phba_other->wwpn[5], in lpfc_reset_pci_bus()
1643 phba_other->wwpn[6], in lpfc_reset_pci_bus()
1644 phba_other->wwpn[7]); in lpfc_reset_pci_bus()
1645 return -EBUSY; in lpfc_reset_pci_bus()
1661 * lpfc_selective_reset - Offline then onlines the port
1674 * -EIO reset not configured or error posting the event
1684 if (!phba->cfg_enable_hba_reset) in lpfc_selective_reset()
1685 return -EACCES; in lpfc_selective_reset()
1687 if (!test_bit(FC_OFFLINE_MODE, &phba->pport->fc_flag)) { in lpfc_selective_reset()
1698 return -ENOMEM; in lpfc_selective_reset()
1703 return -EIO; in lpfc_selective_reset()
1709 * lpfc_issue_reset - Selectively resets an adapter
1725 * -EINVAL if the buffer does not contain the string "selective"
1726 * length of buf if lpfc-selective_reset() if the call succeeds
1734 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_issue_reset()
1735 struct lpfc_hba *phba = vport->phba; in lpfc_issue_reset()
1736 int status = -EINVAL; in lpfc_issue_reset()
1738 if (!phba->cfg_enable_hba_reset) in lpfc_issue_reset()
1739 return -EACCES; in lpfc_issue_reset()
1741 if (strncmp(buf, "selective", sizeof("selective") - 1) == 0) in lpfc_issue_reset()
1742 status = phba->lpfc_selective_reset(phba); in lpfc_issue_reset()
1751 * lpfc_sli4_pdev_status_reg_wait - Wait for pdev status register for readyness
1755 * SLI4 interface type-2 device to wait on the sliport status register for
1759 * zero for success, -EPERM when port does not have privilege to perform the
1760 * reset, -EIO when port timeout from recovering from the reset.
1773 if (lpfc_readl(phba->sli4_hba.u.if_type2.STATUSregaddr, in lpfc_sli4_pdev_status_reg_wait()
1775 return -EIO; in lpfc_sli4_pdev_status_reg_wait()
1780 return -EPERM; in lpfc_sli4_pdev_status_reg_wait()
1786 return -EIO; in lpfc_sli4_pdev_status_reg_wait()
1791 if (lpfc_readl(phba->sli4_hba.u.if_type2.STATUSregaddr, in lpfc_sli4_pdev_status_reg_wait()
1806 return -EIO; in lpfc_sli4_pdev_status_reg_wait()
1810 * lpfc_sli4_pdev_reg_request - Request physical dev to perform a register acc
1815 * Request SLI4 interface type-2 device to perform a physical register set
1825 struct pci_dev *pdev = phba->pcidev; in lpfc_sli4_pdev_reg_request()
1832 if (!phba->cfg_enable_hba_reset) in lpfc_sli4_pdev_reg_request()
1833 return -EACCES; in lpfc_sli4_pdev_reg_request()
1835 if ((phba->sli_rev < LPFC_SLI_REV4) || in lpfc_sli4_pdev_reg_request()
1836 (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) < in lpfc_sli4_pdev_reg_request()
1838 return -EPERM; in lpfc_sli4_pdev_reg_request()
1841 before_fc_flag = phba->pport->fc_flag; in lpfc_sli4_pdev_reg_request()
1842 sriov_nr_virtfn = phba->cfg_sriov_nr_virtfn; in lpfc_sli4_pdev_reg_request()
1846 phba->fw_dump_cmpl = &online_compl; in lpfc_sli4_pdev_reg_request()
1848 /* Disable SR-IOV virtual functions if enabled */ in lpfc_sli4_pdev_reg_request()
1849 if (phba->cfg_sriov_nr_virtfn) { in lpfc_sli4_pdev_reg_request()
1851 phba->cfg_sriov_nr_virtfn = 0; in lpfc_sli4_pdev_reg_request()
1863 reg_val = readl(phba->sli4_hba.conf_regs_memmap_p + in lpfc_sli4_pdev_reg_request()
1873 writel(reg_val, phba->sli4_hba.conf_regs_memmap_p + in lpfc_sli4_pdev_reg_request()
1876 readl(phba->sli4_hba.conf_regs_memmap_p + LPFC_CTL_PDEV_CTL_OFFSET); in lpfc_sli4_pdev_reg_request()
1881 if (rc == -EPERM) { in lpfc_sli4_pdev_reg_request()
1886 } else if (rc == -EIO) { in lpfc_sli4_pdev_reg_request()
1891 if (phba->fw_dump_cmpl) in lpfc_sli4_pdev_reg_request()
1892 phba->fw_dump_cmpl = NULL; in lpfc_sli4_pdev_reg_request()
1898 if (phba->fw_dump_cmpl) in lpfc_sli4_pdev_reg_request()
1899 phba->fw_dump_cmpl = NULL; in lpfc_sli4_pdev_reg_request()
1908 wait_for_completion(phba->fw_dump_cmpl); in lpfc_sli4_pdev_reg_request()
1924 phba->cfg_sriov_nr_virtfn = 0; in lpfc_sli4_pdev_reg_request()
1930 phba->cfg_sriov_nr_virtfn = sriov_nr_virtfn; in lpfc_sli4_pdev_reg_request()
1936 rc = -ENOMEM; in lpfc_sli4_pdev_reg_request()
1938 rc = -EIO; in lpfc_sli4_pdev_reg_request()
1944 * lpfc_nport_evt_cnt_show - Return the number of nport events
1956 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_nport_evt_cnt_show()
1957 struct lpfc_hba *phba = vport->phba; in lpfc_nport_evt_cnt_show()
1959 return scnprintf(buf, PAGE_SIZE, "%d\n", phba->nport_event_cnt); in lpfc_nport_evt_cnt_show()
1981 return -EINVAL; /* Invalid command */ in lpfc_set_trunking()
1995 return -EINVAL; in lpfc_set_trunking()
2001 mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); in lpfc_set_trunking()
2003 return -ENOMEM; in lpfc_set_trunking()
2005 payload_len = sizeof(struct lpfc_mbx_set_trunk_mode) - in lpfc_set_trunking()
2012 &mbox->u.mqe.un.set_trunk_mode, in lpfc_set_trunking()
2019 mempool_free(mbox, phba->mbox_mem_pool); in lpfc_set_trunking()
2029 struct lpfc_vport *vport = (struct lpfc_vport *)shost->hostdata; in lpfc_xcvr_data_show()
2030 struct lpfc_hba *phba = vport->phba; in lpfc_xcvr_data_show()
2046 len = scnprintf(buf, PAGE_SIZE - len, in lpfc_xcvr_data_show()
2053 len = scnprintf(buf, PAGE_SIZE - len, "SFP info NA:\n"); in lpfc_xcvr_data_show()
2057 strscpy(chbuf, &rdp_context->page_a0[SSF_VENDOR_NAME], 16); in lpfc_xcvr_data_show()
2059 len = scnprintf(buf, PAGE_SIZE - len, "VendorName:\t%s\n", chbuf); in lpfc_xcvr_data_show()
2060 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_xcvr_data_show()
2061 "VendorOUI:\t%02x-%02x-%02x\n", in lpfc_xcvr_data_show()
2062 (uint8_t)rdp_context->page_a0[SSF_VENDOR_OUI], in lpfc_xcvr_data_show()
2063 (uint8_t)rdp_context->page_a0[SSF_VENDOR_OUI + 1], in lpfc_xcvr_data_show()
2064 (uint8_t)rdp_context->page_a0[SSF_VENDOR_OUI + 2]); in lpfc_xcvr_data_show()
2065 strscpy(chbuf, &rdp_context->page_a0[SSF_VENDOR_PN], 16); in lpfc_xcvr_data_show()
2066 len += scnprintf(buf + len, PAGE_SIZE - len, "VendorPN:\t%s\n", chbuf); in lpfc_xcvr_data_show()
2067 strscpy(chbuf, &rdp_context->page_a0[SSF_VENDOR_SN], 16); in lpfc_xcvr_data_show()
2068 len += scnprintf(buf + len, PAGE_SIZE - len, "VendorSN:\t%s\n", chbuf); in lpfc_xcvr_data_show()
2069 strscpy(chbuf, &rdp_context->page_a0[SSF_VENDOR_REV], 4); in lpfc_xcvr_data_show()
2070 len += scnprintf(buf + len, PAGE_SIZE - len, "VendorRev:\t%s\n", chbuf); in lpfc_xcvr_data_show()
2071 strscpy(chbuf, &rdp_context->page_a0[SSF_DATE_CODE], 8); in lpfc_xcvr_data_show()
2072 len += scnprintf(buf + len, PAGE_SIZE - len, "DateCode:\t%s\n", chbuf); in lpfc_xcvr_data_show()
2073 len += scnprintf(buf + len, PAGE_SIZE - len, "Identifier:\t%xh\n", in lpfc_xcvr_data_show()
2074 (uint8_t)rdp_context->page_a0[SSF_IDENTIFIER]); in lpfc_xcvr_data_show()
2075 len += scnprintf(buf + len, PAGE_SIZE - len, "ExtIdentifier:\t%xh\n", in lpfc_xcvr_data_show()
2076 (uint8_t)rdp_context->page_a0[SSF_EXT_IDENTIFIER]); in lpfc_xcvr_data_show()
2077 len += scnprintf(buf + len, PAGE_SIZE - len, "Connector:\t%xh\n", in lpfc_xcvr_data_show()
2078 (uint8_t)rdp_context->page_a0[SSF_CONNECTOR]); in lpfc_xcvr_data_show()
2079 wavelength = (rdp_context->page_a0[SSF_WAVELENGTH_B1] << 8) | in lpfc_xcvr_data_show()
2080 rdp_context->page_a0[SSF_WAVELENGTH_B0]; in lpfc_xcvr_data_show()
2082 len += scnprintf(buf + len, PAGE_SIZE - len, "Wavelength:\t%d nm\n", in lpfc_xcvr_data_show()
2085 &rdp_context->page_a0[SSF_TRANSCEIVER_CODE_B7]; in lpfc_xcvr_data_show()
2087 len += scnprintf(buf + len, PAGE_SIZE - len, "Speeds: \t"); in lpfc_xcvr_data_show()
2089 len += scnprintf(buf + len, PAGE_SIZE - len, "Unknown\n"); in lpfc_xcvr_data_show()
2091 if (trasn_code_byte7->fc_sp_100MB) in lpfc_xcvr_data_show()
2092 len += scnprintf(buf + len, PAGE_SIZE - len, "1 "); in lpfc_xcvr_data_show()
2093 if (trasn_code_byte7->fc_sp_200mb) in lpfc_xcvr_data_show()
2094 len += scnprintf(buf + len, PAGE_SIZE - len, "2 "); in lpfc_xcvr_data_show()
2095 if (trasn_code_byte7->fc_sp_400MB) in lpfc_xcvr_data_show()
2096 len += scnprintf(buf + len, PAGE_SIZE - len, "4 "); in lpfc_xcvr_data_show()
2097 if (trasn_code_byte7->fc_sp_800MB) in lpfc_xcvr_data_show()
2098 len += scnprintf(buf + len, PAGE_SIZE - len, "8 "); in lpfc_xcvr_data_show()
2099 if (trasn_code_byte7->fc_sp_1600MB) in lpfc_xcvr_data_show()
2100 len += scnprintf(buf + len, PAGE_SIZE - len, "16 "); in lpfc_xcvr_data_show()
2101 if (trasn_code_byte7->fc_sp_3200MB) in lpfc_xcvr_data_show()
2102 len += scnprintf(buf + len, PAGE_SIZE - len, "32 "); in lpfc_xcvr_data_show()
2103 if (trasn_code_byte7->speed_chk_ecc) in lpfc_xcvr_data_show()
2104 len += scnprintf(buf + len, PAGE_SIZE - len, "64 "); in lpfc_xcvr_data_show()
2105 len += scnprintf(buf + len, PAGE_SIZE - len, "GB\n"); in lpfc_xcvr_data_show()
2107 temperature = (rdp_context->page_a2[SFF_TEMPERATURE_B1] << 8 | in lpfc_xcvr_data_show()
2108 rdp_context->page_a2[SFF_TEMPERATURE_B0]); in lpfc_xcvr_data_show()
2109 vcc = (rdp_context->page_a2[SFF_VCC_B1] << 8 | in lpfc_xcvr_data_show()
2110 rdp_context->page_a2[SFF_VCC_B0]); in lpfc_xcvr_data_show()
2111 tx_power = (rdp_context->page_a2[SFF_TXPOWER_B1] << 8 | in lpfc_xcvr_data_show()
2112 rdp_context->page_a2[SFF_TXPOWER_B0]); in lpfc_xcvr_data_show()
2113 tx_bias = (rdp_context->page_a2[SFF_TX_BIAS_CURRENT_B1] << 8 | in lpfc_xcvr_data_show()
2114 rdp_context->page_a2[SFF_TX_BIAS_CURRENT_B0]); in lpfc_xcvr_data_show()
2115 rx_power = (rdp_context->page_a2[SFF_RXPOWER_B1] << 8 | in lpfc_xcvr_data_show()
2116 rdp_context->page_a2[SFF_RXPOWER_B0]); in lpfc_xcvr_data_show()
2118 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_xcvr_data_show()
2120 len += scnprintf(buf + len, PAGE_SIZE - len, "Vcc:\t\tx%04x V\n", vcc); in lpfc_xcvr_data_show()
2121 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_xcvr_data_show()
2123 len += scnprintf(buf + len, PAGE_SIZE - len, "TxPower:\tx%04x mW\n", in lpfc_xcvr_data_show()
2125 len += scnprintf(buf + len, PAGE_SIZE - len, "RxPower:\tx%04x mW\n", in lpfc_xcvr_data_show()
2133 * lpfc_board_mode_show - Return the state of the board
2145 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_board_mode_show()
2146 struct lpfc_hba *phba = vport->phba; in lpfc_board_mode_show()
2149 if (phba->link_state == LPFC_HBA_ERROR) in lpfc_board_mode_show()
2151 else if (phba->link_state == LPFC_WARM_START) in lpfc_board_mode_show()
2153 else if (phba->link_state == LPFC_INIT_START) in lpfc_board_mode_show()
2162 * lpfc_board_mode_store - Puts the hba in online, offline, warm or error state
2169 * -EACCES if enable hba reset not enabled
2170 * -EINVAL if the buffer does not contain a valid string (see above)
2171 * -EIO if lpfc_workq_post_event() or lpfc_do_offline() fails
2179 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_board_mode_store()
2180 struct lpfc_hba *phba = vport->phba; in lpfc_board_mode_store()
2186 if (!phba->cfg_enable_hba_reset) { in lpfc_board_mode_store()
2187 status = -EACCES; in lpfc_board_mode_store()
2196 if(strncmp(buf, "online", sizeof("online") - 1) == 0) { in lpfc_board_mode_store()
2200 status = -ENOMEM; in lpfc_board_mode_store()
2205 status = -EIO; in lpfc_board_mode_store()
2206 } else if (strncmp(buf, "offline", sizeof("offline") - 1) == 0) in lpfc_board_mode_store()
2208 else if (strncmp(buf, "warm", sizeof("warm") - 1) == 0) in lpfc_board_mode_store()
2209 if (phba->sli_rev == LPFC_SLI_REV4) in lpfc_board_mode_store()
2210 status = -EINVAL; in lpfc_board_mode_store()
2213 else if (strncmp(buf, "error", sizeof("error") - 1) == 0) in lpfc_board_mode_store()
2214 if (phba->sli_rev == LPFC_SLI_REV4) in lpfc_board_mode_store()
2215 status = -EINVAL; in lpfc_board_mode_store()
2218 else if (strncmp(buf, "dump", sizeof("dump") - 1) == 0) in lpfc_board_mode_store()
2220 else if (strncmp(buf, "fw_reset", sizeof("fw_reset") - 1) == 0) in lpfc_board_mode_store()
2222 else if (strncmp(buf, "dv_reset", sizeof("dv_reset") - 1) == 0) in lpfc_board_mode_store()
2224 else if (strncmp(buf, "pci_bus_reset", sizeof("pci_bus_reset") - 1) in lpfc_board_mode_store()
2227 else if (strncmp(buf, "heartbeat", sizeof("heartbeat") - 1) == 0) in lpfc_board_mode_store()
2229 else if (strncmp(buf, "trunk", sizeof("trunk") - 1) == 0) in lpfc_board_mode_store()
2232 status = -EINVAL; in lpfc_board_mode_store()
2244 buf, status, phba->pport->fc_flag); in lpfc_board_mode_store()
2250 * lpfc_get_hba_info - Return various bits of informaton about the adapter
2284 if (phba->link_state < LPFC_LINK_DOWN || in lpfc_get_hba_info()
2285 !phba->mbox_mem_pool || in lpfc_get_hba_info()
2286 (phba->sli.sli_flag & LPFC_SLI_ACTIVE) == 0) in lpfc_get_hba_info()
2289 if (phba->sli.sli_flag & LPFC_BLOCK_MGMT_IO) in lpfc_get_hba_info()
2292 pmboxq = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); in lpfc_get_hba_info()
2297 pmb = &pmboxq->u.mb; in lpfc_get_hba_info()
2298 pmb->mbxCommand = MBX_READ_CONFIG; in lpfc_get_hba_info()
2299 pmb->mbxOwner = OWN_HOST; in lpfc_get_hba_info()
2300 pmboxq->ctx_buf = NULL; in lpfc_get_hba_info()
2302 if (test_bit(FC_OFFLINE_MODE, &phba->pport->fc_flag)) in lpfc_get_hba_info()
2305 rc = lpfc_sli_issue_mbox_wait(phba, pmboxq, phba->fc_ratov * 2); in lpfc_get_hba_info()
2309 mempool_free(pmboxq, phba->mbox_mem_pool); in lpfc_get_hba_info()
2313 if (phba->sli_rev == LPFC_SLI_REV4) { in lpfc_get_hba_info()
2314 sli4_hba = &phba->sli4_hba; in lpfc_get_hba_info()
2315 max_cfg_param = &sli4_hba->max_cfg_param; in lpfc_get_hba_info()
2318 if (!phba->sli4_hba.extents_in_use) { in lpfc_get_hba_info()
2320 *mrpi = max_cfg_param->max_rpi; in lpfc_get_hba_info()
2322 *mxri = max_cfg_param->max_xri; in lpfc_get_hba_info()
2324 max_vpi = max_cfg_param->max_vpi; in lpfc_get_hba_info()
2375 *mrpi = pmb->un.varRdConfig.max_rpi; in lpfc_get_hba_info()
2377 *arpi = pmb->un.varRdConfig.avail_rpi; in lpfc_get_hba_info()
2379 *mxri = pmb->un.varRdConfig.max_xri; in lpfc_get_hba_info()
2381 *axri = pmb->un.varRdConfig.avail_xri; in lpfc_get_hba_info()
2383 *mvpi = pmb->un.varRdConfig.max_vpi; in lpfc_get_hba_info()
2386 if (phba->link_state == LPFC_HBA_READY) in lpfc_get_hba_info()
2387 *avpi = pmb->un.varRdConfig.avail_vpi; in lpfc_get_hba_info()
2389 *avpi = pmb->un.varRdConfig.max_vpi; in lpfc_get_hba_info()
2397 mempool_free(pmboxq, phba->mbox_mem_pool); in lpfc_get_hba_info()
2402 * lpfc_max_rpi_show - Return maximum rpi
2420 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_max_rpi_show()
2421 struct lpfc_hba *phba = vport->phba; in lpfc_max_rpi_show()
2430 * lpfc_used_rpi_show - Return maximum rpi minus available rpi
2448 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_used_rpi_show()
2449 struct lpfc_hba *phba = vport->phba; in lpfc_used_rpi_show()
2454 if (phba->sli_rev == LPFC_SLI_REV4) { in lpfc_used_rpi_show()
2455 sli4_hba = &phba->sli4_hba; in lpfc_used_rpi_show()
2456 max_cfg_param = &sli4_hba->max_cfg_param; in lpfc_used_rpi_show()
2458 max_cfg_param->rpi_used); in lpfc_used_rpi_show()
2461 return scnprintf(buf, PAGE_SIZE, "%d\n", (cnt - acnt)); in lpfc_used_rpi_show()
2467 * lpfc_max_xri_show - Return maximum xri
2485 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_max_xri_show()
2486 struct lpfc_hba *phba = vport->phba; in lpfc_max_xri_show()
2495 * lpfc_used_xri_show - Return maximum xpi minus the available xpi
2513 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_used_xri_show()
2514 struct lpfc_hba *phba = vport->phba; in lpfc_used_xri_show()
2519 if (phba->sli_rev == LPFC_SLI_REV4) { in lpfc_used_xri_show()
2520 sli4_hba = &phba->sli4_hba; in lpfc_used_xri_show()
2521 max_cfg_param = &sli4_hba->max_cfg_param; in lpfc_used_xri_show()
2523 max_cfg_param->xri_used); in lpfc_used_xri_show()
2526 return scnprintf(buf, PAGE_SIZE, "%d\n", (cnt - acnt)); in lpfc_used_xri_show()
2532 * lpfc_max_vpi_show - Return maximum vpi
2550 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_max_vpi_show()
2551 struct lpfc_hba *phba = vport->phba; in lpfc_max_vpi_show()
2560 * lpfc_used_vpi_show - Return maximum vpi minus the available vpi
2578 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_used_vpi_show()
2579 struct lpfc_hba *phba = vport->phba; in lpfc_used_vpi_show()
2584 if (phba->sli_rev == LPFC_SLI_REV4) { in lpfc_used_vpi_show()
2585 sli4_hba = &phba->sli4_hba; in lpfc_used_vpi_show()
2586 max_cfg_param = &sli4_hba->max_cfg_param; in lpfc_used_vpi_show()
2588 max_cfg_param->vpi_used); in lpfc_used_vpi_show()
2591 return scnprintf(buf, PAGE_SIZE, "%d\n", (cnt - acnt)); in lpfc_used_vpi_show()
2597 * lpfc_npiv_info_show - Return text about NPIV support for the adapter
2614 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_npiv_info_show()
2615 struct lpfc_hba *phba = vport->phba; in lpfc_npiv_info_show()
2617 if (!(phba->max_vpi)) in lpfc_npiv_info_show()
2619 if (vport->port_type == LPFC_PHYSICAL_PORT) in lpfc_npiv_info_show()
2621 return scnprintf(buf, PAGE_SIZE, "NPIV Virtual (VPI %d)\n", vport->vpi); in lpfc_npiv_info_show()
2625 * lpfc_poll_show - Return text about poll support for the adapter
2640 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_poll_show()
2641 struct lpfc_hba *phba = vport->phba; in lpfc_poll_show()
2643 return scnprintf(buf, PAGE_SIZE, "%#x\n", phba->cfg_poll); in lpfc_poll_show()
2647 * lpfc_poll_store - Set the value of cfg_poll for the adapter
2657 * -EINVAL if the buffer connot be converted or is out of range
2665 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_poll_store()
2666 struct lpfc_hba *phba = vport->phba; in lpfc_poll_store()
2672 return -EINVAL; in lpfc_poll_store()
2675 return -EINVAL; in lpfc_poll_store()
2678 return -EINVAL; in lpfc_poll_store()
2680 if (phba->sli_rev == LPFC_SLI_REV4) in lpfc_poll_store()
2685 phba->cfg_poll, val); in lpfc_poll_store()
2687 spin_lock_irq(&phba->hbalock); in lpfc_poll_store()
2689 old_val = phba->cfg_poll; in lpfc_poll_store()
2694 if (lpfc_readl(phba->HCregaddr, &creg_val)) { in lpfc_poll_store()
2695 spin_unlock_irq(&phba->hbalock); in lpfc_poll_store()
2696 return -EINVAL; in lpfc_poll_store()
2699 writel(creg_val, phba->HCregaddr); in lpfc_poll_store()
2700 readl(phba->HCregaddr); /* flush */ in lpfc_poll_store()
2705 spin_unlock_irq(&phba->hbalock); in lpfc_poll_store()
2706 return -EINVAL; in lpfc_poll_store()
2712 spin_unlock_irq(&phba->hbalock); in lpfc_poll_store()
2713 timer_delete(&phba->fcp_poll_timer); in lpfc_poll_store()
2714 spin_lock_irq(&phba->hbalock); in lpfc_poll_store()
2715 if (lpfc_readl(phba->HCregaddr, &creg_val)) { in lpfc_poll_store()
2716 spin_unlock_irq(&phba->hbalock); in lpfc_poll_store()
2717 return -EINVAL; in lpfc_poll_store()
2720 writel(creg_val, phba->HCregaddr); in lpfc_poll_store()
2721 readl(phba->HCregaddr); /* flush */ in lpfc_poll_store()
2724 phba->cfg_poll = val; in lpfc_poll_store()
2726 spin_unlock_irq(&phba->hbalock); in lpfc_poll_store()
2732 * lpfc_sriov_hw_max_virtfn_show - Return maximum number of virtual functions
2749 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_sriov_hw_max_virtfn_show()
2750 struct lpfc_hba *phba = vport->phba; in lpfc_sriov_hw_max_virtfn_show()
2769 * -EINVAL if val is invalid
2774 if (lpfc_rangecheck(val, 0, 1) && phba->sli_rev == LPFC_SLI_REV4) { in lpfc_enable_bbcr_set()
2777 "%d\n", phba->cfg_enable_bbcr, val); in lpfc_enable_bbcr_set()
2778 phba->cfg_enable_bbcr = val; in lpfc_enable_bbcr_set()
2784 return -EINVAL; in lpfc_enable_bbcr_set()
2788 * lpfc_param_show - Return a cfg attribute value in decimal
2807 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;\
2808 struct lpfc_hba *phba = vport->phba;\
2810 phba->cfg_##attr);\
2814 * lpfc_param_hex_show - Return a cfg attribute value in hex
2833 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;\
2834 struct lpfc_hba *phba = vport->phba;\
2836 val = phba->cfg_##attr;\
2838 phba->cfg_##attr);\
2842 * lpfc_param_init - Initializes a cfg attribute
2858 * -EINVAL if default used
2865 phba->cfg_##attr = val;\
2871 phba->cfg_##attr = default;\
2872 return -EINVAL;\
2876 * lpfc_param_set - Set a cfg attribute value
2893 * -EINVAL if val is invalid
2902 phba->cfg_##attr, val); \
2903 phba->cfg_##attr = val;\
2909 return -EINVAL;\
2913 * lpfc_param_store - Set a vport attribute value
2930 * -EINVAL if val is invalid or lpfc_##attr##_set() fails
2939 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;\
2940 struct lpfc_hba *phba = vport->phba;\
2943 return -EINVAL;\
2945 return -EINVAL;\
2949 return -EINVAL;\
2953 * lpfc_vport_param_show - Return decimal formatted cfg attribute value
2972 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;\
2973 return scnprintf(buf, PAGE_SIZE, "%d\n", vport->cfg_##attr);\
2977 * lpfc_vport_param_hex_show - Return hex formatted attribute value
2997 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;\
2998 return scnprintf(buf, PAGE_SIZE, "%#x\n", vport->cfg_##attr);\
3002 * lpfc_vport_param_init - Initialize a vport cfg attribute
3017 * -EINVAL if default used
3024 vport->cfg_##attr = val;\
3030 vport->cfg_##attr = default;\
3031 return -EINVAL;\
3035 * lpfc_vport_param_set - Set a vport cfg attribute
3049 * -EINVAL if val is invalid
3059 vport->cfg_##attr, vport->cfg_##attr, \
3061 vport->cfg_##attr = val;\
3067 return -EINVAL;\
3071 * lpfc_vport_param_store - Set a vport attribute
3084 * -EINVAL if val is invalid or lpfc_##attr##_set() fails
3093 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;\
3096 return -EINVAL;\
3098 return -EINVAL;\
3102 return -EINVAL;\
3150 * lpfc_wwn_set - Convert string to the 8 byte WWN value.
3156 * -EINVAL if the buffer does not contain a valid wwn
3165 if (buf[cnt-1] == '\n') in lpfc_wwn_set()
3166 cnt--; in lpfc_wwn_set()
3170 return -EINVAL; in lpfc_wwn_set()
3177 j = ((j << 4) | ((*buf++ - 'a') + 10)); in lpfc_wwn_set()
3179 j = ((j << 4) | ((*buf++ - 'A') + 10)); in lpfc_wwn_set()
3181 j = ((j << 4) | (*buf++ - '0')); in lpfc_wwn_set()
3183 return -EINVAL; in lpfc_wwn_set()
3194 * lpfc_oas_tgt_show - Return wwpn of target whose luns maybe enabled for
3208 struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba; in lpfc_oas_tgt_show()
3211 wwn_to_u64(phba->cfg_oas_tgt_wwpn)); in lpfc_oas_tgt_show()
3215 * lpfc_oas_tgt_store - Store wwpn of target whose luns maybe enabled for
3223 * -EINVAL count is invalid, invalid wwpn byte invalid
3224 * -EPERM oas is not supported by hba
3232 struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba; in lpfc_oas_tgt_store()
3237 if (!phba->cfg_fof) in lpfc_oas_tgt_store()
3238 return -EPERM; in lpfc_oas_tgt_store()
3241 if (buf[cnt-1] == '\n') in lpfc_oas_tgt_store()
3242 cnt--; in lpfc_oas_tgt_store()
3248 memcpy(phba->cfg_oas_tgt_wwpn, wwpn, (8 * sizeof(uint8_t))); in lpfc_oas_tgt_store()
3249 memcpy(phba->sli4_hba.oas_next_tgt_wwpn, wwpn, (8 * sizeof(uint8_t))); in lpfc_oas_tgt_store()
3251 phba->cfg_oas_flags |= OAS_FIND_ANY_TARGET; in lpfc_oas_tgt_store()
3253 phba->cfg_oas_flags &= ~OAS_FIND_ANY_TARGET; in lpfc_oas_tgt_store()
3254 phba->cfg_oas_flags &= ~OAS_LUN_VALID; in lpfc_oas_tgt_store()
3255 phba->sli4_hba.oas_next_lun = FIND_FIRST_OAS_LUN; in lpfc_oas_tgt_store()
3262 * lpfc_oas_priority_show - Return wwpn of target whose luns maybe enabled for
3276 struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba; in lpfc_oas_priority_show()
3278 return scnprintf(buf, PAGE_SIZE, "%d\n", phba->cfg_oas_priority); in lpfc_oas_priority_show()
3282 * lpfc_oas_priority_store - Store wwpn of target whose luns maybe enabled for
3290 * -EINVAL count is invalid, invalid wwpn byte invalid
3291 * -EPERM oas is not supported by hba
3299 struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba; in lpfc_oas_priority_store()
3304 if (!phba->cfg_fof) in lpfc_oas_priority_store()
3305 return -EPERM; in lpfc_oas_priority_store()
3308 if (buf[cnt-1] == '\n') in lpfc_oas_priority_store()
3309 cnt--; in lpfc_oas_priority_store()
3313 return -EINVAL; in lpfc_oas_priority_store()
3316 phba->cfg_oas_priority = (uint8_t)val; in lpfc_oas_priority_store()
3318 phba->cfg_oas_priority = phba->cfg_XLanePriority; in lpfc_oas_priority_store()
3325 * lpfc_oas_vpt_show - Return wwpn of vport whose targets maybe enabled
3339 struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba; in lpfc_oas_vpt_show()
3342 wwn_to_u64(phba->cfg_oas_vpt_wwpn)); in lpfc_oas_vpt_show()
3346 * lpfc_oas_vpt_store - Store wwpn of vport whose targets maybe enabled
3354 * -EINVAL count is invalid, invalid wwpn byte invalid
3355 * -EPERM oas is not supported by hba
3363 struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba; in lpfc_oas_vpt_store()
3368 if (!phba->cfg_fof) in lpfc_oas_vpt_store()
3369 return -EPERM; in lpfc_oas_vpt_store()
3372 if (buf[cnt-1] == '\n') in lpfc_oas_vpt_store()
3373 cnt--; in lpfc_oas_vpt_store()
3379 memcpy(phba->cfg_oas_vpt_wwpn, wwpn, (8 * sizeof(uint8_t))); in lpfc_oas_vpt_store()
3380 memcpy(phba->sli4_hba.oas_next_vpt_wwpn, wwpn, (8 * sizeof(uint8_t))); in lpfc_oas_vpt_store()
3382 phba->cfg_oas_flags |= OAS_FIND_ANY_VPORT; in lpfc_oas_vpt_store()
3384 phba->cfg_oas_flags &= ~OAS_FIND_ANY_VPORT; in lpfc_oas_vpt_store()
3385 phba->cfg_oas_flags &= ~OAS_LUN_VALID; in lpfc_oas_vpt_store()
3386 if (phba->cfg_oas_priority == 0) in lpfc_oas_vpt_store()
3387 phba->cfg_oas_priority = phba->cfg_XLanePriority; in lpfc_oas_vpt_store()
3388 phba->sli4_hba.oas_next_lun = FIND_FIRST_OAS_LUN; in lpfc_oas_vpt_store()
3395 * lpfc_oas_lun_state_show - Return the current state (enabled or disabled)
3410 struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba; in lpfc_oas_lun_state_show()
3412 return scnprintf(buf, PAGE_SIZE, "%d\n", phba->cfg_oas_lun_state); in lpfc_oas_lun_state_show()
3416 * lpfc_oas_lun_state_store - Store the state (enabled or disabled)
3425 * -EINVAL count is invalid, invalid wwpn byte invalid
3426 * -EPERM oas is not supported by hba
3434 struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba; in lpfc_oas_lun_state_store()
3437 if (!phba->cfg_fof) in lpfc_oas_lun_state_store()
3438 return -EPERM; in lpfc_oas_lun_state_store()
3441 return -EINVAL; in lpfc_oas_lun_state_store()
3444 return -EINVAL; in lpfc_oas_lun_state_store()
3447 return -EINVAL; in lpfc_oas_lun_state_store()
3449 phba->cfg_oas_lun_state = val; in lpfc_oas_lun_state_store()
3456 * lpfc_oas_lun_status_show - Return the status of the Optimized Access
3471 struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba; in lpfc_oas_lun_status_show()
3473 if (!(phba->cfg_oas_flags & OAS_LUN_VALID)) in lpfc_oas_lun_status_show()
3474 return -EFAULT; in lpfc_oas_lun_status_show()
3476 return scnprintf(buf, PAGE_SIZE, "%d\n", phba->cfg_oas_lun_status); in lpfc_oas_lun_status_show()
3483 * lpfc_oas_lun_state_set - enable or disable a lun for Optimized Access Storage
3494 * -EPERM OAS is not enabled or not supported by this port.
3505 if (!phba->cfg_fof) in lpfc_oas_lun_state_set()
3506 return -EPERM; in lpfc_oas_lun_state_set()
3512 rc = -ENOMEM; in lpfc_oas_lun_state_set()
3522 * lpfc_oas_lun_get_next - get the next lun that has been enabled for Optimized
3548 phba->sli4_hba.oas_next_vpt_wwpn, in lpfc_oas_lun_get_next()
3550 phba->sli4_hba.oas_next_tgt_wwpn, in lpfc_oas_lun_get_next()
3551 &phba->sli4_hba.oas_next_lun, in lpfc_oas_lun_get_next()
3561 * lpfc_oas_lun_state_change - enable/disable a lun for OAS operations
3574 * -ENOMEM: failed to enable an lun for OAS operations
3575 * -EPERM: OAS is not enabled
3591 * lpfc_oas_lun_show - Return oas enabled luns from a chosen target
3601 * -EFAULT: target or vport wwpn was not set properly.
3602 * -EPERM: oas is not enabled.
3609 struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba; in lpfc_oas_lun_show()
3614 if (!phba->cfg_fof) in lpfc_oas_lun_show()
3615 return -EPERM; in lpfc_oas_lun_show()
3617 if (wwn_to_u64(phba->cfg_oas_vpt_wwpn) == 0) in lpfc_oas_lun_show()
3618 if (!(phba->cfg_oas_flags & OAS_FIND_ANY_VPORT)) in lpfc_oas_lun_show()
3619 return -EFAULT; in lpfc_oas_lun_show()
3621 if (wwn_to_u64(phba->cfg_oas_tgt_wwpn) == 0) in lpfc_oas_lun_show()
3622 if (!(phba->cfg_oas_flags & OAS_FIND_ANY_TARGET)) in lpfc_oas_lun_show()
3623 return -EFAULT; in lpfc_oas_lun_show()
3625 oas_lun = lpfc_oas_lun_get_next(phba, phba->cfg_oas_vpt_wwpn, in lpfc_oas_lun_show()
3626 phba->cfg_oas_tgt_wwpn, in lpfc_oas_lun_show()
3627 &phba->cfg_oas_lun_status, in lpfc_oas_lun_show()
3628 &phba->cfg_oas_priority); in lpfc_oas_lun_show()
3630 phba->cfg_oas_flags |= OAS_LUN_VALID; in lpfc_oas_lun_show()
3632 len += scnprintf(buf + len, PAGE_SIZE-len, "0x%llx", oas_lun); in lpfc_oas_lun_show()
3638 * lpfc_oas_lun_store - Sets the OAS state for lun
3649 * -EFAULT: target or vport wwpn was not set properly.
3650 * -EPERM: oas is not enabled.
3658 struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba; in lpfc_oas_lun_store()
3663 if (!phba->cfg_fof) in lpfc_oas_lun_store()
3664 return -EPERM; in lpfc_oas_lun_store()
3666 if (wwn_to_u64(phba->cfg_oas_vpt_wwpn) == 0) in lpfc_oas_lun_store()
3667 return -EFAULT; in lpfc_oas_lun_store()
3669 if (wwn_to_u64(phba->cfg_oas_tgt_wwpn) == 0) in lpfc_oas_lun_store()
3670 return -EFAULT; in lpfc_oas_lun_store()
3673 return -EINVAL; in lpfc_oas_lun_store()
3676 return -EINVAL; in lpfc_oas_lun_store()
3678 pri = phba->cfg_oas_priority; in lpfc_oas_lun_store()
3680 pri = phba->cfg_XLanePriority; in lpfc_oas_lun_store()
3685 wwn_to_u64(phba->cfg_oas_vpt_wwpn), in lpfc_oas_lun_store()
3686 wwn_to_u64(phba->cfg_oas_tgt_wwpn), scsi_lun, in lpfc_oas_lun_store()
3687 pri, phba->cfg_oas_lun_state); in lpfc_oas_lun_store()
3689 rc = lpfc_oas_lun_state_change(phba, phba->cfg_oas_vpt_wwpn, in lpfc_oas_lun_store()
3690 phba->cfg_oas_tgt_wwpn, scsi_lun, in lpfc_oas_lun_store()
3691 phba->cfg_oas_lun_state, pri); in lpfc_oas_lun_store()
3710 " 0 - none,"
3711 " 1 - poll with interrupts enabled"
3712 " 3 - poll and disable FCP ring interrupts");
3723 "SLI mode selector: 3 - select SLI-3");
3736 * 1, IO completes after receipt of ABTS response or timeout.
3764 struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba; in lpfc_pls_show()
3767 phba->sli4_hba.pc_sli4_params.pls); in lpfc_pls_show()
3776 struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba; in lpfc_pt_show()
3780 &phba->hba_flag) ? 1 : 0); in lpfc_pt_show()
3787 # 1 - (1024)
3788 # 2 - (2048)
3789 # 3 - (3072)
3790 # 4 - (4096)
3791 # 5 - (5120)
3797 struct lpfc_hba *phba = ((struct lpfc_vport *) shost->hostdata)->phba; in lpfc_iocb_hw_show()
3799 return scnprintf(buf, PAGE_SIZE, "%d\n", phba->iocb_max); in lpfc_iocb_hw_show()
3808 struct lpfc_hba *phba = ((struct lpfc_vport *) shost->hostdata)->phba; in lpfc_txq_hw_show()
3812 pring ? pring->txq_max : 0); in lpfc_txq_hw_show()
3822 struct lpfc_hba *phba = ((struct lpfc_vport *) shost->hostdata)->phba; in lpfc_txcmplq_hw_show()
3826 pring ? pring->txcmplq_max : 0); in lpfc_txcmplq_hw_show()
3844 * lpfc_nodev_tmo_show - Return the hba dev loss timeout value
3847 * @buf: on return contains the dev loss timeout in decimal.
3856 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_nodev_tmo_show()
3858 return scnprintf(buf, PAGE_SIZE, "%d\n", vport->cfg_devloss_tmo); in lpfc_nodev_tmo_show()
3862 * lpfc_nodev_tmo_init - Set the hba nodev timeout value
3864 * @val: contains the nodev timeout value.
3874 * -EINVAL val out of range
3879 if (vport->cfg_devloss_tmo != LPFC_DEF_DEVLOSS_TMO) { in lpfc_nodev_tmo_init()
3880 vport->cfg_nodev_tmo = vport->cfg_devloss_tmo; in lpfc_nodev_tmo_init()
3890 vport->cfg_nodev_tmo = val; in lpfc_nodev_tmo_init()
3891 vport->cfg_devloss_tmo = val; in lpfc_nodev_tmo_init()
3898 vport->cfg_nodev_tmo = LPFC_DEF_DEVLOSS_TMO; in lpfc_nodev_tmo_init()
3899 return -EINVAL; in lpfc_nodev_tmo_init()
3903 * lpfc_update_rport_devloss_tmo - Update dev loss tmo value
3919 spin_lock_irqsave(&vport->fc_nodes_list_lock, iflags); in lpfc_update_rport_devloss_tmo()
3920 list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) { in lpfc_update_rport_devloss_tmo()
3921 if (ndlp->rport) in lpfc_update_rport_devloss_tmo()
3922 ndlp->rport->dev_loss_tmo = vport->cfg_devloss_tmo; in lpfc_update_rport_devloss_tmo()
3924 spin_lock(&ndlp->lock); in lpfc_update_rport_devloss_tmo()
3927 remoteport = rport->remoteport; in lpfc_update_rport_devloss_tmo()
3928 spin_unlock(&ndlp->lock); in lpfc_update_rport_devloss_tmo()
3931 vport->cfg_devloss_tmo); in lpfc_update_rport_devloss_tmo()
3934 spin_unlock_irqrestore(&vport->fc_nodes_list_lock, iflags); in lpfc_update_rport_devloss_tmo()
3938 * lpfc_nodev_tmo_set - Set the vport nodev tmo and devloss tmo values
3950 * -EINVAL val out of range
3955 if (vport->dev_loss_tmo_changed || in lpfc_nodev_tmo_set()
3963 vport->cfg_nodev_tmo = val; in lpfc_nodev_tmo_set()
3964 vport->cfg_devloss_tmo = val; in lpfc_nodev_tmo_set()
3977 return -EINVAL; in lpfc_nodev_tmo_set()
3998 * lpfc_devloss_tmo_set - Sets vport nodev tmo, devloss tmo values, changed bit in lpfc_vport_param_init()
4009 * -EINVAL val out of range in lpfc_vport_param_init()
4015 vport->cfg_nodev_tmo = val; in lpfc_vport_param_init()
4016 vport->cfg_devloss_tmo = val; in lpfc_vport_param_init()
4017 vport->dev_loss_tmo_changed = 1; in lpfc_vport_param_init()
4027 return -EINVAL; in lpfc_vport_param_init()
4064 * Supported Values: 1 - register just FCP
4065 * 3 - register both FCP and NVME
4070 "Enable FC4 Protocol support - FCP / NVME");
4079 "Verbose logging bit-mask");
4115 * -EINVAL if val is invalid
4124 return -EINVAL; in lpfc_tgt_queue_depth_set()
4126 if (val == vport->cfg_tgt_queue_depth) in lpfc_tgt_queue_depth_set()
4129 vport->cfg_tgt_queue_depth = val; in lpfc_tgt_queue_depth_set()
4132 spin_lock_irqsave(&vport->fc_nodes_list_lock, iflags); in lpfc_tgt_queue_depth_set()
4133 list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) in lpfc_tgt_queue_depth_set()
4134 ndlp->cmd_qdepth = vport->cfg_tgt_queue_depth; in lpfc_tgt_queue_depth_set()
4135 spin_unlock_irqrestore(&vport->fc_nodes_list_lock, iflags); in lpfc_tgt_queue_depth_set()
4183 * lpfc_restrict_login_init - Set the vport restrict login flag
4195 * -EINVAL val out of range
4205 vport->cfg_restrict_login = 1; in lpfc_restrict_login_init()
4206 return -EINVAL; in lpfc_restrict_login_init()
4208 if (vport->port_type == LPFC_PHYSICAL_PORT) { in lpfc_restrict_login_init()
4209 vport->cfg_restrict_login = 0; in lpfc_restrict_login_init()
4212 vport->cfg_restrict_login = val; in lpfc_restrict_login_init()
4217 * lpfc_restrict_login_set - Set the vport restrict login flag
4230 * -EINVAL val out of range
4240 vport->cfg_restrict_login = 1; in lpfc_restrict_login_set()
4241 return -EINVAL; in lpfc_restrict_login_set()
4243 if (vport->port_type == LPFC_PHYSICAL_PORT && val != 0) { in lpfc_restrict_login_set()
4247 vport->cfg_restrict_login = 0; in lpfc_restrict_login_set()
4250 vport->cfg_restrict_login = val; in lpfc_restrict_login_set()
4259 # Fibre channel "ALPA". In the FC-AL Profile there is an "informative
4265 # Turning on the scan-down variable (on = 1, off = 0) will
4278 # 0x0 = attempt loop mode then point-to-point
4280 # 0x02 = attempt point-to-point mode only
4282 # 0x06 = attempt point-to-point mode then loop
4283 # Set point-to-point mode if you want to run as an N_Port.
4291 * lpfc_topology_store - Set the adapters topology field
4305 * non-zero return value from lpfc_issue_lip()
4306 * -EINVAL val out of range
4313 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_topology_store()
4314 struct lpfc_hba *phba = vport->phba; in lpfc_topology_store()
4328 return -EINVAL; in lpfc_topology_store()
4330 return -EINVAL; in lpfc_topology_store()
4333 prev_val = phba->cfg_topology; in lpfc_topology_store()
4334 if (phba->cfg_link_speed == LPFC_USER_LINK_SPEED_16G && in lpfc_topology_store()
4339 return -EINVAL; in lpfc_topology_store()
4343 * - persistent topology enabled in lpfc_topology_store()
4344 * - ASIC_GEN_NUM >= 0xC, with no private loop support in lpfc_topology_store()
4347 &phba->sli4_hba.sli_intf); in lpfc_topology_store()
4349 &phba->sli4_hba.sli_intf); in lpfc_topology_store()
4350 if ((test_bit(HBA_PERSISTENT_TOPO, &phba->hba_flag) || in lpfc_topology_store()
4351 (!phba->sli4_hba.pc_sli4_params.pls && in lpfc_topology_store()
4357 return -EINVAL; in lpfc_topology_store()
4359 phba->cfg_topology = val; in lpfc_topology_store()
4366 if (prev_val != val && phba->sli_rev == LPFC_SLI_REV4) in lpfc_topology_store()
4367 phba->fc_topology_changed = 1; in lpfc_topology_store()
4368 err = lpfc_issue_lip(lpfc_shost_from_vport(phba->pport)); in lpfc_topology_store()
4370 phba->cfg_topology = prev_val; in lpfc_topology_store()
4371 return -EINVAL; in lpfc_topology_store()
4378 phba->brd_no, val); in lpfc_topology_store()
4379 return -EINVAL; in lpfc_topology_store()
4401 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_static_vport_show()
4402 if (vport->vport_flag & STATIC_VPORT) in lpfc_static_vport_show()
4421 * lpfc_link_speed_store - Set the adapters link speed
4436 * non-zero return value from lpfc_issue_lip()
4437 * -EINVAL val out of range
4444 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_link_speed_store()
4445 struct lpfc_hba *phba = vport->phba; in lpfc_link_speed_store()
4452 if_type = bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf); in lpfc_link_speed_store()
4454 test_bit(HBA_FORCED_LINK_SPEED, &phba->hba_flag)) in lpfc_link_speed_store()
4455 return -EPERM; in lpfc_link_speed_store()
4463 return -EINVAL; in lpfc_link_speed_store()
4465 return -EINVAL; in lpfc_link_speed_store()
4469 phba->cfg_link_speed, val, nolip ? "(nolip)" : "(lip)"); in lpfc_link_speed_store()
4471 if (((val == LPFC_USER_LINK_SPEED_1G) && !(phba->lmt & LMT_1Gb)) || in lpfc_link_speed_store()
4472 ((val == LPFC_USER_LINK_SPEED_2G) && !(phba->lmt & LMT_2Gb)) || in lpfc_link_speed_store()
4473 ((val == LPFC_USER_LINK_SPEED_4G) && !(phba->lmt & LMT_4Gb)) || in lpfc_link_speed_store()
4474 ((val == LPFC_USER_LINK_SPEED_8G) && !(phba->lmt & LMT_8Gb)) || in lpfc_link_speed_store()
4475 ((val == LPFC_USER_LINK_SPEED_10G) && !(phba->lmt & LMT_10Gb)) || in lpfc_link_speed_store()
4476 ((val == LPFC_USER_LINK_SPEED_16G) && !(phba->lmt & LMT_16Gb)) || in lpfc_link_speed_store()
4477 ((val == LPFC_USER_LINK_SPEED_32G) && !(phba->lmt & LMT_32Gb)) || in lpfc_link_speed_store()
4478 ((val == LPFC_USER_LINK_SPEED_64G) && !(phba->lmt & LMT_64Gb))) { in lpfc_link_speed_store()
4483 return -EINVAL; in lpfc_link_speed_store()
4486 phba->fc_topology == LPFC_TOPOLOGY_LOOP) { in lpfc_link_speed_store()
4491 return -EINVAL; in lpfc_link_speed_store()
4503 prev_val = phba->cfg_link_speed; in lpfc_link_speed_store()
4504 phba->cfg_link_speed = val; in lpfc_link_speed_store()
4508 err = lpfc_issue_lip(lpfc_shost_from_vport(phba->pport)); in lpfc_link_speed_store()
4510 phba->cfg_link_speed = prev_val; in lpfc_link_speed_store()
4511 return -EINVAL; in lpfc_link_speed_store()
4522 return -EINVAL; in lpfc_link_speed_store()
4532 * lpfc_link_speed_init - Set the adapters link speed in lpfc_param_show()
4545 * -EINVAL val out of range in lpfc_param_show()
4550 if (val >= LPFC_USER_LINK_SPEED_16G && phba->cfg_topology == 4) { in lpfc_param_show()
4555 phba->cfg_topology = 0; in lpfc_param_show()
4567 phba->cfg_link_speed = val; in lpfc_param_show()
4574 phba->cfg_link_speed = LPFC_USER_LINK_SPEED_AUTO; in lpfc_param_show()
4575 return -EINVAL; in lpfc_param_show()
4587 # N.B. Parts of LPFC_ATTR open-coded since some of the underlying
4588 # infrastructure (phba->cfg_aer_support) is gone.
4601 * lpfc_aer_support_store - Set the adapter for aer support
4615 * -EINVAL if val out of range
4624 return -EINVAL; in lpfc_aer_support_store()
4626 return -EINVAL; in lpfc_aer_support_store()
4635 * lpfc_aer_cleanup_state - Clean up aer state to the aer enabled device
4649 * -EINVAL if the buf does not contain 1
4650 * -EPERM if the OS cannot clear AER error status, i.e., when platform
4658 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_aer_cleanup_state()
4659 struct lpfc_hba *phba = vport->phba; in lpfc_aer_cleanup_state()
4660 int val, rc = -1; in lpfc_aer_cleanup_state()
4663 return -EINVAL; in lpfc_aer_cleanup_state()
4665 return -EINVAL; in lpfc_aer_cleanup_state()
4667 return -EINVAL; in lpfc_aer_cleanup_state()
4669 rc = pci_aer_clear_nonfatal_status(phba->pcidev); in lpfc_aer_cleanup_state()
4674 return -EPERM; in lpfc_aer_cleanup_state()
4681 * lpfc_sriov_nr_virtfn_store - Enable the adapter for sr-iov virtual functions
4690 * try to enable or disable SR-IOV virtual functions according to the
4700 * cfg_sriov_nr_virtfn; otherwise, -EINVAL shall be returned and driver
4703 * If none-zero virtual functions have already been enabled to the
4705 * -EINVAL will be returned and the driver does nothing;
4707 * If the nr_vfn provided is zero and none-zero virtual functions have
4717 * -EINVAL if val out of range or intended mode is not supported.
4724 struct lpfc_vport *vport = (struct lpfc_vport *)shost->hostdata; in lpfc_sriov_nr_virtfn_store()
4725 struct lpfc_hba *phba = vport->phba; in lpfc_sriov_nr_virtfn_store()
4726 struct pci_dev *pdev = phba->pcidev; in lpfc_sriov_nr_virtfn_store()
4727 int val = 0, rc = -EINVAL; in lpfc_sriov_nr_virtfn_store()
4731 return -EINVAL; in lpfc_sriov_nr_virtfn_store()
4733 return -EINVAL; in lpfc_sriov_nr_virtfn_store()
4735 return -EINVAL; in lpfc_sriov_nr_virtfn_store()
4739 if (phba->cfg_sriov_nr_virtfn > 0) { in lpfc_sriov_nr_virtfn_store()
4741 phba->cfg_sriov_nr_virtfn = 0; in lpfc_sriov_nr_virtfn_store()
4747 if (phba->cfg_sriov_nr_virtfn > 0) { in lpfc_sriov_nr_virtfn_store()
4751 phba->cfg_sriov_nr_virtfn); in lpfc_sriov_nr_virtfn_store()
4752 return -EEXIST; in lpfc_sriov_nr_virtfn_store()
4756 phba->cfg_sriov_nr_virtfn = val; in lpfc_sriov_nr_virtfn_store()
4761 return -EINVAL; in lpfc_sriov_nr_virtfn_store()
4764 rc = lpfc_sli_probe_sriov_nr_virtfn(phba, phba->cfg_sriov_nr_virtfn); in lpfc_sriov_nr_virtfn_store()
4766 phba->cfg_sriov_nr_virtfn = 0; in lpfc_sriov_nr_virtfn_store()
4767 rc = -EPERM; in lpfc_sriov_nr_virtfn_store()
4775 "Enable PCIe device SR-IOV virtual fn");
4781 * lpfc_request_firmware_upgrade_store - Request for Linux generic firmware upgrade
4793 * -EINVAL if val out of range or intended mode is not supported.
4801 struct lpfc_vport *vport = (struct lpfc_vport *)shost->hostdata; in lpfc_request_firmware_upgrade_store()
4802 struct lpfc_hba *phba = vport->phba; in lpfc_request_firmware_upgrade_store()
4807 return -EINVAL; in lpfc_request_firmware_upgrade_store()
4809 return -EINVAL; in lpfc_request_firmware_upgrade_store()
4811 return -EINVAL; in lpfc_request_firmware_upgrade_store()
4815 rc = -EPERM; in lpfc_request_firmware_upgrade_store()
4827 * lpfc_request_firmware_upgrade_init - Enable initial linux generic fw upgrade in lpfc_param_show()
4836 * -EINVAL val out of range in lpfc_param_show()
4842 phba->cfg_request_firmware_upgrade = val; in lpfc_param_show()
4845 return -EINVAL; in lpfc_param_show()
4865 * 0 - on success
4866 * -EIO - if command is not sent
4873 struct lpfc_vport *vport = (struct lpfc_vport *)shost->hostdata; in lpfc_force_rscn_store()
4878 return -EIO; in lpfc_force_rscn_store()
4895 * lpfc_force_rscn_init - Force an RSCN to be sent to all remote NPorts in lpfc_param_show()
4914 * @buf: string with the number of fast-path FCP interrupts per second.
4919 * maximum number of fast-path FCP interrupts per second.
4924 * -EINVAL if val out of range or intended mode is not supported.
4931 struct lpfc_vport *vport = (struct lpfc_vport *)shost->hostdata; in lpfc_fcp_imax_store()
4932 struct lpfc_hba *phba = vport->phba; in lpfc_fcp_imax_store()
4938 if (phba->sli_rev != LPFC_SLI_REV4) in lpfc_fcp_imax_store()
4939 return -EINVAL; in lpfc_fcp_imax_store()
4943 return -EINVAL; in lpfc_fcp_imax_store()
4945 return -EINVAL; in lpfc_fcp_imax_store()
4953 return -EINVAL; in lpfc_fcp_imax_store()
4955 phba->cfg_auto_imax = (val) ? 0 : 1; in lpfc_fcp_imax_store()
4956 if (phba->cfg_fcp_imax && !val) { in lpfc_fcp_imax_store()
4957 queue_delayed_work(phba->wq, &phba->eq_delay_work, in lpfc_fcp_imax_store()
4961 eqi = per_cpu_ptr(phba->sli4_hba.eq_info, i); in lpfc_fcp_imax_store()
4962 eqi->icnt = 0; in lpfc_fcp_imax_store()
4966 phba->cfg_fcp_imax = (uint32_t)val; in lpfc_fcp_imax_store()
4968 if (phba->cfg_fcp_imax) in lpfc_fcp_imax_store()
4969 usdelay = LPFC_SEC_TO_USEC / phba->cfg_fcp_imax; in lpfc_fcp_imax_store()
4973 for (i = 0; i < phba->cfg_irq_chann; i += LPFC_MAX_EQ_DELAY_EQID_CNT) in lpfc_fcp_imax_store()
4981 # lpfc_fcp_imax: The maximum number of fast-path FCP interrupts per second
4993 * lpfc_fcp_imax_init - Set the initial sr-iov virtual function enable in lpfc_param_show()
4999 * maximum number of fast-path FCP interrupts per second. in lpfc_param_show()
5003 * -EINVAL val out of range in lpfc_param_show()
5008 if (phba->sli_rev != LPFC_SLI_REV4) { in lpfc_param_show()
5009 phba->cfg_fcp_imax = 0; in lpfc_param_show()
5015 phba->cfg_fcp_imax = val; in lpfc_param_show()
5022 phba->cfg_fcp_imax = LPFC_DEF_IMAX; in lpfc_param_show()
5042 * -ERANGE: if val is not in the valid range
5043 * -EINVAL: if bad value format or intended mode is not supported.
5050 struct lpfc_vport *vport = (struct lpfc_vport *)shost->hostdata; in lpfc_cq_max_proc_limit_store()
5051 struct lpfc_hba *phba = vport->phba; in lpfc_cq_max_proc_limit_store()
5057 if (phba->sli_rev != LPFC_SLI_REV4) in lpfc_cq_max_proc_limit_store()
5058 return -EINVAL; in lpfc_cq_max_proc_limit_store()
5062 return -EINVAL; in lpfc_cq_max_proc_limit_store()
5064 return -EINVAL; in lpfc_cq_max_proc_limit_store()
5067 return -ERANGE; in lpfc_cq_max_proc_limit_store()
5069 phba->cfg_cq_max_proc_limit = (uint32_t)val; in lpfc_cq_max_proc_limit_store()
5072 for (i = 0; i < phba->cfg_irq_chann; i++) { in lpfc_cq_max_proc_limit_store()
5074 eq = phba->sli4_hba.hba_eq_hdl[i].eq; in lpfc_cq_max_proc_limit_store()
5078 list_for_each_entry(cq, &eq->child_list, list) in lpfc_cq_max_proc_limit_store()
5079 cq->max_proc_limit = min(phba->cfg_cq_max_proc_limit, in lpfc_cq_max_proc_limit_store()
5080 cq->entry_count); in lpfc_cq_max_proc_limit_store()
5100 * than re-enabling interrupts.
5108 * lpfc_cq_max_proc_limit_init - Set the initial cq max_proc_limit
5124 phba->cfg_cq_max_proc_limit = LPFC_CQ_DEF_MAX_PROC_LIMIT; in lpfc_cq_max_proc_limit_init()
5126 if (phba->sli_rev != LPFC_SLI_REV4) in lpfc_cq_max_proc_limit_init()
5130 phba->cfg_cq_max_proc_limit = val; in lpfc_cq_max_proc_limit_init()
5137 phba->cfg_cq_max_proc_limit); in lpfc_cq_max_proc_limit_init()
5145 * lpfc_fcp_cpu_map_show - Display current driver CPU affinity
5157 struct lpfc_vport *vport = (struct lpfc_vport *)shost->hostdata; in lpfc_fcp_cpu_map_show()
5158 struct lpfc_hba *phba = vport->phba; in lpfc_fcp_cpu_map_show()
5162 if ((phba->sli_rev != LPFC_SLI_REV4) || in lpfc_fcp_cpu_map_show()
5163 (phba->intr_type != MSIX)) in lpfc_fcp_cpu_map_show()
5166 switch (phba->cfg_fcp_cpu_map) { in lpfc_fcp_cpu_map_show()
5168 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_fcp_cpu_map_show()
5170 phba->cfg_fcp_cpu_map); in lpfc_fcp_cpu_map_show()
5173 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_fcp_cpu_map_show()
5176 phba->cfg_fcp_cpu_map, num_online_cpus(), in lpfc_fcp_cpu_map_show()
5178 phba->sli4_hba.num_possible_cpu); in lpfc_fcp_cpu_map_show()
5182 while (phba->sli4_hba.curr_disp_cpu < in lpfc_fcp_cpu_map_show()
5183 phba->sli4_hba.num_possible_cpu) { in lpfc_fcp_cpu_map_show()
5184 cpup = &phba->sli4_hba.cpu_map[phba->sli4_hba.curr_disp_cpu]; in lpfc_fcp_cpu_map_show()
5186 if (!cpu_present(phba->sli4_hba.curr_disp_cpu)) in lpfc_fcp_cpu_map_show()
5187 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_fcp_cpu_map_show()
5189 phba->sli4_hba.curr_disp_cpu); in lpfc_fcp_cpu_map_show()
5190 else if (cpup->eq == LPFC_VECTOR_MAP_EMPTY) { in lpfc_fcp_cpu_map_show()
5191 if (cpup->hdwq == LPFC_VECTOR_MAP_EMPTY) in lpfc_fcp_cpu_map_show()
5193 buf + len, PAGE_SIZE - len, in lpfc_fcp_cpu_map_show()
5196 phba->sli4_hba.curr_disp_cpu, in lpfc_fcp_cpu_map_show()
5197 cpup->phys_id, cpup->core_id, in lpfc_fcp_cpu_map_show()
5198 (cpup->flag & LPFC_CPU_MAP_HYPER), in lpfc_fcp_cpu_map_show()
5199 (cpup->flag & LPFC_CPU_MAP_UNASSIGN)); in lpfc_fcp_cpu_map_show()
5202 buf + len, PAGE_SIZE - len, in lpfc_fcp_cpu_map_show()
5205 phba->sli4_hba.curr_disp_cpu, in lpfc_fcp_cpu_map_show()
5206 cpup->hdwq, cpup->phys_id, in lpfc_fcp_cpu_map_show()
5207 cpup->core_id, in lpfc_fcp_cpu_map_show()
5208 (cpup->flag & LPFC_CPU_MAP_HYPER), in lpfc_fcp_cpu_map_show()
5209 (cpup->flag & LPFC_CPU_MAP_UNASSIGN)); in lpfc_fcp_cpu_map_show()
5211 if (cpup->hdwq == LPFC_VECTOR_MAP_EMPTY) in lpfc_fcp_cpu_map_show()
5213 buf + len, PAGE_SIZE - len, in lpfc_fcp_cpu_map_show()
5216 phba->sli4_hba.curr_disp_cpu, in lpfc_fcp_cpu_map_show()
5217 cpup->phys_id, in lpfc_fcp_cpu_map_show()
5218 cpup->core_id, in lpfc_fcp_cpu_map_show()
5219 (cpup->flag & LPFC_CPU_MAP_HYPER), in lpfc_fcp_cpu_map_show()
5220 (cpup->flag & LPFC_CPU_MAP_UNASSIGN), in lpfc_fcp_cpu_map_show()
5221 lpfc_get_irq(cpup->eq)); in lpfc_fcp_cpu_map_show()
5224 buf + len, PAGE_SIZE - len, in lpfc_fcp_cpu_map_show()
5227 phba->sli4_hba.curr_disp_cpu, in lpfc_fcp_cpu_map_show()
5228 cpup->eq, cpup->hdwq, cpup->phys_id, in lpfc_fcp_cpu_map_show()
5229 cpup->core_id, in lpfc_fcp_cpu_map_show()
5230 (cpup->flag & LPFC_CPU_MAP_HYPER), in lpfc_fcp_cpu_map_show()
5231 (cpup->flag & LPFC_CPU_MAP_UNASSIGN), in lpfc_fcp_cpu_map_show()
5232 lpfc_get_irq(cpup->eq)); in lpfc_fcp_cpu_map_show()
5235 phba->sli4_hba.curr_disp_cpu++; in lpfc_fcp_cpu_map_show()
5238 if (phba->sli4_hba.curr_disp_cpu < in lpfc_fcp_cpu_map_show()
5239 phba->sli4_hba.num_possible_cpu && in lpfc_fcp_cpu_map_show()
5240 (len >= (PAGE_SIZE - 64))) { in lpfc_fcp_cpu_map_show()
5242 PAGE_SIZE - len, "more...\n"); in lpfc_fcp_cpu_map_show()
5247 if (phba->sli4_hba.curr_disp_cpu == phba->sli4_hba.num_possible_cpu) in lpfc_fcp_cpu_map_show()
5248 phba->sli4_hba.curr_disp_cpu = 0; in lpfc_fcp_cpu_map_show()
5254 * lpfc_fcp_cpu_map_store - Change CPU affinity of driver vectors
5261 * -EINVAL - Not implemented yet.
5267 return -EINVAL; in lpfc_fcp_cpu_map_store()
5275 # 0 - Do not affinitze IRQ vectors
5276 # 1 - Affintize HBA vectors with respect to each HBA
5286 * lpfc_fcp_cpu_map_init - Set the initial sr-iov virtual function enable
5291 * If val is in a valid range [0-2], then affinitze the adapter's
5296 * -EINVAL val out of range
5301 if (phba->sli_rev != LPFC_SLI_REV4) { in lpfc_fcp_cpu_map_init()
5302 phba->cfg_fcp_cpu_map = 0; in lpfc_fcp_cpu_map_init()
5307 phba->cfg_fcp_cpu_map = val; in lpfc_fcp_cpu_map_init()
5314 phba->cfg_fcp_cpu_map = LPFC_HBA_CPU_MAP; in lpfc_fcp_cpu_map_init()
5349 * Parameter supported on physical port only - no NPIV support.
5370 # the parameter is set to a non-zero value, the I/O queue depth is controlled
5384 if (val == vport->cfg_max_scsicmpl_time) in lpfc_max_scsicmpl_time_set()
5387 return -EINVAL; in lpfc_max_scsicmpl_time_set()
5388 vport->cfg_max_scsicmpl_time = val; in lpfc_max_scsicmpl_time_set()
5390 spin_lock_irqsave(&vport->fc_nodes_list_lock, iflags); in lpfc_max_scsicmpl_time_set()
5391 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, nlp_listp) { in lpfc_max_scsicmpl_time_set()
5392 if (ndlp->nlp_state == NLP_STE_UNUSED_NODE) in lpfc_max_scsicmpl_time_set()
5394 ndlp->cmd_qdepth = vport->cfg_tgt_queue_depth; in lpfc_max_scsicmpl_time_set()
5396 spin_unlock_irqrestore(&vport->fc_nodes_list_lock, iflags); in lpfc_max_scsicmpl_time_set()
5434 "issuing commands [0] - Hardware Queue, [1] - Current CPU");
5446 "[0] - GID_FT, [1] - GID_PT");
5452 # For [1], bus reset issues target reset to non-FCP2 devices
5455 "FCP2 devices [0] - issue tgt reset, [1] - no tgt reset");
5508 # Traditional FDMI support means the driver will assume FDMI-2 support;
5509 # however, if that fails, it will fallback to FDMI-1.
5533 # there are FC targets, such as JBODs, that only recognize 8-bits of
5566 # 2 = MSI-X enabled (default)
5570 "MSI-X (2), if possible");
5629 * lpfc_cpumask_irq_mode_init - initalizes cpumask of phba based on
5638 struct cpumask *aff_mask = &phba->sli4_hba.irq_aff_mask; in lpfc_cpumask_irq_mode_init()
5642 if (phba->irq_chann_mode == NUMA_MODE) { in lpfc_cpumask_irq_mode_init()
5644 numa_node = dev_to_node(&phba->pcidev->dev); in lpfc_cpumask_irq_mode_init()
5646 phba->irq_chann_mode = NORMAL_MODE; in lpfc_cpumask_irq_mode_init()
5652 switch (phba->irq_chann_mode) { in lpfc_cpumask_irq_mode_init()
5677 phba->irq_chann_mode = NUMA_MODE; in lpfc_assign_default_irq_chann()
5681 phba->irq_chann_mode = NHT_MODE; in lpfc_assign_default_irq_chann()
5684 phba->irq_chann_mode = NORMAL_MODE; in lpfc_assign_default_irq_chann()
5689 phba->irq_chann_mode = NORMAL_MODE; in lpfc_assign_default_irq_chann()
5696 * of EQ / MSI-X vectors the driver will create. This should never be
5711 /* lpfc_irq_chann_init - Set the hba irq_chann initial value
5722 * -EINVAL if value was out of range
5729 if (phba->cfg_use_msi != 2) { in lpfc_irq_chann_init()
5732 phba->cfg_use_msi); in lpfc_irq_chann_init()
5733 phba->irq_chann_mode = NORMAL_MODE; in lpfc_irq_chann_init()
5734 phba->cfg_irq_chann = LPFC_IRQ_CHANN_DEF; in lpfc_irq_chann_init()
5740 phba->cfg_hdw_queue == LPFC_HBA_HDWQ_DEF && in lpfc_irq_chann_init()
5741 phba->sli_rev == LPFC_SLI_REV4) in lpfc_irq_chann_init()
5744 if (phba->irq_chann_mode != NORMAL_MODE) { in lpfc_irq_chann_init()
5745 aff_mask = &phba->sli4_hba.irq_aff_mask; in lpfc_irq_chann_init()
5751 phba->irq_chann_mode); in lpfc_irq_chann_init()
5752 phba->irq_chann_mode = NORMAL_MODE; in lpfc_irq_chann_init()
5753 phba->cfg_irq_chann = LPFC_IRQ_CHANN_DEF; in lpfc_irq_chann_init()
5755 phba->cfg_irq_chann = cpumask_weight(aff_mask); in lpfc_irq_chann_init()
5760 if (phba->irq_chann_mode == NHT_MODE) in lpfc_irq_chann_init()
5761 phba->cfg_hdw_queue = phba->cfg_irq_chann; in lpfc_irq_chann_init()
5765 "(mode: %d)\n", phba->cfg_irq_chann, in lpfc_irq_chann_init()
5766 phba->irq_chann_mode); in lpfc_irq_chann_init()
5777 phba->cfg_irq_chann = LPFC_IRQ_CHANN_DEF; in lpfc_irq_chann_init()
5778 return -EINVAL; in lpfc_irq_chann_init()
5780 if (phba->sli_rev == LPFC_SLI_REV4) { in lpfc_irq_chann_init()
5781 phba->cfg_irq_chann = val; in lpfc_irq_chann_init()
5783 phba->cfg_irq_chann = 2; in lpfc_irq_chann_init()
5784 phba->cfg_hdw_queue = 1; in lpfc_irq_chann_init()
5792 * lpfc_irq_chann_show - Display value of irq_chann
5804 struct lpfc_vport *vport = (struct lpfc_vport *)shost->hostdata; in lpfc_irq_chann_show()
5805 struct lpfc_hba *phba = vport->phba; in lpfc_irq_chann_show()
5807 return scnprintf(buf, PAGE_SIZE, "%u\n", phba->cfg_irq_chann); in lpfc_irq_chann_show()
5839 # 0x0 - 0x7f = CS_CTL field in FC header (high 7 bits)
5845 # lpfc_enable_bg: Enable BlockGuard (Emulex's Implementation of T10-DIF)
5854 # - Bit mask of host protection capabilities used to register with the
5855 # SCSI mid-layer
5856 # - Only meaningful if BG is turned on (lpfc_enable_bg=1).
5857 # - Allows you to ultimately specify which profiles to use
5858 # - Default will result in registering capabilities for all profiles.
5859 # - SHOST_DIF_TYPE1_PROTECTION 1
5861 # - SHOST_DIX_TYPE0_PROTECTION 8
5863 # - SHOST_DIX_TYPE1_PROTECTION 16
5875 "T10-DIF host protection capabilities mask");
5879 # - Bit mask of protection guard types to register with the SCSI mid-layer
5880 # - Guard types are currently either 1) T10-DIF CRC 2) IP checksum
5881 # - Allows you to ultimately specify which profiles to use
5882 # - Default will result in registering capabilities for all guard types
5887 "T10-DIF host protection guard type");
5895 * When this parameter is set to non-zero value, initial Nport discovery is
5907 * lpfc_sg_seg_cnt - Initial Maximum DMA Segment Count
5911 * Because of the additional overhead involved in setting up T10-DIF,
5920 * lpfc_sg_seg_cnt_show - Display the scatter/gather list sizes
5933 struct lpfc_vport *vport = (struct lpfc_vport *)shost->hostdata; in lpfc_sg_seg_cnt_show()
5934 struct lpfc_hba *phba = vport->phba; in lpfc_sg_seg_cnt_show()
5938 phba->cfg_sg_dma_buf_size, phba->cfg_total_seg_cnt); in lpfc_sg_seg_cnt_show()
5940 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_sg_seg_cnt_show()
5942 phba->cfg_sg_seg_cnt, phba->cfg_scsi_seg_cnt, in lpfc_sg_seg_cnt_show()
5943 phba->cfg_nvme_seg_cnt); in lpfc_sg_seg_cnt_show()
5950 * lpfc_sg_seg_cnt_init - Set the hba sg_seg_cnt initial value
5961 * -EINVAL if value was out of range
5967 phba->cfg_sg_seg_cnt = val; in lpfc_sg_seg_cnt_init()
5974 phba->cfg_sg_seg_cnt = LPFC_DEFAULT_SG_SEG_CNT; in lpfc_sg_seg_cnt_init()
5975 return -EINVAL; in lpfc_sg_seg_cnt_init()
5989 * [1-4] = Multiple of 1/4th Mb of host memory for FW logging
6002 return -EINVAL; in lpfc_ras_fwlog_buffsize_set()
6004 if (phba->cfg_ras_fwlog_buffsize == val) in lpfc_ras_fwlog_buffsize_set()
6007 if (phba->cfg_ras_fwlog_func != PCI_FUNC(phba->pcidev->devfn)) in lpfc_ras_fwlog_buffsize_set()
6008 return -EINVAL; in lpfc_ras_fwlog_buffsize_set()
6010 spin_lock_irq(&phba->ras_fwlog_lock); in lpfc_ras_fwlog_buffsize_set()
6011 state = phba->ras_fwlog.state; in lpfc_ras_fwlog_buffsize_set()
6012 spin_unlock_irq(&phba->ras_fwlog_lock); in lpfc_ras_fwlog_buffsize_set()
6017 return -EBUSY; in lpfc_ras_fwlog_buffsize_set()
6024 phba->cfg_ras_fwlog_buffsize = val; in lpfc_ras_fwlog_buffsize_set()
6031 if (phba->ras_fwlog.ras_enabled) in lpfc_ras_fwlog_buffsize_set()
6032 ret = lpfc_sli4_ras_fwlog_init(phba, phba->cfg_ras_fwlog_level, in lpfc_ras_fwlog_buffsize_set()
6074 int lpfc_use_cgn_signal = 1; /* 0 - only use FPINs, 1 - Use signals if avail */
6097 * 4 - 255 = vmid support enabled for 4-255 VMs
6104 * lpfc_vmid_inactivity_timeout: Inactivity timeout duration in hours
6105 * 0 = Timeout is disabled
6109 "Inactivity timeout in hours");
6302 * sysfs_ctlreg_write - Write method for writing to ctlreg
6315 * -ERANGE off and count combo out of range
6316 * -EINVAL off, count or buff address invalid
6317 * -EPERM adapter is offline
6328 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in sysfs_ctlreg_write()
6329 struct lpfc_hba *phba = vport->phba; in sysfs_ctlreg_write()
6331 if (phba->sli_rev >= LPFC_SLI_REV4) in sysfs_ctlreg_write()
6332 return -EPERM; in sysfs_ctlreg_write()
6335 return -ERANGE; in sysfs_ctlreg_write()
6341 return -EINVAL; in sysfs_ctlreg_write()
6345 return -EINVAL; in sysfs_ctlreg_write()
6347 if (!test_bit(FC_OFFLINE_MODE, &vport->fc_flag)) in sysfs_ctlreg_write()
6348 return -EPERM; in sysfs_ctlreg_write()
6350 spin_lock_irq(&phba->hbalock); in sysfs_ctlreg_write()
6351 for (buf_off = 0; buf_off < count - LPFC_REG_WRITE_KEY_SIZE; in sysfs_ctlreg_write()
6354 phba->ctrl_regs_memmap_p + off + buf_off); in sysfs_ctlreg_write()
6356 spin_unlock_irq(&phba->hbalock); in sysfs_ctlreg_write()
6362 * sysfs_ctlreg_read - Read method for reading from ctlreg
6375 * -ERANGE off and count combo out of range
6376 * -EINVAL off, count or buff address invalid
6388 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in sysfs_ctlreg_read()
6389 struct lpfc_hba *phba = vport->phba; in sysfs_ctlreg_read()
6391 if (phba->sli_rev >= LPFC_SLI_REV4) in sysfs_ctlreg_read()
6392 return -EPERM; in sysfs_ctlreg_read()
6395 return -ERANGE; in sysfs_ctlreg_read()
6398 count = FF_REG_AREA_SIZE - off; in sysfs_ctlreg_read()
6403 return -EINVAL; in sysfs_ctlreg_read()
6405 spin_lock_irq(&phba->hbalock); in sysfs_ctlreg_read()
6409 *tmp_ptr = readl(phba->ctrl_regs_memmap_p + off + buf_off); in sysfs_ctlreg_read()
6412 spin_unlock_irq(&phba->hbalock); in sysfs_ctlreg_read()
6428 * sysfs_mbox_write - Write method for writing information via mbox
6441 * -EPERM operation not permitted
6448 return -EPERM; in sysfs_mbox_write()
6452 * sysfs_mbox_read - Read method for reading information via mbox
6465 * -EPERM operation not permitted
6472 return -EPERM; in sysfs_mbox_read()
6486 * lpfc_alloc_sysfs_attr - Creates the ctlreg and mbox entries
6500 if (vport->port_type == LPFC_NPIV_PORT) in lpfc_alloc_sysfs_attr()
6503 error = sysfs_create_bin_file(&shost->shost_dev.kobj, in lpfc_alloc_sysfs_attr()
6508 error = sysfs_create_bin_file(&shost->shost_dev.kobj, in lpfc_alloc_sysfs_attr()
6515 sysfs_remove_bin_file(&shost->shost_dev.kobj, &sysfs_ctlreg_attr); in lpfc_alloc_sysfs_attr()
6521 * lpfc_free_sysfs_attr - Removes the ctlreg and mbox entries
6530 if (vport->port_type == LPFC_NPIV_PORT) in lpfc_free_sysfs_attr()
6532 sysfs_remove_bin_file(&shost->shost_dev.kobj, &sysfs_mbox_attr); in lpfc_free_sysfs_attr()
6533 sysfs_remove_bin_file(&shost->shost_dev.kobj, &sysfs_ctlreg_attr); in lpfc_free_sysfs_attr()
6541 * lpfc_get_host_symbolic_name - Copy symbolic name into the scsi host
6547 struct lpfc_vport *vport = (struct lpfc_vport *)shost->hostdata; in lpfc_get_host_symbolic_name()
6554 * lpfc_get_host_port_id - Copy the vport DID into the scsi host port id
6560 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_get_host_port_id()
6563 fc_host_port_id(shost) = vport->fc_myDID; in lpfc_get_host_port_id()
6567 * lpfc_get_host_port_type - Set the value of the scsi host port type
6573 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_get_host_port_type()
6574 struct lpfc_hba *phba = vport->phba; in lpfc_get_host_port_type()
6576 if (vport->port_type == LPFC_NPIV_PORT) { in lpfc_get_host_port_type()
6579 if (phba->fc_topology == LPFC_TOPOLOGY_LOOP) { in lpfc_get_host_port_type()
6580 if (test_bit(FC_PUBLIC_LOOP, &vport->fc_flag)) in lpfc_get_host_port_type()
6585 if (test_bit(FC_FABRIC, &vport->fc_flag)) in lpfc_get_host_port_type()
6595 * lpfc_get_host_port_state - Set the value of the scsi host port state
6601 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_get_host_port_state()
6602 struct lpfc_hba *phba = vport->phba; in lpfc_get_host_port_state()
6604 if (test_bit(FC_OFFLINE_MODE, &vport->fc_flag)) in lpfc_get_host_port_state()
6607 switch (phba->link_state) { in lpfc_get_host_port_state()
6616 if (vport->port_state < LPFC_VPORT_READY) in lpfc_get_host_port_state()
6634 * lpfc_get_host_speed - Set the value of the scsi host speed
6640 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_get_host_speed()
6641 struct lpfc_hba *phba = vport->phba; in lpfc_get_host_speed()
6644 !test_bit(HBA_FCOE_MODE, &phba->hba_flag)) { in lpfc_get_host_speed()
6645 switch(phba->fc_linkspeed) { in lpfc_get_host_speed()
6681 test_bit(HBA_FCOE_MODE, &phba->hba_flag)) { in lpfc_get_host_speed()
6682 switch (phba->fc_linkspeed) { in lpfc_get_host_speed()
6710 * lpfc_get_host_fabric_name - Set the value of the scsi host fabric name
6716 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_get_host_fabric_name()
6717 struct lpfc_hba *phba = vport->phba; in lpfc_get_host_fabric_name()
6720 if (vport->port_state > LPFC_FLOGI && in lpfc_get_host_fabric_name()
6721 (test_bit(FC_FABRIC, &vport->fc_flag) || in lpfc_get_host_fabric_name()
6722 (phba->fc_topology == LPFC_TOPOLOGY_LOOP && in lpfc_get_host_fabric_name()
6723 test_bit(FC_PUBLIC_LOOP, &vport->fc_flag)))) in lpfc_get_host_fabric_name()
6724 node_name = wwn_to_u64(phba->fc_fabparam.nodeName.u.wwn); in lpfc_get_host_fabric_name()
6733 * lpfc_get_stats - Return statistical information about the adapter
6747 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_get_stats()
6748 struct lpfc_hba *phba = vport->phba; in lpfc_get_stats()
6749 struct lpfc_sli *psli = &phba->sli; in lpfc_get_stats()
6750 struct fc_host_statistics *hs = &phba->link_stats; in lpfc_get_stats()
6751 struct lpfc_lnk_stat * lso = &psli->lnk_stat_offsets; in lpfc_get_stats()
6760 if (phba->link_state < LPFC_LINK_DOWN || in lpfc_get_stats()
6761 !phba->mbox_mem_pool || in lpfc_get_stats()
6762 (phba->sli.sli_flag & LPFC_SLI_ACTIVE) == 0) in lpfc_get_stats()
6765 if (phba->sli.sli_flag & LPFC_BLOCK_MGMT_IO) in lpfc_get_stats()
6768 pmboxq = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); in lpfc_get_stats()
6773 pmb = &pmboxq->u.mb; in lpfc_get_stats()
6774 pmb->mbxCommand = MBX_READ_STATUS; in lpfc_get_stats()
6775 pmb->mbxOwner = OWN_HOST; in lpfc_get_stats()
6776 pmboxq->ctx_buf = NULL; in lpfc_get_stats()
6777 pmboxq->vport = vport; in lpfc_get_stats()
6779 if (test_bit(FC_OFFLINE_MODE, &vport->fc_flag)) { in lpfc_get_stats()
6782 mempool_free(pmboxq, phba->mbox_mem_pool); in lpfc_get_stats()
6786 rc = lpfc_sli_issue_mbox_wait(phba, pmboxq, phba->fc_ratov * 2); in lpfc_get_stats()
6789 mempool_free(pmboxq, phba->mbox_mem_pool); in lpfc_get_stats()
6796 hs->tx_frames = pmb->un.varRdStatus.xmitFrameCnt; in lpfc_get_stats()
6797 hs->rx_frames = pmb->un.varRdStatus.rcvFrameCnt; in lpfc_get_stats()
6806 if (pmb->un.varRdStatus.xkb & RD_ST_XKB) { in lpfc_get_stats()
6807 hs->tx_words = (u64) in lpfc_get_stats()
6808 ((((u64)(pmb->un.varRdStatus.xmit_xkb & in lpfc_get_stats()
6810 (u64)pmb->un.varRdStatus.xmitByteCnt) * in lpfc_get_stats()
6812 hs->rx_words = (u64) in lpfc_get_stats()
6813 ((((u64)(pmb->un.varRdStatus.rcv_xkb & in lpfc_get_stats()
6815 (u64)pmb->un.varRdStatus.rcvByteCnt) * in lpfc_get_stats()
6818 hs->tx_words = (uint64_t) in lpfc_get_stats()
6819 ((uint64_t)pmb->un.varRdStatus.xmitByteCnt in lpfc_get_stats()
6821 hs->rx_words = (uint64_t) in lpfc_get_stats()
6822 ((uint64_t)pmb->un.varRdStatus.rcvByteCnt in lpfc_get_stats()
6827 pmb->mbxCommand = MBX_READ_LNK_STAT; in lpfc_get_stats()
6828 pmb->mbxOwner = OWN_HOST; in lpfc_get_stats()
6829 pmboxq->ctx_buf = NULL; in lpfc_get_stats()
6830 pmboxq->vport = vport; in lpfc_get_stats()
6832 if (test_bit(FC_OFFLINE_MODE, &vport->fc_flag)) { in lpfc_get_stats()
6835 mempool_free(pmboxq, phba->mbox_mem_pool); in lpfc_get_stats()
6839 rc = lpfc_sli_issue_mbox_wait(phba, pmboxq, phba->fc_ratov * 2); in lpfc_get_stats()
6842 mempool_free(pmboxq, phba->mbox_mem_pool); in lpfc_get_stats()
6847 hs->link_failure_count = pmb->un.varRdLnk.linkFailureCnt; in lpfc_get_stats()
6848 hs->loss_of_sync_count = pmb->un.varRdLnk.lossSyncCnt; in lpfc_get_stats()
6849 hs->loss_of_signal_count = pmb->un.varRdLnk.lossSignalCnt; in lpfc_get_stats()
6850 hs->prim_seq_protocol_err_count = pmb->un.varRdLnk.primSeqErrCnt; in lpfc_get_stats()
6851 hs->invalid_tx_word_count = pmb->un.varRdLnk.invalidXmitWord; in lpfc_get_stats()
6852 hs->invalid_crc_count = pmb->un.varRdLnk.crcCnt; in lpfc_get_stats()
6853 hs->error_frames = pmb->un.varRdLnk.crcCnt; in lpfc_get_stats()
6855 hs->cn_sig_warn = atomic64_read(&phba->cgn_acqe_stat.warn); in lpfc_get_stats()
6856 hs->cn_sig_alarm = atomic64_read(&phba->cgn_acqe_stat.alarm); in lpfc_get_stats()
6858 hs->link_failure_count -= lso->link_failure_count; in lpfc_get_stats()
6859 hs->loss_of_sync_count -= lso->loss_of_sync_count; in lpfc_get_stats()
6860 hs->loss_of_signal_count -= lso->loss_of_signal_count; in lpfc_get_stats()
6861 hs->prim_seq_protocol_err_count -= lso->prim_seq_protocol_err_count; in lpfc_get_stats()
6862 hs->invalid_tx_word_count -= lso->invalid_tx_word_count; in lpfc_get_stats()
6863 hs->invalid_crc_count -= lso->invalid_crc_count; in lpfc_get_stats()
6864 hs->error_frames -= lso->error_frames; in lpfc_get_stats()
6866 if (test_bit(HBA_FCOE_MODE, &phba->hba_flag)) { in lpfc_get_stats()
6867 hs->lip_count = -1; in lpfc_get_stats()
6868 hs->nos_count = (phba->link_events >> 1); in lpfc_get_stats()
6869 hs->nos_count -= lso->link_events; in lpfc_get_stats()
6870 } else if (phba->fc_topology == LPFC_TOPOLOGY_LOOP) { in lpfc_get_stats()
6871 hs->lip_count = (phba->fc_eventTag >> 1); in lpfc_get_stats()
6872 hs->lip_count -= lso->link_events; in lpfc_get_stats()
6873 hs->nos_count = -1; in lpfc_get_stats()
6875 hs->lip_count = -1; in lpfc_get_stats()
6876 hs->nos_count = (phba->fc_eventTag >> 1); in lpfc_get_stats()
6877 hs->nos_count -= lso->link_events; in lpfc_get_stats()
6880 hs->dumped_frames = -1; in lpfc_get_stats()
6882 hs->seconds_since_last_reset = ktime_get_seconds() - psli->stats_start; in lpfc_get_stats()
6884 mempool_free(pmboxq, phba->mbox_mem_pool); in lpfc_get_stats()
6890 * lpfc_reset_stats - Copy the adapter link stats information
6896 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_reset_stats()
6897 struct lpfc_hba *phba = vport->phba; in lpfc_reset_stats()
6898 struct lpfc_sli *psli = &phba->sli; in lpfc_reset_stats()
6899 struct lpfc_lnk_stat *lso = &psli->lnk_stat_offsets; in lpfc_reset_stats()
6904 if (phba->sli.sli_flag & LPFC_BLOCK_MGMT_IO) in lpfc_reset_stats()
6907 pmboxq = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); in lpfc_reset_stats()
6912 pmb = &pmboxq->u.mb; in lpfc_reset_stats()
6913 pmb->mbxCommand = MBX_READ_STATUS; in lpfc_reset_stats()
6914 pmb->mbxOwner = OWN_HOST; in lpfc_reset_stats()
6915 pmb->un.varWords[0] = 0x1; /* reset request */ in lpfc_reset_stats()
6916 pmboxq->ctx_buf = NULL; in lpfc_reset_stats()
6917 pmboxq->vport = vport; in lpfc_reset_stats()
6919 if (test_bit(FC_OFFLINE_MODE, &vport->fc_flag) || in lpfc_reset_stats()
6920 !(psli->sli_flag & LPFC_SLI_ACTIVE)) { in lpfc_reset_stats()
6923 mempool_free(pmboxq, phba->mbox_mem_pool); in lpfc_reset_stats()
6927 rc = lpfc_sli_issue_mbox_wait(phba, pmboxq, phba->fc_ratov * 2); in lpfc_reset_stats()
6930 mempool_free(pmboxq, phba->mbox_mem_pool); in lpfc_reset_stats()
6936 pmb->mbxCommand = MBX_READ_LNK_STAT; in lpfc_reset_stats()
6937 pmb->mbxOwner = OWN_HOST; in lpfc_reset_stats()
6938 pmboxq->ctx_buf = NULL; in lpfc_reset_stats()
6939 pmboxq->vport = vport; in lpfc_reset_stats()
6941 if (test_bit(FC_OFFLINE_MODE, &vport->fc_flag) || in lpfc_reset_stats()
6942 !(psli->sli_flag & LPFC_SLI_ACTIVE)) { in lpfc_reset_stats()
6945 mempool_free(pmboxq, phba->mbox_mem_pool); in lpfc_reset_stats()
6949 rc = lpfc_sli_issue_mbox_wait(phba, pmboxq, phba->fc_ratov * 2); in lpfc_reset_stats()
6952 mempool_free(pmboxq, phba->mbox_mem_pool); in lpfc_reset_stats()
6957 lso->link_failure_count = pmb->un.varRdLnk.linkFailureCnt; in lpfc_reset_stats()
6958 lso->loss_of_sync_count = pmb->un.varRdLnk.lossSyncCnt; in lpfc_reset_stats()
6959 lso->loss_of_signal_count = pmb->un.varRdLnk.lossSignalCnt; in lpfc_reset_stats()
6960 lso->prim_seq_protocol_err_count = pmb->un.varRdLnk.primSeqErrCnt; in lpfc_reset_stats()
6961 lso->invalid_tx_word_count = pmb->un.varRdLnk.invalidXmitWord; in lpfc_reset_stats()
6962 lso->invalid_crc_count = pmb->un.varRdLnk.crcCnt; in lpfc_reset_stats()
6963 lso->error_frames = pmb->un.varRdLnk.crcCnt; in lpfc_reset_stats()
6964 if (test_bit(HBA_FCOE_MODE, &phba->hba_flag)) in lpfc_reset_stats()
6965 lso->link_events = (phba->link_events >> 1); in lpfc_reset_stats()
6967 lso->link_events = (phba->fc_eventTag >> 1); in lpfc_reset_stats()
6969 atomic64_set(&phba->cgn_acqe_stat.warn, 0); in lpfc_reset_stats()
6970 atomic64_set(&phba->cgn_acqe_stat.alarm, 0); in lpfc_reset_stats()
6972 memset(&shost_to_fc_host(shost)->fpin_stats, 0, in lpfc_reset_stats()
6973 sizeof(shost_to_fc_host(shost)->fpin_stats)); in lpfc_reset_stats()
6975 psli->stats_start = ktime_get_seconds(); in lpfc_reset_stats()
6977 mempool_free(pmboxq, phba->mbox_mem_pool); in lpfc_reset_stats()
6988 * lpfc_get_node_by_target - Return the nodelist for a target
6998 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); in lpfc_get_node_by_target()
6999 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_get_node_by_target()
7003 spin_lock_irqsave(&vport->fc_nodes_list_lock, iflags); in lpfc_get_node_by_target()
7005 list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) { in lpfc_get_node_by_target()
7006 if (ndlp->nlp_state == NLP_STE_MAPPED_NODE && in lpfc_get_node_by_target()
7007 starget->id == ndlp->nlp_sid) { in lpfc_get_node_by_target()
7008 spin_unlock_irqrestore(&vport->fc_nodes_list_lock, in lpfc_get_node_by_target()
7013 spin_unlock_irqrestore(&vport->fc_nodes_list_lock, iflags); in lpfc_get_node_by_target()
7018 * lpfc_get_starget_port_id - Set the target port id to the ndlp DID or -1
7026 fc_starget_port_id(starget) = ndlp ? ndlp->nlp_DID : -1; in lpfc_get_starget_port_id()
7030 * lpfc_get_starget_node_name - Set the target node name
7041 ndlp ? wwn_to_u64(ndlp->nlp_nodename.u.wwn) : 0; in lpfc_get_starget_node_name()
7045 * lpfc_get_starget_port_name - Set the target port name
7056 ndlp ? wwn_to_u64(ndlp->nlp_portname.u.wwn) : 0; in lpfc_get_starget_port_name()
7060 * lpfc_set_rport_loss_tmo - Set the rport dev loss tmo
7062 * @timeout: new value for dev loss tmo.
7065 * If timeout is non zero set the dev_loss_tmo to timeout, else set
7069 lpfc_set_rport_loss_tmo(struct fc_rport *rport, uint32_t timeout) in lpfc_set_rport_loss_tmo() argument
7071 struct lpfc_rport_data *rdata = rport->dd_data; in lpfc_set_rport_loss_tmo()
7072 struct lpfc_nodelist *ndlp = rdata->pnode; in lpfc_set_rport_loss_tmo()
7077 if (timeout) in lpfc_set_rport_loss_tmo()
7078 rport->dev_loss_tmo = timeout; in lpfc_set_rport_loss_tmo()
7080 rport->dev_loss_tmo = 1; in lpfc_set_rport_loss_tmo()
7083 dev_info(&rport->dev, "Cannot find remote node to " in lpfc_set_rport_loss_tmo()
7085 rport->port_id); in lpfc_set_rport_loss_tmo()
7092 if (nrport && nrport->remoteport) in lpfc_set_rport_loss_tmo()
7093 nvme_fc_set_remoteport_devloss(nrport->remoteport, in lpfc_set_rport_loss_tmo()
7094 rport->dev_loss_tmo); in lpfc_set_rport_loss_tmo()
7099 * lpfc_rport_show_function - Return rport target information
7117 struct lpfc_rport_data *rdata = rport->hostdata; \
7119 (rdata->target) ? cast rdata->target->field : 0); \
7127 * lpfc_set_vport_symbolic_name - Set the vport's symbolic name
7132 * has been changed. This function re-registers the symbolic name with the
7138 struct lpfc_vport *vport = *(struct lpfc_vport **)fc_vport->dd_data; in lpfc_set_vport_symbolic_name()
7140 if (vport->port_state == LPFC_VPORT_READY) in lpfc_set_vport_symbolic_name()
7145 * lpfc_hba_log_verbose_init - Set hba's log verbose level
7157 phba->cfg_log_verbose = verbose; in lpfc_hba_log_verbose_init()
7293 * lpfc_get_hba_function_mode - Used to determine the HBA function in FCoE
7301 switch (phba->pcidev->device) { in lpfc_get_hba_function_mode()
7309 set_bit(HBA_FCOE_MODE, &phba->hba_flag); in lpfc_get_hba_function_mode()
7313 clear_bit(HBA_FCOE_MODE, &phba->hba_flag); in lpfc_get_hba_function_mode()
7318 * lpfc_get_cfgparam - Used during probe_one to init the adapter structure
7362 if (phba->sli_rev != LPFC_SLI_REV4) in lpfc_get_cfgparam()
7363 phba->cfg_EnableXLane = 0; in lpfc_get_cfgparam()
7366 memset(phba->cfg_oas_tgt_wwpn, 0, (8 * sizeof(uint8_t))); in lpfc_get_cfgparam()
7367 memset(phba->cfg_oas_vpt_wwpn, 0, (8 * sizeof(uint8_t))); in lpfc_get_cfgparam()
7368 phba->cfg_oas_lun_state = 0; in lpfc_get_cfgparam()
7369 phba->cfg_oas_lun_status = 0; in lpfc_get_cfgparam()
7370 phba->cfg_oas_flags = 0; in lpfc_get_cfgparam()
7371 phba->cfg_oas_priority = 0; in lpfc_get_cfgparam()
7375 if (phba->sli_rev == LPFC_SLI_REV4) in lpfc_get_cfgparam()
7376 phba->cfg_poll = 0; in lpfc_get_cfgparam()
7378 phba->cfg_poll = lpfc_poll; in lpfc_get_cfgparam()
7384 if (phba->cfg_enable_bg && test_bit(HBA_FCOE_MODE, &phba->hba_flag)) { in lpfc_get_cfgparam()
7388 phba->cfg_enable_bg = 0; in lpfc_get_cfgparam()
7389 } else if (phba->cfg_enable_bg) { in lpfc_get_cfgparam()
7390 phba->sli3_options |= LPFC_SLI3_BG_ENABLED; in lpfc_get_cfgparam()
7409 phba->cgn_p.cgn_param_mode = LPFC_CFG_OFF; in lpfc_get_cfgparam()
7410 phba->cmf_active_mode = LPFC_CFG_OFF; in lpfc_get_cfgparam()
7415 if (phba->sli_rev != LPFC_SLI_REV4) { in lpfc_get_cfgparam()
7417 phba->nvmet_support = 0; in lpfc_get_cfgparam()
7418 phba->cfg_nvmet_mrq = 0; in lpfc_get_cfgparam()
7419 phba->cfg_enable_fc4_type = LPFC_ENABLE_FCP; in lpfc_get_cfgparam()
7420 phba->cfg_enable_bbcr = 0; in lpfc_get_cfgparam()
7421 phba->cfg_xri_rebalancing = 0; in lpfc_get_cfgparam()
7424 if (!(phba->cfg_enable_fc4_type & LPFC_ENABLE_FCP)) in lpfc_get_cfgparam()
7425 phba->cfg_enable_fc4_type |= LPFC_ENABLE_FCP; in lpfc_get_cfgparam()
7428 phba->cfg_auto_imax = (phba->cfg_fcp_imax) ? 0 : 1; in lpfc_get_cfgparam()
7430 phba->cfg_enable_pbde = 0; in lpfc_get_cfgparam()
7433 if (phba->cfg_hdw_queue == 0) in lpfc_get_cfgparam()
7434 phba->cfg_hdw_queue = phba->sli4_hba.num_present_cpu; in lpfc_get_cfgparam()
7435 if (phba->cfg_irq_chann == 0) in lpfc_get_cfgparam()
7436 phba->cfg_irq_chann = phba->sli4_hba.num_present_cpu; in lpfc_get_cfgparam()
7437 if (phba->cfg_irq_chann > phba->cfg_hdw_queue && in lpfc_get_cfgparam()
7438 phba->sli_rev == LPFC_SLI_REV4) in lpfc_get_cfgparam()
7439 phba->cfg_irq_chann = phba->cfg_hdw_queue; in lpfc_get_cfgparam()
7457 * lpfc_nvme_mod_param_dep - Adjust module parameter value based on
7466 if (phba->cfg_hdw_queue > phba->sli4_hba.num_present_cpu) { in lpfc_nvme_mod_param_dep()
7467 phba->cfg_hdw_queue = phba->sli4_hba.num_present_cpu; in lpfc_nvme_mod_param_dep()
7470 if (phba->cfg_irq_chann > phba->sli4_hba.num_present_cpu) { in lpfc_nvme_mod_param_dep()
7471 phba->cfg_irq_chann = phba->sli4_hba.num_present_cpu; in lpfc_nvme_mod_param_dep()
7474 if (phba->cfg_irq_chann > phba->cfg_hdw_queue) { in lpfc_nvme_mod_param_dep()
7475 phba->cfg_irq_chann = phba->cfg_hdw_queue; in lpfc_nvme_mod_param_dep()
7480 "2006 Reducing Queues - CPU limitation: " in lpfc_nvme_mod_param_dep()
7482 phba->cfg_irq_chann, in lpfc_nvme_mod_param_dep()
7483 phba->cfg_hdw_queue); in lpfc_nvme_mod_param_dep()
7485 if (phba->cfg_enable_fc4_type & LPFC_ENABLE_NVME && in lpfc_nvme_mod_param_dep()
7486 phba->nvmet_support) { in lpfc_nvme_mod_param_dep()
7487 phba->cfg_enable_fc4_type &= ~LPFC_ENABLE_FCP; in lpfc_nvme_mod_param_dep()
7492 phba->cfg_nvme_enable_fb, in lpfc_nvme_mod_param_dep()
7493 phba->cfg_nvmet_fb_size, in lpfc_nvme_mod_param_dep()
7496 if (phba->cfg_nvme_enable_fb == 0) in lpfc_nvme_mod_param_dep()
7497 phba->cfg_nvmet_fb_size = 0; in lpfc_nvme_mod_param_dep()
7499 if (phba->cfg_nvmet_fb_size > LPFC_NVMET_FB_SZ_MAX) in lpfc_nvme_mod_param_dep()
7500 phba->cfg_nvmet_fb_size = LPFC_NVMET_FB_SZ_MAX; in lpfc_nvme_mod_param_dep()
7503 if (!phba->cfg_nvmet_mrq) in lpfc_nvme_mod_param_dep()
7504 phba->cfg_nvmet_mrq = phba->cfg_hdw_queue; in lpfc_nvme_mod_param_dep()
7507 if (phba->cfg_nvmet_mrq > phba->cfg_hdw_queue) { in lpfc_nvme_mod_param_dep()
7508 phba->cfg_nvmet_mrq = phba->cfg_hdw_queue; in lpfc_nvme_mod_param_dep()
7511 phba->cfg_nvmet_mrq); in lpfc_nvme_mod_param_dep()
7513 if (phba->cfg_nvmet_mrq > LPFC_NVMET_MRQ_MAX) in lpfc_nvme_mod_param_dep()
7514 phba->cfg_nvmet_mrq = LPFC_NVMET_MRQ_MAX; in lpfc_nvme_mod_param_dep()
7518 phba->nvmet_support = 0; in lpfc_nvme_mod_param_dep()
7519 phba->cfg_nvmet_mrq = 0; in lpfc_nvme_mod_param_dep()
7520 phba->cfg_nvmet_fb_size = 0; in lpfc_nvme_mod_param_dep()
7525 * lpfc_get_vport_cfgparam - Used during port create, init the vport structure