summaryrefslogtreecommitdiffstats
path: root/drivers/net/usb
diff options
context:
space:
mode:
authorRobert Foss <robert.foss@collabora.com>2016-08-29 09:32:19 -0400
committerDavid S. Miller <davem@davemloft.net>2016-08-31 21:07:06 -0700
commit535baf8588d04b177cb33700f81499f2b5203c2d (patch)
tree185daf2bc71d41f3127f50728b6ef848026dbe75 /drivers/net/usb
parenta243c2efb5774b29f1e0b43240cfcdcabf001497 (diff)
downloadlinux-stable-535baf8588d04b177cb33700f81499f2b5203c2d.tar.gz
linux-stable-535baf8588d04b177cb33700f81499f2b5203c2d.tar.bz2
linux-stable-535baf8588d04b177cb33700f81499f2b5203c2d.zip
net: asix: autoneg will set WRITE_MEDIUM reg
From: Grant Grundler <grundler@chromium.org> The miii_nway_restart() causes a PHY link change activity and ax88772_link_reset will be called. link_reset will set AX_CMD_WRITE_MEDIUM_MODE register correctly. The asix_write_medium_mode in reset() fills in a default value to the register which may be different from the negotiation result. So do this first. Ignore the ret value since it's ignored in XXX_link_reset() functions. Signed-off-by: Grant Grundler <grundler@google.com> Signed-off-by: Robert Foss <robert.foss@collabora.com> Tested-by: Robert Foss <robert.foss@collabora.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/usb')
-rw-r--r--drivers/net/usb/asix_devices.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/net/usb/asix_devices.c b/drivers/net/usb/asix_devices.c
index dbcdda2ebb18..cce24950a0ab 100644
--- a/drivers/net/usb/asix_devices.c
+++ b/drivers/net/usb/asix_devices.c
@@ -928,12 +928,9 @@ static int ax88178_reset(struct usbnet *dev)
asix_mdio_write(dev->net, dev->mii.phy_id, MII_CTRL1000,
ADVERTISE_1000FULL);
+ asix_write_medium_mode(dev, AX88178_MEDIUM_DEFAULT, 0);
mii_nway_restart(&dev->mii);
- ret = asix_write_medium_mode(dev, AX88178_MEDIUM_DEFAULT, 0);
- if (ret < 0)
- return ret;
-
/* Rewrite MAC address */
memcpy(data->mac_addr, dev->net->dev_addr, ETH_ALEN);
ret = asix_write_cmd(dev, AX_CMD_WRITE_NODE_ID, 0, 0, ETH_ALEN,