Lines Matching +full:elastic +full:- +full:limit
1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 2015-2017 Broadcom
6 #include "bcm-phy-lib.h"
192 if (phydev->interrupts == PHY_INTERRUPT_ENABLED) { in bcm_phy_config_intr()
359 if (phydev->autoneg == AUTONEG_ENABLE) in bcm_phy_enable_apd()
367 /* Enable Auto Power-Down (APD) for the PHY */ in bcm_phy_enable_apd()
394 phydev->supported)) in bcm_phy_set_eee()
397 phydev->supported)) in bcm_phy_set_eee()
448 if (count - BCM54XX_SHD_SCR2_WSPD_RTRY_LMT_OFFSET > in bcm_phy_downshift_set()
451 return -ERANGE; in bcm_phy_downshift_set()
488 val |= (count - BCM54XX_SHD_SCR2_WSPD_RTRY_LMT_OFFSET) << in bcm_phy_downshift_set()
507 { "phy_receive_errors", -1, MII_BRCM_CORE_BASE12, 0, 16 },
508 { "phy_serdes_ber_errors", -1, MII_BRCM_CORE_BASE13, 8, 8 },
509 { "phy_false_carrier_sense_errors", -1, MII_BRCM_CORE_BASE13, 0, 8 },
510 { "phy_local_rcvr_nok", -1, MII_BRCM_CORE_BASE14, 8, 8 },
511 { "phy_remote_rcv_nok", -1, MII_BRCM_CORE_BASE14, 0, 8 },
549 val = val & ((1 << stat.bits) - 1); in bcm_phy_get_stat()
592 /* Adjust bias current trim by -3 */ in bcm_phy_28nm_a0b0_afe_config_init()
633 /* Enable the elastic FIFO for raising the transmission limit from in bcm_phy_enable_jumbo()
657 /* Auto-negotiation must be enabled for cable diagnostics to work, but in _bcm_phy_cable_test_start()
679 /* re-enable the RDB access even if there was an error */ in _bcm_phy_cable_test_start()
788 /* re-enable the RDB access even if there was an error */ in _bcm_phy_cable_test_get_status()
801 phydev->pause = 0; in bcm_setup_lre_forced()
802 phydev->asym_pause = 0; in bcm_setup_lre_forced()
804 if (phydev->speed == SPEED_100) in bcm_setup_lre_forced()
807 if (phydev->duplex != DUPLEX_FULL) in bcm_setup_lre_forced()
808 return -EOPNOTSUPP; in bcm_setup_lre_forced()
814 * bcm_linkmode_adv_to_lre_adv_t - translate linkmode advertisement to LDS
816 * Return: LDS Auto-Negotiation Advertised Ability register value
853 * mode. If, in the future, this is not true anymore, we have to re-implement
877 struct net_device *ndev = phydev->attached_dev; in bcm_phy_set_wol()
883 /* Allow a MAC driver to play through its own Wake-on-LAN in bcm_phy_set_wol()
886 if (wol->wolopts & ~BCM54XX_WOL_SUPPORTED_MASK) in bcm_phy_set_wol()
887 return -EOPNOTSUPP; in bcm_phy_set_wol()
892 BUILD_BUG_ON(sizeof(wol->sopass) != ETH_ALEN); in bcm_phy_set_wol()
905 if (!wol->wolopts) { in bcm_phy_set_wol()
907 disable_irq_wake(phydev->irq); in bcm_phy_set_wol()
915 /* Disable the global Wake-on-LAN enable bit */ in bcm_phy_set_wol()
921 /* Clear the previously configured mode and mask mode for Wake-on-LAN */ in bcm_phy_set_wol()
933 * - WAKE_UCAST -> MAC DA is the device's MAC with a perfect match in bcm_phy_set_wol()
934 * - WAKE_MCAST -> MAC DA is X1:XX:XX:XX:XX:XX where XX is don't care in bcm_phy_set_wol()
935 * - WAKE_BCAST -> MAC DA is FF:FF:FF:FF:FF:FF with a perfect match in bcm_phy_set_wol()
942 if (wol->wolopts & WAKE_MCAST) { in bcm_phy_set_wol()
948 if (wol->wolopts & WAKE_UCAST) { in bcm_phy_set_wol()
949 ether_addr_copy(da, ndev->dev_addr); in bcm_phy_set_wol()
950 } else if (wol->wolopts & WAKE_BCAST) { in bcm_phy_set_wol()
952 } else if (wol->wolopts & WAKE_MAGICSECURE) { in bcm_phy_set_wol()
953 ether_addr_copy(da, wol->sopass); in bcm_phy_set_wol()
954 } else if (wol->wolopts & WAKE_MAGIC) { in bcm_phy_set_wol()
961 if (wol->wolopts & (WAKE_MAGIC | WAKE_MAGICSECURE)) { in bcm_phy_set_wol()
963 BCM54XX_WOL_MPD_DATA1(2 - i), in bcm_phy_set_wol()
964 ndev->dev_addr[i * 2] << 8 | in bcm_phy_set_wol()
965 ndev->dev_addr[i * 2 + 1]); in bcm_phy_set_wol()
970 ret = bcm_phy_write_exp(phydev, BCM54XX_WOL_MPD_DATA2(2 - i), in bcm_phy_set_wol()
975 ret = bcm_phy_write_exp(phydev, BCM54XX_WOL_MASK(2 - i), in bcm_phy_set_wol()
981 if (wol->wolopts & WAKE_MAGICSECURE) { in bcm_phy_set_wol()
988 if (wol->wolopts & WAKE_MAGIC) in bcm_phy_set_wol()
996 /* Globally enable Wake-on-LAN */ in bcm_phy_set_wol()
1013 /* Enable all Wake-on-LAN interrupt sources */ in bcm_phy_set_wol()
1019 enable_irq_wake(phydev->irq); in bcm_phy_set_wol()
1027 struct net_device *ndev = phydev->attached_dev; in bcm_phy_get_wol()
1033 wol->supported = BCM54XX_WOL_SUPPORTED_MASK; in bcm_phy_get_wol()
1034 wol->wolopts = 0; in bcm_phy_get_wol()
1047 BCM54XX_WOL_MPD_DATA2(2 - i)); in bcm_phy_get_wol()
1057 wol->wolopts |= WAKE_BCAST; in bcm_phy_get_wol()
1059 wol->wolopts |= WAKE_MCAST; in bcm_phy_get_wol()
1060 else if (ether_addr_equal(da, ndev->dev_addr)) in bcm_phy_get_wol()
1061 wol->wolopts |= WAKE_UCAST; in bcm_phy_get_wol()
1066 wol->wolopts |= WAKE_MAGIC; in bcm_phy_get_wol()
1069 wol->wolopts |= WAKE_MAGICSECURE; in bcm_phy_get_wol()
1070 memcpy(wol->sopass, da, sizeof(da)); in bcm_phy_get_wol()
1093 return -EINVAL; in bcm_phy_led_brightness_set()
1116 switch (phydev->master_slave_set) { in bcm_setup_lre_master_slave()
1129 return -EOPNOTSUPP; in bcm_setup_lre_master_slave()
1149 if (phydev->autoneg != AUTONEG_ENABLE) in bcm_config_lre_aneg()
1163 * bcm_config_lre_advert - sanitize and advertise Long-Distance Signaling
1164 * auto-negotiation parameters
1175 u32 adv = bcm_linkmode_adv_to_lre_adv_t(phydev->advertising); in bcm_config_lre_advert()
1177 /* Setup BroadR-Reach mode advertisement */ in bcm_config_lre_advert()