diff options
| author | Jeff Garzik <jgarzik@pobox.com> | 2005-11-04 21:39:31 -0500 |
|---|---|---|
| committer | Jeff Garzik <jgarzik@pobox.com> | 2005-11-04 21:39:31 -0500 |
| commit | c2cc87ca9561ddfe744d446789cc10f507e87db9 (patch) | |
| tree | d505fc0110eb1a3d8750ba2f67648c131f0d9aca /include/linux/etherdevice.h | |
| parent | ce1eeb95fc4eb25109c00bea3e83a87eeff6b07d (diff) | |
| parent | 7015faa7df829876a0f931cd18aa6d7c24a1b581 (diff) | |
Merge branch 'master'
Diffstat (limited to 'include/linux/etherdevice.h')
| -rw-r--r-- | include/linux/etherdevice.h | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index cc84934f9059..5f49a30eb6f2 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h | |||
| @@ -48,8 +48,10 @@ static inline void eth_copy_and_sum (struct sk_buff *dest, | |||
| 48 | } | 48 | } |
| 49 | 49 | ||
| 50 | /** | 50 | /** |
| 51 | * is_zero_ether_addr - Determine if give Ethernet address is all | 51 | * is_zero_ether_addr - Determine if give Ethernet address is all zeros. |
| 52 | * zeros. | 52 | * @addr: Pointer to a six-byte array containing the Ethernet address |
| 53 | * | ||
| 54 | * Return true if the address is all zeroes. | ||
| 53 | */ | 55 | */ |
| 54 | static inline int is_zero_ether_addr(const u8 *addr) | 56 | static inline int is_zero_ether_addr(const u8 *addr) |
| 55 | { | 57 | { |
| @@ -57,9 +59,7 @@ static inline int is_zero_ether_addr(const u8 *addr) | |||
| 57 | } | 59 | } |
| 58 | 60 | ||
| 59 | /** | 61 | /** |
| 60 | * is_multicast_ether_addr - Determine if the given Ethernet address is a | 62 | * is_multicast_ether_addr - Determine if the Ethernet address is a multicast. |
| 61 | * multicast address. | ||
| 62 | * | ||
| 63 | * @addr: Pointer to a six-byte array containing the Ethernet address | 63 | * @addr: Pointer to a six-byte array containing the Ethernet address |
| 64 | * | 64 | * |
| 65 | * Return true if the address is a multicast address. | 65 | * Return true if the address is a multicast address. |
| @@ -69,10 +69,15 @@ static inline int is_multicast_ether_addr(const u8 *addr) | |||
| 69 | return ((addr[0] != 0xff) && (0x01 & addr[0])); | 69 | return ((addr[0] != 0xff) && (0x01 & addr[0])); |
| 70 | } | 70 | } |
| 71 | 71 | ||
| 72 | /** | ||
| 73 | * is_broadcast_ether_addr - Determine if the Ethernet address is broadcast | ||
| 74 | * @addr: Pointer to a six-byte array containing the Ethernet address | ||
| 75 | * | ||
| 76 | * Return true if the address is the broadcast address. | ||
| 77 | */ | ||
| 72 | static inline int is_broadcast_ether_addr(const u8 *addr) | 78 | static inline int is_broadcast_ether_addr(const u8 *addr) |
| 73 | { | 79 | { |
| 74 | return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && | 80 | return (addr[0] & addr[1] & addr[2] & addr[3] & addr[4] & addr[5]) == 0xff; |
| 75 | (addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff)); | ||
| 76 | } | 81 | } |
| 77 | 82 | ||
| 78 | /** | 83 | /** |
| @@ -108,14 +113,14 @@ static inline void random_ether_addr(u8 *addr) | |||
| 108 | /** | 113 | /** |
| 109 | * compare_ether_addr - Compare two Ethernet addresses | 114 | * compare_ether_addr - Compare two Ethernet addresses |
| 110 | * @addr1: Pointer to a six-byte array containing the Ethernet address | 115 | * @addr1: Pointer to a six-byte array containing the Ethernet address |
| 111 | * @addr2 Pointer other six-byte array containing the Ethernet address | 116 | * @addr2: Pointer other six-byte array containing the Ethernet address |
| 112 | * | 117 | * |
| 113 | * Compare two ethernet addresses, returns 0 if equal | 118 | * Compare two ethernet addresses, returns 0 if equal |
| 114 | */ | 119 | */ |
| 115 | static inline unsigned compare_ether_addr(const u8 *_a, const u8 *_b) | 120 | static inline unsigned compare_ether_addr(const u8 *addr1, const u8 *addr2) |
| 116 | { | 121 | { |
| 117 | const u16 *a = (const u16 *) _a; | 122 | const u16 *a = (const u16 *) addr1; |
| 118 | const u16 *b = (const u16 *) _b; | 123 | const u16 *b = (const u16 *) addr2; |
| 119 | 124 | ||
| 120 | BUILD_BUG_ON(ETH_ALEN != 6); | 125 | BUILD_BUG_ON(ETH_ALEN != 6); |
| 121 | return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | (a[2] ^ b[2])) != 0; | 126 | return ((a[0] ^ b[0]) | (a[1] ^ b[1]) | (a[2] ^ b[2])) != 0; |
