summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGrant Grundler <grundler@chromium.org>2016-07-27 15:31:46 -0400
committerRobert Foss <robert.foss@collabora.com>2016-07-27 16:02:38 -0400
commit6c9610b921dd1f04b4bf61af3580545722393b1e (patch)
tree95494857305aae9cc9f141ccd649d9cb2f2d9522
parent52bf48ce654585cee70600aabcd890ecf5f10f24 (diff)
downloadlinux-patch_net_usb_asix_v2.tar.gz
linux-patch_net_usb_asix_v2.tar.xz
net: asix: autoneg will set WRITE_MEDIUM regpatch_net_usb_asix_v2
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 link_reset code too. Signed-off-by: Grant Grundler <grundler@google.com> Signed-off-by: Robert Foss <robert.foss@collabora.com>
-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 dbcdda2..cce2495 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,