summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet
AgeCommit message (Collapse)Author
2022-01-15net: mvneta: use .mac_select_pcs() interfaceRussell King (Oracle)
Convert mvneta to use the mac_select_interface rather than using phylink_set_pcs(). The intention here is to unify the approach for PCS and eventually remove phylink_set_pcs(). Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-15net: mvneta: reorder initialisationRussell King (Oracle)
Re-order the mvneta initialisation to move devm based resources and easy setup earlier in the probe function. The primary reason for this is to allow us to switch the driver to use phylink's mac_select_pcs() callback. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-14net: stmmac: use .mac_select_pcs() interfaceRussell King (Oracle)
Convert stmmac to use the mac_select_pcs() interface rather than using phylink_set_pcs(). The intention here is to unify the approach for PCS and eventually to remove phylink_set_pcs(). Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-14net: stmmac: convert to phylink_generic_validate()Russell King (Oracle)
Convert stmmac to use phylink_generic_validate() now that we have the MAC capabilities and supported interfaces filled in, and we have the PCS validation handled via the PCS operations. Tested-by: Wong Vee Khee <vee.khee.wong@linux.intel.com> # Intel EHL Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-14net: stmmac: remove phylink_config.pcs_poll usageRussell King (Oracle)
Phylink will use PCS polling whenever the PCS's poll member is set, so setting phylink_config.pcs_poll as well is redundant. Tested-by: Wong Vee Khee <vee.khee.wong@linux.intel.com> # Intel EHL Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-14net: stmmac/xpcs: convert to pcs_validate()Russell King (Oracle)
stmmac explicitly calls the xpcs driver to validate the ethtool linkmodes. This is no longer necessary as phylink now supports validation through a PCS method. Convert both drivers to use this new mechanism. Tested-by: Wong Vee Khee <vee.khee.wong@linux.intel.com> # Intel EHL Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-14net: stmmac: fill in supported_interfacesRussell King (Oracle)
Fill in phylink's supported_interfaces bitmap with the PHY interface modes which can be used to talk to the PHY. We indicate that the PHY interface mode passed in platform data is always supported, as this is the initial mode passed into phylink. When there is no PCS specified, we assume that this is the only mode that is supported - indeed, the driver appears not to support dynamic switching of interface types at present. When a xpcs is present, it defines the PHY interface modes that the stmmac driver can support. Request the supported interfaces from the xpcs driver, and pass them to phylink. Tested-by: Wong Vee Khee <vee.khee.wong@linux.intel.com> # Intel EHL Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-14net: stmmac: convert to phylink_get_linkmodes()Russell King (Oracle)
Add the MAC speed, duplex and pause capabilities to the phylink_config structure, and switch stmmac_validate() to use phylink_get_linkmodes() to generate the mask of supported ethtool link modes. Tested-by: Wong Vee Khee <vee.khee.wong@linux.intel.com> # Intel EHL Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-14net: enetc: use .mac_select_pcs() interfaceRussell King (Oracle)
Convert the PCS selection to use mac_select_pcs, which allows the PCS to perform any validation it needs. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-14net: dpaa2-mac: use .mac_select_pcs() interfaceRussell King (Oracle)
Convert dpaa2-mac to use the mac_select_pcs() interface rather than using phylink_set_pcs(). The intention here is to unify the approach for PCS and eventually to remove phylink_set_pcs(). Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-12net: axienet: replace mdiobus_write() with mdiodev_write()Russell King (Oracle)
Commit 0ebecb2644c8 ("net: mdio: Add helper functions for accessing MDIO devices") added support for mdiodev accessor operations that neatly wrap the mdiobus accessor operations. Since we are dealing with a mdio device here, update the driver to use mdiodev_write(). Tested-by: Harini Katakam <harini.katakam@xilinx.com> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-12net: axienet: convert to phylink_pcsRussell King (Oracle)
Convert axienet to use the phylink_pcs layer, resulting in it no longer being a legacy driver. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-12net: macb: use .mac_select_pcs() interfaceRussell King (Oracle)
Convert the PCS selection to use mac_select_pcs, which allows the PCS to perform any validation it needs. We must use separate phylink_pcs instances for the USX and SGMII PCS, rather than just changing the "ops" pointer before re-setting it to phylink as this interface queries the PCS, rather than requesting it to be changed. Acked-by: Nicolas Ferre <nicolas.ferre@microchip.com> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-12net: mvneta: convert to pcs_validate() and phylink_generic_validate()Russell King (Oracle)
Convert mvneta to validate the autoneg state for 1000base-X in the pcs_validate() operation, rather than the MAC validate() operation. This allows us to switch the MAC validate() to use phylink_generic_validate(). Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-12net: mvneta: convert to phylink pcs operationsRussell King
An initial stab at converting mvneta to PCS operations. There's a few FIXMEs to be solved. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2022-01-12net: mvneta: convert to use mac_prepare()/mac_finish()Russell King
Convert mvneta to use the mac_prepare() and mac_finish() methods in preparation to converting mvneta to split-PCS support. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2022-01-12net: mvpp2: convert to pcs_validate() and phylink_generic_validate()Russell King (Oracle)
Convert mvpp2 to validate the autoneg state for 1000base-X in the pcs_validate() operation, rather than the MAC validate() operation. This allows us to switch the MAC validate() to use phylink_generic_validate(). Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-12net: mvpp2: use .mac_select_pcs() interfaceRussell King (Oracle)
Use the mac_select_pcs() method to choose between the GMAC and XLG PCS implementations. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-12net: mvneta: mark as a legacy_pre_march2020 driverRussell King (Oracle)
mvneta provides mac_an_restart and mac_pcs_get_state methods, so needs to be marked as a legacy driver. Marek spotted that mvneta had stopped working in 2500base-X mode - thanks for reporting. Reported-by: Marek Behún <kabel@kernel.org> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-12net: axienet: mark as a legacy_pre_march2020 driverRussell King (Oracle)
axienet has a PCS, but does not make use of the phylink PCS support. Mark it was a pre-March 2020 driver. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-12net: ag71xx: remove unnecessary legacy methodsRussell King (Oracle)
ag71xx may have a PCS, but it does not appear to support configuration of the PCS in the current code. The functions to get its state merely report that the link is down, and the AN restart function is empty. Since neither of these functions will be called unless phylink's legacy flag is set, we can safely remove these functions and indicate this is a modern driver. Should PCS support be added later, it will need to be modelled using the phylink_pcs support rather than operating as a legacy driver. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-12net: mtk_eth_soc: mark as a legacy_pre_march2020 driverRussell King (Oracle)
mtk_eth_soc has not been updated for commit 7cceb599d15d ("net: phylink: avoid mac_config calls"), and makes use of state->speed and state->duplex in contravention of the phylink documentation. This makes reliant on the legacy behaviours, so mark it as a legacy driver. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-12net: mvneta: program 1ms autonegotiation clock divisorRussell King
Program the 1ms autonegotiation clock divisor according to the clocking rate of neta - without this, the 1ms clock ticks at about 660us on Armada 38x configured for 250MHz. Bring this into correct specification. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2022-01-12net: macb: convert to phylink_generic_validate()Russell King (Oracle)
Populate the supported interfaces bitmap and MAC capabilities mask for the macb driver and remove the old validate implementation. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-12net: marvell: mvpp2: Add support for 5gbase-rMarek Behún
Add support for PHY_INTERFACE_MODE_5GBASER. Signed-off-by: Marek Behún <kabel@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
2022-01-12Fix coverity issue 'Uninitialized scalar variable"Yacov Simhony
There are three boolean variable which were not initialized and later being used in the code. Signed-off-by: Yacov Simhony <ysimhony@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
2022-01-12net: macb: Fix several edge cases in validateSean Anderson
There were several cases where validate() would return bogus supported modes with unusual combinations of interfaces and capabilities. For example, if state->interface was 10GBASER and the macb had HIGH_SPEED and PCS but not GIGABIT MODE, then 10/100 modes would be set anyway. In another case, SGMII could be enabled even if the mac was not a GEM (despite this being checked for later on in mac_config()). These inconsistencies make it difficult to refactor this function cleanly. There is still the open question of what exactly the requirements for SGMII and 10GBASER are, and what SGMII actually supports. If someone from Cadence (or anyone else with access to the GEM/MACB datasheet) could comment on this, it would be greatly appreciated. In particular, what is supported by Cadence vs. vendor extension/limitation? To address this, the current logic is split into three parts. First, we determine what we support, then we eliminate unsupported interfaces, and finally we set the appropriate link modes. There is still some cruft related to NA, but this can be removed in a future patch. Signed-off-by: Sean Anderson <sean.anderson@seco.com> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-12net: dpaa2-mac: use phylink_generic_validate()Russell King (Oracle)
DPAA2 has no special behaviour in its validation implementation, so can be switched to phylink_generic_validate(). Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-12net: dpaa2-mac: remove interface checks in dpaa2_mac_validate()Russell King (Oracle)
As phylink checks the interface mode against the supported_interfaces bitmap, we no longer need to validate the interface mode, nor handle PHY_INTERFACE_MODE_NA in the validation function. Remove these to simplify the implementation. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-12net: dpaa2-mac: populate supported_interfaces memberRussell King
Populate the phy interface mode bitmap for the Freescale DPAA2 driver with interfaces modes supported by the MAC. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2022-01-12net: ag71xx: use phylink_generic_validate()Russell King (Oracle)
ag71xx apparently only supports MII port type, which makes it different from other implementations. However, Oleksij says there is no special reason for this. Convert the driver to use phylink_generic_validate(), which will allow all ethtool port linkmodes instead of only MII, giving the driver consistent behaviour with other drivers. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-12net: ag71xx: remove interface checks in ag71xx_mac_validate()Russell King (Oracle)
As phylink checks the interface mode against the supported_interfaces bitmap, we no longer need to validate the interface mode, nor handle PHY_INTERFACE_MODE_NA in the validation function. Remove these to simplify the implementation. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-12net: ag71xx: populate supported_interfaces memberRussell King
Populate the phy_interface_t bitmap for the Atheros ag71xx driver with interfaces modes supported by the MAC. Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
2022-01-12net: ocelot_net: use phylink_generic_validate()Russell King (Oracle)
ocelot_net has no special behaviour in its validation implementation, so can be switched to phylink_generic_validate(). Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-12net: ocelot_net: remove interface checks in macb_validate()Russell King (Oracle)
As phylink checks the interface mode against the supported_interfaces bitmap, we no longer need to validate the interface mode in the validation function. Remove this to simplify it. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-12net: ocelot_net: populate supported_interfaces memberRussell King (Oracle)
Populate the phy interface mode bitmap for the MSCC Ocelot driver with the interface modes supported by the MAC. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-12net: mtk_eth_soc: use phylink_generic_validate()Russell King (Oracle)
mtk_eth_soc has no special behaviour in its validation implementation, so can be switched to phylink_generic_validate(). Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-12net: mtk_eth_soc: drop use of phylink_helper_basex_speed()Russell King (Oracle)
Now that we have a better method to select SFP interface modes, we no longer need to use phylink_helper_basex_speed() in a driver's validation function, and we can also get rid of our hack to indicate both 1000base-X and 2500base-X if the comphy is present to make that work. Remove this hack and use of phylink_helper_basex_speed(). Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-12net: mtk_eth_soc: remove interface checks in mtk_validate()Russell King (Oracle)
As phylink checks the interface mode against the supported_interfaces bitmap, we no longer need to validate the interface mode, nor handle PHY_INTERFACE_MODE_NA in the validation function. Remove these to simplify the implementation. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-12net: mtk_eth_soc: populate supported_interfaces memberRussell King (Oracle)
Populate the phy interface mode bitmap for the Mediatek driver with interfaces modes supported by the MAC. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-12net: sparx5: use phylink_generic_validate()Russell King (Oracle)
Sparx5 has no special behaviour in its validation implementation, so can be switched to phylink_generic_validate(). Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-12net: sparx5: clean up sparx5_phylink_validate()Russell King (Oracle)
sparx5_phylink_validate() no longer needs to check for PHY_INTERFACE_MODE_NA as phylink will walk the supported interface types to discover the link mode capabilities. Neither is it necessary to check the device capabilities as we will not be called for unsupported interface modes. Remove these checks. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-12net: sparx5: populate supported_interfaces memberRussell King (Oracle)
Populate the phy_interface_t bitmap for the Microchip Sparx5 driver with interfaces modes supported by the MAC. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-12net: enetc: use phylink_generic_validate()Russell King (Oracle)
enetc has no special behaviour in its validation implementation, so can be switched to phylink_generic_validate(). Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-12net: enetc: remove interface checks in enetc_pl_mac_validate()Russell King (Oracle)
As phylink checks the interface mode against the supported_interfaces bitmap, we no longer need to validate the interface mode in the validation function. Remove this to simplify it. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-12net: enetc: populate supported_interfaces memberRussell King (Oracle)
Populate the phy_interface_t bitmap for the Freescale enetc driver with interfaces modes supported by the MAC. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-12net: axienet: use phylink_generic_validate()Russell King (Oracle)
axienet has no special behaviour in its validation implementation, so can be switched to phylink_generic_validate(). Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-12net: axienet: remove interface checks in axienet_validate()Russell King (Oracle)
As phylink checks the interface mode against the supported_interfaces bitmap, we no longer need to validate the interface mode in the validation function. Remove this to simplify it. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-12net: axienet: populate supported_interfaces memberRussell King (Oracle)
Populate the phy_interface_t bitmap for the Xilinx axienet driver with interfaces modes supported by the MAC. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
2022-01-12net: mvpp2: use phylink_generic_validate()Russell King (Oracle)
Convert mvpp2 to use phylink_generic_validate() for the bulk of its validate() implementation. This network adapter has a restriction that for 802.3z links, autonegotiation must be enabled. Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>