]> git.ipfire.org Git - people/ms/u-boot.git/commitdiff
Move is_valid_ether_addr() to include/net.h
authorMike Frysinger <vapier@gentoo.org>
Tue, 27 Jan 2009 21:53:39 +0000 (16:53 -0500)
committerBen Warren <biggerbadderben@gmail.com>
Thu, 29 Jan 2009 07:59:27 +0000 (23:59 -0800)
Import the is_valid_ether_addr() function from the Linux kernel.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Ben Warren <biggerbadderben@gmail.com>
board/bf537-stamp/bf537-stamp.c
include/net.h

index 7303f1b4155e59cf003b8bee64c4690bbe8433e7..cec2b2633accd2cb339279d5e4dd9808bd190145 100644 (file)
 #include <asm/mach-common/bits/bootrom.h>
 #include <netdev.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
index d2d394f0da80d0788e92dce97f740c9fe0679443..bbe0d4b5a2dfe4b001f00b3b8e62d86923372ca1 100644 (file)
@@ -474,6 +474,22 @@ static inline int is_multicast_ether_addr(const u8 *addr)
        return (0x01 & addr[0]);
 }
 
+/**
+ * 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);
+}
+
 /* Convert an IP address to a string */
 extern void    ip_to_string (IPaddr_t x, char *s);