Lines Matching +full:eee +full:- +full:pcs
1 // SPDX-License-Identifier: GPL-2.0-only
5 Copyright (C) 2007-2009 STMicroelectronics Ltd
98 /* EEE */
130 /* PCS */
306 if (priv->plat->has_gmac || priv->plat->has_gmac4) in stmmac_ethtool_getdrvinfo()
307 strscpy(info->driver, GMAC_ETHTOOL_NAME, sizeof(info->driver)); in stmmac_ethtool_getdrvinfo()
308 else if (priv->plat->has_xgmac) in stmmac_ethtool_getdrvinfo()
309 strscpy(info->driver, XGMAC_ETHTOOL_NAME, sizeof(info->driver)); in stmmac_ethtool_getdrvinfo()
311 strscpy(info->driver, MAC100_ETHTOOL_NAME, in stmmac_ethtool_getdrvinfo()
312 sizeof(info->driver)); in stmmac_ethtool_getdrvinfo()
314 if (priv->plat->pdev) { in stmmac_ethtool_getdrvinfo()
315 strscpy(info->bus_info, pci_name(priv->plat->pdev), in stmmac_ethtool_getdrvinfo()
316 sizeof(info->bus_info)); in stmmac_ethtool_getdrvinfo()
325 if (!(priv->plat->flags & STMMAC_FLAG_HAS_INTEGRATED_PCS) && in stmmac_ethtool_get_link_ksettings()
326 (priv->hw->pcs & STMMAC_PCS_RGMII || in stmmac_ethtool_get_link_ksettings()
327 priv->hw->pcs & STMMAC_PCS_SGMII)) { in stmmac_ethtool_get_link_ksettings()
331 if (!priv->xstats.pcs_link) { in stmmac_ethtool_get_link_ksettings()
332 cmd->base.speed = SPEED_UNKNOWN; in stmmac_ethtool_get_link_ksettings()
333 cmd->base.duplex = DUPLEX_UNKNOWN; in stmmac_ethtool_get_link_ksettings()
336 cmd->base.duplex = priv->xstats.pcs_duplex; in stmmac_ethtool_get_link_ksettings()
338 cmd->base.speed = priv->xstats.pcs_speed; in stmmac_ethtool_get_link_ksettings()
341 if (stmmac_pcs_get_adv_lp(priv, priv->ioaddr, &adv)) in stmmac_ethtool_get_link_ksettings()
342 return -EOPNOTSUPP; /* should never happen indeed */ in stmmac_ethtool_get_link_ksettings()
347 &supported, cmd->link_modes.supported); in stmmac_ethtool_get_link_ksettings()
349 &advertising, cmd->link_modes.advertising); in stmmac_ethtool_get_link_ksettings()
351 &lp_advertising, cmd->link_modes.lp_advertising); in stmmac_ethtool_get_link_ksettings()
363 cmd->base.autoneg = ADVERTISED_Autoneg; in stmmac_ethtool_get_link_ksettings()
391 cmd->base.port = PORT_OTHER; in stmmac_ethtool_get_link_ksettings()
394 cmd->link_modes.supported, supported); in stmmac_ethtool_get_link_ksettings()
396 cmd->link_modes.advertising, advertising); in stmmac_ethtool_get_link_ksettings()
398 cmd->link_modes.lp_advertising, lp_advertising); in stmmac_ethtool_get_link_ksettings()
403 return phylink_ethtool_ksettings_get(priv->phylink, cmd); in stmmac_ethtool_get_link_ksettings()
412 if (!(priv->plat->flags & STMMAC_FLAG_HAS_INTEGRATED_PCS) && in stmmac_ethtool_set_link_ksettings()
413 (priv->hw->pcs & STMMAC_PCS_RGMII || in stmmac_ethtool_set_link_ksettings()
414 priv->hw->pcs & STMMAC_PCS_SGMII)) { in stmmac_ethtool_set_link_ksettings()
416 if (cmd->base.autoneg != AUTONEG_ENABLE) in stmmac_ethtool_set_link_ksettings()
417 return -EINVAL; in stmmac_ethtool_set_link_ksettings()
419 mutex_lock(&priv->lock); in stmmac_ethtool_set_link_ksettings()
420 stmmac_pcs_ctrl_ane(priv, priv->ioaddr, 1, priv->hw->ps, 0); in stmmac_ethtool_set_link_ksettings()
421 mutex_unlock(&priv->lock); in stmmac_ethtool_set_link_ksettings()
426 return phylink_ethtool_ksettings_set(priv->phylink, cmd); in stmmac_ethtool_set_link_ksettings()
432 return priv->msg_enable; in stmmac_ethtool_getmsglevel()
438 priv->msg_enable = level; in stmmac_ethtool_setmsglevel()
446 if (priv->plat->has_xgmac) in stmmac_ethtool_get_regs_len()
448 else if (priv->plat->has_gmac4) in stmmac_ethtool_get_regs_len()
459 stmmac_dump_mac_regs(priv, priv->hw, reg_space); in stmmac_ethtool_gregs()
460 stmmac_dump_dma_regs(priv, priv->ioaddr, reg_space); in stmmac_ethtool_gregs()
463 if (priv->plat->has_gmac4) { in stmmac_ethtool_gregs()
468 } else if (!priv->plat->has_xgmac) { in stmmac_ethtool_gregs()
479 return phylink_ethtool_nway_reset(priv->phylink); in stmmac_nway_reset()
489 ring->rx_max_pending = DMA_MAX_RX_SIZE; in stmmac_get_ringparam()
490 ring->tx_max_pending = DMA_MAX_TX_SIZE; in stmmac_get_ringparam()
491 ring->rx_pending = priv->dma_conf.dma_rx_size; in stmmac_get_ringparam()
492 ring->tx_pending = priv->dma_conf.dma_tx_size; in stmmac_get_ringparam()
500 if (ring->rx_mini_pending || ring->rx_jumbo_pending || in stmmac_set_ringparam()
501 ring->rx_pending < DMA_MIN_RX_SIZE || in stmmac_set_ringparam()
502 ring->rx_pending > DMA_MAX_RX_SIZE || in stmmac_set_ringparam()
503 !is_power_of_2(ring->rx_pending) || in stmmac_set_ringparam()
504 ring->tx_pending < DMA_MIN_TX_SIZE || in stmmac_set_ringparam()
505 ring->tx_pending > DMA_MAX_TX_SIZE || in stmmac_set_ringparam()
506 !is_power_of_2(ring->tx_pending)) in stmmac_set_ringparam()
507 return -EINVAL; in stmmac_set_ringparam()
509 return stmmac_reinit_ringparam(netdev, ring->rx_pending, in stmmac_set_ringparam()
510 ring->tx_pending); in stmmac_set_ringparam()
520 if (priv->hw->pcs && !stmmac_pcs_get_adv_lp(priv, priv->ioaddr, &adv_lp)) { in stmmac_get_pauseparam()
521 pause->autoneg = 1; in stmmac_get_pauseparam()
525 phylink_ethtool_get_pauseparam(priv->phylink, pause); in stmmac_get_pauseparam()
536 if (priv->hw->pcs && !stmmac_pcs_get_adv_lp(priv, priv->ioaddr, &adv_lp)) { in stmmac_set_pauseparam()
537 pause->autoneg = 1; in stmmac_set_pauseparam()
539 return -EOPNOTSUPP; in stmmac_set_pauseparam()
542 return phylink_ethtool_set_pauseparam(priv->phylink, pause); in stmmac_set_pauseparam()
557 pcpu = per_cpu_ptr(priv->xstats.pcpu_stats, cpu); in stmmac_get_rx_normal_irq_n()
559 start = u64_stats_fetch_begin(&pcpu->syncp); in stmmac_get_rx_normal_irq_n()
560 irq_n = u64_stats_read(&pcpu->rx_normal_irq_n[q]); in stmmac_get_rx_normal_irq_n()
561 } while (u64_stats_fetch_retry(&pcpu->syncp, start)); in stmmac_get_rx_normal_irq_n()
578 pcpu = per_cpu_ptr(priv->xstats.pcpu_stats, cpu); in stmmac_get_tx_normal_irq_n()
580 start = u64_stats_fetch_begin(&pcpu->syncp); in stmmac_get_tx_normal_irq_n()
581 irq_n = u64_stats_read(&pcpu->tx_normal_irq_n[q]); in stmmac_get_tx_normal_irq_n()
582 } while (u64_stats_fetch_retry(&pcpu->syncp, start)); in stmmac_get_tx_normal_irq_n()
590 u32 tx_cnt = priv->plat->tx_queues_to_use; in stmmac_get_per_qstats()
591 u32 rx_cnt = priv->plat->rx_queues_to_use; in stmmac_get_per_qstats()
596 struct stmmac_txq_stats *txq_stats = &priv->xstats.txq_stats[q]; in stmmac_get_per_qstats()
600 start = u64_stats_fetch_begin(&txq_stats->napi_syncp); in stmmac_get_per_qstats()
601 pkt_n = u64_stats_read(&txq_stats->napi.tx_pkt_n); in stmmac_get_per_qstats()
602 } while (u64_stats_fetch_retry(&txq_stats->napi_syncp, start)); in stmmac_get_per_qstats()
609 struct stmmac_rxq_stats *rxq_stats = &priv->xstats.rxq_stats[q]; in stmmac_get_per_qstats()
613 start = u64_stats_fetch_begin(&rxq_stats->napi_syncp); in stmmac_get_per_qstats()
614 pkt_n = u64_stats_read(&rxq_stats->napi.rx_pkt_n); in stmmac_get_per_qstats()
615 } while (u64_stats_fetch_retry(&rxq_stats->napi_syncp, start)); in stmmac_get_per_qstats()
626 u32 rx_queues_count = priv->plat->rx_queues_to_use; in stmmac_get_ethtool_stats()
627 u32 tx_queues_count = priv->plat->tx_queues_to_use; in stmmac_get_ethtool_stats()
633 if (priv->dma_cap.asp) { in stmmac_get_ethtool_stats()
635 if (!stmmac_safety_feat_dump(priv, &priv->sstats, i, in stmmac_get_ethtool_stats()
642 ret = stmmac_dma_diagnostic_fr(priv, &priv->xstats, priv->ioaddr); in stmmac_get_ethtool_stats()
645 if (priv->dma_cap.rmon) { in stmmac_get_ethtool_stats()
646 stmmac_mmc_read(priv, priv->mmcaddr, &priv->mmc); in stmmac_get_ethtool_stats()
657 if (priv->dma_cap.eee) { in stmmac_get_ethtool_stats()
658 int val = phylink_get_eee_err(priv->phylink); in stmmac_get_ethtool_stats()
660 priv->xstats.phy_eee_wakeup_error_n = val; in stmmac_get_ethtool_stats()
663 if (priv->synopsys_id >= DWMAC_CORE_3_50) in stmmac_get_ethtool_stats()
664 stmmac_mac_debug(priv, priv->ioaddr, in stmmac_get_ethtool_stats()
665 (void *)&priv->xstats, in stmmac_get_ethtool_stats()
676 struct stmmac_rxq_stats *rxq_stats = &priv->xstats.rxq_stats[i]; in stmmac_get_ethtool_stats()
682 start = u64_stats_fetch_begin(&rxq_stats->napi_syncp); in stmmac_get_ethtool_stats()
683 snapshot = rxq_stats->napi; in stmmac_get_ethtool_stats()
684 } while (u64_stats_fetch_retry(&rxq_stats->napi_syncp, start)); in stmmac_get_ethtool_stats()
695 struct stmmac_txq_stats *txq_stats = &priv->xstats.txq_stats[i]; in stmmac_get_ethtool_stats()
702 start = u64_stats_fetch_begin(&txq_stats->q_syncp); in stmmac_get_ethtool_stats()
703 q_snapshot = txq_stats->q; in stmmac_get_ethtool_stats()
704 } while (u64_stats_fetch_retry(&txq_stats->q_syncp, start)); in stmmac_get_ethtool_stats()
706 start = u64_stats_fetch_begin(&txq_stats->napi_syncp); in stmmac_get_ethtool_stats()
707 napi_snapshot = txq_stats->napi; in stmmac_get_ethtool_stats()
708 } while (u64_stats_fetch_retry(&txq_stats->napi_syncp, start)); in stmmac_get_ethtool_stats()
721 normal_irq_n += priv->xstats.rx_early_irq; in stmmac_get_ethtool_stats()
731 u32 tx_cnt = priv->plat->tx_queues_to_use; in stmmac_get_sset_count()
732 u32 rx_cnt = priv->plat->rx_queues_to_use; in stmmac_get_sset_count()
741 if (priv->dma_cap.rmon) in stmmac_get_sset_count()
743 if (priv->dma_cap.asp) { in stmmac_get_sset_count()
746 &priv->sstats, i, in stmmac_get_sset_count()
758 return -EOPNOTSUPP; in stmmac_get_sset_count()
764 u32 tx_cnt = priv->plat->tx_queues_to_use; in stmmac_get_qstats_string()
765 u32 rx_cnt = priv->plat->rx_queues_to_use; in stmmac_get_qstats_string()
792 if (priv->dma_cap.asp) { in stmmac_get_strings()
796 &priv->sstats, i, in stmmac_get_strings()
803 if (priv->dma_cap.rmon) in stmmac_get_strings()
833 if (!priv->plat->pmt) in stmmac_get_wol()
834 return phylink_ethtool_get_wol(priv->phylink, wol); in stmmac_get_wol()
836 mutex_lock(&priv->lock); in stmmac_get_wol()
837 if (device_can_wakeup(priv->device)) { in stmmac_get_wol()
838 wol->supported = WAKE_MAGIC | WAKE_UCAST; in stmmac_get_wol()
839 if (priv->hw_cap_support && !priv->dma_cap.pmt_magic_frame) in stmmac_get_wol()
840 wol->supported &= ~WAKE_MAGIC; in stmmac_get_wol()
841 wol->wolopts = priv->wolopts; in stmmac_get_wol()
843 mutex_unlock(&priv->lock); in stmmac_get_wol()
851 if (!device_can_wakeup(priv->device)) in stmmac_set_wol()
852 return -EOPNOTSUPP; in stmmac_set_wol()
854 if (!priv->plat->pmt) { in stmmac_set_wol()
855 int ret = phylink_ethtool_set_wol(priv->phylink, wol); in stmmac_set_wol()
858 device_set_wakeup_enable(priv->device, !!wol->wolopts); in stmmac_set_wol()
865 if ((priv->hw_cap_support) && (!priv->dma_cap.pmt_magic_frame)) in stmmac_set_wol()
866 wol->wolopts &= ~WAKE_MAGIC; in stmmac_set_wol()
868 if (wol->wolopts & ~support) in stmmac_set_wol()
869 return -EINVAL; in stmmac_set_wol()
871 if (wol->wolopts) { in stmmac_set_wol()
873 device_set_wakeup_enable(priv->device, 1); in stmmac_set_wol()
875 if (priv->wol_irq_disabled) in stmmac_set_wol()
876 enable_irq_wake(priv->wol_irq); in stmmac_set_wol()
877 priv->wol_irq_disabled = false; in stmmac_set_wol()
879 device_set_wakeup_enable(priv->device, 0); in stmmac_set_wol()
881 if (!priv->wol_irq_disabled) in stmmac_set_wol()
882 disable_irq_wake(priv->wol_irq); in stmmac_set_wol()
883 priv->wol_irq_disabled = true; in stmmac_set_wol()
886 mutex_lock(&priv->lock); in stmmac_set_wol()
887 priv->wolopts = wol->wolopts; in stmmac_set_wol()
888 mutex_unlock(&priv->lock); in stmmac_set_wol()
898 if (!priv->dma_cap.eee) in stmmac_ethtool_op_get_eee()
899 return -EOPNOTSUPP; in stmmac_ethtool_op_get_eee()
901 return phylink_ethtool_get_eee(priv->phylink, edata); in stmmac_ethtool_op_get_eee()
909 if (!priv->dma_cap.eee) in stmmac_ethtool_op_set_eee()
910 return -EOPNOTSUPP; in stmmac_ethtool_op_set_eee()
912 return phylink_ethtool_set_eee(priv->phylink, edata); in stmmac_ethtool_op_set_eee()
917 unsigned long clk = clk_get_rate(priv->plat->stmmac_clk); in stmmac_usec2riwt()
920 clk = priv->plat->clk_ref_rate; in stmmac_usec2riwt()
930 unsigned long clk = clk_get_rate(priv->plat->stmmac_clk); in stmmac_riwt2usec()
933 clk = priv->plat->clk_ref_rate; in stmmac_riwt2usec()
950 rx_cnt = priv->plat->rx_queues_to_use; in __stmmac_get_coalesce()
951 tx_cnt = priv->plat->tx_queues_to_use; in __stmmac_get_coalesce()
957 return -EINVAL; in __stmmac_get_coalesce()
960 ec->tx_coalesce_usecs = priv->tx_coal_timer[queue]; in __stmmac_get_coalesce()
961 ec->tx_max_coalesced_frames = priv->tx_coal_frames[queue]; in __stmmac_get_coalesce()
963 ec->tx_coalesce_usecs = 0; in __stmmac_get_coalesce()
964 ec->tx_max_coalesced_frames = 0; in __stmmac_get_coalesce()
967 if (priv->use_riwt && queue < rx_cnt) { in __stmmac_get_coalesce()
968 ec->rx_max_coalesced_frames = priv->rx_coal_frames[queue]; in __stmmac_get_coalesce()
969 ec->rx_coalesce_usecs = stmmac_riwt2usec(priv->rx_riwt[queue], in __stmmac_get_coalesce()
972 ec->rx_max_coalesced_frames = 0; in __stmmac_get_coalesce()
973 ec->rx_coalesce_usecs = 0; in __stmmac_get_coalesce()
984 return __stmmac_get_coalesce(dev, ec, -1); in stmmac_get_coalesce()
1004 rx_cnt = priv->plat->rx_queues_to_use; in __stmmac_set_coalesce()
1005 tx_cnt = priv->plat->tx_queues_to_use; in __stmmac_set_coalesce()
1011 return -EINVAL; in __stmmac_set_coalesce()
1013 if (priv->use_riwt) { in __stmmac_set_coalesce()
1014 rx_riwt = stmmac_usec2riwt(ec->rx_coalesce_usecs, priv); in __stmmac_set_coalesce()
1017 return -EINVAL; in __stmmac_set_coalesce()
1023 priv->rx_riwt[i] = rx_riwt; in __stmmac_set_coalesce()
1024 stmmac_rx_watchdog(priv, priv->ioaddr, in __stmmac_set_coalesce()
1026 priv->rx_coal_frames[i] = in __stmmac_set_coalesce()
1027 ec->rx_max_coalesced_frames; in __stmmac_set_coalesce()
1030 priv->rx_riwt[queue] = rx_riwt; in __stmmac_set_coalesce()
1031 stmmac_rx_watchdog(priv, priv->ioaddr, in __stmmac_set_coalesce()
1033 priv->rx_coal_frames[queue] = in __stmmac_set_coalesce()
1034 ec->rx_max_coalesced_frames; in __stmmac_set_coalesce()
1038 if ((ec->tx_coalesce_usecs == 0) && in __stmmac_set_coalesce()
1039 (ec->tx_max_coalesced_frames == 0)) in __stmmac_set_coalesce()
1040 return -EINVAL; in __stmmac_set_coalesce()
1042 if ((ec->tx_coalesce_usecs > STMMAC_MAX_COAL_TX_TICK) || in __stmmac_set_coalesce()
1043 (ec->tx_max_coalesced_frames > STMMAC_TX_MAX_FRAMES)) in __stmmac_set_coalesce()
1044 return -EINVAL; in __stmmac_set_coalesce()
1050 priv->tx_coal_frames[i] = in __stmmac_set_coalesce()
1051 ec->tx_max_coalesced_frames; in __stmmac_set_coalesce()
1052 priv->tx_coal_timer[i] = in __stmmac_set_coalesce()
1053 ec->tx_coalesce_usecs; in __stmmac_set_coalesce()
1056 priv->tx_coal_frames[queue] = in __stmmac_set_coalesce()
1057 ec->tx_max_coalesced_frames; in __stmmac_set_coalesce()
1058 priv->tx_coal_timer[queue] = in __stmmac_set_coalesce()
1059 ec->tx_coalesce_usecs; in __stmmac_set_coalesce()
1070 return __stmmac_set_coalesce(dev, ec, -1); in stmmac_set_coalesce()
1084 switch (rxnfc->cmd) { in stmmac_get_rxnfc()
1086 rxnfc->data = priv->plat->rx_queues_to_use; in stmmac_get_rxnfc()
1089 return -EOPNOTSUPP; in stmmac_get_rxnfc()
1099 return sizeof(priv->rss.key); in stmmac_get_rxfh_key_size()
1106 return ARRAY_SIZE(priv->rss.table); in stmmac_get_rxfh_indir_size()
1115 if (rxfh->indir) { in stmmac_get_rxfh()
1116 for (i = 0; i < ARRAY_SIZE(priv->rss.table); i++) in stmmac_get_rxfh()
1117 rxfh->indir[i] = priv->rss.table[i]; in stmmac_get_rxfh()
1120 if (rxfh->key) in stmmac_get_rxfh()
1121 memcpy(rxfh->key, priv->rss.key, sizeof(priv->rss.key)); in stmmac_get_rxfh()
1122 rxfh->hfunc = ETH_RSS_HASH_TOP; in stmmac_get_rxfh()
1134 if (rxfh->hfunc != ETH_RSS_HASH_NO_CHANGE && in stmmac_set_rxfh()
1135 rxfh->hfunc != ETH_RSS_HASH_TOP) in stmmac_set_rxfh()
1136 return -EOPNOTSUPP; in stmmac_set_rxfh()
1138 if (rxfh->indir) { in stmmac_set_rxfh()
1139 for (i = 0; i < ARRAY_SIZE(priv->rss.table); i++) in stmmac_set_rxfh()
1140 priv->rss.table[i] = rxfh->indir[i]; in stmmac_set_rxfh()
1143 if (rxfh->key) in stmmac_set_rxfh()
1144 memcpy(priv->rss.key, rxfh->key, sizeof(priv->rss.key)); in stmmac_set_rxfh()
1146 return stmmac_rss_configure(priv, priv->hw, &priv->rss, in stmmac_set_rxfh()
1147 priv->plat->rx_queues_to_use); in stmmac_set_rxfh()
1155 chan->rx_count = priv->plat->rx_queues_to_use; in stmmac_get_channels()
1156 chan->tx_count = priv->plat->tx_queues_to_use; in stmmac_get_channels()
1157 chan->max_rx = priv->dma_cap.number_rx_queues; in stmmac_get_channels()
1158 chan->max_tx = priv->dma_cap.number_tx_queues; in stmmac_get_channels()
1166 if (chan->rx_count > priv->dma_cap.number_rx_queues || in stmmac_set_channels()
1167 chan->tx_count > priv->dma_cap.number_tx_queues || in stmmac_set_channels()
1168 !chan->rx_count || !chan->tx_count) in stmmac_set_channels()
1169 return -EINVAL; in stmmac_set_channels()
1171 return stmmac_reinit_queues(dev, chan->rx_count, chan->tx_count); in stmmac_set_channels()
1179 if ((priv->dma_cap.time_stamp || priv->dma_cap.atime_stamp)) { in stmmac_get_ts_info()
1181 info->so_timestamping = SOF_TIMESTAMPING_TX_SOFTWARE | in stmmac_get_ts_info()
1186 if (priv->ptp_clock) in stmmac_get_ts_info()
1187 info->phc_index = ptp_clock_index(priv->ptp_clock); in stmmac_get_ts_info()
1189 info->phc_index = 0; in stmmac_get_ts_info()
1191 info->tx_types = (1 << HWTSTAMP_TX_OFF) | (1 << HWTSTAMP_TX_ON); in stmmac_get_ts_info()
1193 info->rx_filters = ((1 << HWTSTAMP_FILTER_NONE) | in stmmac_get_ts_info()
1217 return -EOPNOTSUPP; in stmmac_get_mm()
1219 spin_lock_irqsave(&priv->fpe_cfg.lock, flags); in stmmac_get_mm()
1221 state->max_verify_time = STMMAC_FPE_MM_MAX_VERIFY_TIME_MS; in stmmac_get_mm()
1222 state->verify_enabled = priv->fpe_cfg.verify_enabled; in stmmac_get_mm()
1223 state->pmac_enabled = priv->fpe_cfg.pmac_enabled; in stmmac_get_mm()
1224 state->verify_time = priv->fpe_cfg.verify_time; in stmmac_get_mm()
1225 state->tx_enabled = priv->fpe_cfg.tx_enabled; in stmmac_get_mm()
1226 state->verify_status = priv->fpe_cfg.status; in stmmac_get_mm()
1227 state->rx_min_frag_size = ETH_ZLEN; in stmmac_get_mm()
1232 if (state->tx_enabled && in stmmac_get_mm()
1233 (state->verify_status == ETHTOOL_MM_VERIFY_STATUS_SUCCEEDED || in stmmac_get_mm()
1234 state->verify_status == ETHTOOL_MM_VERIFY_STATUS_DISABLED)) in stmmac_get_mm()
1235 state->tx_active = true; in stmmac_get_mm()
1237 state->tx_active = false; in stmmac_get_mm()
1240 state->tx_min_frag_size = ethtool_mm_frag_size_add_to_min(frag_size); in stmmac_get_mm()
1242 spin_unlock_irqrestore(&priv->fpe_cfg.lock, flags); in stmmac_get_mm()
1251 struct stmmac_fpe_cfg *fpe_cfg = &priv->fpe_cfg; in stmmac_set_mm()
1256 err = ethtool_mm_frag_size_min_to_add(cfg->tx_min_frag_size, in stmmac_set_mm()
1262 timer_shutdown_sync(&fpe_cfg->verify_timer); in stmmac_set_mm()
1264 spin_lock_irqsave(&fpe_cfg->lock, flags); in stmmac_set_mm()
1266 fpe_cfg->verify_enabled = cfg->verify_enabled; in stmmac_set_mm()
1267 fpe_cfg->pmac_enabled = cfg->pmac_enabled; in stmmac_set_mm()
1268 fpe_cfg->verify_time = cfg->verify_time; in stmmac_set_mm()
1269 fpe_cfg->tx_enabled = cfg->tx_enabled; in stmmac_set_mm()
1271 if (!cfg->verify_enabled) in stmmac_set_mm()
1272 fpe_cfg->status = ETHTOOL_MM_VERIFY_STATUS_DISABLED; in stmmac_set_mm()
1277 spin_unlock_irqrestore(&fpe_cfg->lock, flags); in stmmac_set_mm()
1286 struct stmmac_counters *mmc = &priv->mmc; in stmmac_get_mm_stats()
1288 if (!priv->dma_cap.rmon) in stmmac_get_mm_stats()
1291 stmmac_mmc_read(priv, priv->mmcaddr, mmc); in stmmac_get_mm_stats()
1293 s->MACMergeFrameAssErrorCount = mmc->mmc_rx_packet_assembly_err_cntr; in stmmac_get_mm_stats()
1294 s->MACMergeFrameAssOkCount = mmc->mmc_rx_packet_assembly_ok_cntr; in stmmac_get_mm_stats()
1295 s->MACMergeFrameSmdErrorCount = mmc->mmc_rx_packet_smd_err_cntr; in stmmac_get_mm_stats()
1296 s->MACMergeFragCountRx = mmc->mmc_rx_fpe_fragment_cntr; in stmmac_get_mm_stats()
1297 s->MACMergeFragCountTx = mmc->mmc_tx_fpe_fragment_cntr; in stmmac_get_mm_stats()
1298 s->MACMergeHoldCount = mmc->mmc_tx_hold_req_cntr; in stmmac_get_mm_stats()
1344 netdev->ethtool_ops = &stmmac_ethtool_ops; in stmmac_set_ethtool_ops()