• Home
  • Raw
  • Download

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()
810 * mode. If, in the future, this is not true anymore, we have to re-implement
834 struct net_device *ndev = phydev->attached_dev; in bcm_phy_set_wol()
840 /* Allow a MAC driver to play through its own Wake-on-LAN in bcm_phy_set_wol()
843 if (wol->wolopts & ~BCM54XX_WOL_SUPPORTED_MASK) in bcm_phy_set_wol()
844 return -EOPNOTSUPP; in bcm_phy_set_wol()
849 BUILD_BUG_ON(sizeof(wol->sopass) != ETH_ALEN); in bcm_phy_set_wol()
862 if (!wol->wolopts) { in bcm_phy_set_wol()
864 disable_irq_wake(phydev->irq); in bcm_phy_set_wol()
872 /* Disable the global Wake-on-LAN enable bit */ in bcm_phy_set_wol()
878 /* Clear the previously configured mode and mask mode for Wake-on-LAN */ in bcm_phy_set_wol()
890 * - WAKE_UCAST -> MAC DA is the device's MAC with a perfect match in bcm_phy_set_wol()
891 * - WAKE_MCAST -> MAC DA is X1:XX:XX:XX:XX:XX where XX is don't care in bcm_phy_set_wol()
892 * - WAKE_BCAST -> MAC DA is FF:FF:FF:FF:FF:FF with a perfect match in bcm_phy_set_wol()
899 if (wol->wolopts & WAKE_MCAST) { in bcm_phy_set_wol()
905 if (wol->wolopts & WAKE_UCAST) { in bcm_phy_set_wol()
906 ether_addr_copy(da, ndev->dev_addr); in bcm_phy_set_wol()
907 } else if (wol->wolopts & WAKE_BCAST) { in bcm_phy_set_wol()
909 } else if (wol->wolopts & WAKE_MAGICSECURE) { in bcm_phy_set_wol()
910 ether_addr_copy(da, wol->sopass); in bcm_phy_set_wol()
911 } else if (wol->wolopts & WAKE_MAGIC) { in bcm_phy_set_wol()
918 if (wol->wolopts & (WAKE_MAGIC | WAKE_MAGICSECURE)) { in bcm_phy_set_wol()
920 BCM54XX_WOL_MPD_DATA1(2 - i), in bcm_phy_set_wol()
921 ndev->dev_addr[i * 2] << 8 | in bcm_phy_set_wol()
922 ndev->dev_addr[i * 2 + 1]); in bcm_phy_set_wol()
927 ret = bcm_phy_write_exp(phydev, BCM54XX_WOL_MPD_DATA2(2 - i), in bcm_phy_set_wol()
932 ret = bcm_phy_write_exp(phydev, BCM54XX_WOL_MASK(2 - i), in bcm_phy_set_wol()
938 if (wol->wolopts & WAKE_MAGICSECURE) { in bcm_phy_set_wol()
945 if (wol->wolopts & WAKE_MAGIC) in bcm_phy_set_wol()
953 /* Globally enable Wake-on-LAN */ in bcm_phy_set_wol()
970 /* Enable all Wake-on-LAN interrupt sources */ in bcm_phy_set_wol()
976 enable_irq_wake(phydev->irq); in bcm_phy_set_wol()
984 struct net_device *ndev = phydev->attached_dev; in bcm_phy_get_wol()
990 wol->supported = BCM54XX_WOL_SUPPORTED_MASK; in bcm_phy_get_wol()
991 wol->wolopts = 0; in bcm_phy_get_wol()
1004 BCM54XX_WOL_MPD_DATA2(2 - i)); in bcm_phy_get_wol()
1014 wol->wolopts |= WAKE_BCAST; in bcm_phy_get_wol()
1016 wol->wolopts |= WAKE_MCAST; in bcm_phy_get_wol()
1017 else if (ether_addr_equal(da, ndev->dev_addr)) in bcm_phy_get_wol()
1018 wol->wolopts |= WAKE_UCAST; in bcm_phy_get_wol()
1023 wol->wolopts |= WAKE_MAGIC; in bcm_phy_get_wol()
1026 wol->wolopts |= WAKE_MAGICSECURE; in bcm_phy_get_wol()
1027 memcpy(wol->sopass, da, sizeof(da)); in bcm_phy_get_wol()
1050 return -EINVAL; in bcm_phy_led_brightness_set()