Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 15665342 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'Preparing-for-phylib-linkmodes'



Andrew Lunn says:

====================
Preparing for phylib linkmodes

phylib currently makes us of a u32 bitmap for advertising, supported,
and link partner capabilities. For a long time, this has been
sufficient, for devices up to 1Gbps. With more MAC/PHY combinations
now supporting speeds greater than 1Gbps, we have run out of
bits. There is the need to replace this u32 with an
__ETHTOOL_DECLARE_LINK_MODE_MASK, which makes use of linux's generic
bitmaps.

This patchset does some of the work preparing for this change. A few
cleanups are applied to PHY drivers. Some MAC drivers directly access
members of phydev which are going to change type. These patches adds
some helpers and swaps MAC drivers to use them, mostly dealing with
Pause configuration.

v3:
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Add missing at in commit message
Change Subject of patch 5
Fix return in from phy_set_asym_pause
Fix kerneldoc in phy_set_pause

v2:
Fixup bad indentation in tg3.c
Rename phy_support_pause() to phy_support_sym_pause()
Also trigger autoneg if the advertising settings have changed.
Rename phy_set_pause() to phy_set_sym_pause()
Use the bcm63xx_enet.c logic, not fec_main.c for validating pause
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents eca09be8 22b7d299
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -377,9 +377,7 @@ static int ax_mii_probe(struct net_device *dev)
		return ret;
	}

	/* mask with MAC supported features */
	phy_dev->supported &= PHY_BASIC_FEATURES;
	phy_dev->advertising = phy_dev->supported;
	phy_set_max_speed(phy_dev, SPEED_100);

	netdev_info(dev, "PHY driver [%s] (mii_bus:phy_addr=%s, irq=%d)\n",
		    phy_dev->drv->name, phydev_name(phy_dev), phy_dev->irq);
+2 −2
Original line number Diff line number Diff line
@@ -1279,9 +1279,9 @@ static int greth_mdio_probe(struct net_device *dev)
	}

	if (greth->gbit_mac)
		phy->supported &= PHY_GBIT_FEATURES;
		phy_set_max_speed(phy, SPEED_1000);
	else
		phy->supported &= PHY_BASIC_FEATURES;
		phy_set_max_speed(phy, SPEED_100);

	phy->advertising = phy->supported;

+2 −10
Original line number Diff line number Diff line
@@ -3258,19 +3258,11 @@ static int et131x_mii_probe(struct net_device *netdev)
		return PTR_ERR(phydev);
	}

	phydev->supported &= (SUPPORTED_10baseT_Half |
			      SUPPORTED_10baseT_Full |
			      SUPPORTED_100baseT_Half |
			      SUPPORTED_100baseT_Full |
			      SUPPORTED_Autoneg |
			      SUPPORTED_MII |
			      SUPPORTED_TP);
	phy_set_max_speed(phydev, SPEED_100);

	if (adapter->pdev->device != ET131X_PCI_DEVICE_ID_FAST)
		phydev->supported |= SUPPORTED_1000baseT_Half |
				     SUPPORTED_1000baseT_Full;
		phy_set_max_speed(phydev, SPEED_1000);

	phydev->advertising = phydev->supported;
	phydev->autoneg = AUTONEG_ENABLE;

	phy_attached_info(phydev);
+1 −2
Original line number Diff line number Diff line
@@ -172,8 +172,7 @@ static int emac_mdio_probe(struct net_device *dev)
	}

	/* mask with MAC supported features */
	phydev->supported &= PHY_BASIC_FEATURES;
	phydev->advertising = phydev->supported;
	phy_set_max_speed(phydev, SPEED_100);

	db->link = 0;
	db->speed = 0;
+1 −4
Original line number Diff line number Diff line
@@ -835,13 +835,10 @@ static int init_phy(struct net_device *dev)
	}

	/* Stop Advertising 1000BASE Capability if interface is not GMII
	 * Note: Checkpatch throws CHECKs for the camel case defines below,
	 * it's ok to ignore.
	 */
	if ((priv->phy_iface == PHY_INTERFACE_MODE_MII) ||
	    (priv->phy_iface == PHY_INTERFACE_MODE_RMII))
		phydev->advertising &= ~(SUPPORTED_1000baseT_Half |
					 SUPPORTED_1000baseT_Full);
		phy_set_max_speed(phydev, SPEED_100);

	/* Broken HW is sometimes missing the pull-up resistor on the
	 * MDIO line, which results in reads to non-existent devices returning
Loading