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

Merge branch 'ethtool-EEE'



Heiner Kallweit says:

====================
ethtool: switch EEE netlink interface to use EEE linkmode bitmaps

So far only 32bit legacy bitmaps are passed to userspace. This makes
it impossible to manage EEE linkmodes beyond bit 32, e.g. manage EEE
for 2500BaseT and 5000BaseT. This series adds support for passing
full linkmode bitmaps between kernel and userspace.

Fortunately the netlink-based part of ethtool is quite smart and no
changes are needed in ethtool. However this applies to the netlink
interface only, the ioctl interface for now remains restricted to
legacy bitmaps.

Next step will be adding support for the c45 EEE2 standard registers
(3.21, 7.62, 7.63) to the genphy_c45 functions dealing with EEE.
I have a follow-up series for this ready to be submitted.

v2:
- now as RFC
- adopt suggestion from Andrew to start with struct ethtool_keee
  being an identical copy of ethtool_eee, and switch all users
v3:
- switch from RFC to net-next
- add patch 4, and reuse old names in patch 5
- rebase patch 1
v4:
- fix missing replacement in patch 4
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 2acfd589 2bb05261
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -1257,7 +1257,7 @@ static void b53_adjust_link(struct dsa_switch *ds, int port,
			    struct phy_device *phydev)
{
	struct b53_device *dev = ds->priv;
	struct ethtool_eee *p = &dev->ports[port].eee;
	struct ethtool_keee *p = &dev->ports[port].eee;
	u8 rgmii_ctrl = 0, reg = 0, off;
	bool tx_pause = false;
	bool rx_pause = false;
@@ -2224,10 +2224,10 @@ int b53_eee_init(struct dsa_switch *ds, int port, struct phy_device *phy)
}
EXPORT_SYMBOL(b53_eee_init);

int b53_get_mac_eee(struct dsa_switch *ds, int port, struct ethtool_eee *e)
int b53_get_mac_eee(struct dsa_switch *ds, int port, struct ethtool_keee *e)
{
	struct b53_device *dev = ds->priv;
	struct ethtool_eee *p = &dev->ports[port].eee;
	struct ethtool_keee *p = &dev->ports[port].eee;
	u16 reg;

	if (is5325(dev) || is5365(dev))
@@ -2241,10 +2241,10 @@ int b53_get_mac_eee(struct dsa_switch *ds, int port, struct ethtool_eee *e)
}
EXPORT_SYMBOL(b53_get_mac_eee);

int b53_set_mac_eee(struct dsa_switch *ds, int port, struct ethtool_eee *e)
int b53_set_mac_eee(struct dsa_switch *ds, int port, struct ethtool_keee *e)
{
	struct b53_device *dev = ds->priv;
	struct ethtool_eee *p = &dev->ports[port].eee;
	struct ethtool_keee *p = &dev->ports[port].eee;

	if (is5325(dev) || is5365(dev))
		return -EOPNOTSUPP;
+3 −3
Original line number Diff line number Diff line
@@ -95,7 +95,7 @@ struct b53_pcs {

struct b53_port {
	u16		vlan_ctl_mask;
	struct ethtool_eee eee;
	struct ethtool_keee eee;
};

struct b53_vlan {
@@ -397,7 +397,7 @@ void b53_disable_port(struct dsa_switch *ds, int port);
void b53_brcm_hdr_setup(struct dsa_switch *ds, int port);
void b53_eee_enable_set(struct dsa_switch *ds, int port, bool enable);
int b53_eee_init(struct dsa_switch *ds, int port, struct phy_device *phy);
int b53_get_mac_eee(struct dsa_switch *ds, int port, struct ethtool_eee *e);
int b53_set_mac_eee(struct dsa_switch *ds, int port, struct ethtool_eee *e);
int b53_get_mac_eee(struct dsa_switch *ds, int port, struct ethtool_keee *e);
int b53_set_mac_eee(struct dsa_switch *ds, int port, struct ethtool_keee *e);

#endif
+1 −1
Original line number Diff line number Diff line
@@ -835,7 +835,7 @@ static void bcm_sf2_sw_mac_link_up(struct dsa_switch *ds, int port,
				   bool tx_pause, bool rx_pause)
{
	struct bcm_sf2_priv *priv = bcm_sf2_to_priv(ds);
	struct ethtool_eee *p = &priv->dev->ports[port].eee;
	struct ethtool_keee *p = &priv->dev->ports[port].eee;
	u32 reg_rgmii_ctrl = 0;
	u32 reg, offset;

+2 −2
Original line number Diff line number Diff line
@@ -2852,7 +2852,7 @@ static int ksz_validate_eee(struct dsa_switch *ds, int port)
}

static int ksz_get_mac_eee(struct dsa_switch *ds, int port,
			   struct ethtool_eee *e)
			   struct ethtool_keee *e)
{
	int ret;

@@ -2872,7 +2872,7 @@ static int ksz_get_mac_eee(struct dsa_switch *ds, int port,
}

static int ksz_set_mac_eee(struct dsa_switch *ds, int port,
			   struct ethtool_eee *e)
			   struct ethtool_keee *e)
{
	struct ksz_device *dev = ds->priv;
	int ret;
+2 −2
Original line number Diff line number Diff line
@@ -3048,7 +3048,7 @@ mt753x_setup(struct dsa_switch *ds)
}

static int mt753x_get_mac_eee(struct dsa_switch *ds, int port,
			      struct ethtool_eee *e)
			      struct ethtool_keee *e)
{
	struct mt7530_priv *priv = ds->priv;
	u32 eeecr = mt7530_read(priv, MT7530_PMEEECR_P(port));
@@ -3060,7 +3060,7 @@ static int mt753x_get_mac_eee(struct dsa_switch *ds, int port,
}

static int mt753x_set_mac_eee(struct dsa_switch *ds, int port,
			      struct ethtool_eee *e)
			      struct ethtool_keee *e)
{
	struct mt7530_priv *priv = ds->priv;
	u32 set, mask = LPI_THRESH_MASK | LPI_MODE_EN;
Loading