aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Glendinning <steve.glendinning@shawell.net>2012-12-09 20:01:19 -0500
committerDavid S. Miller <davem@davemloft.net>2012-12-10 14:09:00 -0500
commit481705a172a1fcd483d4a90963c7593964219273 (patch)
treebd567a8e72350436173bf688dbccefa1a8238eea
parent4b5511ebc7e1cf94e4f13be19c2cf3e90edc3395 (diff)
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: Steve Glendinning <steve.glendinning@shawell.net> Reported-by: Robert Cunningham <rcunningham@nsmsurveillance.com> Cc: Bjorn Mork <bjorn@mork.no> Cc: Dan Williams <dcbw@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/usb/smsc75xx.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c
index 1cbd936bb028..251a3354a4b0 100644
--- a/drivers/net/usb/smsc75xx.c
+++ b/drivers/net/usb/smsc75xx.c
@@ -1054,8 +1054,6 @@ static int smsc75xx_reset(struct usbnet *dev)
1054 1054
1055 netif_dbg(dev, ifup, dev->net, "PHY reset complete\n"); 1055 netif_dbg(dev, ifup, dev->net, "PHY reset complete\n");
1056 1056
1057 smsc75xx_init_mac_address(dev);
1058
1059 ret = smsc75xx_set_mac_address(dev); 1057 ret = smsc75xx_set_mac_address(dev);
1060 if (ret < 0) { 1058 if (ret < 0) {
1061 netdev_warn(dev->net, "Failed to set mac address\n"); 1059 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 dev->net->hw_features = NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM | 1420 dev->net->hw_features = NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM |
1423 NETIF_F_SG | NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_RXCSUM; 1421 NETIF_F_SG | NETIF_F_TSO | NETIF_F_TSO6 | NETIF_F_RXCSUM;
1424 1422
1423 ret = smsc75xx_wait_ready(dev, 0);
1424 if (ret < 0) {
1425 netdev_warn(dev->net, "device not ready in smsc75xx_bind\n");
1426 return ret;
1427 }
1428
1429 smsc75xx_init_mac_address(dev);
1430
1425 /* Init all registers */ 1431 /* Init all registers */
1426 ret = smsc75xx_reset(dev); 1432 ret = smsc75xx_reset(dev);
1427 if (ret < 0) { 1433 if (ret < 0) {