Lines Matching refs:efx
99 struct efx_nic *efx = netdev_priv(net_dev); in efx_ethtool_phys_id() local
116 efx->type->set_id_led(efx, mode); in efx_ethtool_phys_id()
124 struct efx_nic *efx = netdev_priv(net_dev); in efx_ethtool_get_settings() local
125 struct efx_link_state *link_state = &efx->link_state; in efx_ethtool_get_settings()
127 mutex_lock(&efx->mac_lock); in efx_ethtool_get_settings()
128 efx->phy_op->get_settings(efx, ecmd); in efx_ethtool_get_settings()
129 mutex_unlock(&efx->mac_lock); in efx_ethtool_get_settings()
134 if (LOOPBACK_INTERNAL(efx)) { in efx_ethtool_get_settings()
146 struct efx_nic *efx = netdev_priv(net_dev); in efx_ethtool_set_settings() local
152 netif_dbg(efx, drv, efx->net_dev, in efx_ethtool_set_settings()
157 mutex_lock(&efx->mac_lock); in efx_ethtool_set_settings()
158 rc = efx->phy_op->set_settings(efx, ecmd); in efx_ethtool_set_settings()
159 mutex_unlock(&efx->mac_lock); in efx_ethtool_set_settings()
166 struct efx_nic *efx = netdev_priv(net_dev); in efx_ethtool_get_drvinfo() local
170 if (efx_nic_rev(efx) >= EFX_REV_SIENA_A0) in efx_ethtool_get_drvinfo()
171 efx_mcdi_print_fwver(efx, info->fw_version, in efx_ethtool_get_drvinfo()
173 strlcpy(info->bus_info, pci_name(efx->pci_dev), sizeof(info->bus_info)); in efx_ethtool_get_drvinfo()
184 struct efx_nic *efx = netdev_priv(net_dev); in efx_ethtool_get_regs() local
186 regs->version = efx->type->revision; in efx_ethtool_get_regs()
187 efx_nic_get_regs(efx, buf); in efx_ethtool_get_regs()
192 struct efx_nic *efx = netdev_priv(net_dev); in efx_ethtool_get_msglevel() local
193 return efx->msg_enable; in efx_ethtool_get_msglevel()
198 struct efx_nic *efx = netdev_priv(net_dev); in efx_ethtool_set_msglevel() local
199 efx->msg_enable = msg_enable; in efx_ethtool_set_msglevel()
257 static int efx_fill_loopback_test(struct efx_nic *efx, in efx_fill_loopback_test() argument
264 efx_get_channel(efx, efx->tx_channel_offset); in efx_fill_loopback_test()
302 static int efx_ethtool_fill_self_tests(struct efx_nic *efx, in efx_ethtool_fill_self_tests() argument
318 efx_for_each_channel(channel, efx) { in efx_ethtool_fill_self_tests()
334 if (efx->phy_op->run_tests != NULL) { in efx_ethtool_fill_self_tests()
335 EFX_BUG_ON_PARANOID(efx->phy_op->test_name == NULL); in efx_ethtool_fill_self_tests()
341 name = efx->phy_op->test_name(efx, i); in efx_ethtool_fill_self_tests()
352 if (!(efx->loopback_modes & (1 << mode))) in efx_ethtool_fill_self_tests()
354 n = efx_fill_loopback_test(efx, in efx_ethtool_fill_self_tests()
362 static size_t efx_describe_per_queue_stats(struct efx_nic *efx, u8 *strings) in efx_describe_per_queue_stats() argument
367 efx_for_each_channel(channel, efx) { in efx_describe_per_queue_stats()
380 efx_for_each_channel(channel, efx) { in efx_describe_per_queue_stats()
396 struct efx_nic *efx = netdev_priv(net_dev); in efx_ethtool_get_sset_count() local
400 return efx->type->describe_stats(efx, NULL) + in efx_ethtool_get_sset_count()
402 efx_describe_per_queue_stats(efx, NULL) + in efx_ethtool_get_sset_count()
403 efx_ptp_describe_stats(efx, NULL); in efx_ethtool_get_sset_count()
405 return efx_ethtool_fill_self_tests(efx, NULL, NULL, NULL); in efx_ethtool_get_sset_count()
414 struct efx_nic *efx = netdev_priv(net_dev); in efx_ethtool_get_strings() local
419 strings += (efx->type->describe_stats(efx, strings) * in efx_ethtool_get_strings()
425 strings += (efx_describe_per_queue_stats(efx, strings) * in efx_ethtool_get_strings()
427 efx_ptp_describe_stats(efx, strings); in efx_ethtool_get_strings()
430 efx_ethtool_fill_self_tests(efx, NULL, strings, NULL); in efx_ethtool_get_strings()
442 struct efx_nic *efx = netdev_priv(net_dev); in efx_ethtool_get_stats() local
449 spin_lock_bh(&efx->stats_lock); in efx_ethtool_get_stats()
452 data += efx->type->update_stats(efx, data, NULL); in efx_ethtool_get_stats()
459 data[i] = stat->get_stat((void *)efx + stat->offset); in efx_ethtool_get_stats()
463 efx_for_each_channel(channel, efx) in efx_ethtool_get_stats()
469 efx_for_each_channel(channel, efx) { in efx_ethtool_get_stats()
480 spin_unlock_bh(&efx->stats_lock); in efx_ethtool_get_stats()
482 efx_for_each_channel(channel, efx) { in efx_ethtool_get_stats()
491 efx_for_each_channel(channel, efx) { in efx_ethtool_get_stats()
501 efx_ptp_update_stats(efx, data); in efx_ethtool_get_stats()
507 struct efx_nic *efx = netdev_priv(net_dev); in efx_ethtool_self_test() local
516 if (efx->state != STATE_READY) { in efx_ethtool_self_test()
521 netif_info(efx, drv, efx->net_dev, "starting %sline testing\n", in efx_ethtool_self_test()
525 already_up = (efx->net_dev->flags & IFF_UP); in efx_ethtool_self_test()
527 rc = dev_open(efx->net_dev); in efx_ethtool_self_test()
529 netif_err(efx, drv, efx->net_dev, in efx_ethtool_self_test()
535 rc = efx_selftest(efx, efx_tests, test->flags); in efx_ethtool_self_test()
538 dev_close(efx->net_dev); in efx_ethtool_self_test()
540 netif_info(efx, drv, efx->net_dev, "%s %sline self-tests\n", in efx_ethtool_self_test()
545 efx_ethtool_fill_self_tests(efx, efx_tests, NULL, data); in efx_ethtool_self_test()
555 struct efx_nic *efx = netdev_priv(net_dev); in efx_ethtool_nway_reset() local
557 return mdio45_nway_restart(&efx->mdio); in efx_ethtool_nway_reset()
592 struct efx_nic *efx = netdev_priv(net_dev); in efx_ethtool_get_coalesce() local
596 efx_get_irq_moderation(efx, &tx_usecs, &rx_usecs, &rx_adaptive); in efx_ethtool_get_coalesce()
610 struct efx_nic *efx = netdev_priv(net_dev); in efx_ethtool_set_coalesce() local
619 efx_get_irq_moderation(efx, &tx_usecs, &rx_usecs, &adaptive); in efx_ethtool_set_coalesce()
638 rc = efx_init_irq_moderation(efx, tx_usecs, rx_usecs, adaptive, in efx_ethtool_set_coalesce()
643 efx_for_each_channel(channel, efx) in efx_ethtool_set_coalesce()
644 efx->type->push_irq_moderation(channel); in efx_ethtool_set_coalesce()
652 struct efx_nic *efx = netdev_priv(net_dev); in efx_ethtool_get_ringparam() local
655 ring->tx_max_pending = EFX_TXQ_MAX_ENT(efx); in efx_ethtool_get_ringparam()
656 ring->rx_pending = efx->rxq_entries; in efx_ethtool_get_ringparam()
657 ring->tx_pending = efx->txq_entries; in efx_ethtool_get_ringparam()
663 struct efx_nic *efx = netdev_priv(net_dev); in efx_ethtool_set_ringparam() local
668 ring->tx_pending > EFX_TXQ_MAX_ENT(efx)) in efx_ethtool_set_ringparam()
672 netif_err(efx, drv, efx->net_dev, in efx_ethtool_set_ringparam()
678 txq_entries = max(ring->tx_pending, EFX_TXQ_MIN_ENT(efx)); in efx_ethtool_set_ringparam()
680 netif_warn(efx, drv, efx->net_dev, in efx_ethtool_set_ringparam()
684 return efx_realloc_channels(efx, ring->rx_pending, txq_entries); in efx_ethtool_set_ringparam()
690 struct efx_nic *efx = netdev_priv(net_dev); in efx_ethtool_set_pauseparam() local
695 mutex_lock(&efx->mac_lock); in efx_ethtool_set_pauseparam()
702 netif_dbg(efx, drv, efx->net_dev, in efx_ethtool_set_pauseparam()
708 if ((wanted_fc & EFX_FC_AUTO) && !efx->link_advertising) { in efx_ethtool_set_pauseparam()
709 netif_dbg(efx, drv, efx->net_dev, in efx_ethtool_set_pauseparam()
716 if (efx->type->prepare_enable_fc_tx && in efx_ethtool_set_pauseparam()
717 (wanted_fc & EFX_FC_TX) && !(efx->wanted_fc & EFX_FC_TX)) in efx_ethtool_set_pauseparam()
718 efx->type->prepare_enable_fc_tx(efx); in efx_ethtool_set_pauseparam()
720 old_adv = efx->link_advertising; in efx_ethtool_set_pauseparam()
721 old_fc = efx->wanted_fc; in efx_ethtool_set_pauseparam()
722 efx_link_set_wanted_fc(efx, wanted_fc); in efx_ethtool_set_pauseparam()
723 if (efx->link_advertising != old_adv || in efx_ethtool_set_pauseparam()
724 (efx->wanted_fc ^ old_fc) & EFX_FC_AUTO) { in efx_ethtool_set_pauseparam()
725 rc = efx->phy_op->reconfigure(efx); in efx_ethtool_set_pauseparam()
727 netif_err(efx, drv, efx->net_dev, in efx_ethtool_set_pauseparam()
737 efx_mac_reconfigure(efx); in efx_ethtool_set_pauseparam()
740 mutex_unlock(&efx->mac_lock); in efx_ethtool_set_pauseparam()
748 struct efx_nic *efx = netdev_priv(net_dev); in efx_ethtool_get_pauseparam() local
750 pause->rx_pause = !!(efx->wanted_fc & EFX_FC_RX); in efx_ethtool_get_pauseparam()
751 pause->tx_pause = !!(efx->wanted_fc & EFX_FC_TX); in efx_ethtool_get_pauseparam()
752 pause->autoneg = !!(efx->wanted_fc & EFX_FC_AUTO); in efx_ethtool_get_pauseparam()
758 struct efx_nic *efx = netdev_priv(net_dev); in efx_ethtool_get_wol() local
759 return efx->type->get_wol(efx, wol); in efx_ethtool_get_wol()
766 struct efx_nic *efx = netdev_priv(net_dev); in efx_ethtool_set_wol() local
767 return efx->type->set_wol(efx, wol->wolopts); in efx_ethtool_set_wol()
772 struct efx_nic *efx = netdev_priv(net_dev); in efx_ethtool_reset() local
775 rc = efx->type->map_reset_flags(flags); in efx_ethtool_reset()
779 return efx_reset(efx, rc); in efx_ethtool_reset()
789 static int efx_ethtool_get_class_rule(struct efx_nic *efx, in efx_ethtool_get_class_rule() argument
799 rc = efx_filter_get_filter_safe(efx, EFX_FILTER_PRI_MANUAL, in efx_ethtool_get_class_rule()
877 struct efx_nic *efx = netdev_priv(net_dev); in efx_ethtool_get_rxnfc() local
881 info->data = efx->n_rx_channels; in efx_ethtool_get_rxnfc()
912 if (efx_nic_rev(efx) < min_revision) in efx_ethtool_get_rxnfc()
918 info->data = efx_filter_get_rx_id_limit(efx); in efx_ethtool_get_rxnfc()
923 efx_filter_count_rx_used(efx, EFX_FILTER_PRI_MANUAL); in efx_ethtool_get_rxnfc()
927 if (efx_filter_get_rx_id_limit(efx) == 0) in efx_ethtool_get_rxnfc()
929 return efx_ethtool_get_class_rule(efx, &info->fs); in efx_ethtool_get_rxnfc()
933 info->data = efx_filter_get_rx_id_limit(efx); in efx_ethtool_get_rxnfc()
936 rc = efx_filter_get_rx_ids(efx, EFX_FILTER_PRI_MANUAL, in efx_ethtool_get_rxnfc()
949 static int efx_ethtool_set_class_rule(struct efx_nic *efx, in efx_ethtool_set_class_rule() argument
964 if (rule->ring_cookie >= efx->n_rx_channels && in efx_ethtool_set_class_rule()
975 efx->rx_scatter ? EFX_FILTER_FLAG_RX_SCATTER : 0, in efx_ethtool_set_class_rule()
1051 rc = efx_filter_insert_filter(efx, &spec, true); in efx_ethtool_set_class_rule()
1062 struct efx_nic *efx = netdev_priv(net_dev); in efx_ethtool_set_rxnfc() local
1064 if (efx_filter_get_rx_id_limit(efx) == 0) in efx_ethtool_set_rxnfc()
1069 return efx_ethtool_set_class_rule(efx, &info->fs); in efx_ethtool_set_rxnfc()
1072 return efx_filter_remove_id_safe(efx, EFX_FILTER_PRI_MANUAL, in efx_ethtool_set_rxnfc()
1082 struct efx_nic *efx = netdev_priv(net_dev); in efx_ethtool_get_rxfh_indir_size() local
1084 return ((efx_nic_rev(efx) < EFX_REV_FALCON_B0 || in efx_ethtool_get_rxfh_indir_size()
1085 efx->n_rx_channels == 1) ? in efx_ethtool_get_rxfh_indir_size()
1086 0 : ARRAY_SIZE(efx->rx_indir_table)); in efx_ethtool_get_rxfh_indir_size()
1092 struct efx_nic *efx = netdev_priv(net_dev); in efx_ethtool_get_rxfh() local
1097 memcpy(indir, efx->rx_indir_table, sizeof(efx->rx_indir_table)); in efx_ethtool_get_rxfh()
1104 struct efx_nic *efx = netdev_priv(net_dev); in efx_ethtool_set_rxfh() local
1113 return efx->type->rx_push_rss_config(efx, true, indir); in efx_ethtool_set_rxfh()
1119 struct efx_nic *efx = netdev_priv(net_dev); in efx_ethtool_get_ts_info() local
1126 efx_ptp_get_ts_info(efx, ts_info); in efx_ethtool_get_ts_info()
1134 struct efx_nic *efx = netdev_priv(net_dev); in efx_ethtool_get_module_eeprom() local
1137 if (!efx->phy_op || !efx->phy_op->get_module_eeprom) in efx_ethtool_get_module_eeprom()
1140 mutex_lock(&efx->mac_lock); in efx_ethtool_get_module_eeprom()
1141 ret = efx->phy_op->get_module_eeprom(efx, ee, data); in efx_ethtool_get_module_eeprom()
1142 mutex_unlock(&efx->mac_lock); in efx_ethtool_get_module_eeprom()
1150 struct efx_nic *efx = netdev_priv(net_dev); in efx_ethtool_get_module_info() local
1153 if (!efx->phy_op || !efx->phy_op->get_module_info) in efx_ethtool_get_module_info()
1156 mutex_lock(&efx->mac_lock); in efx_ethtool_get_module_info()
1157 ret = efx->phy_op->get_module_info(efx, modinfo); in efx_ethtool_get_module_info()
1158 mutex_unlock(&efx->mac_lock); in efx_ethtool_get_module_info()