diff options
author | Mike Rapoport <mike@compulab.co.il> | 2007-08-12 08:48:27 +0300 |
---|---|---|
committer | Ben Warren <bwarren@qstreams.com> | 2007-08-13 23:06:34 -0400 |
commit | 50cca8b976ec74069860208c36e64ce8f4d5e4c1 (patch) | |
tree | 52e8323efd924077a21bcc80604538fb2c4acd0f /include | |
parent | d1bc6c8d5f4a9c7ca9fb2292d5c65f846dcc3995 (diff) | |
download | u-boot-imx-50cca8b976ec74069860208c36e64ce8f4d5e4c1.zip u-boot-imx-50cca8b976ec74069860208c36e64ce8f4d5e4c1.tar.gz u-boot-imx-50cca8b976ec74069860208c36e64ce8f4d5e4c1.tar.bz2 |
Add ability to take MAC address from the environment to DM9000 driver
Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Signed-off-by: Ben Warren <bwarren@qstreams.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/net.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/include/net.h b/include/net.h index 9671948..aa58e33 100644 --- a/include/net.h +++ b/include/net.h @@ -435,6 +435,29 @@ static inline void NetCopyLong(ulong *to, ulong *from) memcpy((void*)to, (void*)from, sizeof(ulong)); } +/** + * is_zero_ether_addr - Determine if give Ethernet address is all zeros. + * @addr: Pointer to a six-byte array containing the Ethernet address + * + * Return true if the address is all zeroes. + */ +static inline int is_zero_ether_addr(const u8 *addr) +{ + return !(addr[0] | addr[1] | addr[2] | addr[3] | addr[4] | addr[5]); +} + +/** + * is_multicast_ether_addr - Determine if the Ethernet address is a multicast. + * @addr: Pointer to a six-byte array containing the Ethernet address + * + * Return true if the address is a multicast address. + * By definition the broadcast address is also a multicast address. + */ +static inline int is_multicast_ether_addr(const u8 *addr) +{ + return (0x01 & addr[0]); +} + /* Convert an IP address to a string */ extern void ip_to_string (IPaddr_t x, char *s); |