From: Peter Korsgaard <jacmet@sunsite•dk>
To: Wu Fengguang <wfg@linux•intel.com>
Cc: netdev@vger•kernel.org
Subject: Re: [PATCH] dm9601: warn on invalid mac address
Date: Tue, 06 Jan 2009 12:17:56 +0100 [thread overview]
Message-ID: <87r63gu1i3.fsf@macbook.be.48ers.dk> (raw)
In-Reply-To: <20090106094757.GA19587@localhost> (Wu Fengguang's message of "Tue\, 6 Jan 2009 17\:47\:57 +0800")
>>>>> "Wu" == Wu Fengguang <wfg@linux•intel.com> writes:
Hi,
Wu> if (is_valid_ether_addr(mac))
Wu> memcpy(dev->net->dev_addr, mac, ETH_ALEN);
Wu> + else {
Wu> + DECLARE_MAC_BUF(mac_buf);
Wu> + print_mac(mac_buf, mac);
Wu> + devdbg(dev, "EEPROM reported mac address %s is invalid,"
Wu> + " use the randomly generated one.", mac_buf);
>>
>> And this should be a warning.
Wu> Then let the warning message appear repeatedly for some devices?
This is called at probe time - But yes, I think it makes sense to print
it.
We should print the random address instead of the ff's though.
Wu> Also dev_warn() won't be able to show the device name at that time,
Wu> like this:
Ah yes, that's presumably why I used a raw printk just above.
Wu> [28489.062180] : EEPROM reported mac address ff:ff:ff:ff:ff:ff is
Wu> invalid, use the randomly generated one.
I would prefer something like:
printk(KERN_WARNING "dm9601: No valid MAC address in EEPROM, using %s\n",
print_mac(..));
Also, it seems like you're not writing the random address to the
hardware registers, so you won't be able to receive any unicast -
You'll need to add a call to dm9601_set_mac_address() or similar.
--
Bye, Peter Korsgaard
next prev parent reply other threads:[~2009-01-06 11:18 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-01-06 9:10 [PATCH] dm9601: warn on invalid mac address Wu Fengguang
2009-01-06 9:18 ` Peter Korsgaard
2009-01-06 9:47 ` Wu Fengguang
2009-01-06 11:17 ` Peter Korsgaard [this message]
2009-01-07 4:52 ` Wu Fengguang
2009-01-07 8:24 ` Peter Korsgaard
2009-01-08 18:45 ` David Miller
2009-01-06 11:52 ` Ben Hutchings
2009-01-06 18:52 ` David Miller
2009-01-07 4:55 ` Wu Fengguang
2009-01-07 8:25 ` Peter Korsgaard
2009-01-08 18:47 ` David Miller
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=87r63gu1i3.fsf@macbook.be.48ers.dk \
--to=jacmet@sunsite$(echo .)dk \
--cc=netdev@vger$(echo .)kernel.org \
--cc=wfg@linux$(echo .)intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox