Skip to contentSkip to conversation

Move is_valid_ether_addr() to include/net.h

PATCH New Mike Frysinger 2 participants 2 messages Jan 27, 2009 – Jan 29, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Move is_valid_ether_addr() to include/net.h

Import the is_valid_ether_addr() function from the Linux kernel.

---
 board/bf537-stamp/bf537-stamp.c |   16 ----------------
 include/net.h                   |   16 ++++++++++++++++
 2 files changed, 16 insertions(+), 16 deletions(-)
board/bf537-stamp/bf537-stamp.c +0 -16
index 7303f1b..cec2b26 100644
@@ -34,22 +34,6 @@
 #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
include/net.h +16 -0
index d2d394f..bbe0d4b 100644
@@ -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);
 
Signature · 1 line
1.6.1.1
Applied
#1 lore raw

PATCH 1/1 Move is_valid_ether_addr() to include/net.h

Quoted 54 lines · Mike Frysinger

Import the is_valid_ether_addr() function from the Linux kernel.

---
 board/bf537-stamp/bf537-stamp.c |   16 ----------------
 include/net.h                   |   16 ++++++++++++++++
 2 files changed, 16 insertions(+), 16 deletions(-)
board/bf537-stamp/bf537-stamp.c +0 -16
index 7303f1b..cec2b26 100644
@@ -34,22 +34,6 @@
 #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
include/net.h +9 -0
index d2d394f..bbe0d4b 100644
@@ -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.
+ */

include/net.h static inline int is_multicast_ether_addr(const u8 *addr) · line 495

Quoted 10 lines
include/net.h +7 -0
+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);
 

Applied to net repo.

thanks,
Ben