diff options
| author | James Morris <james.l.morris@oracle.com> | 2012-08-17 20:42:30 +1000 |
|---|---|---|
| committer | James Morris <james.l.morris@oracle.com> | 2012-08-17 20:42:30 +1000 |
| commit | 51b743fe87d7fb3dba7a2ff4a1fe23bb65dc2245 (patch) | |
| tree | f8b8f601713a3ecb264eb9f145636343d9350520 /include/linux/etherdevice.h | |
| parent | 9f99798ff49e73dded73a8c674044ea6fb6af651 (diff) | |
| parent | d9875690d9b89a866022ff49e3fcea892345ad92 (diff) | |
Merge tag 'v3.6-rc2' into next
Linux 3.6-rc2
Resync with Linus.
Diffstat (limited to 'include/linux/etherdevice.h')
| -rw-r--r-- | include/linux/etherdevice.h | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index 3d406e0ede6d..d426336d92d9 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h @@ -124,17 +124,30 @@ static inline bool is_valid_ether_addr(const u8 *addr) } /** - * random_ether_addr - Generate software assigned random Ethernet address + * eth_random_addr - Generate software assigned random Ethernet address * @addr: Pointer to a six-byte array containing the Ethernet address * * Generate a random Ethernet address (MAC) that is not multicast * and has the local assigned bit set. */ -static inline void random_ether_addr(u8 *addr) +static inline void eth_random_addr(u8 *addr) { - get_random_bytes (addr, ETH_ALEN); - addr [0] &= 0xfe; /* clear multicast bit */ - addr [0] |= 0x02; /* set local assignment bit (IEEE802) */ + get_random_bytes(addr, ETH_ALEN); + addr[0] &= 0xfe; /* clear multicast bit */ + addr[0] |= 0x02; /* set local assignment bit (IEEE802) */ +} + +#define random_ether_addr(addr) eth_random_addr(addr) + +/** + * eth_broadcast_addr - Assign broadcast address + * @addr: Pointer to a six-byte array containing the Ethernet address + * + * Assign the broadcast address to the given address array. + */ +static inline void eth_broadcast_addr(u8 *addr) +{ + memset(addr, 0xff, ETH_ALEN); } /** @@ -149,7 +162,7 @@ static inline void random_ether_addr(u8 *addr) static inline void eth_hw_addr_random(struct net_device *dev) { dev->addr_assign_type |= NET_ADDR_RANDOM; - random_ether_addr(dev->dev_addr); + eth_random_addr(dev->dev_addr); } /** |
