Lines Matching +full:auto +full:- +full:string +full:- +full:detection
1 // SPDX-License-Identifier: GPL-2.0+
27 /* Vendor-specific PHY Definitions */
43 const char *string; member
70 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { in smsc_phy_config_intr()
91 struct smsc_phy_priv *priv = phydev->priv; in smsc_phy_config_edpd()
93 if (priv->edpd_enable) in smsc_phy_config_edpd()
107 if (irq_status != -ENODEV) in smsc_phy_handle_interrupt()
124 struct smsc_phy_priv *priv = phydev->priv; in smsc_phy_config_init()
130 if (!priv->edpd_mode_set_by_user && phydev->irq != PHY_POLL) in smsc_phy_config_init()
131 priv->edpd_enable = false; in smsc_phy_config_init()
162 /* When auto-negotiation is disabled (forced mode), the PHY's in lan87xx_config_aneg()
163 * Auto-MDIX will continue toggling the TX/RX pairs. in lan87xx_config_aneg()
167 * 'auto'), we default to ETH_TP_MDI. This choice of a ETH_TP_MDI mode in lan87xx_config_aneg()
171 if (phydev->autoneg == AUTONEG_DISABLE) { in lan87xx_config_aneg()
172 if (phydev->mdix_ctrl == ETH_TP_MDI_AUTO) in lan87xx_config_aneg()
175 mdix_ctrl = phydev->mdix_ctrl; in lan87xx_config_aneg()
177 mdix_ctrl = phydev->mdix_ctrl; in lan87xx_config_aneg()
206 phydev->mdix = mdix_ctrl; in lan87xx_config_aneg()
212 if (phydev->phy_id == 0x0007c0f0) { /* LAN9500A or LAN9505A */ in lan95xx_config_aneg_ext()
225 * The LAN87xx suffers from rare absence of the ENERGYON-bit when Ethernet cable
226 * plugs in while LAN87xx is in Energy Detect Power-Down mode. This leads to
227 * unstable detection of plugging in Ethernet cable.
228 * This workaround disables Energy Detect Power-Down mode and waiting for
230 * The Energy Detect Power-Down mode is enabled again in the end of procedure to
232 * The workaround is only applicable to poll mode. Energy Detect Power-Down may
233 * not be used in interrupt mode lest link change detection becomes unreliable.
237 struct smsc_phy_priv *priv = phydev->priv; in lan87xx_read_status()
244 if (!phydev->link && priv && priv->edpd_enable && in lan87xx_read_status()
245 priv->edpd_max_wait_ms) { in lan87xx_read_status()
246 unsigned int max_wait = priv->edpd_max_wait_ms * 1000; in lan87xx_read_status()
269 /* Re-enable EDPD */ in lan87xx_read_status()
288 /* The LAN87xx PHY's initial MDI-X mode is determined by the AUTOMDIX_EN in lan87xx_phy_config_init()
294 * into a known state with Auto-MDIX enabled, which is the expected in lan87xx_phy_config_init()
306 phydev->mdix_ctrl = ETH_TP_MDI_AUTO; in lan87xx_phy_config_init()
323 * be cleared to de-assert PME signal after a WoL event happens, but in lan874x_phy_config_init()
324 * using PME auto clear gets around that. in lan874x_phy_config_init()
344 struct smsc_phy_priv *priv = phydev->priv; in lan874x_get_wol()
347 wol->supported = (WAKE_UCAST | WAKE_BCAST | WAKE_MAGIC | in lan874x_get_wol()
349 wol->wolopts = 0; in lan874x_get_wol()
356 wol->wolopts |= WAKE_UCAST; in lan874x_get_wol()
359 wol->wolopts |= WAKE_BCAST; in lan874x_get_wol()
362 wol->wolopts |= WAKE_MAGIC; in lan874x_get_wol()
365 if (priv->wol_arp) in lan874x_get_wol()
366 wol->wolopts |= WAKE_ARP; in lan874x_get_wol()
368 wol->wolopts |= WAKE_MCAST; in lan874x_get_wol()
385 * are 8 registers to program the 16-bit masks, where each bit means in lan874x_chk_wol_pattern()
396 for (j = 0; j < 16; j++, i++, len--) { in lan874x_chk_wol_pattern()
440 reg--; in lan874x_set_wol_pattern()
442 masklen -= 16; in lan874x_set_wol_pattern()
448 reg--; in lan874x_set_wol_pattern()
456 struct net_device *ndev = phydev->attached_dev; in lan874x_set_wol()
457 struct smsc_phy_priv *priv = phydev->priv; in lan874x_set_wol()
464 if ((wol->wolopts & (WAKE_ARP | WAKE_MCAST)) == in lan874x_set_wol()
468 return -EOPNOTSUPP; in lan874x_set_wol()
477 if (wol->wolopts & WAKE_UCAST) in lan874x_set_wol()
482 if (wol->wolopts & WAKE_BCAST) in lan874x_set_wol()
487 if (wol->wolopts & WAKE_MAGIC) in lan874x_set_wol()
493 if (wol->wolopts & (WAKE_ARP | WAKE_MCAST)) in lan874x_set_wol()
498 if (wol->wolopts & WAKE_ARP) { in lan874x_set_wol()
515 priv->wol_arp = true; in lan874x_set_wol()
518 if (wol->wolopts & WAKE_MCAST) { in lan874x_set_wol()
524 priv->wol_arp = false; in lan874x_set_wol()
527 if (wol->wolopts & (WAKE_MAGIC | WAKE_UCAST)) { in lan874x_set_wol()
528 const u8 *mac = (const u8 *)ndev->dev_addr; in lan874x_set_wol()
532 for (i = 0; i < 6; i += 2, reg--) { in lan874x_set_wol()
558 ethtool_puts(&data, smsc_hw_stats[i].string); in smsc_get_strings()
587 struct smsc_phy_priv *priv = phydev->priv; in smsc_phy_get_edpd()
590 return -EOPNOTSUPP; in smsc_phy_get_edpd()
592 if (!priv->edpd_enable) in smsc_phy_get_edpd()
594 else if (!priv->edpd_max_wait_ms) in smsc_phy_get_edpd()
597 *edpd = PHY_STATE_MACH_MS + priv->edpd_max_wait_ms; in smsc_phy_get_edpd()
604 struct smsc_phy_priv *priv = phydev->priv; in smsc_phy_set_edpd()
607 return -EOPNOTSUPP; in smsc_phy_set_edpd()
611 priv->edpd_enable = false; in smsc_phy_set_edpd()
614 priv->edpd_enable = true; in smsc_phy_set_edpd()
615 priv->edpd_max_wait_ms = 0; in smsc_phy_set_edpd()
621 if (phydev->irq != PHY_POLL) in smsc_phy_set_edpd()
622 return -EOPNOTSUPP; in smsc_phy_set_edpd()
624 return -EINVAL; in smsc_phy_set_edpd()
625 priv->edpd_enable = true; in smsc_phy_set_edpd()
626 priv->edpd_max_wait_ms = edpd - PHY_STATE_MACH_MS; in smsc_phy_set_edpd()
629 priv->edpd_mode_set_by_user = true; in smsc_phy_set_edpd()
637 switch (tuna->id) { in smsc_phy_get_tunable()
641 return -EOPNOTSUPP; in smsc_phy_get_tunable()
649 switch (tuna->id) { in smsc_phy_set_tunable()
653 return -EOPNOTSUPP; in smsc_phy_set_tunable()
660 struct device *dev = &phydev->mdio.dev; in smsc_phy_probe()
666 return -ENOMEM; in smsc_phy_probe()
668 priv->edpd_enable = true; in smsc_phy_probe()
669 priv->edpd_max_wait_ms = EDPD_MAX_WAIT_DFLT_MS; in smsc_phy_probe()
671 if (device_property_present(dev, "smsc,disable-energy-detect")) in smsc_phy_probe()
672 priv->edpd_enable = false; in smsc_phy_probe()
674 phydev->priv = priv; in smsc_phy_probe()