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

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

Merge branch 'Continue-towards-using-linkmode-in-phylib'



Andrew Lunn says:

====================
Continue towards using linkmode in phylib

These patches contain some further cleanup and helpers, and the first
real patch towards using linkmode bitmaps in phylink.

The macro magic in the RFC version has been replaced with run time
initialisation.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 97ea8ac3 719655a1
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -658,11 +658,7 @@ static void mt7530_adjust_link(struct dsa_switch *ds, int port,
			if (phydev->asym_pause)
				rmt_adv |= LPA_PAUSE_ASYM;

			if (phydev->advertising & ADVERTISED_Pause)
				lcl_adv |= ADVERTISE_PAUSE_CAP;
			if (phydev->advertising & ADVERTISED_Asym_Pause)
				lcl_adv |= ADVERTISE_PAUSE_ASYM;

			lcl_adv = ethtool_adv_to_lcl_adv_t(phydev->advertising);
			flowctrl = mii_resolve_flowctrl_fdx(lcl_adv, rmt_adv);

			if (flowctrl & FLOW_CTRL_TX)
+7 −8
Original line number Diff line number Diff line
@@ -878,8 +878,9 @@ static bool xgbe_phy_finisar_phy_quirks(struct xgbe_prv_data *pdata)
	phy_write(phy_data->phydev, 0x04, 0x0d01);
	phy_write(phy_data->phydev, 0x00, 0x9140);

	phy_data->phydev->supported = PHY_GBIT_FEATURES;
	phy_data->phydev->advertising = phy_data->phydev->supported;
	phy_data->phydev->supported = PHY_10BT_FEATURES |
				      PHY_100BT_FEATURES |
				      PHY_1000BT_FEATURES;
	phy_support_asym_pause(phy_data->phydev);

	netif_dbg(pdata, drv, pdata->netdev,
@@ -950,8 +951,9 @@ static bool xgbe_phy_belfuse_phy_quirks(struct xgbe_prv_data *pdata)
	reg = phy_read(phy_data->phydev, 0x00);
	phy_write(phy_data->phydev, 0x00, reg & ~0x00800);

	phy_data->phydev->supported = PHY_GBIT_FEATURES;
	phy_data->phydev->advertising = phy_data->phydev->supported;
	phy_data->phydev->supported = (PHY_10BT_FEATURES |
				       PHY_100BT_FEATURES |
				       PHY_1000BT_FEATURES);
	phy_support_asym_pause(phy_data->phydev);

	netif_dbg(pdata, drv, pdata->netdev,
@@ -1495,10 +1497,7 @@ static void xgbe_phy_phydev_flowctrl(struct xgbe_prv_data *pdata)
	if (!phy_data->phydev)
		return;

	if (phy_data->phydev->advertising & ADVERTISED_Pause)
		lcl_adv |= ADVERTISE_PAUSE_CAP;
	if (phy_data->phydev->advertising & ADVERTISED_Asym_Pause)
		lcl_adv |= ADVERTISE_PAUSE_ASYM;
	lcl_adv = ethtool_adv_to_lcl_adv_t(phy_data->phydev->advertising);

	if (phy_data->phydev->pause) {
		XGBE_SET_LP_ADV(lks, Pause);
+1 −5
Original line number Diff line number Diff line
@@ -393,11 +393,7 @@ void fman_get_pause_cfg(struct mac_device *mac_dev, bool *rx_pause,
	 */

	/* get local capabilities */
	lcl_adv = 0;
	if (phy_dev->advertising & ADVERTISED_Pause)
		lcl_adv |= ADVERTISE_PAUSE_CAP;
	if (phy_dev->advertising & ADVERTISED_Asym_Pause)
		lcl_adv |= ADVERTISE_PAUSE_ASYM;
	lcl_adv = ethtool_adv_to_lcl_adv_t(phy_dev->advertising);

	/* get link partner capabilities */
	rmt_adv = 0;
+1 −6
Original line number Diff line number Diff line
@@ -3656,12 +3656,7 @@ static u32 gfar_get_flowctrl_cfg(struct gfar_private *priv)
		if (phydev->asym_pause)
			rmt_adv |= LPA_PAUSE_ASYM;

		lcl_adv = 0;
		if (phydev->advertising & ADVERTISED_Pause)
			lcl_adv |= ADVERTISE_PAUSE_CAP;
		if (phydev->advertising & ADVERTISED_Asym_Pause)
			lcl_adv |= ADVERTISE_PAUSE_ASYM;

		lcl_adv = ethtool_adv_to_lcl_adv_t(phydev->advertising);
		flowctrl = mii_resolve_flowctrl_fdx(lcl_adv, rmt_adv);
		if (flowctrl & FLOW_CTRL_TX)
			val |= MACCFG1_TX_FLOW;
+1 −5
Original line number Diff line number Diff line
@@ -5006,11 +5006,7 @@ int hclge_cfg_flowctrl(struct hclge_dev *hdev)
	if (!phydev->link || !phydev->autoneg)
		return 0;

	if (phydev->advertising & ADVERTISED_Pause)
		local_advertising = ADVERTISE_PAUSE_CAP;

	if (phydev->advertising & ADVERTISED_Asym_Pause)
		local_advertising |= ADVERTISE_PAUSE_ASYM;
	local_advertising = ethtool_adv_to_lcl_adv_t(phydev->advertising);

	if (phydev->pause)
		remote_advertising = LPA_PAUSE_CAP;
Loading