Lines Matching +full:cpu +full:- +full:centric
4 * Copyright (C) 2017-2021 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",
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()
127 int cpu; in lpfc_cmf_info_show() local
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_ver, 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()
259 for_each_present_cpu(cpu) { 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()
295 * lpfc_drvr_version_show - Return the Emulex driver string with version number
310 * lpfc_enable_fip_show - Return the fip mode of the HBA
322 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_enable_fip_show()
323 struct lpfc_hba *phba = vport->phba; in lpfc_enable_fip_show()
325 if (phba->hba_flag & HBA_FIP_SUPPORT) in lpfc_enable_fip_show()
337 struct lpfc_hba *phba = vport->phba; in lpfc_nvme_info_show()
352 if (!(vport->cfg_enable_fc4_type & LPFC_ENABLE_NVME)) { in lpfc_nvme_info_show()
356 if (phba->nvmet_support) { in lpfc_nvme_info_show()
357 if (!phba->targetport) { in lpfc_nvme_info_show()
360 wwn_to_u64(vport->fc_portname.u.wwn)); in lpfc_nvme_info_show()
364 if (phba->targetport->port_id) in lpfc_nvme_info_show()
377 phba->brd_no, in lpfc_nvme_info_show()
378 wwn_to_u64(vport->fc_portname.u.wwn), in lpfc_nvme_info_show()
379 wwn_to_u64(vport->fc_nodename.u.wwn), in lpfc_nvme_info_show()
380 phba->targetport->port_id); in lpfc_nvme_info_show()
388 tgtp = (struct lpfc_nvmet_tgtport *)phba->targetport->private; in lpfc_nvme_info_show()
391 atomic_read(&tgtp->rcv_ls_req_in), in lpfc_nvme_info_show()
392 atomic_read(&tgtp->rcv_ls_req_drop), in lpfc_nvme_info_show()
393 atomic_read(&tgtp->xmt_ls_abort)); in lpfc_nvme_info_show()
397 if (atomic_read(&tgtp->rcv_ls_req_in) != in lpfc_nvme_info_show()
398 atomic_read(&tgtp->rcv_ls_req_out)) { in lpfc_nvme_info_show()
401 atomic_read(&tgtp->rcv_ls_req_in), in lpfc_nvme_info_show()
402 atomic_read(&tgtp->rcv_ls_req_out)); in lpfc_nvme_info_show()
409 atomic_read(&tgtp->xmt_ls_rsp), in lpfc_nvme_info_show()
410 atomic_read(&tgtp->xmt_ls_drop), in lpfc_nvme_info_show()
411 atomic_read(&tgtp->xmt_ls_rsp_cmpl)); in lpfc_nvme_info_show()
417 atomic_read(&tgtp->xmt_ls_rsp_aborted), in lpfc_nvme_info_show()
418 atomic_read(&tgtp->xmt_ls_rsp_xb_set), in lpfc_nvme_info_show()
419 atomic_read(&tgtp->xmt_ls_rsp_error)); in lpfc_nvme_info_show()
426 atomic_read(&tgtp->rcv_fcp_cmd_in), in lpfc_nvme_info_show()
427 atomic_read(&tgtp->rcv_fcp_cmd_defer), in lpfc_nvme_info_show()
428 atomic_read(&tgtp->xmt_fcp_release), in lpfc_nvme_info_show()
429 atomic_read(&tgtp->rcv_fcp_cmd_drop)); in lpfc_nvme_info_show()
433 if (atomic_read(&tgtp->rcv_fcp_cmd_in) != in lpfc_nvme_info_show()
434 atomic_read(&tgtp->rcv_fcp_cmd_out)) { in lpfc_nvme_info_show()
437 atomic_read(&tgtp->rcv_fcp_cmd_in), in lpfc_nvme_info_show()
438 atomic_read(&tgtp->rcv_fcp_cmd_out)); in lpfc_nvme_info_show()
446 atomic_read(&tgtp->xmt_fcp_read), in lpfc_nvme_info_show()
447 atomic_read(&tgtp->xmt_fcp_read_rsp), in lpfc_nvme_info_show()
448 atomic_read(&tgtp->xmt_fcp_write), in lpfc_nvme_info_show()
449 atomic_read(&tgtp->xmt_fcp_rsp), in lpfc_nvme_info_show()
450 atomic_read(&tgtp->xmt_fcp_drop)); in lpfc_nvme_info_show()
456 atomic_read(&tgtp->xmt_fcp_rsp_cmpl), in lpfc_nvme_info_show()
457 atomic_read(&tgtp->xmt_fcp_rsp_error), in lpfc_nvme_info_show()
458 atomic_read(&tgtp->xmt_fcp_rsp_drop)); in lpfc_nvme_info_show()
464 atomic_read(&tgtp->xmt_fcp_rsp_aborted), in lpfc_nvme_info_show()
465 atomic_read(&tgtp->xmt_fcp_rsp_xb_set), in lpfc_nvme_info_show()
466 atomic_read(&tgtp->xmt_fcp_xri_abort_cqe)); in lpfc_nvme_info_show()
472 atomic_read(&tgtp->xmt_fcp_abort), in lpfc_nvme_info_show()
473 atomic_read(&tgtp->xmt_fcp_abort_cmpl)); in lpfc_nvme_info_show()
479 atomic_read(&tgtp->xmt_abort_sol), in lpfc_nvme_info_show()
480 atomic_read(&tgtp->xmt_abort_unsol), in lpfc_nvme_info_show()
481 atomic_read(&tgtp->xmt_abort_rsp), in lpfc_nvme_info_show()
482 atomic_read(&tgtp->xmt_abort_rsp_error)); in lpfc_nvme_info_show()
488 atomic_read(&tgtp->defer_ctx), in lpfc_nvme_info_show()
489 atomic_read(&tgtp->defer_fod), in lpfc_nvme_info_show()
490 atomic_read(&tgtp->defer_wqfull)); in lpfc_nvme_info_show()
495 tot = atomic_read(&tgtp->rcv_fcp_cmd_drop); in lpfc_nvme_info_show()
496 tot += atomic_read(&tgtp->xmt_fcp_release); in lpfc_nvme_info_show()
497 tot = atomic_read(&tgtp->rcv_fcp_cmd_in) - tot; in lpfc_nvme_info_show()
502 phba->sli4_hba.nvmet_xri_cnt, in lpfc_nvme_info_show()
503 phba->sli4_hba.nvmet_io_wait_cnt, in lpfc_nvme_info_show()
504 phba->sli4_hba.nvmet_io_wait_total, in lpfc_nvme_info_show()
510 localport = vport->localport; in lpfc_nvme_info_show()
514 wwn_to_u64(vport->fc_portname.u.wwn)); in lpfc_nvme_info_show()
517 lport = (struct lpfc_nvme_lport *)localport->private; in lpfc_nvme_info_show()
523 phba->brd_no, in lpfc_nvme_info_show()
524 phba->sli4_hba.max_cfg_param.max_xri, in lpfc_nvme_info_show()
525 phba->sli4_hba.io_xri_max, in lpfc_nvme_info_show()
531 if (localport->port_id) in lpfc_nvme_info_show()
539 phba->brd_no, in lpfc_nvme_info_show()
540 wwn_to_u64(vport->fc_portname.u.wwn), in lpfc_nvme_info_show()
541 wwn_to_u64(vport->fc_nodename.u.wwn), in lpfc_nvme_info_show()
542 localport->port_id, statep); in lpfc_nvme_info_show()
546 spin_lock_irq(shost->host_lock); in lpfc_nvme_info_show()
548 list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) { in lpfc_nvme_info_show()
550 spin_lock(&ndlp->lock); in lpfc_nvme_info_show()
553 nrport = rport->remoteport; in lpfc_nvme_info_show()
554 spin_unlock(&ndlp->lock); in lpfc_nvme_info_show()
559 switch (nrport->port_state) { in lpfc_nvme_info_show()
574 if (phba->brd_no >= 10) { in lpfc_nvme_info_show()
580 nrport->port_name); in lpfc_nvme_info_show()
585 nrport->node_name); in lpfc_nvme_info_show()
590 nrport->port_id); in lpfc_nvme_info_show()
595 if (nrport->port_role & FC_PORT_ROLE_NVME_INITIATOR) { in lpfc_nvme_info_show()
599 if (nrport->port_role & FC_PORT_ROLE_NVME_TARGET) { in lpfc_nvme_info_show()
603 if (nrport->port_role & FC_PORT_ROLE_NVME_DISCOVERY) { in lpfc_nvme_info_show()
607 if (nrport->port_role & ~(FC_PORT_ROLE_NVME_INITIATOR | in lpfc_nvme_info_show()
611 nrport->port_role); in lpfc_nvme_info_show()
620 spin_unlock_irq(shost->host_lock); in lpfc_nvme_info_show()
630 atomic_read(&lport->fc4NvmeLsRequests), in lpfc_nvme_info_show()
631 atomic_read(&lport->fc4NvmeLsCmpls), in lpfc_nvme_info_show()
632 atomic_read(&lport->xmt_ls_abort)); in lpfc_nvme_info_show()
638 atomic_read(&lport->xmt_ls_err), in lpfc_nvme_info_show()
639 atomic_read(&lport->cmpl_ls_xb), in lpfc_nvme_info_show()
640 atomic_read(&lport->cmpl_ls_err)); in lpfc_nvme_info_show()
646 for (i = 0; i < phba->cfg_hdw_queue; i++) { in lpfc_nvme_info_show()
647 cstat = &phba->sli4_hba.hdwq[i].nvme_cstat; in lpfc_nvme_info_show()
648 tot = cstat->io_cmpls; in lpfc_nvme_info_show()
650 data1 = cstat->input_requests; in lpfc_nvme_info_show()
651 data2 = cstat->output_requests; in lpfc_nvme_info_show()
652 data3 = cstat->control_requests; in lpfc_nvme_info_show()
658 totin, totout, totout - totin); in lpfc_nvme_info_show()
665 atomic_read(&lport->xmt_fcp_abort), in lpfc_nvme_info_show()
666 atomic_read(&lport->xmt_fcp_noxri), in lpfc_nvme_info_show()
667 atomic_read(&lport->xmt_fcp_bad_ndlp), in lpfc_nvme_info_show()
668 atomic_read(&lport->xmt_fcp_qdepth), in lpfc_nvme_info_show()
669 atomic_read(&lport->xmt_fcp_wqerr), in lpfc_nvme_info_show()
670 atomic_read(&lport->xmt_fcp_err)); in lpfc_nvme_info_show()
676 atomic_read(&lport->cmpl_fcp_xb), in lpfc_nvme_info_show()
677 atomic_read(&lport->cmpl_fcp_err)); in lpfc_nvme_info_show()
684 spin_unlock_irq(shost->host_lock); in lpfc_nvme_info_show()
689 if (unlikely(len >= (PAGE_SIZE - 1))) { in lpfc_nvme_info_show()
694 strscpy(buf + PAGE_SIZE - 1 - sizeof(LPFC_INFO_MORE_STR), in lpfc_nvme_info_show()
708 struct lpfc_hba *phba = vport->phba; in lpfc_scsi_stat_show()
716 if (!(vport->cfg_enable_fc4_type & LPFC_ENABLE_FCP) || in lpfc_scsi_stat_show()
717 (phba->sli_rev != LPFC_SLI_REV4)) in lpfc_scsi_stat_show()
724 for (i = 0; i < phba->cfg_hdw_queue; i++) { in lpfc_scsi_stat_show()
725 cstat = &phba->sli4_hba.hdwq[i].scsi_cstat; in lpfc_scsi_stat_show()
726 tot = cstat->io_cmpls; in lpfc_scsi_stat_show()
728 data1 = cstat->input_requests; in lpfc_scsi_stat_show()
729 data2 = cstat->output_requests; in lpfc_scsi_stat_show()
730 data3 = cstat->control_requests; in lpfc_scsi_stat_show()
739 tot, ((data1 + data2 + data3) - tot)); in lpfc_scsi_stat_show()
744 "OutIO %016llx\n", totin, totout, totout - totin); in lpfc_scsi_stat_show()
758 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_bg_info_show()
759 struct lpfc_hba *phba = vport->phba; in lpfc_bg_info_show()
761 if (phba->cfg_enable_bg) { in lpfc_bg_info_show()
762 if (phba->sli3_options & LPFC_SLI3_BG_ENABLED) in lpfc_bg_info_show()
778 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_bg_guard_err_show()
779 struct lpfc_hba *phba = vport->phba; in lpfc_bg_guard_err_show()
782 (unsigned long long)phba->bg_guard_err_cnt); in lpfc_bg_guard_err_show()
790 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_bg_apptag_err_show()
791 struct lpfc_hba *phba = vport->phba; in lpfc_bg_apptag_err_show()
794 (unsigned long long)phba->bg_apptag_err_cnt); in lpfc_bg_apptag_err_show()
802 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_bg_reftag_err_show()
803 struct lpfc_hba *phba = vport->phba; in lpfc_bg_reftag_err_show()
806 (unsigned long long)phba->bg_reftag_err_cnt); in lpfc_bg_reftag_err_show()
810 * lpfc_info_show - Return some pci info about the host in ascii
827 * lpfc_serialnum_show - Return the hba serial number in ascii
839 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_serialnum_show()
840 struct lpfc_hba *phba = vport->phba; in lpfc_serialnum_show()
842 return scnprintf(buf, PAGE_SIZE, "%s\n", phba->SerialNumber); in lpfc_serialnum_show()
846 * lpfc_temp_sensor_show - Return the temperature sensor level
862 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_temp_sensor_show()
863 struct lpfc_hba *phba = vport->phba; in lpfc_temp_sensor_show()
864 return scnprintf(buf, PAGE_SIZE, "%d\n", phba->temp_sensor_support); in lpfc_temp_sensor_show()
868 * lpfc_modeldesc_show - Return the model description of the hba
880 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_modeldesc_show()
881 struct lpfc_hba *phba = vport->phba; in lpfc_modeldesc_show()
883 return scnprintf(buf, PAGE_SIZE, "%s\n", phba->ModelDesc); in lpfc_modeldesc_show()
887 * lpfc_modelname_show - Return the model name of the hba
899 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_modelname_show()
900 struct lpfc_hba *phba = vport->phba; in lpfc_modelname_show()
902 return scnprintf(buf, PAGE_SIZE, "%s\n", phba->ModelName); in lpfc_modelname_show()
906 * lpfc_programtype_show - Return the program type of the hba
918 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_programtype_show()
919 struct lpfc_hba *phba = vport->phba; in lpfc_programtype_show()
921 return scnprintf(buf, PAGE_SIZE, "%s\n", phba->ProgramType); in lpfc_programtype_show()
925 * lpfc_mlomgmt_show - Return the Menlo Maintenance sli flag
936 struct lpfc_vport *vport = (struct lpfc_vport *)shost->hostdata; in lpfc_mlomgmt_show()
937 struct lpfc_hba *phba = vport->phba; in lpfc_mlomgmt_show()
940 (phba->sli.sli_flag & LPFC_MENLO_MAINT)); in lpfc_mlomgmt_show()
944 * lpfc_vportnum_show - Return the port number in ascii of the hba
956 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_vportnum_show()
957 struct lpfc_hba *phba = vport->phba; in lpfc_vportnum_show()
959 return scnprintf(buf, PAGE_SIZE, "%s\n", phba->Port); in lpfc_vportnum_show()
963 * lpfc_fwrev_show - Return the firmware rev running in the hba
975 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_fwrev_show()
976 struct lpfc_hba *phba = vport->phba; in lpfc_fwrev_show()
983 if_type = phba->sli4_hba.pc_sli4_params.if_type; in lpfc_fwrev_show()
984 sli_family = phba->sli4_hba.pc_sli4_params.sli_family; in lpfc_fwrev_show()
986 if (phba->sli_rev < LPFC_SLI_REV4) in lpfc_fwrev_show()
987 len = scnprintf(buf, PAGE_SIZE, "%s, sli-%d\n", in lpfc_fwrev_show()
988 fwrev, phba->sli_rev); in lpfc_fwrev_show()
990 len = scnprintf(buf, PAGE_SIZE, "%s, sli-%d:%d:%x\n", in lpfc_fwrev_show()
991 fwrev, phba->sli_rev, if_type, sli_family); in lpfc_fwrev_show()
997 * lpfc_hdw_show - Return the jedec information about the hba
1009 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_hdw_show()
1010 struct lpfc_hba *phba = vport->phba; in lpfc_hdw_show()
1011 lpfc_vpd_t *vp = &phba->vpd; in lpfc_hdw_show()
1013 lpfc_jedec_to_ascii(vp->rev.biuRev, hdw); in lpfc_hdw_show()
1015 vp->rev.smRev, vp->rev.smFwRev); in lpfc_hdw_show()
1019 * lpfc_option_rom_version_show - Return the adapter ROM FCode version
1031 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_option_rom_version_show()
1032 struct lpfc_hba *phba = vport->phba; in lpfc_option_rom_version_show()
1035 if (phba->sli_rev < LPFC_SLI_REV4) in lpfc_option_rom_version_show()
1037 phba->OptionROMVersion); in lpfc_option_rom_version_show()
1044 * lpfc_link_state_show - Return the link state of the port
1059 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_link_state_show()
1060 struct lpfc_hba *phba = vport->phba; in lpfc_link_state_show()
1063 switch (phba->link_state) { in lpfc_link_state_show()
1070 if (phba->hba_flag & LINK_DISABLED) in lpfc_link_state_show()
1071 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_link_state_show()
1072 "Link Down - User disabled\n"); in lpfc_link_state_show()
1074 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_link_state_show()
1080 len += scnprintf(buf + len, PAGE_SIZE-len, "Link Up - "); in lpfc_link_state_show()
1082 switch (vport->port_state) { in lpfc_link_state_show()
1084 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_link_state_show()
1094 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_link_state_show()
1098 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_link_state_show()
1103 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_link_state_show()
1108 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_link_state_show()
1112 if (phba->sli.sli_flag & LPFC_MENLO_MAINT) in lpfc_link_state_show()
1113 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_link_state_show()
1115 else if (phba->fc_topology == LPFC_TOPOLOGY_LOOP) { in lpfc_link_state_show()
1116 if (vport->fc_flag & FC_PUBLIC_LOOP) in lpfc_link_state_show()
1117 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_link_state_show()
1120 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_link_state_show()
1123 if (vport->fc_flag & FC_FABRIC) in lpfc_link_state_show()
1124 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_link_state_show()
1127 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_link_state_show()
1128 " Point-2-Point\n"); in lpfc_link_state_show()
1132 if ((phba->sli_rev == LPFC_SLI_REV4) && in lpfc_link_state_show()
1134 &phba->sli4_hba.sli_intf) == in lpfc_link_state_show()
1136 struct lpfc_trunk_link link = phba->trunk_link; in lpfc_link_state_show()
1138 if (bf_get(lpfc_conf_trunk_port0, &phba->sli4_hba)) in lpfc_link_state_show()
1139 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_link_state_show()
1145 if (bf_get(lpfc_conf_trunk_port1, &phba->sli4_hba)) in lpfc_link_state_show()
1146 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_link_state_show()
1152 if (bf_get(lpfc_conf_trunk_port2, &phba->sli4_hba)) in lpfc_link_state_show()
1153 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_link_state_show()
1159 if (bf_get(lpfc_conf_trunk_port3, &phba->sli4_hba)) in lpfc_link_state_show()
1160 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_link_state_show()
1172 * lpfc_sli4_protocol_show - Return the fip mode of the HBA
1184 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_sli4_protocol_show()
1185 struct lpfc_hba *phba = vport->phba; in lpfc_sli4_protocol_show()
1187 if (phba->sli_rev < LPFC_SLI_REV4) in lpfc_sli4_protocol_show()
1190 if (phba->sli4_hba.lnk_info.lnk_dv == LPFC_LNK_DAT_VAL) { in lpfc_sli4_protocol_show()
1191 if (phba->sli4_hba.lnk_info.lnk_tp == LPFC_LNK_TYPE_GE) in lpfc_sli4_protocol_show()
1193 if (phba->sli4_hba.lnk_info.lnk_tp == LPFC_LNK_TYPE_FC) in lpfc_sli4_protocol_show()
1200 * lpfc_oas_supported_show - Return whether or not Optimized Access Storage
1213 struct lpfc_vport *vport = (struct lpfc_vport *)shost->hostdata; in lpfc_oas_supported_show()
1214 struct lpfc_hba *phba = vport->phba; in lpfc_oas_supported_show()
1217 phba->sli4_hba.pc_sli4_params.oas_supported); in lpfc_oas_supported_show()
1221 * lpfc_link_state_store - Transition the link_state on an HBA port
1228 * -EINVAL if the buffer is not "up" or "down"
1229 * return from link state change function if non-zero
1237 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_link_state_store()
1238 struct lpfc_hba *phba = vport->phba; in lpfc_link_state_store()
1240 int status = -EINVAL; in lpfc_link_state_store()
1242 if ((strncmp(buf, "up", sizeof("up") - 1) == 0) && in lpfc_link_state_store()
1243 (phba->link_state == LPFC_LINK_DOWN)) in lpfc_link_state_store()
1244 status = phba->lpfc_hba_init_link(phba, MBX_NOWAIT); in lpfc_link_state_store()
1245 else if ((strncmp(buf, "down", sizeof("down") - 1) == 0) && in lpfc_link_state_store()
1246 (phba->link_state >= LPFC_LINK_UP)) in lpfc_link_state_store()
1247 status = phba->lpfc_hba_down_link(phba, MBX_NOWAIT); in lpfc_link_state_store()
1256 * lpfc_num_discovered_ports_show - Return sum of mapped and unmapped vports
1272 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_num_discovered_ports_show()
1275 vport->fc_map_cnt + vport->fc_unmap_cnt); in lpfc_num_discovered_ports_show()
1279 * lpfc_issue_lip - Misnomer, name carried over from long ago
1283 * Bring the link down gracefully then re-init the link. The firmware will
1284 * re-init the fiber channel interface as required. Does not issue a LIP.
1287 * -EPERM port offline or management commands are being blocked
1288 * -ENOMEM cannot allocate memory for the mailbox command
1289 * -EIO error sending the mailbox command
1295 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_issue_lip()
1296 struct lpfc_hba *phba = vport->phba; in lpfc_issue_lip()
1304 if ((vport->fc_flag & FC_OFFLINE_MODE) || in lpfc_issue_lip()
1305 (phba->hba_flag & LINK_DISABLED) || in lpfc_issue_lip()
1306 (phba->sli.sli_flag & LPFC_BLOCK_MGMT_IO)) in lpfc_issue_lip()
1307 return -EPERM; in lpfc_issue_lip()
1309 pmboxq = mempool_alloc(phba->mbox_mem_pool,GFP_KERNEL); in lpfc_issue_lip()
1312 return -ENOMEM; in lpfc_issue_lip()
1315 pmboxq->u.mb.mbxCommand = MBX_DOWN_LINK; in lpfc_issue_lip()
1316 pmboxq->u.mb.mbxOwner = OWN_HOST; in lpfc_issue_lip()
1321 (pmboxq->u.mb.mbxStatus == 0 || in lpfc_issue_lip()
1322 pmboxq->u.mb.mbxStatus == MBXERR_LINK_DOWN)) { in lpfc_issue_lip()
1324 lpfc_init_link(phba, pmboxq, phba->cfg_topology, in lpfc_issue_lip()
1325 phba->cfg_link_speed); in lpfc_issue_lip()
1327 phba->fc_ratov * 2); in lpfc_issue_lip()
1329 (pmboxq->u.mb.mbxStatus == MBXERR_SEC_NO_PERMISSION)) in lpfc_issue_lip()
1337 mempool_free(pmboxq, phba->mbox_mem_pool); in lpfc_issue_lip()
1340 return -EIO; in lpfc_issue_lip()
1367 * lpfc_do_offline - Issues a mailbox command to bring the link down
1375 * lpfc_workq_post_event() returns a non-zero return code if call fails.
1378 * -EIO error posting the event
1396 return -ENOMEM; in lpfc_do_offline()
1401 return -EIO; in lpfc_do_offline()
1403 psli = &phba->sli; in lpfc_do_offline()
1410 spin_lock_irq(&phba->hbalock); in lpfc_do_offline()
1411 if (!(psli->sli_flag & LPFC_QUEUE_FREE_INIT)) { in lpfc_do_offline()
1412 psli->sli_flag |= LPFC_QUEUE_FREE_WAIT; in lpfc_do_offline()
1414 spin_unlock_irq(&phba->hbalock); in lpfc_do_offline()
1417 spin_unlock_irq(&phba->hbalock); in lpfc_do_offline()
1422 if (phba->sli_rev != LPFC_SLI_REV4) { in lpfc_do_offline()
1423 for (i = 0; i < psli->num_rings; i++) { in lpfc_do_offline()
1424 pring = &psli->sli3_ring[i]; in lpfc_do_offline()
1425 if (!lpfc_emptyq_wait(phba, &pring->txcmplq, in lpfc_do_offline()
1426 &phba->hbalock)) in lpfc_do_offline()
1430 list_for_each_entry(qp, &phba->sli4_hba.lpfc_wq_list, wq_list) { in lpfc_do_offline()
1431 pring = qp->pring; in lpfc_do_offline()
1434 if (!lpfc_emptyq_wait(phba, &pring->txcmplq, in lpfc_do_offline()
1435 &pring->ring_lock)) in lpfc_do_offline()
1440 spin_lock_irq(&phba->hbalock); in lpfc_do_offline()
1441 psli->sli_flag &= ~LPFC_QUEUE_FREE_WAIT; in lpfc_do_offline()
1442 spin_unlock_irq(&phba->hbalock); in lpfc_do_offline()
1448 return -ENOMEM; in lpfc_do_offline()
1453 return -EIO; in lpfc_do_offline()
1459 * lpfc_reset_pci_bus - resets PCI bridge controller's secondary bus of an HBA
1463 * Issues a PCI secondary bus reset for the phba->pcidev.
1472 * -ENOTSUPP, cfg_enable_hba_reset must be of value 2
1473 * -ENODEV, NULL ptr to pcidev
1474 * -EBADSLT, detected invalid device
1475 * -EBUSY, port is not in offline state
1481 struct pci_dev *pdev = phba->pcidev; in lpfc_reset_pci_bus()
1487 if (phba->cfg_enable_hba_reset != 2) in lpfc_reset_pci_bus()
1488 return -ENOTSUPP; in lpfc_reset_pci_bus()
1492 return -ENODEV; in lpfc_reset_pci_bus()
1500 list_for_each_entry(ptr, &pdev->bus->devices, bus_list) { in lpfc_reset_pci_bus()
1505 ((struct lpfc_vport *)shost->hostdata)->phba; in lpfc_reset_pci_bus()
1506 if (!(phba_other->pport->fc_flag & FC_OFFLINE_MODE)) { in lpfc_reset_pci_bus()
1511 phba_other->wwpn[0], in lpfc_reset_pci_bus()
1512 phba_other->wwpn[1], in lpfc_reset_pci_bus()
1513 phba_other->wwpn[2], in lpfc_reset_pci_bus()
1514 phba_other->wwpn[3], in lpfc_reset_pci_bus()
1515 phba_other->wwpn[4], in lpfc_reset_pci_bus()
1516 phba_other->wwpn[5], in lpfc_reset_pci_bus()
1517 phba_other->wwpn[6], in lpfc_reset_pci_bus()
1518 phba_other->wwpn[7]); in lpfc_reset_pci_bus()
1519 return -EBUSY; in lpfc_reset_pci_bus()
1535 * lpfc_selective_reset - Offline then onlines the port
1548 * -EIO reset not configured or error posting the event
1558 if (!phba->cfg_enable_hba_reset) in lpfc_selective_reset()
1559 return -EACCES; in lpfc_selective_reset()
1561 if (!(phba->pport->fc_flag & FC_OFFLINE_MODE)) { in lpfc_selective_reset()
1572 return -ENOMEM; in lpfc_selective_reset()
1577 return -EIO; in lpfc_selective_reset()
1583 * lpfc_issue_reset - Selectively resets an adapter
1599 * -EINVAL if the buffer does not contain the string "selective"
1600 * length of buf if lpfc-selective_reset() if the call succeeds
1608 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_issue_reset()
1609 struct lpfc_hba *phba = vport->phba; in lpfc_issue_reset()
1610 int status = -EINVAL; in lpfc_issue_reset()
1612 if (!phba->cfg_enable_hba_reset) in lpfc_issue_reset()
1613 return -EACCES; in lpfc_issue_reset()
1615 if (strncmp(buf, "selective", sizeof("selective") - 1) == 0) in lpfc_issue_reset()
1616 status = phba->lpfc_selective_reset(phba); in lpfc_issue_reset()
1625 * lpfc_sli4_pdev_status_reg_wait - Wait for pdev status register for readyness
1629 * SLI4 interface type-2 device to wait on the sliport status register for
1633 * zero for success, -EPERM when port does not have privilege to perform the
1634 * reset, -EIO when port timeout from recovering from the reset.
1647 if (lpfc_readl(phba->sli4_hba.u.if_type2.STATUSregaddr, in lpfc_sli4_pdev_status_reg_wait()
1649 return -EIO; in lpfc_sli4_pdev_status_reg_wait()
1654 return -EPERM; in lpfc_sli4_pdev_status_reg_wait()
1659 if (lpfc_readl(phba->sli4_hba.u.if_type2.STATUSregaddr, in lpfc_sli4_pdev_status_reg_wait()
1674 return -EIO; in lpfc_sli4_pdev_status_reg_wait()
1678 * lpfc_sli4_pdev_reg_request - Request physical dev to perform a register acc
1683 * Request SLI4 interface type-2 device to perform a physical register set
1693 struct pci_dev *pdev = phba->pcidev; in lpfc_sli4_pdev_reg_request()
1700 if (!phba->cfg_enable_hba_reset) in lpfc_sli4_pdev_reg_request()
1701 return -EACCES; in lpfc_sli4_pdev_reg_request()
1703 if ((phba->sli_rev < LPFC_SLI_REV4) || in lpfc_sli4_pdev_reg_request()
1704 (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) < in lpfc_sli4_pdev_reg_request()
1706 return -EPERM; in lpfc_sli4_pdev_reg_request()
1709 before_fc_flag = phba->pport->fc_flag; in lpfc_sli4_pdev_reg_request()
1710 sriov_nr_virtfn = phba->cfg_sriov_nr_virtfn; in lpfc_sli4_pdev_reg_request()
1712 /* Disable SR-IOV virtual functions if enabled */ in lpfc_sli4_pdev_reg_request()
1713 if (phba->cfg_sriov_nr_virtfn) { in lpfc_sli4_pdev_reg_request()
1715 phba->cfg_sriov_nr_virtfn = 0; in lpfc_sli4_pdev_reg_request()
1719 phba->hba_flag |= HBA_FW_DUMP_OP; in lpfc_sli4_pdev_reg_request()
1724 phba->hba_flag &= ~HBA_FW_DUMP_OP; in lpfc_sli4_pdev_reg_request()
1731 reg_val = readl(phba->sli4_hba.conf_regs_memmap_p + in lpfc_sli4_pdev_reg_request()
1741 writel(reg_val, phba->sli4_hba.conf_regs_memmap_p + in lpfc_sli4_pdev_reg_request()
1744 readl(phba->sli4_hba.conf_regs_memmap_p + LPFC_CTL_PDEV_CTL_OFFSET); in lpfc_sli4_pdev_reg_request()
1749 if (rc == -EPERM) { in lpfc_sli4_pdev_reg_request()
1754 } else if (rc == -EIO) { in lpfc_sli4_pdev_reg_request()
1780 phba->cfg_sriov_nr_virtfn = sriov_nr_virtfn; in lpfc_sli4_pdev_reg_request()
1786 rc = -ENOMEM; in lpfc_sli4_pdev_reg_request()
1788 rc = -EIO; in lpfc_sli4_pdev_reg_request()
1794 * lpfc_nport_evt_cnt_show - Return the number of nport events
1806 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_nport_evt_cnt_show()
1807 struct lpfc_hba *phba = vport->phba; in lpfc_nport_evt_cnt_show()
1809 return scnprintf(buf, PAGE_SIZE, "%d\n", phba->nport_event_cnt); in lpfc_nport_evt_cnt_show()
1830 return -EINVAL; /* Invalid command */ in lpfc_set_trunking()
1844 return -EINVAL; in lpfc_set_trunking()
1850 mbox = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); in lpfc_set_trunking()
1852 return -ENOMEM; in lpfc_set_trunking()
1859 &mbox->u.mqe.un.set_trunk_mode, in lpfc_set_trunking()
1866 mempool_free(mbox, phba->mbox_mem_pool); in lpfc_set_trunking()
1872 * lpfc_board_mode_show - Return the state of the board
1884 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_board_mode_show()
1885 struct lpfc_hba *phba = vport->phba; in lpfc_board_mode_show()
1888 if (phba->link_state == LPFC_HBA_ERROR) in lpfc_board_mode_show()
1890 else if (phba->link_state == LPFC_WARM_START) in lpfc_board_mode_show()
1892 else if (phba->link_state == LPFC_INIT_START) in lpfc_board_mode_show()
1901 * lpfc_board_mode_store - Puts the hba in online, offline, warm or error state
1908 * -EACCES if enable hba reset not enabled
1909 * -EINVAL if the buffer does not contain a valid string (see above)
1910 * -EIO if lpfc_workq_post_event() or lpfc_do_offline() fails
1918 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_board_mode_store()
1919 struct lpfc_hba *phba = vport->phba; in lpfc_board_mode_store()
1925 if (!phba->cfg_enable_hba_reset) { in lpfc_board_mode_store()
1926 status = -EACCES; in lpfc_board_mode_store()
1935 if(strncmp(buf, "online", sizeof("online") - 1) == 0) { in lpfc_board_mode_store()
1939 status = -ENOMEM; in lpfc_board_mode_store()
1944 status = -EIO; in lpfc_board_mode_store()
1945 } else if (strncmp(buf, "offline", sizeof("offline") - 1) == 0) in lpfc_board_mode_store()
1947 else if (strncmp(buf, "warm", sizeof("warm") - 1) == 0) in lpfc_board_mode_store()
1948 if (phba->sli_rev == LPFC_SLI_REV4) in lpfc_board_mode_store()
1949 status = -EINVAL; in lpfc_board_mode_store()
1952 else if (strncmp(buf, "error", sizeof("error") - 1) == 0) in lpfc_board_mode_store()
1953 if (phba->sli_rev == LPFC_SLI_REV4) in lpfc_board_mode_store()
1954 status = -EINVAL; in lpfc_board_mode_store()
1957 else if (strncmp(buf, "dump", sizeof("dump") - 1) == 0) in lpfc_board_mode_store()
1959 else if (strncmp(buf, "fw_reset", sizeof("fw_reset") - 1) == 0) in lpfc_board_mode_store()
1961 else if (strncmp(buf, "dv_reset", sizeof("dv_reset") - 1) == 0) in lpfc_board_mode_store()
1963 else if (strncmp(buf, "pci_bus_reset", sizeof("pci_bus_reset") - 1) in lpfc_board_mode_store()
1966 else if (strncmp(buf, "heartbeat", sizeof("heartbeat") - 1) == 0) in lpfc_board_mode_store()
1968 else if (strncmp(buf, "trunk", sizeof("trunk") - 1) == 0) in lpfc_board_mode_store()
1971 status = -EINVAL; in lpfc_board_mode_store()
1983 buf, status, phba->pport->fc_flag); in lpfc_board_mode_store()
1989 * lpfc_get_hba_info - Return various bits of informaton about the adapter
2022 if (phba->link_state < LPFC_LINK_DOWN || in lpfc_get_hba_info()
2023 !phba->mbox_mem_pool || in lpfc_get_hba_info()
2024 (phba->sli.sli_flag & LPFC_SLI_ACTIVE) == 0) in lpfc_get_hba_info()
2027 if (phba->sli.sli_flag & LPFC_BLOCK_MGMT_IO) in lpfc_get_hba_info()
2030 pmboxq = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); in lpfc_get_hba_info()
2035 pmb = &pmboxq->u.mb; in lpfc_get_hba_info()
2036 pmb->mbxCommand = MBX_READ_CONFIG; in lpfc_get_hba_info()
2037 pmb->mbxOwner = OWN_HOST; in lpfc_get_hba_info()
2038 pmboxq->ctx_buf = NULL; in lpfc_get_hba_info()
2040 if (phba->pport->fc_flag & FC_OFFLINE_MODE) in lpfc_get_hba_info()
2043 rc = lpfc_sli_issue_mbox_wait(phba, pmboxq, phba->fc_ratov * 2); in lpfc_get_hba_info()
2047 mempool_free(pmboxq, phba->mbox_mem_pool); in lpfc_get_hba_info()
2051 if (phba->sli_rev == LPFC_SLI_REV4) { in lpfc_get_hba_info()
2052 rd_config = &pmboxq->u.mqe.un.rd_config; in lpfc_get_hba_info()
2056 *arpi = bf_get(lpfc_mbx_rd_conf_rpi_count, rd_config) - in lpfc_get_hba_info()
2057 phba->sli4_hba.max_cfg_param.rpi_used; in lpfc_get_hba_info()
2061 *axri = bf_get(lpfc_mbx_rd_conf_xri_count, rd_config) - in lpfc_get_hba_info()
2062 phba->sli4_hba.max_cfg_param.xri_used; in lpfc_get_hba_info()
2064 /* Account for differences with SLI-3. Get vpi count from in lpfc_get_hba_info()
2068 (bf_get(lpfc_mbx_rd_conf_vpi_count, rd_config) - 1) : 0; in lpfc_get_hba_info()
2076 *avpi = max_vpi - phba->sli4_hba.max_cfg_param.vpi_used; in lpfc_get_hba_info()
2079 *mrpi = pmb->un.varRdConfig.max_rpi; in lpfc_get_hba_info()
2081 *arpi = pmb->un.varRdConfig.avail_rpi; in lpfc_get_hba_info()
2083 *mxri = pmb->un.varRdConfig.max_xri; in lpfc_get_hba_info()
2085 *axri = pmb->un.varRdConfig.avail_xri; in lpfc_get_hba_info()
2087 *mvpi = pmb->un.varRdConfig.max_vpi; in lpfc_get_hba_info()
2090 if (phba->link_state == LPFC_HBA_READY) in lpfc_get_hba_info()
2091 *avpi = pmb->un.varRdConfig.avail_vpi; in lpfc_get_hba_info()
2093 *avpi = pmb->un.varRdConfig.max_vpi; in lpfc_get_hba_info()
2097 mempool_free(pmboxq, phba->mbox_mem_pool); in lpfc_get_hba_info()
2102 * lpfc_max_rpi_show - Return maximum rpi
2120 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_max_rpi_show()
2121 struct lpfc_hba *phba = vport->phba; in lpfc_max_rpi_show()
2130 * lpfc_used_rpi_show - Return maximum rpi minus available rpi
2148 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_used_rpi_show()
2149 struct lpfc_hba *phba = vport->phba; in lpfc_used_rpi_show()
2153 return scnprintf(buf, PAGE_SIZE, "%d\n", (cnt - acnt)); in lpfc_used_rpi_show()
2158 * lpfc_max_xri_show - Return maximum xri
2176 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_max_xri_show()
2177 struct lpfc_hba *phba = vport->phba; in lpfc_max_xri_show()
2186 * lpfc_used_xri_show - Return maximum xpi minus the available xpi
2204 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_used_xri_show()
2205 struct lpfc_hba *phba = vport->phba; in lpfc_used_xri_show()
2209 return scnprintf(buf, PAGE_SIZE, "%d\n", (cnt - acnt)); in lpfc_used_xri_show()
2214 * lpfc_max_vpi_show - Return maximum vpi
2232 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_max_vpi_show()
2233 struct lpfc_hba *phba = vport->phba; in lpfc_max_vpi_show()
2242 * lpfc_used_vpi_show - Return maximum vpi minus the available vpi
2260 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_used_vpi_show()
2261 struct lpfc_hba *phba = vport->phba; in lpfc_used_vpi_show()
2265 return scnprintf(buf, PAGE_SIZE, "%d\n", (cnt - acnt)); in lpfc_used_vpi_show()
2270 * lpfc_npiv_info_show - Return text about NPIV support for the adapter
2287 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_npiv_info_show()
2288 struct lpfc_hba *phba = vport->phba; in lpfc_npiv_info_show()
2290 if (!(phba->max_vpi)) in lpfc_npiv_info_show()
2292 if (vport->port_type == LPFC_PHYSICAL_PORT) in lpfc_npiv_info_show()
2294 return scnprintf(buf, PAGE_SIZE, "NPIV Virtual (VPI %d)\n", vport->vpi); in lpfc_npiv_info_show()
2298 * lpfc_poll_show - Return text about poll support for the adapter
2313 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_poll_show()
2314 struct lpfc_hba *phba = vport->phba; in lpfc_poll_show()
2316 return scnprintf(buf, PAGE_SIZE, "%#x\n", phba->cfg_poll); in lpfc_poll_show()
2320 * lpfc_poll_store - Set the value of cfg_poll for the adapter
2330 * -EINVAL if the buffer connot be converted or is out of range
2338 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_poll_store()
2339 struct lpfc_hba *phba = vport->phba; in lpfc_poll_store()
2345 return -EINVAL; in lpfc_poll_store()
2348 return -EINVAL; in lpfc_poll_store()
2351 return -EINVAL; in lpfc_poll_store()
2353 if (phba->sli_rev == LPFC_SLI_REV4) in lpfc_poll_store()
2358 phba->cfg_poll, val); in lpfc_poll_store()
2360 spin_lock_irq(&phba->hbalock); in lpfc_poll_store()
2362 old_val = phba->cfg_poll; in lpfc_poll_store()
2367 if (lpfc_readl(phba->HCregaddr, &creg_val)) { in lpfc_poll_store()
2368 spin_unlock_irq(&phba->hbalock); in lpfc_poll_store()
2369 return -EINVAL; in lpfc_poll_store()
2372 writel(creg_val, phba->HCregaddr); in lpfc_poll_store()
2373 readl(phba->HCregaddr); /* flush */ in lpfc_poll_store()
2378 spin_unlock_irq(&phba->hbalock); in lpfc_poll_store()
2379 return -EINVAL; in lpfc_poll_store()
2385 spin_unlock_irq(&phba->hbalock); in lpfc_poll_store()
2386 del_timer(&phba->fcp_poll_timer); in lpfc_poll_store()
2387 spin_lock_irq(&phba->hbalock); in lpfc_poll_store()
2388 if (lpfc_readl(phba->HCregaddr, &creg_val)) { in lpfc_poll_store()
2389 spin_unlock_irq(&phba->hbalock); in lpfc_poll_store()
2390 return -EINVAL; in lpfc_poll_store()
2393 writel(creg_val, phba->HCregaddr); in lpfc_poll_store()
2394 readl(phba->HCregaddr); /* flush */ in lpfc_poll_store()
2397 phba->cfg_poll = val; in lpfc_poll_store()
2399 spin_unlock_irq(&phba->hbalock); in lpfc_poll_store()
2405 * lpfc_sriov_hw_max_virtfn_show - Return maximum number of virtual functions
2422 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_sriov_hw_max_virtfn_show()
2423 struct lpfc_hba *phba = vport->phba; in lpfc_sriov_hw_max_virtfn_show()
2442 * -EINVAL if val is invalid
2447 if (lpfc_rangecheck(val, 0, 1) && phba->sli_rev == LPFC_SLI_REV4) { in lpfc_enable_bbcr_set()
2450 "%d\n", phba->cfg_enable_bbcr, val); in lpfc_enable_bbcr_set()
2451 phba->cfg_enable_bbcr = val; in lpfc_enable_bbcr_set()
2457 return -EINVAL; in lpfc_enable_bbcr_set()
2461 * lpfc_param_show - Return a cfg attribute value in decimal
2480 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;\
2481 struct lpfc_hba *phba = vport->phba;\
2483 phba->cfg_##attr);\
2487 * lpfc_param_hex_show - Return a cfg attribute value in hex
2506 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;\
2507 struct lpfc_hba *phba = vport->phba;\
2509 val = phba->cfg_##attr;\
2511 phba->cfg_##attr);\
2515 * lpfc_param_init - Initializes a cfg attribute
2531 * -EINVAL if default used
2538 phba->cfg_##attr = val;\
2544 phba->cfg_##attr = default;\
2545 return -EINVAL;\
2549 * lpfc_param_set - Set a cfg attribute value
2566 * -EINVAL if val is invalid
2575 phba->cfg_##attr, val); \
2576 phba->cfg_##attr = val;\
2582 return -EINVAL;\
2586 * lpfc_param_store - Set a vport attribute value
2603 * -EINVAL if val is invalid or lpfc_##attr##_set() fails
2612 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;\
2613 struct lpfc_hba *phba = vport->phba;\
2616 return -EINVAL;\
2618 return -EINVAL;\
2622 return -EINVAL;\
2626 * lpfc_vport_param_show - Return decimal formatted cfg attribute value
2645 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;\
2646 return scnprintf(buf, PAGE_SIZE, "%d\n", vport->cfg_##attr);\
2650 * lpfc_vport_param_hex_show - Return hex formatted attribute value
2670 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;\
2671 return scnprintf(buf, PAGE_SIZE, "%#x\n", vport->cfg_##attr);\
2675 * lpfc_vport_param_init - Initialize a vport cfg attribute
2690 * -EINVAL if default used
2697 vport->cfg_##attr = val;\
2703 vport->cfg_##attr = default;\
2704 return -EINVAL;\
2708 * lpfc_vport_param_set - Set a vport cfg attribute
2722 * -EINVAL if val is invalid
2732 vport->cfg_##attr, vport->cfg_##attr, \
2734 vport->cfg_##attr = val;\
2740 return -EINVAL;\
2744 * lpfc_vport_param_store - Set a vport attribute
2757 * -EINVAL if val is invalid or lpfc_##attr##_set() fails
2766 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata;\
2769 return -EINVAL;\
2771 return -EINVAL;\
2775 return -EINVAL;\
2823 * lpfc_wwn_set - Convert string to the 8 byte WWN value.
2829 * -EINVAL if the buffer does not contain a valid wwn
2838 if (buf[cnt-1] == '\n') in lpfc_wwn_set()
2839 cnt--; in lpfc_wwn_set()
2843 return -EINVAL; in lpfc_wwn_set()
2850 j = ((j << 4) | ((*buf++ - 'a') + 10)); in lpfc_wwn_set()
2852 j = ((j << 4) | ((*buf++ - 'A') + 10)); in lpfc_wwn_set()
2854 j = ((j << 4) | (*buf++ - '0')); in lpfc_wwn_set()
2856 return -EINVAL; in lpfc_wwn_set()
2865 * lpfc_soft_wwn_enable_store - Allows setting of the wwn if the key is valid
2872 * -EINVAL if the buffer does not contain lpfc_soft_wwn_key
2880 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_soft_wwn_enable_store()
2881 struct lpfc_hba *phba = vport->phba; in lpfc_soft_wwn_enable_store()
2883 uint8_t vvvl = vport->fc_sparam.cmn.valid_vendor_ver_level; in lpfc_soft_wwn_enable_store()
2884 u32 *fawwpn_key = (uint32_t *)&vport->fc_sparam.un.vendorVersion[0]; in lpfc_soft_wwn_enable_store()
2891 * desired, the key must be written again to re-enable the in lpfc_soft_wwn_enable_store()
2894 * The "key" is not secret - it is a hardcoded string shown in lpfc_soft_wwn_enable_store()
2902 return -EINVAL; in lpfc_soft_wwn_enable_store()
2906 if (buf[cnt-1] == '\n') in lpfc_soft_wwn_enable_store()
2907 cnt--; in lpfc_soft_wwn_enable_store()
2911 return -EINVAL; in lpfc_soft_wwn_enable_store()
2913 phba->soft_wwn_enable = 1; in lpfc_soft_wwn_enable_store()
2915 dev_printk(KERN_WARNING, &phba->pcidev->dev, in lpfc_soft_wwn_enable_store()
2917 phba->brd_no); in lpfc_soft_wwn_enable_store()
2918 dev_printk(KERN_WARNING, &phba->pcidev->dev, in lpfc_soft_wwn_enable_store()
2926 * lpfc_soft_wwpn_show - Return the cfg soft ww port name of the adapter
2938 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_soft_wwpn_show()
2939 struct lpfc_hba *phba = vport->phba; in lpfc_soft_wwpn_show()
2942 (unsigned long long)phba->cfg_soft_wwpn); in lpfc_soft_wwpn_show()
2946 * lpfc_soft_wwpn_store - Set the ww port name of the adapter
2953 * -EACCES hba reset not enabled, adapter over temp
2954 * -EINVAL soft wwn not enabled, count is invalid, invalid wwpn byte invalid
2955 * -EIO error taking adapter offline or online
2963 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_soft_wwpn_store()
2964 struct lpfc_hba *phba = vport->phba; in lpfc_soft_wwpn_store()
2971 if (!phba->cfg_enable_hba_reset) in lpfc_soft_wwpn_store()
2972 return -EACCES; in lpfc_soft_wwpn_store()
2973 spin_lock_irq(&phba->hbalock); in lpfc_soft_wwpn_store()
2974 if (phba->over_temp_state == HBA_OVER_TEMP) { in lpfc_soft_wwpn_store()
2975 spin_unlock_irq(&phba->hbalock); in lpfc_soft_wwpn_store()
2976 return -EACCES; in lpfc_soft_wwpn_store()
2978 spin_unlock_irq(&phba->hbalock); in lpfc_soft_wwpn_store()
2980 if (buf[cnt-1] == '\n') in lpfc_soft_wwpn_store()
2981 cnt--; in lpfc_soft_wwpn_store()
2983 if (!phba->soft_wwn_enable) in lpfc_soft_wwpn_store()
2984 return -EINVAL; in lpfc_soft_wwpn_store()
2987 phba->soft_wwn_enable = 0; in lpfc_soft_wwpn_store()
2992 phba->soft_wwn_enable = 1; in lpfc_soft_wwpn_store()
2996 phba->cfg_soft_wwpn = wwn_to_u64(wwpn); in lpfc_soft_wwpn_store()
2997 fc_host_port_name(shost) = phba->cfg_soft_wwpn; in lpfc_soft_wwpn_store()
2998 if (phba->cfg_soft_wwnn) in lpfc_soft_wwpn_store()
2999 fc_host_node_name(shost) = phba->cfg_soft_wwnn; in lpfc_soft_wwpn_store()
3001 dev_printk(KERN_NOTICE, &phba->pcidev->dev, in lpfc_soft_wwpn_store()
3002 "lpfc%d: Reinitializing to use soft_wwpn\n", phba->brd_no); in lpfc_soft_wwpn_store()
3008 "reinit adapter - %d\n", stat1); in lpfc_soft_wwpn_store()
3013 return -ENOMEM; in lpfc_soft_wwpn_store()
3019 "reinit adapter - %d\n", stat2); in lpfc_soft_wwpn_store()
3020 return (stat1 || stat2) ? -EIO : count; in lpfc_soft_wwpn_store()
3025 * lpfc_soft_wwnn_show - Return the cfg soft ww node name for the adapter
3037 struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba; in lpfc_soft_wwnn_show()
3039 (unsigned long long)phba->cfg_soft_wwnn); in lpfc_soft_wwnn_show()
3043 * lpfc_soft_wwnn_store - sets the ww node name of the adapter
3050 * -EINVAL soft wwn not enabled, count is invalid, invalid wwnn byte invalid
3058 struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba; in lpfc_soft_wwnn_store()
3064 if (buf[cnt-1] == '\n') in lpfc_soft_wwnn_store()
3065 cnt--; in lpfc_soft_wwnn_store()
3067 if (!phba->soft_wwn_enable) in lpfc_soft_wwnn_store()
3068 return -EINVAL; in lpfc_soft_wwnn_store()
3078 phba->cfg_soft_wwnn = wwn_to_u64(wwnn); in lpfc_soft_wwnn_store()
3080 dev_printk(KERN_NOTICE, &phba->pcidev->dev, in lpfc_soft_wwnn_store()
3082 "setting of the soft_wwpn\n", phba->brd_no); in lpfc_soft_wwnn_store()
3089 * lpfc_oas_tgt_show - Return wwpn of target whose luns maybe enabled for
3103 struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba; in lpfc_oas_tgt_show()
3106 wwn_to_u64(phba->cfg_oas_tgt_wwpn)); in lpfc_oas_tgt_show()
3110 * lpfc_oas_tgt_store - Store wwpn of target whose luns maybe enabled for
3118 * -EINVAL count is invalid, invalid wwpn byte invalid
3119 * -EPERM oas is not supported by hba
3127 struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba; in lpfc_oas_tgt_store()
3132 if (!phba->cfg_fof) in lpfc_oas_tgt_store()
3133 return -EPERM; in lpfc_oas_tgt_store()
3136 if (buf[cnt-1] == '\n') in lpfc_oas_tgt_store()
3137 cnt--; in lpfc_oas_tgt_store()
3143 memcpy(phba->cfg_oas_tgt_wwpn, wwpn, (8 * sizeof(uint8_t))); in lpfc_oas_tgt_store()
3144 memcpy(phba->sli4_hba.oas_next_tgt_wwpn, wwpn, (8 * sizeof(uint8_t))); in lpfc_oas_tgt_store()
3146 phba->cfg_oas_flags |= OAS_FIND_ANY_TARGET; in lpfc_oas_tgt_store()
3148 phba->cfg_oas_flags &= ~OAS_FIND_ANY_TARGET; in lpfc_oas_tgt_store()
3149 phba->cfg_oas_flags &= ~OAS_LUN_VALID; in lpfc_oas_tgt_store()
3150 phba->sli4_hba.oas_next_lun = FIND_FIRST_OAS_LUN; in lpfc_oas_tgt_store()
3157 * lpfc_oas_priority_show - Return wwpn of target whose luns maybe enabled for
3171 struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba; in lpfc_oas_priority_show()
3173 return scnprintf(buf, PAGE_SIZE, "%d\n", phba->cfg_oas_priority); in lpfc_oas_priority_show()
3177 * lpfc_oas_priority_store - Store wwpn of target whose luns maybe enabled for
3185 * -EINVAL count is invalid, invalid wwpn byte invalid
3186 * -EPERM oas is not supported by hba
3194 struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba; in lpfc_oas_priority_store()
3199 if (!phba->cfg_fof) in lpfc_oas_priority_store()
3200 return -EPERM; in lpfc_oas_priority_store()
3203 if (buf[cnt-1] == '\n') in lpfc_oas_priority_store()
3204 cnt--; in lpfc_oas_priority_store()
3208 return -EINVAL; in lpfc_oas_priority_store()
3211 phba->cfg_oas_priority = (uint8_t)val; in lpfc_oas_priority_store()
3213 phba->cfg_oas_priority = phba->cfg_XLanePriority; in lpfc_oas_priority_store()
3220 * lpfc_oas_vpt_show - Return wwpn of vport whose targets maybe enabled
3234 struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba; in lpfc_oas_vpt_show()
3237 wwn_to_u64(phba->cfg_oas_vpt_wwpn)); in lpfc_oas_vpt_show()
3241 * lpfc_oas_vpt_store - Store wwpn of vport whose targets maybe enabled
3249 * -EINVAL count is invalid, invalid wwpn byte invalid
3250 * -EPERM oas is not supported by hba
3258 struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba; in lpfc_oas_vpt_store()
3263 if (!phba->cfg_fof) in lpfc_oas_vpt_store()
3264 return -EPERM; in lpfc_oas_vpt_store()
3267 if (buf[cnt-1] == '\n') in lpfc_oas_vpt_store()
3268 cnt--; in lpfc_oas_vpt_store()
3274 memcpy(phba->cfg_oas_vpt_wwpn, wwpn, (8 * sizeof(uint8_t))); in lpfc_oas_vpt_store()
3275 memcpy(phba->sli4_hba.oas_next_vpt_wwpn, wwpn, (8 * sizeof(uint8_t))); in lpfc_oas_vpt_store()
3277 phba->cfg_oas_flags |= OAS_FIND_ANY_VPORT; in lpfc_oas_vpt_store()
3279 phba->cfg_oas_flags &= ~OAS_FIND_ANY_VPORT; in lpfc_oas_vpt_store()
3280 phba->cfg_oas_flags &= ~OAS_LUN_VALID; in lpfc_oas_vpt_store()
3281 if (phba->cfg_oas_priority == 0) in lpfc_oas_vpt_store()
3282 phba->cfg_oas_priority = phba->cfg_XLanePriority; in lpfc_oas_vpt_store()
3283 phba->sli4_hba.oas_next_lun = FIND_FIRST_OAS_LUN; in lpfc_oas_vpt_store()
3290 * lpfc_oas_lun_state_show - Return the current state (enabled or disabled)
3305 struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba; in lpfc_oas_lun_state_show()
3307 return scnprintf(buf, PAGE_SIZE, "%d\n", phba->cfg_oas_lun_state); in lpfc_oas_lun_state_show()
3311 * lpfc_oas_lun_state_store - Store the state (enabled or disabled)
3320 * -EINVAL count is invalid, invalid wwpn byte invalid
3321 * -EPERM oas is not supported by hba
3329 struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba; in lpfc_oas_lun_state_store()
3332 if (!phba->cfg_fof) in lpfc_oas_lun_state_store()
3333 return -EPERM; in lpfc_oas_lun_state_store()
3336 return -EINVAL; in lpfc_oas_lun_state_store()
3339 return -EINVAL; in lpfc_oas_lun_state_store()
3342 return -EINVAL; in lpfc_oas_lun_state_store()
3344 phba->cfg_oas_lun_state = val; in lpfc_oas_lun_state_store()
3351 * lpfc_oas_lun_status_show - Return the status of the Optimized Access
3366 struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba; in lpfc_oas_lun_status_show()
3368 if (!(phba->cfg_oas_flags & OAS_LUN_VALID)) in lpfc_oas_lun_status_show()
3369 return -EFAULT; in lpfc_oas_lun_status_show()
3371 return scnprintf(buf, PAGE_SIZE, "%d\n", phba->cfg_oas_lun_status); in lpfc_oas_lun_status_show()
3378 * lpfc_oas_lun_state_set - enable or disable a lun for Optimized Access Storage
3389 * -EPERM OAS is not enabled or not supported by this port.
3400 if (!phba->cfg_fof) in lpfc_oas_lun_state_set()
3401 return -EPERM; in lpfc_oas_lun_state_set()
3407 rc = -ENOMEM; in lpfc_oas_lun_state_set()
3417 * lpfc_oas_lun_get_next - get the next lun that has been enabled for Optimized
3443 phba->sli4_hba.oas_next_vpt_wwpn, in lpfc_oas_lun_get_next()
3445 phba->sli4_hba.oas_next_tgt_wwpn, in lpfc_oas_lun_get_next()
3446 &phba->sli4_hba.oas_next_lun, in lpfc_oas_lun_get_next()
3456 * lpfc_oas_lun_state_change - enable/disable a lun for OAS operations
3469 * -ENOMEM: failed to enable an lun for OAS operations
3470 * -EPERM: OAS is not enabled
3486 * lpfc_oas_lun_show - Return oas enabled luns from a chosen target
3496 * -EFAULT: target or vport wwpn was not set properly.
3497 * -EPERM: oas is not enabled.
3504 struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba; in lpfc_oas_lun_show()
3509 if (!phba->cfg_fof) in lpfc_oas_lun_show()
3510 return -EPERM; in lpfc_oas_lun_show()
3512 if (wwn_to_u64(phba->cfg_oas_vpt_wwpn) == 0) in lpfc_oas_lun_show()
3513 if (!(phba->cfg_oas_flags & OAS_FIND_ANY_VPORT)) in lpfc_oas_lun_show()
3514 return -EFAULT; in lpfc_oas_lun_show()
3516 if (wwn_to_u64(phba->cfg_oas_tgt_wwpn) == 0) in lpfc_oas_lun_show()
3517 if (!(phba->cfg_oas_flags & OAS_FIND_ANY_TARGET)) in lpfc_oas_lun_show()
3518 return -EFAULT; in lpfc_oas_lun_show()
3520 oas_lun = lpfc_oas_lun_get_next(phba, phba->cfg_oas_vpt_wwpn, in lpfc_oas_lun_show()
3521 phba->cfg_oas_tgt_wwpn, in lpfc_oas_lun_show()
3522 &phba->cfg_oas_lun_status, in lpfc_oas_lun_show()
3523 &phba->cfg_oas_priority); in lpfc_oas_lun_show()
3525 phba->cfg_oas_flags |= OAS_LUN_VALID; in lpfc_oas_lun_show()
3527 len += scnprintf(buf + len, PAGE_SIZE-len, "0x%llx", oas_lun); in lpfc_oas_lun_show()
3533 * lpfc_oas_lun_store - Sets the OAS state for lun
3544 * -EFAULT: target or vport wwpn was not set properly.
3545 * -EPERM: oas is not enabled.
3553 struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba; in lpfc_oas_lun_store()
3558 if (!phba->cfg_fof) in lpfc_oas_lun_store()
3559 return -EPERM; in lpfc_oas_lun_store()
3561 if (wwn_to_u64(phba->cfg_oas_vpt_wwpn) == 0) in lpfc_oas_lun_store()
3562 return -EFAULT; in lpfc_oas_lun_store()
3564 if (wwn_to_u64(phba->cfg_oas_tgt_wwpn) == 0) in lpfc_oas_lun_store()
3565 return -EFAULT; in lpfc_oas_lun_store()
3568 return -EINVAL; in lpfc_oas_lun_store()
3571 return -EINVAL; in lpfc_oas_lun_store()
3573 pri = phba->cfg_oas_priority; in lpfc_oas_lun_store()
3575 pri = phba->cfg_XLanePriority; in lpfc_oas_lun_store()
3580 wwn_to_u64(phba->cfg_oas_vpt_wwpn), in lpfc_oas_lun_store()
3581 wwn_to_u64(phba->cfg_oas_tgt_wwpn), scsi_lun, in lpfc_oas_lun_store()
3582 pri, phba->cfg_oas_lun_state); in lpfc_oas_lun_store()
3584 rc = lpfc_oas_lun_state_change(phba, phba->cfg_oas_vpt_wwpn, in lpfc_oas_lun_store()
3585 phba->cfg_oas_tgt_wwpn, scsi_lun, in lpfc_oas_lun_store()
3586 phba->cfg_oas_lun_state, pri); in lpfc_oas_lun_store()
3605 " 0 - none,"
3606 " 1 - poll with interrupts enabled"
3607 " 3 - poll and disable FCP ring interrupts");
3618 "SLI mode selector: 3 - select SLI-3");
3659 struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba; in lpfc_pls_show()
3662 phba->sli4_hba.pc_sli4_params.pls); in lpfc_pls_show()
3671 struct lpfc_hba *phba = ((struct lpfc_vport *)shost->hostdata)->phba; in lpfc_pt_show()
3674 (phba->hba_flag & HBA_PERSISTENT_TOPO) ? 1 : 0); in lpfc_pt_show()
3681 # 1 - (1024)
3682 # 2 - (2048)
3683 # 3 - (3072)
3684 # 4 - (4096)
3685 # 5 - (5120)
3691 struct lpfc_hba *phba = ((struct lpfc_vport *) shost->hostdata)->phba; in lpfc_iocb_hw_show()
3693 return scnprintf(buf, PAGE_SIZE, "%d\n", phba->iocb_max); in lpfc_iocb_hw_show()
3702 struct lpfc_hba *phba = ((struct lpfc_vport *) shost->hostdata)->phba; in lpfc_txq_hw_show()
3706 pring ? pring->txq_max : 0); in lpfc_txq_hw_show()
3716 struct lpfc_hba *phba = ((struct lpfc_vport *) shost->hostdata)->phba; in lpfc_txcmplq_hw_show()
3720 pring ? pring->txcmplq_max : 0); in lpfc_txcmplq_hw_show()
3738 * lpfc_nodev_tmo_show - Return the hba dev loss timeout value
3750 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_nodev_tmo_show()
3752 return scnprintf(buf, PAGE_SIZE, "%d\n", vport->cfg_devloss_tmo); in lpfc_nodev_tmo_show()
3756 * lpfc_nodev_tmo_init - Set the hba nodev timeout value
3768 * -EINVAL val out of range
3773 if (vport->cfg_devloss_tmo != LPFC_DEF_DEVLOSS_TMO) { in lpfc_nodev_tmo_init()
3774 vport->cfg_nodev_tmo = vport->cfg_devloss_tmo; in lpfc_nodev_tmo_init()
3784 vport->cfg_nodev_tmo = val; in lpfc_nodev_tmo_init()
3785 vport->cfg_devloss_tmo = val; in lpfc_nodev_tmo_init()
3792 vport->cfg_nodev_tmo = LPFC_DEF_DEVLOSS_TMO; in lpfc_nodev_tmo_init()
3793 return -EINVAL; in lpfc_nodev_tmo_init()
3797 * lpfc_update_rport_devloss_tmo - Update dev loss tmo value
3814 spin_lock_irq(shost->host_lock); in lpfc_update_rport_devloss_tmo()
3815 list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) { in lpfc_update_rport_devloss_tmo()
3816 if (ndlp->rport) in lpfc_update_rport_devloss_tmo()
3817 ndlp->rport->dev_loss_tmo = vport->cfg_devloss_tmo; in lpfc_update_rport_devloss_tmo()
3819 spin_lock(&ndlp->lock); in lpfc_update_rport_devloss_tmo()
3822 remoteport = rport->remoteport; in lpfc_update_rport_devloss_tmo()
3823 spin_unlock(&ndlp->lock); in lpfc_update_rport_devloss_tmo()
3826 vport->cfg_devloss_tmo); in lpfc_update_rport_devloss_tmo()
3829 spin_unlock_irq(shost->host_lock); in lpfc_update_rport_devloss_tmo()
3833 * lpfc_nodev_tmo_set - Set the vport nodev tmo and devloss tmo values
3845 * -EINVAL val out of range
3850 if (vport->dev_loss_tmo_changed || in lpfc_nodev_tmo_set()
3858 vport->cfg_nodev_tmo = val; in lpfc_nodev_tmo_set()
3859 vport->cfg_devloss_tmo = val; in lpfc_nodev_tmo_set()
3872 return -EINVAL; in lpfc_nodev_tmo_set()
3893 * lpfc_devloss_tmo_set - Sets vport nodev tmo, devloss tmo values, changed bit in lpfc_vport_param_init()
3904 * -EINVAL val out of range in lpfc_vport_param_init()
3910 vport->cfg_nodev_tmo = val; in lpfc_vport_param_init()
3911 vport->cfg_devloss_tmo = val; in lpfc_vport_param_init()
3912 vport->dev_loss_tmo_changed = 1; in lpfc_vport_param_init()
3922 return -EINVAL; in lpfc_vport_param_init()
3959 * Supported Values: 1 - register just FCP
3960 * 3 - register both FCP and NVME
3965 "Enable FC4 Protocol support - FCP / NVME");
3974 "Verbose logging bit-mask");
4010 * -EINVAL if val is invalid
4019 return -EINVAL; in lpfc_tgt_queue_depth_set()
4021 if (val == vport->cfg_tgt_queue_depth) in lpfc_tgt_queue_depth_set()
4024 spin_lock_irq(shost->host_lock); in lpfc_tgt_queue_depth_set()
4025 vport->cfg_tgt_queue_depth = val; in lpfc_tgt_queue_depth_set()
4028 list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) in lpfc_tgt_queue_depth_set()
4029 ndlp->cmd_qdepth = vport->cfg_tgt_queue_depth; in lpfc_tgt_queue_depth_set()
4031 spin_unlock_irq(shost->host_lock); in lpfc_tgt_queue_depth_set()
4079 * lpfc_restrict_login_init - Set the vport restrict login flag
4091 * -EINVAL val out of range
4101 vport->cfg_restrict_login = 1; in lpfc_restrict_login_init()
4102 return -EINVAL; in lpfc_restrict_login_init()
4104 if (vport->port_type == LPFC_PHYSICAL_PORT) { in lpfc_restrict_login_init()
4105 vport->cfg_restrict_login = 0; in lpfc_restrict_login_init()
4108 vport->cfg_restrict_login = val; in lpfc_restrict_login_init()
4113 * lpfc_restrict_login_set - Set the vport restrict login flag
4126 * -EINVAL val out of range
4136 vport->cfg_restrict_login = 1; in lpfc_restrict_login_set()
4137 return -EINVAL; in lpfc_restrict_login_set()
4139 if (vport->port_type == LPFC_PHYSICAL_PORT && val != 0) { in lpfc_restrict_login_set()
4143 vport->cfg_restrict_login = 0; in lpfc_restrict_login_set()
4146 vport->cfg_restrict_login = val; in lpfc_restrict_login_set()
4155 # Fibre channel "ALPA". In the FC-AL Profile there is an "informative
4161 # Turning on the scan-down variable (on = 1, off = 0) will
4174 # 0x0 = attempt loop mode then point-to-point
4176 # 0x02 = attempt point-to-point mode only
4178 # 0x06 = attempt point-to-point mode then loop
4179 # Set point-to-point mode if you want to run as an N_Port.
4187 * lpfc_topology_store - Set the adapters topology field
4201 * non-zero return value from lpfc_issue_lip()
4202 * -EINVAL val out of range
4209 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_topology_store()
4210 struct lpfc_hba *phba = vport->phba; in lpfc_topology_store()
4224 return -EINVAL; in lpfc_topology_store()
4226 return -EINVAL; in lpfc_topology_store()
4229 prev_val = phba->cfg_topology; in lpfc_topology_store()
4230 if (phba->cfg_link_speed == LPFC_USER_LINK_SPEED_16G && in lpfc_topology_store()
4235 return -EINVAL; in lpfc_topology_store()
4239 * - persistent topology enabled in lpfc_topology_store()
4240 * - ASIC_GEN_NUM >= 0xC, with no private loop support in lpfc_topology_store()
4243 &phba->sli4_hba.sli_intf); in lpfc_topology_store()
4245 &phba->sli4_hba.sli_intf); in lpfc_topology_store()
4246 if ((phba->hba_flag & HBA_PERSISTENT_TOPO || in lpfc_topology_store()
4247 (!phba->sli4_hba.pc_sli4_params.pls && in lpfc_topology_store()
4253 return -EINVAL; in lpfc_topology_store()
4255 phba->cfg_topology = val; in lpfc_topology_store()
4262 if (prev_val != val && phba->sli_rev == LPFC_SLI_REV4) in lpfc_topology_store()
4263 phba->fc_topology_changed = 1; in lpfc_topology_store()
4264 err = lpfc_issue_lip(lpfc_shost_from_vport(phba->pport)); in lpfc_topology_store()
4266 phba->cfg_topology = prev_val; in lpfc_topology_store()
4267 return -EINVAL; in lpfc_topology_store()
4274 phba->brd_no, val); in lpfc_topology_store()
4275 return -EINVAL; in lpfc_topology_store()
4297 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_static_vport_show()
4298 if (vport->vport_flag & STATIC_VPORT) in lpfc_static_vport_show()
4312 * lpfc_stat_data_ctrl_store - write call back for lpfc_stat_data_ctrl sysfs file
4336 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_stat_data_ctrl_store()
4337 struct lpfc_hba *phba = vport->phba; in lpfc_stat_data_ctrl_store()
4348 if (strlen(buf) > (LPFC_MAX_DATA_CTRL_LEN - 1)) in lpfc_stat_data_ctrl_store()
4349 return -EINVAL; in lpfc_stat_data_ctrl_store()
4353 /* Ignore this token - this is command token */ in lpfc_stat_data_ctrl_store()
4356 return -EINVAL; in lpfc_stat_data_ctrl_store()
4360 return -EINVAL; in lpfc_stat_data_ctrl_store()
4367 return -EINVAL; in lpfc_stat_data_ctrl_store()
4371 return -EINVAL; in lpfc_stat_data_ctrl_store()
4376 return -EINVAL; in lpfc_stat_data_ctrl_store()
4379 return -EINVAL; in lpfc_stat_data_ctrl_store()
4384 return -ENOMEM; in lpfc_stat_data_ctrl_store()
4386 for (i = 0; i <= phba->max_vports && vports[i] != NULL; i++) { in lpfc_stat_data_ctrl_store()
4388 spin_lock_irq(v_shost->host_lock); in lpfc_stat_data_ctrl_store()
4390 vports[i]->stat_data_blocked = 1; in lpfc_stat_data_ctrl_store()
4391 if (vports[i]->stat_data_enabled) in lpfc_stat_data_ctrl_store()
4393 spin_unlock_irq(v_shost->host_lock); in lpfc_stat_data_ctrl_store()
4397 phba->bucket_type = bucket_type; in lpfc_stat_data_ctrl_store()
4398 phba->bucket_base = base; in lpfc_stat_data_ctrl_store()
4399 phba->bucket_step = step; in lpfc_stat_data_ctrl_store()
4401 for (i = 0; i <= phba->max_vports && vports[i] != NULL; i++) { in lpfc_stat_data_ctrl_store()
4405 spin_lock_irq(v_shost->host_lock); in lpfc_stat_data_ctrl_store()
4406 vports[i]->stat_data_blocked = 0; in lpfc_stat_data_ctrl_store()
4407 spin_unlock_irq(v_shost->host_lock); in lpfc_stat_data_ctrl_store()
4416 return -ENOMEM; in lpfc_stat_data_ctrl_store()
4418 for (i = 0; i <= phba->max_vports && vports[i] != NULL; i++) { in lpfc_stat_data_ctrl_store()
4420 spin_lock_irq(shost->host_lock); in lpfc_stat_data_ctrl_store()
4421 vports[i]->stat_data_blocked = 1; in lpfc_stat_data_ctrl_store()
4423 vport->stat_data_enabled = 0; in lpfc_stat_data_ctrl_store()
4424 vports[i]->stat_data_blocked = 0; in lpfc_stat_data_ctrl_store()
4425 spin_unlock_irq(shost->host_lock); in lpfc_stat_data_ctrl_store()
4428 phba->bucket_type = LPFC_NO_BUCKET; in lpfc_stat_data_ctrl_store()
4429 phba->bucket_base = 0; in lpfc_stat_data_ctrl_store()
4430 phba->bucket_step = 0; in lpfc_stat_data_ctrl_store()
4436 if (phba->bucket_type == LPFC_NO_BUCKET) in lpfc_stat_data_ctrl_store()
4437 return -EINVAL; in lpfc_stat_data_ctrl_store()
4438 spin_lock_irq(shost->host_lock); in lpfc_stat_data_ctrl_store()
4439 if (vport->stat_data_enabled) { in lpfc_stat_data_ctrl_store()
4440 spin_unlock_irq(shost->host_lock); in lpfc_stat_data_ctrl_store()
4444 vport->stat_data_enabled = 1; in lpfc_stat_data_ctrl_store()
4445 spin_unlock_irq(shost->host_lock); in lpfc_stat_data_ctrl_store()
4450 spin_lock_irq(shost->host_lock); in lpfc_stat_data_ctrl_store()
4451 if (vport->stat_data_enabled == 0) { in lpfc_stat_data_ctrl_store()
4452 spin_unlock_irq(shost->host_lock); in lpfc_stat_data_ctrl_store()
4456 vport->stat_data_enabled = 0; in lpfc_stat_data_ctrl_store()
4457 spin_unlock_irq(shost->host_lock); in lpfc_stat_data_ctrl_store()
4462 if ((phba->bucket_type == LPFC_NO_BUCKET) in lpfc_stat_data_ctrl_store()
4463 || !vport->stat_data_enabled) in lpfc_stat_data_ctrl_store()
4465 spin_lock_irq(shost->host_lock); in lpfc_stat_data_ctrl_store()
4466 vport->stat_data_blocked = 1; in lpfc_stat_data_ctrl_store()
4468 vport->stat_data_blocked = 0; in lpfc_stat_data_ctrl_store()
4469 spin_unlock_irq(shost->host_lock); in lpfc_stat_data_ctrl_store()
4472 return -EINVAL; in lpfc_stat_data_ctrl_store()
4477 * lpfc_stat_data_ctrl_show - Read function for lpfc_stat_data_ctrl sysfs file
4491 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_stat_data_ctrl_show()
4492 struct lpfc_hba *phba = vport->phba; in lpfc_stat_data_ctrl_show()
4498 switch (phba->bucket_type) { in lpfc_stat_data_ctrl_show()
4513 vport->stat_data_enabled, vport->stat_data_blocked, in lpfc_stat_data_ctrl_show()
4514 bucket_type, phba->bucket_base, phba->bucket_step); in lpfc_stat_data_ctrl_show()
4516 if (phba->bucket_type != LPFC_NO_BUCKET) { in lpfc_stat_data_ctrl_show()
4518 if (phba->bucket_type == LPFC_LINEAR_BUCKET) in lpfc_stat_data_ctrl_show()
4519 bucket_value = phba->bucket_base + in lpfc_stat_data_ctrl_show()
4520 phba->bucket_step * i; in lpfc_stat_data_ctrl_show()
4522 bucket_value = phba->bucket_base + in lpfc_stat_data_ctrl_show()
4523 (1 << i) * phba->bucket_step; in lpfc_stat_data_ctrl_show()
4554 * sysfs_drvr_stat_data_read - Read function for lpfc_drvr_stat_data attribute
4574 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in sysfs_drvr_stat_data_read()
4575 struct lpfc_hba *phba = vport->phba; in sysfs_drvr_stat_data_read()
4582 if (!vport->stat_data_enabled || vport->stat_data_blocked in sysfs_drvr_stat_data_read()
4583 || (phba->bucket_type == LPFC_NO_BUCKET)) in sysfs_drvr_stat_data_read()
4586 spin_lock_irq(shost->host_lock); in sysfs_drvr_stat_data_read()
4587 list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) { in sysfs_drvr_stat_data_read()
4588 if (!ndlp->lat_data) in sysfs_drvr_stat_data_read()
4592 nport_index--; in sysfs_drvr_stat_data_read()
4600 if (!ndlp->lat_data) in sysfs_drvr_stat_data_read()
4605 ndlp->nlp_portname.u.wwn[0], in sysfs_drvr_stat_data_read()
4606 ndlp->nlp_portname.u.wwn[1], in sysfs_drvr_stat_data_read()
4607 ndlp->nlp_portname.u.wwn[2], in sysfs_drvr_stat_data_read()
4608 ndlp->nlp_portname.u.wwn[3], in sysfs_drvr_stat_data_read()
4609 ndlp->nlp_portname.u.wwn[4], in sysfs_drvr_stat_data_read()
4610 ndlp->nlp_portname.u.wwn[5], in sysfs_drvr_stat_data_read()
4611 ndlp->nlp_portname.u.wwn[6], in sysfs_drvr_stat_data_read()
4612 ndlp->nlp_portname.u.wwn[7]); in sysfs_drvr_stat_data_read()
4618 ndlp->lat_data[i].cmd_count); in sysfs_drvr_stat_data_read()
4624 spin_unlock_irq(shost->host_lock); in sysfs_drvr_stat_data_read()
4644 * lpfc_link_speed_store - Set the adapters link speed
4659 * non-zero return value from lpfc_issue_lip()
4660 * -EINVAL val out of range
4667 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_link_speed_store()
4668 struct lpfc_hba *phba = vport->phba; in lpfc_link_speed_store()
4675 if_type = bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf); in lpfc_link_speed_store()
4677 phba->hba_flag & HBA_FORCED_LINK_SPEED) in lpfc_link_speed_store()
4678 return -EPERM; in lpfc_link_speed_store()
4686 return -EINVAL; in lpfc_link_speed_store()
4688 return -EINVAL; in lpfc_link_speed_store()
4692 phba->cfg_link_speed, val, nolip ? "(nolip)" : "(lip)"); in lpfc_link_speed_store()
4694 if (((val == LPFC_USER_LINK_SPEED_1G) && !(phba->lmt & LMT_1Gb)) || in lpfc_link_speed_store()
4695 ((val == LPFC_USER_LINK_SPEED_2G) && !(phba->lmt & LMT_2Gb)) || in lpfc_link_speed_store()
4696 ((val == LPFC_USER_LINK_SPEED_4G) && !(phba->lmt & LMT_4Gb)) || in lpfc_link_speed_store()
4697 ((val == LPFC_USER_LINK_SPEED_8G) && !(phba->lmt & LMT_8Gb)) || in lpfc_link_speed_store()
4698 ((val == LPFC_USER_LINK_SPEED_10G) && !(phba->lmt & LMT_10Gb)) || in lpfc_link_speed_store()
4699 ((val == LPFC_USER_LINK_SPEED_16G) && !(phba->lmt & LMT_16Gb)) || in lpfc_link_speed_store()
4700 ((val == LPFC_USER_LINK_SPEED_32G) && !(phba->lmt & LMT_32Gb)) || in lpfc_link_speed_store()
4701 ((val == LPFC_USER_LINK_SPEED_64G) && !(phba->lmt & LMT_64Gb))) { in lpfc_link_speed_store()
4706 return -EINVAL; in lpfc_link_speed_store()
4709 phba->fc_topology == LPFC_TOPOLOGY_LOOP) { in lpfc_link_speed_store()
4714 return -EINVAL; in lpfc_link_speed_store()
4726 prev_val = phba->cfg_link_speed; in lpfc_link_speed_store()
4727 phba->cfg_link_speed = val; in lpfc_link_speed_store()
4731 err = lpfc_issue_lip(lpfc_shost_from_vport(phba->pport)); in lpfc_link_speed_store()
4733 phba->cfg_link_speed = prev_val; in lpfc_link_speed_store()
4734 return -EINVAL; in lpfc_link_speed_store()
4745 return -EINVAL; in lpfc_link_speed_store()
4755 * lpfc_link_speed_init - Set the adapters link speed in lpfc_param_show()
4768 * -EINVAL val out of range in lpfc_param_show()
4773 if (val >= LPFC_USER_LINK_SPEED_16G && phba->cfg_topology == 4) { in lpfc_param_show()
4778 phba->cfg_topology = 0; in lpfc_param_show()
4790 phba->cfg_link_speed = val; in lpfc_param_show()
4797 phba->cfg_link_speed = LPFC_USER_LINK_SPEED_AUTO; in lpfc_param_show()
4798 return -EINVAL; in lpfc_param_show()
4815 * lpfc_aer_support_store - Set the adapter for aer support in lpfc_param_show()
4839 * -EINVAL if val out of range or intended mode is not supported. in lpfc_param_show()
4846 struct lpfc_vport *vport = (struct lpfc_vport *)shost->hostdata; in lpfc_param_show()
4847 struct lpfc_hba *phba = vport->phba; in lpfc_param_show()
4848 int val = 0, rc = -EINVAL; in lpfc_param_show()
4851 return -EINVAL; in lpfc_param_show()
4853 return -EINVAL; in lpfc_param_show()
4857 if (phba->hba_flag & HBA_AER_ENABLED) { in lpfc_param_show()
4858 rc = pci_disable_pcie_error_reporting(phba->pcidev); in lpfc_param_show()
4860 spin_lock_irq(&phba->hbalock); in lpfc_param_show()
4861 phba->hba_flag &= ~HBA_AER_ENABLED; in lpfc_param_show()
4862 spin_unlock_irq(&phba->hbalock); in lpfc_param_show()
4863 phba->cfg_aer_support = 0; in lpfc_param_show()
4866 rc = -EPERM; in lpfc_param_show()
4868 phba->cfg_aer_support = 0; in lpfc_param_show()
4873 if (!(phba->hba_flag & HBA_AER_ENABLED)) { in lpfc_param_show()
4874 rc = pci_enable_pcie_error_reporting(phba->pcidev); in lpfc_param_show()
4876 spin_lock_irq(&phba->hbalock); in lpfc_param_show()
4877 phba->hba_flag |= HBA_AER_ENABLED; in lpfc_param_show()
4878 spin_unlock_irq(&phba->hbalock); in lpfc_param_show()
4879 phba->cfg_aer_support = 1; in lpfc_param_show()
4882 rc = -EPERM; in lpfc_param_show()
4884 phba->cfg_aer_support = 1; in lpfc_param_show()
4889 rc = -EINVAL; in lpfc_param_show()
4898 * lpfc_aer_cleanup_state - Clean up aer state to the aer enabled device
4913 * -EINVAL if the buf does not contain the 1 or the device is not currently
4921 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_aer_cleanup_state()
4922 struct lpfc_hba *phba = vport->phba; in lpfc_aer_cleanup_state()
4923 int val, rc = -1; in lpfc_aer_cleanup_state()
4926 return -EINVAL; in lpfc_aer_cleanup_state()
4928 return -EINVAL; in lpfc_aer_cleanup_state()
4930 return -EINVAL; in lpfc_aer_cleanup_state()
4932 if (phba->hba_flag & HBA_AER_ENABLED) in lpfc_aer_cleanup_state()
4933 rc = pci_aer_clear_nonfatal_status(phba->pcidev); in lpfc_aer_cleanup_state()
4938 return -EPERM; in lpfc_aer_cleanup_state()
4945 * lpfc_sriov_nr_virtfn_store - Enable the adapter for sr-iov virtual functions
4954 * try to enable or disable SR-IOV virtual functions according to the
4964 * cfg_sriov_nr_virtfn; otherwise, -EINVAL shall be returned and driver
4967 * If none-zero virtual functions have already been enabled to the
4969 * -EINVAL will be returned and the driver does nothing;
4971 * If the nr_vfn provided is zero and none-zero virtual functions have
4981 * -EINVAL if val out of range or intended mode is not supported.
4988 struct lpfc_vport *vport = (struct lpfc_vport *)shost->hostdata; in lpfc_sriov_nr_virtfn_store()
4989 struct lpfc_hba *phba = vport->phba; in lpfc_sriov_nr_virtfn_store()
4990 struct pci_dev *pdev = phba->pcidev; in lpfc_sriov_nr_virtfn_store()
4991 int val = 0, rc = -EINVAL; in lpfc_sriov_nr_virtfn_store()
4995 return -EINVAL; in lpfc_sriov_nr_virtfn_store()
4997 return -EINVAL; in lpfc_sriov_nr_virtfn_store()
4999 return -EINVAL; in lpfc_sriov_nr_virtfn_store()
5003 if (phba->cfg_sriov_nr_virtfn > 0) { in lpfc_sriov_nr_virtfn_store()
5005 phba->cfg_sriov_nr_virtfn = 0; in lpfc_sriov_nr_virtfn_store()
5011 if (phba->cfg_sriov_nr_virtfn > 0) { in lpfc_sriov_nr_virtfn_store()
5015 phba->cfg_sriov_nr_virtfn); in lpfc_sriov_nr_virtfn_store()
5016 return -EEXIST; in lpfc_sriov_nr_virtfn_store()
5020 phba->cfg_sriov_nr_virtfn = val; in lpfc_sriov_nr_virtfn_store()
5025 return -EINVAL; in lpfc_sriov_nr_virtfn_store()
5028 rc = lpfc_sli_probe_sriov_nr_virtfn(phba, phba->cfg_sriov_nr_virtfn); in lpfc_sriov_nr_virtfn_store()
5030 phba->cfg_sriov_nr_virtfn = 0; in lpfc_sriov_nr_virtfn_store()
5031 rc = -EPERM; in lpfc_sriov_nr_virtfn_store()
5039 "Enable PCIe device SR-IOV virtual fn");
5045 * lpfc_request_firmware_upgrade_store - Request for Linux generic firmware upgrade
5057 * -EINVAL if val out of range or intended mode is not supported.
5065 struct lpfc_vport *vport = (struct lpfc_vport *)shost->hostdata; in lpfc_request_firmware_upgrade_store()
5066 struct lpfc_hba *phba = vport->phba; in lpfc_request_firmware_upgrade_store()
5071 return -EINVAL; in lpfc_request_firmware_upgrade_store()
5073 return -EINVAL; in lpfc_request_firmware_upgrade_store()
5075 return -EINVAL; in lpfc_request_firmware_upgrade_store()
5079 rc = -EPERM; in lpfc_request_firmware_upgrade_store()
5091 * lpfc_request_firmware_upgrade_init - Enable initial linux generic fw upgrade in lpfc_param_show()
5100 * -EINVAL val out of range in lpfc_param_show()
5106 phba->cfg_request_firmware_upgrade = val; in lpfc_param_show()
5109 return -EINVAL; in lpfc_param_show()
5129 * 0 - on success
5130 * -EIO - if command is not sent
5137 struct lpfc_vport *vport = (struct lpfc_vport *)shost->hostdata; in lpfc_force_rscn_store()
5142 return -EIO; in lpfc_force_rscn_store()
5159 * lpfc_force_rscn_init - Force an RSCN to be sent to all remote NPorts in lpfc_param_show()
5178 * @buf: string with the number of fast-path FCP interrupts per second.
5183 * maximum number of fast-path FCP interrupts per second.
5188 * -EINVAL if val out of range or intended mode is not supported.
5195 struct lpfc_vport *vport = (struct lpfc_vport *)shost->hostdata; in lpfc_fcp_imax_store()
5196 struct lpfc_hba *phba = vport->phba; in lpfc_fcp_imax_store()
5202 if (phba->sli_rev != LPFC_SLI_REV4) in lpfc_fcp_imax_store()
5203 return -EINVAL; in lpfc_fcp_imax_store()
5207 return -EINVAL; in lpfc_fcp_imax_store()
5209 return -EINVAL; in lpfc_fcp_imax_store()
5217 return -EINVAL; in lpfc_fcp_imax_store()
5219 phba->cfg_auto_imax = (val) ? 0 : 1; in lpfc_fcp_imax_store()
5220 if (phba->cfg_fcp_imax && !val) { in lpfc_fcp_imax_store()
5221 queue_delayed_work(phba->wq, &phba->eq_delay_work, in lpfc_fcp_imax_store()
5225 eqi = per_cpu_ptr(phba->sli4_hba.eq_info, i); in lpfc_fcp_imax_store()
5226 eqi->icnt = 0; in lpfc_fcp_imax_store()
5230 phba->cfg_fcp_imax = (uint32_t)val; in lpfc_fcp_imax_store()
5232 if (phba->cfg_fcp_imax) in lpfc_fcp_imax_store()
5233 usdelay = LPFC_SEC_TO_USEC / phba->cfg_fcp_imax; in lpfc_fcp_imax_store()
5237 for (i = 0; i < phba->cfg_irq_chann; i += LPFC_MAX_EQ_DELAY_EQID_CNT) in lpfc_fcp_imax_store()
5245 # lpfc_fcp_imax: The maximum number of fast-path FCP interrupts per second
5257 * lpfc_fcp_imax_init - Set the initial sr-iov virtual function enable in lpfc_param_show()
5263 * maximum number of fast-path FCP interrupts per second. in lpfc_param_show()
5267 * -EINVAL val out of range in lpfc_param_show()
5272 if (phba->sli_rev != LPFC_SLI_REV4) { in lpfc_param_show()
5273 phba->cfg_fcp_imax = 0; in lpfc_param_show()
5279 phba->cfg_fcp_imax = val; in lpfc_param_show()
5286 phba->cfg_fcp_imax = LPFC_DEF_IMAX; in lpfc_param_show()
5306 * -ERANGE: if val is not in the valid range
5307 * -EINVAL: if bad value format or intended mode is not supported.
5314 struct lpfc_vport *vport = (struct lpfc_vport *)shost->hostdata; in lpfc_cq_max_proc_limit_store()
5315 struct lpfc_hba *phba = vport->phba; in lpfc_cq_max_proc_limit_store()
5321 if (phba->sli_rev != LPFC_SLI_REV4) in lpfc_cq_max_proc_limit_store()
5322 return -EINVAL; in lpfc_cq_max_proc_limit_store()
5326 return -EINVAL; in lpfc_cq_max_proc_limit_store()
5328 return -EINVAL; in lpfc_cq_max_proc_limit_store()
5331 return -ERANGE; in lpfc_cq_max_proc_limit_store()
5333 phba->cfg_cq_max_proc_limit = (uint32_t)val; in lpfc_cq_max_proc_limit_store()
5336 for (i = 0; i < phba->cfg_irq_chann; i++) { in lpfc_cq_max_proc_limit_store()
5338 eq = phba->sli4_hba.hba_eq_hdl[i].eq; in lpfc_cq_max_proc_limit_store()
5342 list_for_each_entry(cq, &eq->child_list, list) in lpfc_cq_max_proc_limit_store()
5343 cq->max_proc_limit = min(phba->cfg_cq_max_proc_limit, in lpfc_cq_max_proc_limit_store()
5344 cq->entry_count); in lpfc_cq_max_proc_limit_store()
5364 * than re-enabling interrupts.
5372 * lpfc_cq_max_proc_limit_init - Set the initial cq max_proc_limit
5388 phba->cfg_cq_max_proc_limit = LPFC_CQ_DEF_MAX_PROC_LIMIT; in lpfc_cq_max_proc_limit_init()
5390 if (phba->sli_rev != LPFC_SLI_REV4) in lpfc_cq_max_proc_limit_init()
5394 phba->cfg_cq_max_proc_limit = val; in lpfc_cq_max_proc_limit_init()
5401 phba->cfg_cq_max_proc_limit); in lpfc_cq_max_proc_limit_init()
5409 * lpfc_fcp_cpu_map_show - Display current driver CPU affinity
5421 struct lpfc_vport *vport = (struct lpfc_vport *)shost->hostdata; in lpfc_fcp_cpu_map_show()
5422 struct lpfc_hba *phba = vport->phba; in lpfc_fcp_cpu_map_show()
5426 if ((phba->sli_rev != LPFC_SLI_REV4) || in lpfc_fcp_cpu_map_show()
5427 (phba->intr_type != MSIX)) in lpfc_fcp_cpu_map_show()
5430 switch (phba->cfg_fcp_cpu_map) { in lpfc_fcp_cpu_map_show()
5432 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_fcp_cpu_map_show()
5434 phba->cfg_fcp_cpu_map); in lpfc_fcp_cpu_map_show()
5437 len += scnprintf(buf + len, PAGE_SIZE-len, in lpfc_fcp_cpu_map_show()
5438 "fcp_cpu_map: HBA centric mapping (%d): " in lpfc_fcp_cpu_map_show()
5440 phba->cfg_fcp_cpu_map, num_online_cpus(), in lpfc_fcp_cpu_map_show()
5442 phba->sli4_hba.num_possible_cpu); in lpfc_fcp_cpu_map_show()
5446 while (phba->sli4_hba.curr_disp_cpu < in lpfc_fcp_cpu_map_show()
5447 phba->sli4_hba.num_possible_cpu) { in lpfc_fcp_cpu_map_show()
5448 cpup = &phba->sli4_hba.cpu_map[phba->sli4_hba.curr_disp_cpu]; in lpfc_fcp_cpu_map_show()
5450 if (!cpu_present(phba->sli4_hba.curr_disp_cpu)) in lpfc_fcp_cpu_map_show()
5451 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_fcp_cpu_map_show()
5452 "CPU %02d not present\n", in lpfc_fcp_cpu_map_show()
5453 phba->sli4_hba.curr_disp_cpu); in lpfc_fcp_cpu_map_show()
5454 else if (cpup->eq == LPFC_VECTOR_MAP_EMPTY) { in lpfc_fcp_cpu_map_show()
5455 if (cpup->hdwq == LPFC_VECTOR_MAP_EMPTY) in lpfc_fcp_cpu_map_show()
5457 buf + len, PAGE_SIZE - len, in lpfc_fcp_cpu_map_show()
5458 "CPU %02d hdwq None " in lpfc_fcp_cpu_map_show()
5460 phba->sli4_hba.curr_disp_cpu, in lpfc_fcp_cpu_map_show()
5461 cpup->phys_id, cpup->core_id, in lpfc_fcp_cpu_map_show()
5462 (cpup->flag & LPFC_CPU_MAP_HYPER), in lpfc_fcp_cpu_map_show()
5463 (cpup->flag & LPFC_CPU_MAP_UNASSIGN)); in lpfc_fcp_cpu_map_show()
5466 buf + len, PAGE_SIZE - len, in lpfc_fcp_cpu_map_show()
5467 "CPU %02d EQ None hdwq %04d " in lpfc_fcp_cpu_map_show()
5469 phba->sli4_hba.curr_disp_cpu, in lpfc_fcp_cpu_map_show()
5470 cpup->hdwq, cpup->phys_id, in lpfc_fcp_cpu_map_show()
5471 cpup->core_id, in lpfc_fcp_cpu_map_show()
5472 (cpup->flag & LPFC_CPU_MAP_HYPER), in lpfc_fcp_cpu_map_show()
5473 (cpup->flag & LPFC_CPU_MAP_UNASSIGN)); in lpfc_fcp_cpu_map_show()
5475 if (cpup->hdwq == LPFC_VECTOR_MAP_EMPTY) in lpfc_fcp_cpu_map_show()
5477 buf + len, PAGE_SIZE - len, in lpfc_fcp_cpu_map_show()
5478 "CPU %02d hdwq None " in lpfc_fcp_cpu_map_show()
5480 phba->sli4_hba.curr_disp_cpu, in lpfc_fcp_cpu_map_show()
5481 cpup->phys_id, in lpfc_fcp_cpu_map_show()
5482 cpup->core_id, in lpfc_fcp_cpu_map_show()
5483 (cpup->flag & LPFC_CPU_MAP_HYPER), in lpfc_fcp_cpu_map_show()
5484 (cpup->flag & LPFC_CPU_MAP_UNASSIGN), in lpfc_fcp_cpu_map_show()
5485 lpfc_get_irq(cpup->eq)); in lpfc_fcp_cpu_map_show()
5488 buf + len, PAGE_SIZE - len, in lpfc_fcp_cpu_map_show()
5489 "CPU %02d EQ %04d hdwq %04d " in lpfc_fcp_cpu_map_show()
5491 phba->sli4_hba.curr_disp_cpu, in lpfc_fcp_cpu_map_show()
5492 cpup->eq, cpup->hdwq, cpup->phys_id, in lpfc_fcp_cpu_map_show()
5493 cpup->core_id, in lpfc_fcp_cpu_map_show()
5494 (cpup->flag & LPFC_CPU_MAP_HYPER), in lpfc_fcp_cpu_map_show()
5495 (cpup->flag & LPFC_CPU_MAP_UNASSIGN), in lpfc_fcp_cpu_map_show()
5496 lpfc_get_irq(cpup->eq)); in lpfc_fcp_cpu_map_show()
5499 phba->sli4_hba.curr_disp_cpu++; in lpfc_fcp_cpu_map_show()
5502 if (phba->sli4_hba.curr_disp_cpu < in lpfc_fcp_cpu_map_show()
5503 phba->sli4_hba.num_possible_cpu && in lpfc_fcp_cpu_map_show()
5504 (len >= (PAGE_SIZE - 64))) { in lpfc_fcp_cpu_map_show()
5506 PAGE_SIZE - len, "more...\n"); in lpfc_fcp_cpu_map_show()
5511 if (phba->sli4_hba.curr_disp_cpu == phba->sli4_hba.num_possible_cpu) in lpfc_fcp_cpu_map_show()
5512 phba->sli4_hba.curr_disp_cpu = 0; in lpfc_fcp_cpu_map_show()
5518 * lpfc_fcp_cpu_map_store - Change CPU affinity of driver vectors
5525 * -EINVAL - Not implemented yet.
5531 return -EINVAL; in lpfc_fcp_cpu_map_store()
5539 # 0 - Do not affinitze IRQ vectors
5540 # 1 - Affintize HBA vectors with respect to each HBA
5550 * lpfc_fcp_cpu_map_init - Set the initial sr-iov virtual function enable
5555 * If val is in a valid range [0-2], then affinitze the adapter's
5560 * -EINVAL val out of range
5565 if (phba->sli_rev != LPFC_SLI_REV4) { in lpfc_fcp_cpu_map_init()
5566 phba->cfg_fcp_cpu_map = 0; in lpfc_fcp_cpu_map_init()
5571 phba->cfg_fcp_cpu_map = val; in lpfc_fcp_cpu_map_init()
5578 phba->cfg_fcp_cpu_map = LPFC_HBA_CPU_MAP; in lpfc_fcp_cpu_map_init()
5613 * Parameter supported on physical port only - no NPIV support.
5634 # the parameter is set to a non-zero value, the I/O queue depth is controlled
5648 if (val == vport->cfg_max_scsicmpl_time) in lpfc_max_scsicmpl_time_set()
5651 return -EINVAL; in lpfc_max_scsicmpl_time_set()
5652 vport->cfg_max_scsicmpl_time = val; in lpfc_max_scsicmpl_time_set()
5654 spin_lock_irq(shost->host_lock); in lpfc_max_scsicmpl_time_set()
5655 list_for_each_entry_safe(ndlp, next_ndlp, &vport->fc_nodes, nlp_listp) { in lpfc_max_scsicmpl_time_set()
5656 if (ndlp->nlp_state == NLP_STE_UNUSED_NODE) in lpfc_max_scsicmpl_time_set()
5658 ndlp->cmd_qdepth = vport->cfg_tgt_queue_depth; in lpfc_max_scsicmpl_time_set()
5660 spin_unlock_irq(shost->host_lock); in lpfc_max_scsicmpl_time_set()
5684 * current CPU.
5689 * The driver dynamically sets this to 1 (BY_CPU) if it's able to set up cpu
5691 * CPU. Otherwise, the default 0 (Round Robin) scheduling of FCP/NVME I/Os
5698 "issuing commands [0] - Hardware Queue, [1] - Current CPU");
5710 "[0] - GID_FT, [1] - GID_PT");
5716 # For [1], bus reset issues target reset to non-FCP2 devices
5719 "FCP2 devices [0] - issue tgt reset, [1] - no tgt reset");
5772 # Traditional FDMI support means the driver will assume FDMI-2 support;
5773 # however, if that fails, it will fallback to FDMI-1.
5797 # there are FC targets, such as JBODs, that only recognize 8-bits of
5830 # 2 = MSI-X enabled (default)
5834 "MSI-X (2), if possible");
5893 * lpfc_cpumask_irq_mode_init - initalizes cpumask of phba based on
5900 unsigned int cpu, first_cpu, numa_node = NUMA_NO_NODE; in lpfc_cpumask_irq_mode_init() local
5902 struct cpumask *aff_mask = &phba->sli4_hba.irq_aff_mask; in lpfc_cpumask_irq_mode_init()
5906 if (phba->irq_chann_mode == NUMA_MODE) { in lpfc_cpumask_irq_mode_init()
5908 numa_node = dev_to_node(&phba->pcidev->dev); in lpfc_cpumask_irq_mode_init()
5910 phba->irq_chann_mode = NORMAL_MODE; in lpfc_cpumask_irq_mode_init()
5915 for_each_possible_cpu(cpu) { in lpfc_cpumask_irq_mode_init()
5916 switch (phba->irq_chann_mode) { in lpfc_cpumask_irq_mode_init()
5918 if (cpu_to_node(cpu) == numa_node) in lpfc_cpumask_irq_mode_init()
5919 cpumask_set_cpu(cpu, aff_mask); in lpfc_cpumask_irq_mode_init()
5922 sibling_mask = topology_sibling_cpumask(cpu); in lpfc_cpumask_irq_mode_init()
5941 phba->irq_chann_mode = NUMA_MODE; in lpfc_assign_default_irq_chann()
5945 phba->irq_chann_mode = NHT_MODE; in lpfc_assign_default_irq_chann()
5948 phba->irq_chann_mode = NORMAL_MODE; in lpfc_assign_default_irq_chann()
5953 phba->irq_chann_mode = NORMAL_MODE; in lpfc_assign_default_irq_chann()
5960 * of EQ / MSI-X vectors the driver will create. This should never be
5975 /* lpfc_irq_chann_init - Set the hba irq_chann initial value
5986 * -EINVAL if value was out of range
5993 if (phba->cfg_use_msi != 2) { in lpfc_irq_chann_init()
5996 phba->cfg_use_msi); in lpfc_irq_chann_init()
5997 phba->irq_chann_mode = NORMAL_MODE; in lpfc_irq_chann_init()
5998 phba->cfg_irq_chann = LPFC_IRQ_CHANN_DEF; in lpfc_irq_chann_init()
6004 phba->cfg_hdw_queue == LPFC_HBA_HDWQ_DEF && in lpfc_irq_chann_init()
6005 phba->sli_rev == LPFC_SLI_REV4) in lpfc_irq_chann_init()
6008 if (phba->irq_chann_mode != NORMAL_MODE) { in lpfc_irq_chann_init()
6009 aff_mask = &phba->sli4_hba.irq_aff_mask; in lpfc_irq_chann_init()
6015 phba->irq_chann_mode); in lpfc_irq_chann_init()
6016 phba->irq_chann_mode = NORMAL_MODE; in lpfc_irq_chann_init()
6017 phba->cfg_irq_chann = LPFC_IRQ_CHANN_DEF; in lpfc_irq_chann_init()
6019 phba->cfg_irq_chann = cpumask_weight(aff_mask); in lpfc_irq_chann_init()
6024 if (phba->irq_chann_mode == NHT_MODE) in lpfc_irq_chann_init()
6025 phba->cfg_hdw_queue = phba->cfg_irq_chann; in lpfc_irq_chann_init()
6029 "(mode: %d)\n", phba->cfg_irq_chann, in lpfc_irq_chann_init()
6030 phba->irq_chann_mode); in lpfc_irq_chann_init()
6041 phba->cfg_irq_chann = LPFC_IRQ_CHANN_DEF; in lpfc_irq_chann_init()
6042 return -EINVAL; in lpfc_irq_chann_init()
6044 if (phba->sli_rev == LPFC_SLI_REV4) { in lpfc_irq_chann_init()
6045 phba->cfg_irq_chann = val; in lpfc_irq_chann_init()
6047 phba->cfg_irq_chann = 2; in lpfc_irq_chann_init()
6048 phba->cfg_hdw_queue = 1; in lpfc_irq_chann_init()
6056 * lpfc_irq_chann_show - Display value of irq_chann
6068 struct lpfc_vport *vport = (struct lpfc_vport *)shost->hostdata; in lpfc_irq_chann_show()
6069 struct lpfc_hba *phba = vport->phba; in lpfc_irq_chann_show()
6071 return scnprintf(buf, PAGE_SIZE, "%u\n", phba->cfg_irq_chann); in lpfc_irq_chann_show()
6103 # 0x0 - 0x7f = CS_CTL field in FC header (high 7 bits)
6109 # lpfc_enable_bg: Enable BlockGuard (Emulex's Implementation of T10-DIF)
6118 # - Bit mask of host protection capabilities used to register with the
6119 # SCSI mid-layer
6120 # - Only meaningful if BG is turned on (lpfc_enable_bg=1).
6121 # - Allows you to ultimately specify which profiles to use
6122 # - Default will result in registering capabilities for all profiles.
6123 # - SHOST_DIF_TYPE1_PROTECTION 1
6125 # - SHOST_DIX_TYPE0_PROTECTION 8
6127 # - SHOST_DIX_TYPE1_PROTECTION 16
6139 "T10-DIF host protection capabilities mask");
6143 # - Bit mask of protection guard types to register with the SCSI mid-layer
6144 # - Guard types are currently either 1) T10-DIF CRC 2) IP checksum
6145 # - Allows you to ultimately specify which profiles to use
6146 # - Default will result in registering capabilities for all guard types
6151 "T10-DIF host protection guard type");
6159 * When this parameter is set to non-zero value, initial Nport discovery is
6171 * lpfc_sg_seg_cnt - Initial Maximum DMA Segment Count
6175 * Because of the additional overhead involved in setting up T10-DIF,
6184 * lpfc_sg_seg_cnt_show - Display the scatter/gather list sizes
6197 struct lpfc_vport *vport = (struct lpfc_vport *)shost->hostdata; in lpfc_sg_seg_cnt_show()
6198 struct lpfc_hba *phba = vport->phba; in lpfc_sg_seg_cnt_show()
6202 phba->cfg_sg_dma_buf_size, phba->cfg_total_seg_cnt); in lpfc_sg_seg_cnt_show()
6204 len += scnprintf(buf + len, PAGE_SIZE - len, in lpfc_sg_seg_cnt_show()
6206 phba->cfg_sg_seg_cnt, phba->cfg_scsi_seg_cnt, in lpfc_sg_seg_cnt_show()
6207 phba->cfg_nvme_seg_cnt); in lpfc_sg_seg_cnt_show()
6214 * lpfc_sg_seg_cnt_init - Set the hba sg_seg_cnt initial value
6225 * -EINVAL if value was out of range
6231 phba->cfg_sg_seg_cnt = val; in lpfc_sg_seg_cnt_init()
6238 phba->cfg_sg_seg_cnt = LPFC_DEFAULT_SG_SEG_CNT; in lpfc_sg_seg_cnt_init()
6239 return -EINVAL; in lpfc_sg_seg_cnt_init()
6253 * [1-4] = Multiple of 1/4th Mb of host memory for FW logging
6266 return -EINVAL; in lpfc_ras_fwlog_buffsize_set()
6268 if (phba->cfg_ras_fwlog_buffsize == val) in lpfc_ras_fwlog_buffsize_set()
6271 if (phba->cfg_ras_fwlog_func != PCI_FUNC(phba->pcidev->devfn)) in lpfc_ras_fwlog_buffsize_set()
6272 return -EINVAL; in lpfc_ras_fwlog_buffsize_set()
6274 spin_lock_irq(&phba->hbalock); in lpfc_ras_fwlog_buffsize_set()
6275 state = phba->ras_fwlog.state; in lpfc_ras_fwlog_buffsize_set()
6276 spin_unlock_irq(&phba->hbalock); in lpfc_ras_fwlog_buffsize_set()
6281 return -EBUSY; in lpfc_ras_fwlog_buffsize_set()
6288 phba->cfg_ras_fwlog_buffsize = val; in lpfc_ras_fwlog_buffsize_set()
6295 if (phba->ras_fwlog.ras_enabled) in lpfc_ras_fwlog_buffsize_set()
6296 ret = lpfc_sli4_ras_fwlog_init(phba, phba->cfg_ras_fwlog_level, in lpfc_ras_fwlog_buffsize_set()
6338 int lpfc_use_cgn_signal = 1; /* 0 - only use FPINs, 1 - Use signals if avail */
6361 * 4 - 255 = vmid support enabled for 4-255 VMs
6552 * sysfs_ctlreg_write - Write method for writing to ctlreg
6565 * -ERANGE off and count combo out of range
6566 * -EINVAL off, count or buff address invalid
6567 * -EPERM adapter is offline
6578 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in sysfs_ctlreg_write()
6579 struct lpfc_hba *phba = vport->phba; in sysfs_ctlreg_write()
6581 if (phba->sli_rev >= LPFC_SLI_REV4) in sysfs_ctlreg_write()
6582 return -EPERM; in sysfs_ctlreg_write()
6585 return -ERANGE; in sysfs_ctlreg_write()
6591 return -EINVAL; in sysfs_ctlreg_write()
6595 return -EINVAL; in sysfs_ctlreg_write()
6597 if (!(vport->fc_flag & FC_OFFLINE_MODE)) in sysfs_ctlreg_write()
6598 return -EPERM; in sysfs_ctlreg_write()
6600 spin_lock_irq(&phba->hbalock); in sysfs_ctlreg_write()
6601 for (buf_off = 0; buf_off < count - LPFC_REG_WRITE_KEY_SIZE; in sysfs_ctlreg_write()
6604 phba->ctrl_regs_memmap_p + off + buf_off); in sysfs_ctlreg_write()
6606 spin_unlock_irq(&phba->hbalock); in sysfs_ctlreg_write()
6612 * sysfs_ctlreg_read - Read method for reading from ctlreg
6625 * -ERANGE off and count combo out of range
6626 * -EINVAL off, count or buff address invalid
6638 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in sysfs_ctlreg_read()
6639 struct lpfc_hba *phba = vport->phba; in sysfs_ctlreg_read()
6641 if (phba->sli_rev >= LPFC_SLI_REV4) in sysfs_ctlreg_read()
6642 return -EPERM; in sysfs_ctlreg_read()
6645 return -ERANGE; in sysfs_ctlreg_read()
6648 count = FF_REG_AREA_SIZE - off; in sysfs_ctlreg_read()
6653 return -EINVAL; in sysfs_ctlreg_read()
6655 spin_lock_irq(&phba->hbalock); in sysfs_ctlreg_read()
6659 *tmp_ptr = readl(phba->ctrl_regs_memmap_p + off + buf_off); in sysfs_ctlreg_read()
6662 spin_unlock_irq(&phba->hbalock); in sysfs_ctlreg_read()
6678 * sysfs_mbox_write - Write method for writing information via mbox
6691 * -EPERM operation not permitted
6698 return -EPERM; in sysfs_mbox_write()
6702 * sysfs_mbox_read - Read method for reading information via mbox
6715 * -EPERM operation not permitted
6722 return -EPERM; in sysfs_mbox_read()
6736 * lpfc_alloc_sysfs_attr - Creates the ctlreg and mbox entries
6749 error = sysfs_create_bin_file(&shost->shost_dev.kobj, in lpfc_alloc_sysfs_attr()
6753 if (error || vport->port_type == LPFC_NPIV_PORT) in lpfc_alloc_sysfs_attr()
6756 error = sysfs_create_bin_file(&shost->shost_dev.kobj, in lpfc_alloc_sysfs_attr()
6761 error = sysfs_create_bin_file(&shost->shost_dev.kobj, in lpfc_alloc_sysfs_attr()
6768 sysfs_remove_bin_file(&shost->shost_dev.kobj, &sysfs_ctlreg_attr); in lpfc_alloc_sysfs_attr()
6770 sysfs_remove_bin_file(&shost->shost_dev.kobj, in lpfc_alloc_sysfs_attr()
6777 * lpfc_free_sysfs_attr - Removes the ctlreg and mbox entries
6784 sysfs_remove_bin_file(&shost->shost_dev.kobj, in lpfc_free_sysfs_attr()
6787 if (vport->port_type == LPFC_NPIV_PORT) in lpfc_free_sysfs_attr()
6789 sysfs_remove_bin_file(&shost->shost_dev.kobj, &sysfs_mbox_attr); in lpfc_free_sysfs_attr()
6790 sysfs_remove_bin_file(&shost->shost_dev.kobj, &sysfs_ctlreg_attr); in lpfc_free_sysfs_attr()
6798 * lpfc_get_host_symbolic_name - Copy symbolic name into the scsi host
6804 struct lpfc_vport *vport = (struct lpfc_vport *)shost->hostdata; in lpfc_get_host_symbolic_name()
6811 * lpfc_get_host_port_id - Copy the vport DID into the scsi host port id
6817 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_get_host_port_id()
6819 /* note: fc_myDID already in cpu endianness */ in lpfc_get_host_port_id()
6820 fc_host_port_id(shost) = vport->fc_myDID; in lpfc_get_host_port_id()
6824 * lpfc_get_host_port_type - Set the value of the scsi host port type
6830 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_get_host_port_type()
6831 struct lpfc_hba *phba = vport->phba; in lpfc_get_host_port_type()
6833 spin_lock_irq(shost->host_lock); in lpfc_get_host_port_type()
6835 if (vport->port_type == LPFC_NPIV_PORT) { in lpfc_get_host_port_type()
6838 if (phba->fc_topology == LPFC_TOPOLOGY_LOOP) { in lpfc_get_host_port_type()
6839 if (vport->fc_flag & FC_PUBLIC_LOOP) in lpfc_get_host_port_type()
6844 if (vport->fc_flag & FC_FABRIC) in lpfc_get_host_port_type()
6852 spin_unlock_irq(shost->host_lock); in lpfc_get_host_port_type()
6856 * lpfc_get_host_port_state - Set the value of the scsi host port state
6862 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_get_host_port_state()
6863 struct lpfc_hba *phba = vport->phba; in lpfc_get_host_port_state()
6865 spin_lock_irq(shost->host_lock); in lpfc_get_host_port_state()
6867 if (vport->fc_flag & FC_OFFLINE_MODE) in lpfc_get_host_port_state()
6870 switch (phba->link_state) { in lpfc_get_host_port_state()
6879 if (vport->port_state < LPFC_VPORT_READY) in lpfc_get_host_port_state()
6895 spin_unlock_irq(shost->host_lock); in lpfc_get_host_port_state()
6899 * lpfc_get_host_speed - Set the value of the scsi host speed
6905 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_get_host_speed()
6906 struct lpfc_hba *phba = vport->phba; in lpfc_get_host_speed()
6908 spin_lock_irq(shost->host_lock); in lpfc_get_host_speed()
6910 if ((lpfc_is_link_up(phba)) && (!(phba->hba_flag & HBA_FCOE_MODE))) { in lpfc_get_host_speed()
6911 switch(phba->fc_linkspeed) { in lpfc_get_host_speed()
6946 } else if (lpfc_is_link_up(phba) && (phba->hba_flag & HBA_FCOE_MODE)) { in lpfc_get_host_speed()
6947 switch (phba->fc_linkspeed) { in lpfc_get_host_speed()
6973 spin_unlock_irq(shost->host_lock); in lpfc_get_host_speed()
6977 * lpfc_get_host_fabric_name - Set the value of the scsi host fabric name
6983 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_get_host_fabric_name()
6984 struct lpfc_hba *phba = vport->phba; in lpfc_get_host_fabric_name()
6987 spin_lock_irq(shost->host_lock); in lpfc_get_host_fabric_name()
6989 if ((vport->port_state > LPFC_FLOGI) && in lpfc_get_host_fabric_name()
6990 ((vport->fc_flag & FC_FABRIC) || in lpfc_get_host_fabric_name()
6991 ((phba->fc_topology == LPFC_TOPOLOGY_LOOP) && in lpfc_get_host_fabric_name()
6992 (vport->fc_flag & FC_PUBLIC_LOOP)))) in lpfc_get_host_fabric_name()
6993 node_name = wwn_to_u64(phba->fc_fabparam.nodeName.u.wwn); in lpfc_get_host_fabric_name()
6998 spin_unlock_irq(shost->host_lock); in lpfc_get_host_fabric_name()
7004 * lpfc_get_stats - Return statistical information about the adapter
7018 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_get_stats()
7019 struct lpfc_hba *phba = vport->phba; in lpfc_get_stats()
7020 struct lpfc_sli *psli = &phba->sli; in lpfc_get_stats()
7021 struct fc_host_statistics *hs = &phba->link_stats; in lpfc_get_stats()
7022 struct lpfc_lnk_stat * lso = &psli->lnk_stat_offsets; in lpfc_get_stats()
7031 if (phba->link_state < LPFC_LINK_DOWN || in lpfc_get_stats()
7032 !phba->mbox_mem_pool || in lpfc_get_stats()
7033 (phba->sli.sli_flag & LPFC_SLI_ACTIVE) == 0) in lpfc_get_stats()
7036 if (phba->sli.sli_flag & LPFC_BLOCK_MGMT_IO) in lpfc_get_stats()
7039 pmboxq = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); in lpfc_get_stats()
7044 pmb = &pmboxq->u.mb; in lpfc_get_stats()
7045 pmb->mbxCommand = MBX_READ_STATUS; in lpfc_get_stats()
7046 pmb->mbxOwner = OWN_HOST; in lpfc_get_stats()
7047 pmboxq->ctx_buf = NULL; in lpfc_get_stats()
7048 pmboxq->vport = vport; in lpfc_get_stats()
7050 if (vport->fc_flag & FC_OFFLINE_MODE) { in lpfc_get_stats()
7053 mempool_free(pmboxq, phba->mbox_mem_pool); in lpfc_get_stats()
7057 rc = lpfc_sli_issue_mbox_wait(phba, pmboxq, phba->fc_ratov * 2); in lpfc_get_stats()
7060 mempool_free(pmboxq, phba->mbox_mem_pool); in lpfc_get_stats()
7067 hs->tx_frames = pmb->un.varRdStatus.xmitFrameCnt; in lpfc_get_stats()
7072 hs->tx_words = (uint64_t) in lpfc_get_stats()
7073 ((uint64_t)pmb->un.varRdStatus.xmitByteCnt in lpfc_get_stats()
7075 hs->rx_frames = pmb->un.varRdStatus.rcvFrameCnt; in lpfc_get_stats()
7076 hs->rx_words = (uint64_t) in lpfc_get_stats()
7077 ((uint64_t)pmb->un.varRdStatus.rcvByteCnt in lpfc_get_stats()
7081 pmb->mbxCommand = MBX_READ_LNK_STAT; in lpfc_get_stats()
7082 pmb->mbxOwner = OWN_HOST; in lpfc_get_stats()
7083 pmboxq->ctx_buf = NULL; in lpfc_get_stats()
7084 pmboxq->vport = vport; in lpfc_get_stats()
7086 if (vport->fc_flag & FC_OFFLINE_MODE) { in lpfc_get_stats()
7089 mempool_free(pmboxq, phba->mbox_mem_pool); in lpfc_get_stats()
7093 rc = lpfc_sli_issue_mbox_wait(phba, pmboxq, phba->fc_ratov * 2); in lpfc_get_stats()
7096 mempool_free(pmboxq, phba->mbox_mem_pool); in lpfc_get_stats()
7101 hs->link_failure_count = pmb->un.varRdLnk.linkFailureCnt; in lpfc_get_stats()
7102 hs->loss_of_sync_count = pmb->un.varRdLnk.lossSyncCnt; in lpfc_get_stats()
7103 hs->loss_of_signal_count = pmb->un.varRdLnk.lossSignalCnt; in lpfc_get_stats()
7104 hs->prim_seq_protocol_err_count = pmb->un.varRdLnk.primSeqErrCnt; in lpfc_get_stats()
7105 hs->invalid_tx_word_count = pmb->un.varRdLnk.invalidXmitWord; in lpfc_get_stats()
7106 hs->invalid_crc_count = pmb->un.varRdLnk.crcCnt; in lpfc_get_stats()
7107 hs->error_frames = pmb->un.varRdLnk.crcCnt; in lpfc_get_stats()
7109 hs->cn_sig_warn = atomic64_read(&phba->cgn_acqe_stat.warn); in lpfc_get_stats()
7110 hs->cn_sig_alarm = atomic64_read(&phba->cgn_acqe_stat.alarm); in lpfc_get_stats()
7112 hs->link_failure_count -= lso->link_failure_count; in lpfc_get_stats()
7113 hs->loss_of_sync_count -= lso->loss_of_sync_count; in lpfc_get_stats()
7114 hs->loss_of_signal_count -= lso->loss_of_signal_count; in lpfc_get_stats()
7115 hs->prim_seq_protocol_err_count -= lso->prim_seq_protocol_err_count; in lpfc_get_stats()
7116 hs->invalid_tx_word_count -= lso->invalid_tx_word_count; in lpfc_get_stats()
7117 hs->invalid_crc_count -= lso->invalid_crc_count; in lpfc_get_stats()
7118 hs->error_frames -= lso->error_frames; in lpfc_get_stats()
7120 if (phba->hba_flag & HBA_FCOE_MODE) { in lpfc_get_stats()
7121 hs->lip_count = -1; in lpfc_get_stats()
7122 hs->nos_count = (phba->link_events >> 1); in lpfc_get_stats()
7123 hs->nos_count -= lso->link_events; in lpfc_get_stats()
7124 } else if (phba->fc_topology == LPFC_TOPOLOGY_LOOP) { in lpfc_get_stats()
7125 hs->lip_count = (phba->fc_eventTag >> 1); in lpfc_get_stats()
7126 hs->lip_count -= lso->link_events; in lpfc_get_stats()
7127 hs->nos_count = -1; in lpfc_get_stats()
7129 hs->lip_count = -1; in lpfc_get_stats()
7130 hs->nos_count = (phba->fc_eventTag >> 1); in lpfc_get_stats()
7131 hs->nos_count -= lso->link_events; in lpfc_get_stats()
7134 hs->dumped_frames = -1; in lpfc_get_stats()
7136 hs->seconds_since_last_reset = ktime_get_seconds() - psli->stats_start; in lpfc_get_stats()
7138 mempool_free(pmboxq, phba->mbox_mem_pool); in lpfc_get_stats()
7144 * lpfc_reset_stats - Copy the adapter link stats information
7150 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_reset_stats()
7151 struct lpfc_hba *phba = vport->phba; in lpfc_reset_stats()
7152 struct lpfc_sli *psli = &phba->sli; in lpfc_reset_stats()
7153 struct lpfc_lnk_stat *lso = &psli->lnk_stat_offsets; in lpfc_reset_stats()
7158 if (phba->sli.sli_flag & LPFC_BLOCK_MGMT_IO) in lpfc_reset_stats()
7161 pmboxq = mempool_alloc(phba->mbox_mem_pool, GFP_KERNEL); in lpfc_reset_stats()
7166 pmb = &pmboxq->u.mb; in lpfc_reset_stats()
7167 pmb->mbxCommand = MBX_READ_STATUS; in lpfc_reset_stats()
7168 pmb->mbxOwner = OWN_HOST; in lpfc_reset_stats()
7169 pmb->un.varWords[0] = 0x1; /* reset request */ in lpfc_reset_stats()
7170 pmboxq->ctx_buf = NULL; in lpfc_reset_stats()
7171 pmboxq->vport = vport; in lpfc_reset_stats()
7173 if ((vport->fc_flag & FC_OFFLINE_MODE) || in lpfc_reset_stats()
7174 (!(psli->sli_flag & LPFC_SLI_ACTIVE))) { in lpfc_reset_stats()
7177 mempool_free(pmboxq, phba->mbox_mem_pool); in lpfc_reset_stats()
7181 rc = lpfc_sli_issue_mbox_wait(phba, pmboxq, phba->fc_ratov * 2); in lpfc_reset_stats()
7184 mempool_free(pmboxq, phba->mbox_mem_pool); in lpfc_reset_stats()
7190 pmb->mbxCommand = MBX_READ_LNK_STAT; in lpfc_reset_stats()
7191 pmb->mbxOwner = OWN_HOST; in lpfc_reset_stats()
7192 pmboxq->ctx_buf = NULL; in lpfc_reset_stats()
7193 pmboxq->vport = vport; in lpfc_reset_stats()
7195 if ((vport->fc_flag & FC_OFFLINE_MODE) || in lpfc_reset_stats()
7196 (!(psli->sli_flag & LPFC_SLI_ACTIVE))) { in lpfc_reset_stats()
7199 mempool_free(pmboxq, phba->mbox_mem_pool); in lpfc_reset_stats()
7203 rc = lpfc_sli_issue_mbox_wait(phba, pmboxq, phba->fc_ratov * 2); in lpfc_reset_stats()
7206 mempool_free(pmboxq, phba->mbox_mem_pool); in lpfc_reset_stats()
7211 lso->link_failure_count = pmb->un.varRdLnk.linkFailureCnt; in lpfc_reset_stats()
7212 lso->loss_of_sync_count = pmb->un.varRdLnk.lossSyncCnt; in lpfc_reset_stats()
7213 lso->loss_of_signal_count = pmb->un.varRdLnk.lossSignalCnt; in lpfc_reset_stats()
7214 lso->prim_seq_protocol_err_count = pmb->un.varRdLnk.primSeqErrCnt; in lpfc_reset_stats()
7215 lso->invalid_tx_word_count = pmb->un.varRdLnk.invalidXmitWord; in lpfc_reset_stats()
7216 lso->invalid_crc_count = pmb->un.varRdLnk.crcCnt; in lpfc_reset_stats()
7217 lso->error_frames = pmb->un.varRdLnk.crcCnt; in lpfc_reset_stats()
7218 if (phba->hba_flag & HBA_FCOE_MODE) in lpfc_reset_stats()
7219 lso->link_events = (phba->link_events >> 1); in lpfc_reset_stats()
7221 lso->link_events = (phba->fc_eventTag >> 1); in lpfc_reset_stats()
7223 atomic64_set(&phba->cgn_acqe_stat.warn, 0); in lpfc_reset_stats()
7224 atomic64_set(&phba->cgn_acqe_stat.alarm, 0); in lpfc_reset_stats()
7226 memset(&shost_to_fc_host(shost)->fpin_stats, 0, in lpfc_reset_stats()
7227 sizeof(shost_to_fc_host(shost)->fpin_stats)); in lpfc_reset_stats()
7229 psli->stats_start = ktime_get_seconds(); in lpfc_reset_stats()
7231 mempool_free(pmboxq, phba->mbox_mem_pool); in lpfc_reset_stats()
7242 * lpfc_get_node_by_target - Return the nodelist for a target
7252 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); in lpfc_get_node_by_target()
7253 struct lpfc_vport *vport = (struct lpfc_vport *) shost->hostdata; in lpfc_get_node_by_target()
7256 spin_lock_irq(shost->host_lock); in lpfc_get_node_by_target()
7258 list_for_each_entry(ndlp, &vport->fc_nodes, nlp_listp) { in lpfc_get_node_by_target()
7259 if (ndlp->nlp_state == NLP_STE_MAPPED_NODE && in lpfc_get_node_by_target()
7260 starget->id == ndlp->nlp_sid) { in lpfc_get_node_by_target()
7261 spin_unlock_irq(shost->host_lock); in lpfc_get_node_by_target()
7265 spin_unlock_irq(shost->host_lock); in lpfc_get_node_by_target()
7270 * lpfc_get_starget_port_id - Set the target port id to the ndlp DID or -1
7278 fc_starget_port_id(starget) = ndlp ? ndlp->nlp_DID : -1; in lpfc_get_starget_port_id()
7282 * lpfc_get_starget_node_name - Set the target node name
7293 ndlp ? wwn_to_u64(ndlp->nlp_nodename.u.wwn) : 0; in lpfc_get_starget_node_name()
7297 * lpfc_get_starget_port_name - Set the target port name
7308 ndlp ? wwn_to_u64(ndlp->nlp_portname.u.wwn) : 0; in lpfc_get_starget_port_name()
7312 * lpfc_set_rport_loss_tmo - Set the rport dev loss tmo
7323 struct lpfc_rport_data *rdata = rport->dd_data; in lpfc_set_rport_loss_tmo()
7324 struct lpfc_nodelist *ndlp = rdata->pnode; in lpfc_set_rport_loss_tmo()
7330 rport->dev_loss_tmo = timeout; in lpfc_set_rport_loss_tmo()
7332 rport->dev_loss_tmo = 1; in lpfc_set_rport_loss_tmo()
7335 dev_info(&rport->dev, "Cannot find remote node to " in lpfc_set_rport_loss_tmo()
7337 rport->port_id); in lpfc_set_rport_loss_tmo()
7344 if (nrport && nrport->remoteport) in lpfc_set_rport_loss_tmo()
7345 nvme_fc_set_remoteport_devloss(nrport->remoteport, in lpfc_set_rport_loss_tmo()
7346 rport->dev_loss_tmo); in lpfc_set_rport_loss_tmo()
7351 * lpfc_rport_show_function - Return rport target information
7369 struct lpfc_rport_data *rdata = rport->hostdata; \
7371 (rdata->target) ? cast rdata->target->field : 0); \
7379 * lpfc_set_vport_symbolic_name - Set the vport's symbolic name
7384 * has been changed. This function re-registers the symbolic name with the
7390 struct lpfc_vport *vport = *(struct lpfc_vport **)fc_vport->dd_data; in lpfc_set_vport_symbolic_name()
7392 if (vport->port_state == LPFC_VPORT_READY) in lpfc_set_vport_symbolic_name()
7397 * lpfc_hba_log_verbose_init - Set hba's log verbose level
7409 phba->cfg_log_verbose = verbose; in lpfc_hba_log_verbose_init()
7545 * lpfc_get_hba_function_mode - Used to determine the HBA function in FCoE
7553 switch (phba->pcidev->device) { in lpfc_get_hba_function_mode()
7562 phba->hba_flag |= HBA_FCOE_MODE; in lpfc_get_hba_function_mode()
7566 phba->hba_flag &= ~HBA_FCOE_MODE; in lpfc_get_hba_function_mode()
7571 * lpfc_get_cfgparam - Used during probe_one to init the adapter structure
7615 if (phba->sli_rev != LPFC_SLI_REV4) in lpfc_get_cfgparam()
7616 phba->cfg_EnableXLane = 0; in lpfc_get_cfgparam()
7619 memset(phba->cfg_oas_tgt_wwpn, 0, (8 * sizeof(uint8_t))); in lpfc_get_cfgparam()
7620 memset(phba->cfg_oas_vpt_wwpn, 0, (8 * sizeof(uint8_t))); in lpfc_get_cfgparam()
7621 phba->cfg_oas_lun_state = 0; in lpfc_get_cfgparam()
7622 phba->cfg_oas_lun_status = 0; in lpfc_get_cfgparam()
7623 phba->cfg_oas_flags = 0; in lpfc_get_cfgparam()
7624 phba->cfg_oas_priority = 0; in lpfc_get_cfgparam()
7628 if (phba->sli_rev == LPFC_SLI_REV4) in lpfc_get_cfgparam()
7629 phba->cfg_poll = 0; in lpfc_get_cfgparam()
7631 phba->cfg_poll = lpfc_poll; in lpfc_get_cfgparam()
7637 if (phba->cfg_enable_bg && phba->hba_flag & HBA_FCOE_MODE) { in lpfc_get_cfgparam()
7641 phba->cfg_enable_bg = 0; in lpfc_get_cfgparam()
7642 } else if (phba->cfg_enable_bg) { in lpfc_get_cfgparam()
7643 phba->sli3_options |= LPFC_SLI3_BG_ENABLED; in lpfc_get_cfgparam()
7662 phba->cgn_p.cgn_param_mode = LPFC_CFG_OFF; in lpfc_get_cfgparam()
7663 phba->cmf_active_mode = LPFC_CFG_OFF; in lpfc_get_cfgparam()
7668 if (phba->sli_rev != LPFC_SLI_REV4) { in lpfc_get_cfgparam()
7670 phba->nvmet_support = 0; in lpfc_get_cfgparam()
7671 phba->cfg_nvmet_mrq = 0; in lpfc_get_cfgparam()
7672 phba->cfg_enable_fc4_type = LPFC_ENABLE_FCP; in lpfc_get_cfgparam()
7673 phba->cfg_enable_bbcr = 0; in lpfc_get_cfgparam()
7674 phba->cfg_xri_rebalancing = 0; in lpfc_get_cfgparam()
7677 if (!(phba->cfg_enable_fc4_type & LPFC_ENABLE_FCP)) in lpfc_get_cfgparam()
7678 phba->cfg_enable_fc4_type |= LPFC_ENABLE_FCP; in lpfc_get_cfgparam()
7681 phba->cfg_auto_imax = (phba->cfg_fcp_imax) ? 0 : 1; in lpfc_get_cfgparam()
7683 phba->cfg_enable_pbde = 0; in lpfc_get_cfgparam()
7686 if (phba->cfg_hdw_queue == 0) in lpfc_get_cfgparam()
7687 phba->cfg_hdw_queue = phba->sli4_hba.num_present_cpu; in lpfc_get_cfgparam()
7688 if (phba->cfg_irq_chann == 0) in lpfc_get_cfgparam()
7689 phba->cfg_irq_chann = phba->sli4_hba.num_present_cpu; in lpfc_get_cfgparam()
7690 if (phba->cfg_irq_chann > phba->cfg_hdw_queue && in lpfc_get_cfgparam()
7691 phba->sli_rev == LPFC_SLI_REV4) in lpfc_get_cfgparam()
7692 phba->cfg_irq_chann = phba->cfg_hdw_queue; in lpfc_get_cfgparam()
7694 phba->cfg_soft_wwnn = 0L; in lpfc_get_cfgparam()
7695 phba->cfg_soft_wwpn = 0L; in lpfc_get_cfgparam()
7713 * lpfc_nvme_mod_param_dep - Adjust module parameter value based on
7722 if (phba->cfg_hdw_queue > phba->sli4_hba.num_present_cpu) { in lpfc_nvme_mod_param_dep()
7723 phba->cfg_hdw_queue = phba->sli4_hba.num_present_cpu; in lpfc_nvme_mod_param_dep()
7726 if (phba->cfg_irq_chann > phba->sli4_hba.num_present_cpu) { in lpfc_nvme_mod_param_dep()
7727 phba->cfg_irq_chann = phba->sli4_hba.num_present_cpu; in lpfc_nvme_mod_param_dep()
7730 if (phba->cfg_irq_chann > phba->cfg_hdw_queue) { in lpfc_nvme_mod_param_dep()
7731 phba->cfg_irq_chann = phba->cfg_hdw_queue; in lpfc_nvme_mod_param_dep()
7736 "2006 Reducing Queues - CPU limitation: " in lpfc_nvme_mod_param_dep()
7738 phba->cfg_irq_chann, in lpfc_nvme_mod_param_dep()
7739 phba->cfg_hdw_queue); in lpfc_nvme_mod_param_dep()
7741 if (phba->cfg_enable_fc4_type & LPFC_ENABLE_NVME && in lpfc_nvme_mod_param_dep()
7742 phba->nvmet_support) { in lpfc_nvme_mod_param_dep()
7743 phba->cfg_enable_fc4_type &= ~LPFC_ENABLE_FCP; in lpfc_nvme_mod_param_dep()
7748 phba->cfg_nvme_enable_fb, in lpfc_nvme_mod_param_dep()
7749 phba->cfg_nvmet_fb_size, in lpfc_nvme_mod_param_dep()
7752 if (phba->cfg_nvme_enable_fb == 0) in lpfc_nvme_mod_param_dep()
7753 phba->cfg_nvmet_fb_size = 0; in lpfc_nvme_mod_param_dep()
7755 if (phba->cfg_nvmet_fb_size > LPFC_NVMET_FB_SZ_MAX) in lpfc_nvme_mod_param_dep()
7756 phba->cfg_nvmet_fb_size = LPFC_NVMET_FB_SZ_MAX; in lpfc_nvme_mod_param_dep()
7759 if (!phba->cfg_nvmet_mrq) in lpfc_nvme_mod_param_dep()
7760 phba->cfg_nvmet_mrq = phba->cfg_hdw_queue; in lpfc_nvme_mod_param_dep()
7763 if (phba->cfg_nvmet_mrq > phba->cfg_hdw_queue) { in lpfc_nvme_mod_param_dep()
7764 phba->cfg_nvmet_mrq = phba->cfg_hdw_queue; in lpfc_nvme_mod_param_dep()
7767 phba->cfg_nvmet_mrq); in lpfc_nvme_mod_param_dep()
7769 if (phba->cfg_nvmet_mrq > LPFC_NVMET_MRQ_MAX) in lpfc_nvme_mod_param_dep()
7770 phba->cfg_nvmet_mrq = LPFC_NVMET_MRQ_MAX; in lpfc_nvme_mod_param_dep()
7774 phba->nvmet_support = 0; in lpfc_nvme_mod_param_dep()
7775 phba->cfg_nvmet_mrq = 0; in lpfc_nvme_mod_param_dep()
7776 phba->cfg_nvmet_fb_size = 0; in lpfc_nvme_mod_param_dep()
7781 * lpfc_get_vport_cfgparam - Used during port create, init the vport structure