Commit 535baf85 authored by Robert Foss's avatar Robert Foss Committed by David S. Miller

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: default avatarGrant Grundler <grundler@google.com>
Signed-off-by: default avatarRobert Foss <robert.foss@collabora.com>
Tested-by: default avatarRobert Foss <robert.foss@collabora.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a243c2ef
...@@ -928,12 +928,9 @@ static int ax88178_reset(struct usbnet *dev) ...@@ -928,12 +928,9 @@ static int ax88178_reset(struct usbnet *dev)
asix_mdio_write(dev->net, dev->mii.phy_id, MII_CTRL1000, asix_mdio_write(dev->net, dev->mii.phy_id, MII_CTRL1000,
ADVERTISE_1000FULL); ADVERTISE_1000FULL);
asix_write_medium_mode(dev, AX88178_MEDIUM_DEFAULT, 0);
mii_nway_restart(&dev->mii); mii_nway_restart(&dev->mii);
ret = asix_write_medium_mode(dev, AX88178_MEDIUM_DEFAULT, 0);
if (ret < 0)
return ret;
/* Rewrite MAC address */ /* Rewrite MAC address */
memcpy(data->mac_addr, dev->net->dev_addr, ETH_ALEN); memcpy(data->mac_addr, dev->net->dev_addr, ETH_ALEN);
ret = asix_write_cmd(dev, AX_CMD_WRITE_NODE_ID, 0, 0, ETH_ALEN, ret = asix_write_cmd(dev, AX_CMD_WRITE_NODE_ID, 0, 0, ETH_ALEN,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment