[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20190103011040.25974-16-marex@denx.de>
Date: Thu, 3 Jan 2019 02:10:36 +0100
From: Marek Vasut <marex@...x.de>
To: netdev@...r.kernel.org
Cc: Marek Vasut <marex@...x.de>,
"David S . Miller" <davem@...emloft.net>,
Nisar Sayed <Nisar.Sayed@...rochip.com>,
Woojung Huh <Woojung.Huh@...rochip.com>,
Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
linux-usb@...r.kernel.org
Subject: [PATCH 15/19] usbnet: smsc95xx: Replace mii_ethtool_gset()
Replace mii_ethtool_gset() with a phydev compatible function and
update the code to match.
Signed-off-by: Marek Vasut <marex@...x.de>
Cc: David S. Miller <davem@...emloft.net>
Cc: Nisar Sayed <Nisar.Sayed@...rochip.com>
Cc: Woojung Huh <Woojung.Huh@...rochip.com>
Cc: Andrew Lunn <andrew@...n.ch>
Cc: Florian Fainelli <f.fainelli@...il.com>
Cc: linux-usb@...r.kernel.org
To: netdev@...r.kernel.org
---
drivers/net/usb/smsc95xx.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
index 87830c67aee1..b04df07d882e 100644
--- a/drivers/net/usb/smsc95xx.c
+++ b/drivers/net/usb/smsc95xx.c
@@ -541,7 +541,7 @@ static int smsc95xx_link_reset(struct usbnet *dev)
{
struct smsc95xx_priv *pdata = (struct smsc95xx_priv *)(dev->data[0]);
struct mii_if_info *mii = &dev->mii;
- struct ethtool_cmd ecmd = { .cmd = ETHTOOL_GSET };
+ struct ethtool_link_ksettings ecmd;
unsigned long flags;
u16 lcladv, rmtadv;
int ret;
@@ -556,16 +556,16 @@ static int smsc95xx_link_reset(struct usbnet *dev)
return ret;
mii_check_media(mii, 1, 1);
- mii_ethtool_gset(&dev->mii, &ecmd);
+ phy_ethtool_ksettings_get(pdata->phydev, &ecmd);
lcladv = phy_read(pdata->phydev, MII_ADVERTISE);
rmtadv = phy_read(pdata->phydev, MII_LPA);
netif_dbg(dev, link, dev->net,
"speed: %u duplex: %d lcladv: %04x rmtadv: %04x\n",
- ethtool_cmd_speed(&ecmd), ecmd.duplex, lcladv, rmtadv);
+ ecmd.base.speed, ecmd.base.duplex, lcladv, rmtadv);
spin_lock_irqsave(&pdata->mac_cr_lock, flags);
- if (ecmd.duplex != DUPLEX_FULL) {
+ if (ecmd.base.duplex != DUPLEX_FULL) {
pdata->mac_cr &= ~MAC_CR_FDPX_;
pdata->mac_cr |= MAC_CR_RCVOWN_;
} else {
@@ -578,7 +578,8 @@ static int smsc95xx_link_reset(struct usbnet *dev)
if (ret < 0)
return ret;
- ret = smsc95xx_phy_update_flowcontrol(dev, ecmd.duplex, lcladv, rmtadv);
+ ret = smsc95xx_phy_update_flowcontrol(dev, ecmd.base.duplex,
+ lcladv, rmtadv);
if (ret < 0)
netdev_warn(dev->net, "Error updating PHY flow control\n");
--
2.19.2
Powered by blists - more mailing lists