mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-04-26 00:03:57 +00:00
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>
This commit is contained in:
parent
07689b0a5c
commit
0a4dd59498
1 changed files with 8 additions and 6 deletions
|
@ -124,19 +124,21 @@ 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
|
* @addr: Pointer to a six-byte array containing the Ethernet address
|
||||||
*
|
*
|
||||||
* Generate a random Ethernet address (MAC) that is not multicast
|
* Generate a random Ethernet address (MAC) that is not multicast
|
||||||
* and has the local assigned bit set.
|
* 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);
|
get_random_bytes(addr, ETH_ALEN);
|
||||||
addr [0] &= 0xfe; /* clear multicast bit */
|
addr[0] &= 0xfe; /* clear multicast bit */
|
||||||
addr [0] |= 0x02; /* set local assignment bit (IEEE802) */
|
addr[0] |= 0x02; /* set local assignment bit (IEEE802) */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define random_ether_addr(addr) eth_random_addr(addr)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* eth_broadcast_addr - Assign broadcast address
|
* eth_broadcast_addr - Assign broadcast address
|
||||||
* @addr: Pointer to a six-byte array containing the Ethernet address
|
* @addr: Pointer to a six-byte array containing the Ethernet address
|
||||||
|
@ -160,7 +162,7 @@ static inline void eth_broadcast_addr(u8 *addr)
|
||||||
static inline void eth_hw_addr_random(struct net_device *dev)
|
static inline void eth_hw_addr_random(struct net_device *dev)
|
||||||
{
|
{
|
||||||
dev->addr_assign_type |= NET_ADDR_RANDOM;
|
dev->addr_assign_type |= NET_ADDR_RANDOM;
|
||||||
random_ether_addr(dev->dev_addr);
|
eth_random_addr(dev->dev_addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue