Lines Matching defs:efx
24 struct efx_nic *efx;
41 if (!ef100_mport_on_local_intf(devlink->efx, mport_desc)) {
60 rc = efx_ef100_lookup_client_id(devlink->efx, pciefn, &client_id);
68 rc = ef100_get_mac_address(devlink->efx, hw_addr, client_id, true);
103 rc = efx_ef100_lookup_client_id(devlink->efx, pciefn, &client_id);
117 rc = efx_mcdi_rpc(devlink->efx, MC_CMD_SET_CLIENT_MAC_ADDRESSES, inbuf,
139 static int efx_devlink_add_port(struct efx_nic *efx,
144 if (!ef100_mport_on_local_intf(efx, mport))
164 return devl_port_register_with_ops(efx->devlink, &mport->dl_port,
171 static int efx_devlink_info_nvram_partition(struct efx_nic *efx,
180 rc = efx_mcdi_nvram_metadata(efx, partition_type, NULL, version, NULL,
188 netif_err(efx, drv, efx->net_dev, "mcdi nvram %s: failed (rc=%d)\n",
200 static int efx_devlink_info_stored_versions(struct efx_nic *efx,
210 err = efx_devlink_info_nvram_partition(efx, req,
214 err |= efx_devlink_info_nvram_partition(efx, req,
218 err |= efx_devlink_info_nvram_partition(efx, req,
222 err |= efx_devlink_info_nvram_partition(efx, req,
226 err |= efx_devlink_info_nvram_partition(efx, req,
235 static void efx_devlink_info_running_v2(struct efx_nic *efx,
352 static void efx_devlink_info_running_v3(struct efx_nic *efx,
390 static void efx_devlink_info_running_v4(struct efx_nic *efx,
473 static void efx_devlink_info_running_v5(struct efx_nic *efx,
513 static int efx_devlink_info_running_versions(struct efx_nic *efx,
528 rc = efx_mcdi_rpc(efx, MC_CMD_GET_VERSION, inbuf, sizeof(inbuf),
531 netif_err(efx, drv, efx->net_dev,
554 efx_devlink_info_running_v2(efx, req, flags, outbuf);
560 efx_devlink_info_running_v3(efx, req, flags, outbuf);
566 efx_devlink_info_running_v4(efx, req, flags, outbuf);
572 efx_devlink_info_running_v5(efx, req, flags, outbuf);
579 static int efx_devlink_info_board_cfg(struct efx_nic *efx,
586 rc = efx_mcdi_get_board_cfg(efx, (u8 *)mac_address, NULL, NULL);
599 struct efx_nic *efx = devlink_private->efx;
606 err = efx_devlink_info_board_cfg(efx, req);
608 err |= efx_devlink_info_stored_versions(efx, req);
610 err |= efx_devlink_info_running_versions(efx, req);
623 static struct devlink_port *ef100_set_devlink_port(struct efx_nic *efx, u32 idx)
629 if (!efx->mae)
632 if (efx_mae_lookup_mport(efx, idx, &id)) {
635 pci_warn_once(efx->pci_dev, "No mport ID found for PF.\n");
637 pci_warn_once(efx->pci_dev, "No mport ID found for VF %u.\n",
642 mport = efx_mae_get_mport(efx, id);
646 pci_warn_once(efx->pci_dev, "No mport found for PF.\n");
648 pci_warn_once(efx->pci_dev, "No mport found for VF %u.\n",
653 rc = efx_devlink_add_port(efx, mport);
656 pci_warn(efx->pci_dev,
659 pci_warn(efx->pci_dev,
673 void ef100_pf_set_devlink_port(struct efx_nic *efx)
675 efx->dl_port = ef100_set_devlink_port(efx, MAE_MPORT_DESC_VF_IDX_NULL);
683 void ef100_pf_unset_devlink_port(struct efx_nic *efx)
685 efx_devlink_del_port(efx->dl_port);
689 void efx_fini_devlink_lock(struct efx_nic *efx)
691 if (efx->devlink)
692 devl_lock(efx->devlink);
695 void efx_fini_devlink_and_unlock(struct efx_nic *efx)
697 if (efx->devlink) {
698 devl_unregister(efx->devlink);
699 devl_unlock(efx->devlink);
700 devlink_free(efx->devlink);
701 efx->devlink = NULL;
705 int efx_probe_devlink_and_lock(struct efx_nic *efx)
709 if (efx->type->is_vf)
712 efx->devlink = devlink_alloc(&sfc_devlink_ops,
714 &efx->pci_dev->dev);
715 if (!efx->devlink)
718 devl_lock(efx->devlink);
719 devlink_private = devlink_priv(efx->devlink);
720 devlink_private->efx = efx;
722 devl_register(efx->devlink);
727 void efx_probe_devlink_unlock(struct efx_nic *efx)
729 if (!efx->devlink)
732 devl_unlock(efx->devlink);