Commit 481705a1 authored by Steve Glendinning's avatar Steve Glendinning Committed by David S. Miller

smsc75xx: only set mac address once on bind

This patch changes when we decide what the device's MAC address
is from per ifconfig up to once when the device is connected.

Without this patch, a manually forced device MAC is overwritten
on ifconfig down/up.  Also devices that have no EEPROM are
assigned a new random address on ifconfig down/up instead of
persisting the same one.
Signed-off-by: default avatarSteve Glendinning <steve.glendinning@shawell.net>
Reported-by: default avatarRobert Cunningham <rcunningham@nsmsurveillance.com>
Cc: Bjorn Mork <bjorn@mork.no>
Cc: Dan Williams <dcbw@redhat.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4b5511eb
...@@ -1054,8 +1054,6 @@ static int smsc75xx_reset(struct usbnet *dev) ...@@ -1054,8 +1054,6 @@ static int smsc75xx_reset(struct usbnet *dev)
netif_dbg(dev, ifup, dev->net, "PHY reset complete\n"); netif_dbg(dev, ifup, dev->net, "PHY reset complete\n");
smsc75xx_init_mac_address(dev);
ret = smsc75xx_set_mac_address(dev); ret = smsc75xx_set_mac_address(dev);
if (ret < 0) { if (ret < 0) {
netdev_warn(dev->net, "Failed to set mac address\n"); netdev_warn(dev->net, "Failed to set mac address\n");
...@@ -1422,6 +1420,14 @@ static int smsc75xx_bind(struct usbnet *dev, struct usb_interface *intf) ...@@ -1422,6 +1420,14 @@ static int smsc75xx_bind(struct usbnet *dev, struct usb_interface *intf)
dev->net->hw_features = NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | dev->net->hw_features = NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
NETIF_F_SG | NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_RXCSUM; NETIF_F_SG | NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_RXCSUM;
ret = smsc75xx_wait_ready(dev, 0);
if (ret < 0) {
netdev_warn(dev->net, "device not ready in smsc75xx_bind\n");
return ret;
}
smsc75xx_init_mac_address(dev);
/* Init all registers */ /* Init all registers */
ret = smsc75xx_reset(dev); ret = smsc75xx_reset(dev);
if (ret < 0) { if (ret < 0) {
......
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