Lines Matching +full:master +full:- +full:stats
1 // SPDX-License-Identifier: GPL-2.0
16 * DP83TG720S_POLL_ACTIVE_LINK - Polling interval in milliseconds when the link
18 * DP83TG720S_POLL_NO_LINK_MIN - Minimum polling interval in milliseconds when
20 * DP83TG720S_POLL_NO_LINK_MAX - Maximum polling interval in milliseconds when
76 /* Register 0x0576: TDR Master Link Down Control */
88 * 32-bit or 16-bit counters for TX and RX statistics and must be read in
91 * - DP83TG720S_PKT_STAT_1: Contains TX packet count bits [15:0].
92 * - DP83TG720S_PKT_STAT_2: Contains TX packet count bits [31:16].
93 * - DP83TG720S_PKT_STAT_3: Contains TX error packet count.
94 * - DP83TG720S_PKT_STAT_4: Contains RX packet count bits [15:0].
95 * - DP83TG720S_PKT_STAT_5: Contains RX packet count bits [31:16].
96 * - DP83TG720S_PKT_STAT_6: Contains RX error packet count.
126 struct dp83tg720_stats stats; member
130 * dp83tg720_update_stats - Update the PHY statistics for the DP83TD510 PHY.
140 struct dp83tg720_priv *priv = phydev->priv; in dp83tg720_update_stats()
150 priv->stats.link_loss_cnt += count; in dp83tg720_update_stats()
153 * - Group 1 (TX stats): DP83TG720S_PKT_STAT_1 to DP83TG720S_PKT_STAT_3 in dp83tg720_update_stats()
154 * - Group 2 (RX stats): DP83TG720S_PKT_STAT_4 to DP83TG720S_PKT_STAT_6 in dp83tg720_update_stats()
174 priv->stats.tx_pkt_cnt += count; in dp83tg720_update_stats()
180 priv->stats.tx_err_pkt_cnt += ret; in dp83tg720_update_stats()
193 priv->stats.rx_pkt_cnt += count; in dp83tg720_update_stats()
199 priv->stats.rx_err_pkt_cnt += ret; in dp83tg720_update_stats()
207 struct dp83tg720_priv *priv = phydev->priv; in dp83tg720_get_link_stats()
209 link_stats->link_down_events = priv->stats.link_loss_cnt; in dp83tg720_get_link_stats()
214 struct ethtool_phy_stats *stats) in dp83tg720_get_phy_stats() argument
216 struct dp83tg720_priv *priv = phydev->priv; in dp83tg720_get_phy_stats()
218 stats->tx_packets = priv->stats.tx_pkt_cnt; in dp83tg720_get_phy_stats()
219 stats->tx_errors = priv->stats.tx_err_pkt_cnt; in dp83tg720_get_phy_stats()
220 stats->rx_packets = priv->stats.rx_pkt_cnt; in dp83tg720_get_phy_stats()
221 stats->rx_errors = priv->stats.rx_err_pkt_cnt; in dp83tg720_get_phy_stats()
225 * dp83tg720_cable_test_start - Start the cable test for the DP83TG720 PHY.
237 * "DP83TG720S-Q1: Configuring for Open Alliance Specification in dp83tg720_cable_test_start()
243 /* Force master link down */ in dp83tg720_cable_test_start()
284 * dp83tg720_cable_test_get_status - Get the status of the cable test for the
337 /* save the current stats before resetting the PHY */ in dp83tg720_cable_test_get_status()
350 * We need to care only about master/slave configuration if it was in dp83tg720_config_aneg()
357 /* Re-read role configuration to make changes visible even if in dp83tg720_config_aneg()
368 phydev->pause = 0; in dp83tg720_read_status()
369 phydev->asym_pause = 0; in dp83tg720_read_status()
375 phydev->link = !!(phy_sts & DP83TG720S_LINK_STATUS); in dp83tg720_read_status()
376 if (!phydev->link) { in dp83tg720_read_status()
377 /* save the current stats before resetting the PHY */ in dp83tg720_read_status()
393 /* Sleep 600ms for PHY stabilization post-reset. in dp83tg720_read_status()
400 /* After HW reset we need to restore master/slave configuration. in dp83tg720_read_status()
408 phydev->speed = SPEED_UNKNOWN; in dp83tg720_read_status()
409 phydev->duplex = DUPLEX_UNKNOWN; in dp83tg720_read_status()
419 phydev->duplex = DUPLEX_FULL; in dp83tg720_read_status()
420 phydev->speed = SPEED_1000; in dp83tg720_read_status()
430 if (!phydev->link) in dp83tg720_get_sqi()
450 switch (phydev->interface) { in dp83tg720_config_rgmii_delay()
488 * The wait value of one 1ms is documented in "DP83TG720S-Q1 1000BASE-T1 in dp83tg720_config_init()
515 struct device *dev = &phydev->mdio.dev; in dp83tg720_probe()
520 return -ENOMEM; in dp83tg720_probe()
522 phydev->priv = priv; in dp83tg720_probe()
528 * dp83tg720_get_next_update_time - Determine the next update time for PHY
545 * in the worst-case scenario.
554 if (phydev->link) { in dp83tg720_get_next_update_time()
570 get_random_u32_below(max_jiffies - min_jiffies + 1); in dp83tg720_get_next_update_time()