Lines Matching defs:efx

15 #include "efx.h"
93 struct ef4_nic *efx = netdev_priv(net_dev);
110 efx->type->set_id_led(efx, mode);
119 struct ef4_nic *efx = netdev_priv(net_dev);
120 struct ef4_link_state *link_state = &efx->link_state;
122 mutex_lock(&efx->mac_lock);
123 efx->phy_op->get_link_ksettings(efx, cmd);
124 mutex_unlock(&efx->mac_lock);
130 if (LOOPBACK_INTERNAL(efx)) {
143 struct ef4_nic *efx = netdev_priv(net_dev);
149 netif_dbg(efx, drv, efx->net_dev,
154 mutex_lock(&efx->mac_lock);
155 rc = efx->phy_op->set_link_ksettings(efx, cmd);
156 mutex_unlock(&efx->mac_lock);
163 struct ef4_nic *efx = netdev_priv(net_dev);
167 strlcpy(info->bus_info, pci_name(efx->pci_dev), sizeof(info->bus_info));
178 struct ef4_nic *efx = netdev_priv(net_dev);
180 regs->version = efx->type->revision;
181 ef4_nic_get_regs(efx, buf);
186 struct ef4_nic *efx = netdev_priv(net_dev);
187 return efx->msg_enable;
192 struct ef4_nic *efx = netdev_priv(net_dev);
193 efx->msg_enable = msg_enable;
241 * @efx: Efx NIC
251 static int ef4_fill_loopback_test(struct ef4_nic *efx,
258 ef4_get_channel(efx, efx->tx_channel_offset);
285 * @efx: Efx NIC
296 static int ef4_ethtool_fill_self_tests(struct ef4_nic *efx,
312 ef4_for_each_channel(channel, efx) {
328 if (efx->phy_op->run_tests != NULL) {
329 EF4_BUG_ON_PARANOID(efx->phy_op->test_name == NULL);
335 name = efx->phy_op->test_name(efx, i);
346 if (!(efx->loopback_modes & (1 << mode)))
348 n = ef4_fill_loopback_test(efx,
356 static size_t ef4_describe_per_queue_stats(struct ef4_nic *efx, u8 *strings)
361 ef4_for_each_channel(channel, efx) {
374 ef4_for_each_channel(channel, efx) {
390 struct ef4_nic *efx = netdev_priv(net_dev);
394 return efx->type->describe_stats(efx, NULL) +
396 ef4_describe_per_queue_stats(efx, NULL);
398 return ef4_ethtool_fill_self_tests(efx, NULL, NULL, NULL);
407 struct ef4_nic *efx = netdev_priv(net_dev);
412 strings += (efx->type->describe_stats(efx, strings) *
418 strings += (ef4_describe_per_queue_stats(efx, strings) *
422 ef4_ethtool_fill_self_tests(efx, NULL, strings, NULL);
434 struct ef4_nic *efx = netdev_priv(net_dev);
441 spin_lock_bh(&efx->stats_lock);
444 data += efx->type->update_stats(efx, data, NULL);
451 data[i] = stat->get_stat((void *)efx + stat->offset);
455 ef4_for_each_channel(channel, efx)
461 ef4_for_each_channel(channel, efx) {
472 spin_unlock_bh(&efx->stats_lock);
474 ef4_for_each_channel(channel, efx) {
483 ef4_for_each_channel(channel, efx) {
497 struct ef4_nic *efx = netdev_priv(net_dev);
506 if (efx->state != STATE_READY) {
511 netif_info(efx, drv, efx->net_dev, "starting %sline testing\n",
515 already_up = (efx->net_dev->flags & IFF_UP);
517 rc = dev_open(efx->net_dev, NULL);
519 netif_err(efx, drv, efx->net_dev,
525 rc = ef4_selftest(efx, ef4_tests, test->flags);
528 dev_close(efx->net_dev);
530 netif_info(efx, drv, efx->net_dev, "%s %sline self-tests\n",
535 ef4_ethtool_fill_self_tests(efx, ef4_tests, NULL, data);
545 struct ef4_nic *efx = netdev_priv(net_dev);
547 return mdio45_nway_restart(&efx->mdio);
582 struct ef4_nic *efx = netdev_priv(net_dev);
586 ef4_get_irq_moderation(efx, &tx_usecs, &rx_usecs, &rx_adaptive);
600 struct ef4_nic *efx = netdev_priv(net_dev);
606 ef4_get_irq_moderation(efx, &tx_usecs, &rx_usecs, &adaptive);
625 rc = ef4_init_irq_moderation(efx, tx_usecs, rx_usecs, adaptive,
630 ef4_for_each_channel(channel, efx)
631 efx->type->push_irq_moderation(channel);
639 struct ef4_nic *efx = netdev_priv(net_dev);
643 ring->rx_pending = efx->rxq_entries;
644 ring->tx_pending = efx->txq_entries;
650 struct ef4_nic *efx = netdev_priv(net_dev);
659 netif_err(efx, drv, efx->net_dev,
665 txq_entries = max(ring->tx_pending, EF4_TXQ_MIN_ENT(efx));
667 netif_warn(efx, drv, efx->net_dev,
671 return ef4_realloc_channels(efx, ring->rx_pending, txq_entries);
677 struct ef4_nic *efx = netdev_priv(net_dev);
682 mutex_lock(&efx->mac_lock);
689 netif_dbg(efx, drv, efx->net_dev,
695 if ((wanted_fc & EF4_FC_AUTO) && !efx->link_advertising) {
696 netif_dbg(efx, drv, efx->net_dev,
703 if (efx->type->prepare_enable_fc_tx &&
704 (wanted_fc & EF4_FC_TX) && !(efx->wanted_fc & EF4_FC_TX))
705 efx->type->prepare_enable_fc_tx(efx);
707 old_adv = efx->link_advertising;
708 old_fc = efx->wanted_fc;
709 ef4_link_set_wanted_fc(efx, wanted_fc);
710 if (efx->link_advertising != old_adv ||
711 (efx->wanted_fc ^ old_fc) & EF4_FC_AUTO) {
712 rc = efx->phy_op->reconfigure(efx);
714 netif_err(efx, drv, efx->net_dev,
724 ef4_mac_reconfigure(efx);
727 mutex_unlock(&efx->mac_lock);
735 struct ef4_nic *efx = netdev_priv(net_dev);
737 pause->rx_pause = !!(efx->wanted_fc & EF4_FC_RX);
738 pause->tx_pause = !!(efx->wanted_fc & EF4_FC_TX);
739 pause->autoneg = !!(efx->wanted_fc & EF4_FC_AUTO);
745 struct ef4_nic *efx = netdev_priv(net_dev);
746 return efx->type->get_wol(efx, wol);
753 struct ef4_nic *efx = netdev_priv(net_dev);
754 return efx->type->set_wol(efx, wol->wolopts);
759 struct ef4_nic *efx = netdev_priv(net_dev);
762 rc = efx->type->map_reset_flags(flags);
766 return ef4_reset(efx, rc);
782 static int ef4_ethtool_get_class_rule(struct ef4_nic *efx,
798 rc = ef4_filter_get_filter_safe(efx, EF4_FILTER_PRI_MANUAL,
946 struct ef4_nic *efx = netdev_priv(net_dev);
950 info->data = efx->n_rx_channels;
971 if (ef4_nic_rev(efx) < min_revision)
977 info->data = ef4_filter_get_rx_id_limit(efx);
982 ef4_filter_count_rx_used(efx, EF4_FILTER_PRI_MANUAL);
986 if (ef4_filter_get_rx_id_limit(efx) == 0)
988 return ef4_ethtool_get_class_rule(efx, &info->fs);
992 info->data = ef4_filter_get_rx_id_limit(efx);
995 rc = ef4_filter_get_rx_ids(efx, EF4_FILTER_PRI_MANUAL,
1018 static int ef4_ethtool_set_class_rule(struct ef4_nic *efx,
1039 if (rule->ring_cookie >= efx->n_rx_channels &&
1050 efx->rx_scatter ? EF4_FILTER_FLAG_RX_SCATTER : 0,
1212 rc = ef4_filter_insert_filter(efx, &spec, true);
1223 struct ef4_nic *efx = netdev_priv(net_dev);
1225 if (ef4_filter_get_rx_id_limit(efx) == 0)
1230 return ef4_ethtool_set_class_rule(efx, &info->fs);
1233 return ef4_filter_remove_id_safe(efx, EF4_FILTER_PRI_MANUAL,
1243 struct ef4_nic *efx = netdev_priv(net_dev);
1245 return ((ef4_nic_rev(efx) < EF4_REV_FALCON_B0 ||
1246 efx->n_rx_channels == 1) ?
1247 0 : ARRAY_SIZE(efx->rx_indir_table));
1253 struct ef4_nic *efx = netdev_priv(net_dev);
1258 memcpy(indir, efx->rx_indir_table, sizeof(efx->rx_indir_table));
1265 struct ef4_nic *efx = netdev_priv(net_dev);
1274 return efx->type->rx_push_rss_config(efx, true, indir);
1281 struct ef4_nic *efx = netdev_priv(net_dev);
1284 if (!efx->phy_op || !efx->phy_op->get_module_eeprom)
1287 mutex_lock(&efx->mac_lock);
1288 ret = efx->phy_op->get_module_eeprom(efx, ee, data);
1289 mutex_unlock(&efx->mac_lock);
1297 struct ef4_nic *efx = netdev_priv(net_dev);
1300 if (!efx->phy_op || !efx->phy_op->get_module_info)
1303 mutex_lock(&efx->mac_lock);
1304 ret = efx->phy_op->get_module_info(efx, modinfo);
1305 mutex_unlock(&efx->mac_lock);