diff options
author | Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> | 2007-12-10 22:32:14 +0100 |
---|---|---|
committer | Ben Warren <biggerbadderben@gmail.com> | 2008-01-16 17:46:32 -0500 |
commit | b8f4162a4f7a9bee5e9d0305c17f2d34de466a9b (patch) | |
tree | d6424da1e08079219c62784b8f72ba14a91e3e99 /board/bf537-stamp/bf537-stamp.c | |
parent | c2f896b8fc4722e36915903e1942e138e68ce804 (diff) |
bf537-stamp: remove already defined is_zero_ether_addr and is_multicast_ether_addr
and move is_valid_ether_addr board file
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
Diffstat (limited to 'board/bf537-stamp/bf537-stamp.c')
-rw-r--r-- | board/bf537-stamp/bf537-stamp.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/board/bf537-stamp/bf537-stamp.c b/board/bf537-stamp/bf537-stamp.c index b3d8bda9bf6..6954b3003d2 100644 --- a/board/bf537-stamp/bf537-stamp.c +++ b/board/bf537-stamp/bf537-stamp.c @@ -30,8 +30,25 @@ #include <command.h> #include <asm/blackfin.h> #include <asm/io.h> +#include <net.h> #include "ether_bf537.h" +/** + * is_valid_ether_addr - Determine if the given Ethernet address is valid + * @addr: Pointer to a six-byte array containing the Ethernet address + * + * Check that the Ethernet address (MAC) is not 00:00:00:00:00:00, is not + * a multicast address, and is not FF:FF:FF:FF:FF:FF. + * + * Return true if the address is valid. + */ +static inline int is_valid_ether_addr(const u8 * addr) +{ + /* FF:FF:FF:FF:FF:FF is a multicast address so we don't need to + * explicitly check for it here. */ + return !is_multicast_ether_addr(addr) && !is_zero_ether_addr(addr); +} + DECLARE_GLOBAL_DATA_PTR; #define POST_WORD_ADDR 0xFF903FFC |