diff options
author | Danny Kukawka <danny.kukawka@bisect.de> | 2012-02-15 07:45:40 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-02-15 21:34:17 +0100 |
commit | 7ce5d222190cb3ce3ae88bafde7c4fa52a5103e0 (patch) | |
tree | 2b284365b7a2e11d4ba286a589bd35bc39918805 /drivers/net/ethernet/micrel/ks8851.c | |
parent | net: replace random_ether_addr() with eth_hw_addr_random() (diff) | |
download | linux-7ce5d222190cb3ce3ae88bafde7c4fa52a5103e0.tar.xz linux-7ce5d222190cb3ce3ae88bafde7c4fa52a5103e0.zip |
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/micrel/ks8851.c')
-rw-r--r-- | drivers/net/ethernet/micrel/ks8851.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/net/ethernet/micrel/ks8851.c b/drivers/net/ethernet/micrel/ks8851.c index 0930b9c950d0..42a6a20efb15 100644 --- a/drivers/net/ethernet/micrel/ks8851.c +++ b/drivers/net/ethernet/micrel/ks8851.c @@ -439,7 +439,7 @@ static void ks8851_init_mac(struct ks8851_net *ks) dev->dev_addr); } - random_ether_addr(dev->dev_addr); + eth_hw_addr_random(dev); ks8851_write_mac_addr(dev); } @@ -1050,6 +1050,7 @@ static int ks8851_set_mac_address(struct net_device *dev, void *addr) if (!is_valid_ether_addr(sa->sa_data)) return -EADDRNOTAVAIL; + dev->addr_assign_type &= ~NET_ADDR_RANDOM; memcpy(dev->dev_addr, sa->sa_data, ETH_ALEN); return ks8851_write_mac_addr(dev); } |