All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Warren <biggerbadderben@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Move is_valid_ether_addr() to include/net.h
Date: Thu, 29 Jan 2009 00:19:17 -0800	[thread overview]
Message-ID: <49816685.3040505@gmail.com> (raw)
In-Reply-To: <1233093219-12466-1-git-send-email-vapier@gentoo.org>

Mike Frysinger wrote:
> Import the is_valid_ether_addr() function from the Linux kernel.
>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> CC: Ben Warren <biggerbadderben@gmail.com>
> ---
>  board/bf537-stamp/bf537-stamp.c |   16 ----------------
>  include/net.h                   |   16 ++++++++++++++++
>  2 files changed, 16 insertions(+), 16 deletions(-)
>
> diff --git a/board/bf537-stamp/bf537-stamp.c b/board/bf537-stamp/bf537-stamp.c
> index 7303f1b..cec2b26 100644
> --- a/board/bf537-stamp/bf537-stamp.c
> +++ b/board/bf537-stamp/bf537-stamp.c
> @@ -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
> diff --git a/include/net.h b/include/net.h
> index d2d394f..bbe0d4b 100644
> --- a/include/net.h
> +++ b/include/net.h
> @@ -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);
>  
>   
Applied to net repo.

thanks,
Ben

      reply	other threads:[~2009-01-29  8:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-27 21:53 [U-Boot] [PATCH] Move is_valid_ether_addr() to include/net.h Mike Frysinger
2009-01-29  8:19 ` Ben Warren [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49816685.3040505@gmail.com \
    --to=biggerbadderben@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.