aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/marvell
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/marvell
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/marvell')
-rw-r--r--drivers/net/ethernet/marvell/pxa168_eth.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/marvell/pxa168_eth.c b/drivers/net/ethernet/marvell/pxa168_eth.c
index 75df2091bd2e..83e37ad113e0 100644
--- a/drivers/net/ethernet/marvell/pxa168_eth.c
+++ b/drivers/net/ethernet/marvell/pxa168_eth.c
@@ -629,6 +629,7 @@ static int pxa168_eth_set_mac_address(struct net_device *dev, void *addr)
629 if (!is_valid_ether_addr(sa->sa_data)) 629 if (!is_valid_ether_addr(sa->sa_data))
630 return -EINVAL; 630 return -EINVAL;
631 memcpy(oldMac, dev->dev_addr, ETH_ALEN); 631 memcpy(oldMac, dev->dev_addr, ETH_ALEN);
632 dev->addr_assign_type &= ~NET_ADDR_RANDOM;
632 memcpy(dev->dev_addr, sa->sa_data, ETH_ALEN); 633 memcpy(dev->dev_addr, sa->sa_data, ETH_ALEN);
633 netif_addr_lock_bh(dev); 634 netif_addr_lock_bh(dev);
634 update_hash_table_mac_address(pep, oldMac, dev->dev_addr); 635 update_hash_table_mac_address(pep, oldMac, dev->dev_addr);
@@ -1520,7 +1521,7 @@ static int pxa168_eth_probe(struct platform_device *pdev)
1520 INIT_WORK(&pep->tx_timeout_task, pxa168_eth_tx_timeout_task); 1521 INIT_WORK(&pep->tx_timeout_task, pxa168_eth_tx_timeout_task);
1521 1522
1522 printk(KERN_INFO "%s:Using random mac address\n", DRIVER_NAME); 1523 printk(KERN_INFO "%s:Using random mac address\n", DRIVER_NAME);
1523 random_ether_addr(dev->dev_addr); 1524 eth_hw_addr_random(dev);
1524 1525
1525 pep->pd = pdev->dev.platform_data; 1526 pep->pd = pdev->dev.platform_data;
1526 pep->rx_ring_size = NUM_RX_DESCS; 1527 pep->rx_ring_size = NUM_RX_DESCS;