Message ID | be356a21-5a1a-45b3-9407-3a97f3af4600@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 5077bc7af28f649d669f9cda6b5fedecedfaef2d |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [v2,net-next] ixgene-v2: prepare for phylib stop exporting phy_10_100_features_array | expand |
On Wed, Feb 12, 2025 at 07:32:52AM +0100, Heiner Kallweit wrote: > As part of phylib cleanup we plan to stop exporting the feature arrays. > So explicitly remove the modes not supported by the MAC. The media type > bits don't have any impact on kernel behavior, so don't touch them. > > Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Andrew
On 2/12/2025 7:32 AM, Heiner Kallweit wrote: > As part of phylib cleanup we plan to stop exporting the feature arrays. > So explicitly remove the modes not supported by the MAC. The media type > bits don't have any impact on kernel behavior, so don't touch them. > > Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> > --- > v2: > - use phy_remove_link_mode() > --- > drivers/net/ethernet/apm/xgene-v2/mdio.c | 18 ++++++------------ > 1 file changed, 6 insertions(+), 12 deletions(-) > > diff --git a/drivers/net/ethernet/apm/xgene-v2/mdio.c b/drivers/net/ethernet/apm/xgene-v2/mdio.c > index eba06831a..6a17045a5 100644 > --- a/drivers/net/ethernet/apm/xgene-v2/mdio.c > +++ b/drivers/net/ethernet/apm/xgene-v2/mdio.c > @@ -97,7 +97,6 @@ void xge_mdio_remove(struct net_device *ndev) > > int xge_mdio_config(struct net_device *ndev) > { > - __ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, }; > struct xge_pdata *pdata = netdev_priv(ndev); > struct device *dev = &pdata->pdev->dev; > struct mii_bus *mdio_bus; > @@ -137,17 +136,12 @@ int xge_mdio_config(struct net_device *ndev) > goto err; > } > > - linkmode_set_bit_array(phy_10_100_features_array, > - ARRAY_SIZE(phy_10_100_features_array), > - mask); > - linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT, mask); > - linkmode_set_bit(ETHTOOL_LINK_MODE_AUI_BIT, mask); > - linkmode_set_bit(ETHTOOL_LINK_MODE_MII_BIT, mask); > - linkmode_set_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, mask); > - linkmode_set_bit(ETHTOOL_LINK_MODE_BNC_BIT, mask); > - > - linkmode_andnot(phydev->supported, phydev->supported, mask); > - linkmode_copy(phydev->advertising, phydev->supported); > + phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_10baseT_Half_BIT); > + phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_10baseT_Full_BIT); > + phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_100baseT_Half_BIT); > + phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_100baseT_Full_BIT); > + phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_1000baseT_Half_BIT); > + > pdata->phy_speed = SPEED_UNKNOWN; > > return 0; Reviewed-by: Mateusz Polchlopek <mateusz.polchlopek@intel.com>
Hello: This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <kuba@kernel.org>: On Wed, 12 Feb 2025 07:32:52 +0100 you wrote: > As part of phylib cleanup we plan to stop exporting the feature arrays. > So explicitly remove the modes not supported by the MAC. The media type > bits don't have any impact on kernel behavior, so don't touch them. > > Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> > --- > v2: > - use phy_remove_link_mode() > > [...] Here is the summary with links: - [v2,net-next] ixgene-v2: prepare for phylib stop exporting phy_10_100_features_array https://git.kernel.org/netdev/net-next/c/5077bc7af28f You are awesome, thank you!
diff --git a/drivers/net/ethernet/apm/xgene-v2/mdio.c b/drivers/net/ethernet/apm/xgene-v2/mdio.c index eba06831a..6a17045a5 100644 --- a/drivers/net/ethernet/apm/xgene-v2/mdio.c +++ b/drivers/net/ethernet/apm/xgene-v2/mdio.c @@ -97,7 +97,6 @@ void xge_mdio_remove(struct net_device *ndev) int xge_mdio_config(struct net_device *ndev) { - __ETHTOOL_DECLARE_LINK_MODE_MASK(mask) = { 0, }; struct xge_pdata *pdata = netdev_priv(ndev); struct device *dev = &pdata->pdev->dev; struct mii_bus *mdio_bus; @@ -137,17 +136,12 @@ int xge_mdio_config(struct net_device *ndev) goto err; } - linkmode_set_bit_array(phy_10_100_features_array, - ARRAY_SIZE(phy_10_100_features_array), - mask); - linkmode_set_bit(ETHTOOL_LINK_MODE_1000baseT_Half_BIT, mask); - linkmode_set_bit(ETHTOOL_LINK_MODE_AUI_BIT, mask); - linkmode_set_bit(ETHTOOL_LINK_MODE_MII_BIT, mask); - linkmode_set_bit(ETHTOOL_LINK_MODE_FIBRE_BIT, mask); - linkmode_set_bit(ETHTOOL_LINK_MODE_BNC_BIT, mask); - - linkmode_andnot(phydev->supported, phydev->supported, mask); - linkmode_copy(phydev->advertising, phydev->supported); + phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_10baseT_Half_BIT); + phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_10baseT_Full_BIT); + phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_100baseT_Half_BIT); + phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_100baseT_Full_BIT); + phy_remove_link_mode(phydev, ETHTOOL_LINK_MODE_1000baseT_Half_BIT); + pdata->phy_speed = SPEED_UNKNOWN; return 0;
As part of phylib cleanup we plan to stop exporting the feature arrays. So explicitly remove the modes not supported by the MAC. The media type bits don't have any impact on kernel behavior, so don't touch them. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> --- v2: - use phy_remove_link_mode() --- drivers/net/ethernet/apm/xgene-v2/mdio.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-)