aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/etherdevice.h
diff options
context:
space:
mode:
authorJoe Perches <joe@perches.com>2012-07-12 15:33:05 -0400
committerDavid S. Miller <davem@davemloft.net>2012-07-17 01:38:27 -0400
commit0a4dd594982a321699000218715e28664ec49169 (patch)
tree81d589ae2e7cc9f73c9608ff0fc14c6582c0c825 /include/linux/etherdevice.h
parent07689b0a5c26176c528d7864b93188045439f49b (diff)
etherdevice: Rename random_ether_addr to eth_random_addr
Add some API symmetry to eth_broadcast_addr and add a #define to the old name for backward compatibility. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/etherdevice.h')
-rw-r--r--include/linux/etherdevice.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index 98a27cccedfd..d426336d92d9 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -124,19 +124,21 @@ static inline bool is_valid_ether_addr(const u8 *addr)
124} 124}
125 125
126/** 126/**
127 * random_ether_addr - Generate software assigned random Ethernet address 127 * eth_random_addr - Generate software assigned random Ethernet address
128 * @addr: Pointer to a six-byte array containing the Ethernet address 128 * @addr: Pointer to a six-byte array containing the Ethernet address
129 * 129 *
130 * Generate a random Ethernet address (MAC) that is not multicast 130 * Generate a random Ethernet address (MAC) that is not multicast
131 * and has the local assigned bit set. 131 * and has the local assigned bit set.
132 */ 132 */
133static inline void random_ether_addr(u8 *addr) 133static inline void eth_random_addr(u8 *addr)
134{ 134{
135 get_random_bytes (addr, ETH_ALEN); 135 get_random_bytes(addr, ETH_ALEN);
136 addr [0] &= 0xfe; /* clear multicast bit */ 136 addr[0] &= 0xfe; /* clear multicast bit */
137 addr [0] |= 0x02; /* set local assignment bit (IEEE802) */ 137 addr[0] |= 0x02; /* set local assignment bit (IEEE802) */
138} 138}
139 139
140#define random_ether_addr(addr) eth_random_addr(addr)
141
140/** 142/**
141 * eth_broadcast_addr - Assign broadcast address 143 * eth_broadcast_addr - Assign broadcast address
142 * @addr: Pointer to a six-byte array containing the Ethernet address 144 * @addr: Pointer to a six-byte array containing the Ethernet address
@@ -160,7 +162,7 @@ static inline void eth_broadcast_addr(u8 *addr)
160static inline void eth_hw_addr_random(struct net_device *dev) 162static inline void eth_hw_addr_random(struct net_device *dev)
161{ 163{
162 dev->addr_assign_type |= NET_ADDR_RANDOM; 164 dev->addr_assign_type |= NET_ADDR_RANDOM;
163 random_ether_addr(dev->dev_addr); 165 eth_random_addr(dev->dev_addr);
164} 166}
165 167
166/** 168/**