aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/smsc/smsc911x.c
diff options
context:
space:
mode:
authorDanny Kukawka <danny.kukawka@bisect.de>2012-02-15 01:45:40 -0500
committerDavid S. Miller <davem@davemloft.net>2012-02-15 15:34:17 -0500
commit7ce5d222190cb3ce3ae88bafde7c4fa52a5103e0 (patch)
tree2b284365b7a2e11d4ba286a589bd35bc39918805 /drivers/net/ethernet/smsc/smsc911x.c
parentf2cedb63df14342ad40a8b5b324fc5d94a60b665 (diff)
net: use eth_hw_addr_random() and reset addr_assign_type
Use eth_hw_addr_random() instead of calling random_ether_addr() to set addr_assign_type correctly to NET_ADDR_RANDOM. Reset the state to NET_ADDR_PERM as soon as the MAC get changed via .ndo_set_mac_address. v2: adapt to renamed eth_hw_addr_random() Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/smsc/smsc911x.c')
-rw-r--r--drivers/net/ethernet/smsc/smsc911x.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/smsc/smsc911x.c b/drivers/net/ethernet/smsc/smsc911x.c
index 6a1cd2360818..4a6971027076 100644
--- a/drivers/net/ethernet/smsc/smsc911x.c
+++ b/drivers/net/ethernet/smsc/smsc911x.c
@@ -1833,6 +1833,7 @@ static int smsc911x_set_mac_address(struct net_device *dev, void *p)
1833 if (!is_valid_ether_addr(addr->sa_data)) 1833 if (!is_valid_ether_addr(addr->sa_data))
1834 return -EADDRNOTAVAIL; 1834 return -EADDRNOTAVAIL;
1835 1835
1836 dev->addr_assign_type &= ~NET_ADDR_RANDOM;
1836 memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN); 1837 memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
1837 1838
1838 spin_lock_irq(&pdata->mac_lock); 1839 spin_lock_irq(&pdata->mac_lock);
@@ -2485,7 +2486,7 @@ static int __devinit smsc911x_drv_probe(struct platform_device *pdev)
2485 "Mac Address is read from LAN911x EEPROM"); 2486 "Mac Address is read from LAN911x EEPROM");
2486 } else { 2487 } else {
2487 /* eeprom values are invalid, generate random MAC */ 2488 /* eeprom values are invalid, generate random MAC */
2488 random_ether_addr(dev->dev_addr); 2489 eth_hw_addr_random(dev);
2489 smsc911x_set_hw_mac_address(pdata, dev->dev_addr); 2490 smsc911x_set_hw_mac_address(pdata, dev->dev_addr);
2490 SMSC_TRACE(pdata, probe, 2491 SMSC_TRACE(pdata, probe,
2491 "MAC Address is set to random_ether_addr"); 2492 "MAC Address is set to random_ether_addr");