All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@vyatta.com>
To: Daniele Venzano <venza@brownhat.org>
Cc: netdev@vger.kernel.org, akpm@linux-foundation.org, venza@brownhat.org
Subject: Re: [PATCH] SIS900 show warning if bogus MAC address
Date: Mon, 12 Jan 2009 08:23:10 -0800	[thread overview]
Message-ID: <20090112082310.56a9253a@extreme> (raw)
In-Reply-To: <20090111084504.GB12226@brownhat.org>

On Sun, 11 Jan 2009 09:45:04 +0100
Daniele Venzano <venza@brownhat.org> wrote:

> The attached patch modifies the sis900 driver to show a warning at boot
> or module load time to show a message when a null MAC address
> (00:00:00:00:00:00) is read from the the hardware.
> This seems to happen with newer usage of the sis900 chipset, since this
> never came up before.
> 
> Signed-off-by: Daniele Venzano <venza@brownhat.org>
> 
> --
> Daniele Venzano
> http://www.brownhat.org
> 
 /**
+ *      sis900_check_mac_addr - Check the MAc adress for validity
+ *	@net_dev: the net device that has the address to check
+ *
+ * 	Return false (0) if the mac address read from the hardware is
+ * 	composed of all zeros.
+ */
+
+static int __devinit sis900_check_mac_addr(struct net_device *net_dev)
+{
+	int i;
+
+	for (i = 0; i < 6; i++)
+		if (net_dev->dev_addr[i] != 0)
+			return 1;
+
+	return 0;
+}
+

This is a reimplementation of:
        return !is_zero_ether_addr(net_dev->dev_addr);

You probably want to use is_valid_ether_addr() instead.

      parent reply	other threads:[~2009-01-12 16:23 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-11  8:45 [PATCH] SIS900 show warning if bogus MAC address Daniele Venzano
2009-01-11 12:04 ` David Miller
2009-01-12 16:23 ` Stephen Hemminger [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=20090112082310.56a9253a@extreme \
    --to=shemminger@vyatta.com \
    --cc=akpm@linux-foundation.org \
    --cc=netdev@vger.kernel.org \
    --cc=venza@brownhat.org \
    /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.