Commit af8d9bb2 authored by Andrew Lunn's avatar Andrew Lunn Committed by David S. Miller
Browse files

net: ethernet: Add helper for MACs which support asym pause



Rather than have the MAC drivers manipulate phydev members to indicate
they support Asym Pause, add a helper function.

Signed-off-by: default avatarAndrew Lunn <andrew@lunn.ch>
Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 41124fa6
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -879,8 +879,8 @@ static bool xgbe_phy_finisar_phy_quirks(struct xgbe_prv_data *pdata)
	phy_write(phy_data->phydev, 0x00, 0x9140);

	phy_data->phydev->supported = PHY_GBIT_FEATURES;
	phy_data->phydev->supported |= SUPPORTED_Pause | SUPPORTED_Asym_Pause;
	phy_data->phydev->advertising = phy_data->phydev->supported;
	phy_support_asym_pause(phy_data->phydev);

	netif_dbg(pdata, drv, pdata->netdev,
		  "Finisar PHY quirk in place\n");
@@ -951,8 +951,8 @@ static bool xgbe_phy_belfuse_phy_quirks(struct xgbe_prv_data *pdata)
	phy_write(phy_data->phydev, 0x00, reg & ~0x00800);

	phy_data->phydev->supported = PHY_GBIT_FEATURES;
	phy_data->phydev->supported |= SUPPORTED_Pause | SUPPORTED_Asym_Pause;
	phy_data->phydev->advertising = phy_data->phydev->supported;
	phy_support_asym_pause(phy_data->phydev);

	netif_dbg(pdata, drv, pdata->netdev,
		  "BelFuse PHY quirk in place\n");
+1 −3
Original line number Diff line number Diff line
@@ -898,9 +898,7 @@ int xgene_enet_phy_connect(struct net_device *ndev)
	phy_remove_link_mode(phy_dev, ETHTOOL_LINK_MODE_10baseT_Half_BIT);
	phy_remove_link_mode(phy_dev, ETHTOOL_LINK_MODE_100baseT_Half_BIT);
	phy_remove_link_mode(phy_dev, ETHTOOL_LINK_MODE_1000baseT_Half_BIT);
	phy_dev->supported |= SUPPORTED_Pause |
			      SUPPORTED_Asym_Pause;
	phy_dev->advertising = phy_dev->supported;
	phy_support_asym_pause(phy_dev);

	return 0;
}
+1 −4
Original line number Diff line number Diff line
@@ -2358,13 +2358,10 @@ static int sbmac_mii_probe(struct net_device *dev)

	/* Remove any features not supported by the controller */
	phy_set_max_speed(phy_dev, SPEED_1000);
	phy_dev->supported |= SUPPORTED_Pause |
			      SUPPORTED_Asym_Pause;
	phy_support_asym_pause(phy_dev);

	phy_attached_info(phy_dev);

	phy_dev->advertising = phy_dev->supported;

	sc->phy_dev = phy_dev;

	return 0;
+2 −6
Original line number Diff line number Diff line
@@ -2123,15 +2123,13 @@ static int tg3_phy_init(struct tg3 *tp)
	case PHY_INTERFACE_MODE_RGMII:
		if (!(tp->phy_flags & TG3_PHYFLG_10_100_ONLY)) {
			phy_set_max_speed(phydev, SPEED_1000);
			phydev->supported |= (SUPPORTED_Pause |
					      SUPPORTED_Asym_Pause);
			phy_support_asym_pause(phydev);
			break;
		}
		/* fallthru */
	case PHY_INTERFACE_MODE_MII:
		phy_set_max_speed(phydev, SPEED_100);
		phydev->supported |= (SUPPORTED_Pause |
				      SUPPORTED_Asym_Pause);
		phy_support_asym_pause(phydev);
		break;
	default:
		phy_disconnect(mdiobus_get_phy(tp->mdio_bus, tp->phy_addr));
@@ -2140,8 +2138,6 @@ static int tg3_phy_init(struct tg3 *tp)

	tp->phy_flags |= TG3_PHYFLG_IS_CONNECTED;

	phydev->advertising = phydev->supported;

	phy_attached_info(phydev);

	return 0;
+1 −2
Original line number Diff line number Diff line
@@ -373,8 +373,7 @@ static int gmac_setup_phy(struct net_device *netdev)
	netdev->phydev = phy;

	phy_set_max_speed(phy, SPEED_1000);
	phy->supported |= SUPPORTED_Asym_Pause | SUPPORTED_Pause;
	phy->advertising = phy->supported;
	phy_support_asym_pause(phy);

	/* set PHY interface type */
	switch (phy->interface) {
Loading