From: "Alex G." <mr.nuke.me@gmail.com>
To: David Miller <davem@davemloft.net>
Cc: rl@hellgate.ch, florian@openwrt.org, netdev@vger.kernel.org
Subject: Re: [PATCH] via-rhine: do not abort due to invalid MAC address
Date: Fri, 04 Mar 2011 00:08:56 +0200 [thread overview]
Message-ID: <4D701178.8000102@gmail.com> (raw)
In-Reply-To: <20110303.140134.241924015.davem@davemloft.net>
[-- Attachment #1: Type: text/plain, Size: 233 bytes --]
On 03/04/2011 12:01 AM, David Miller wrote:
>
> Still wrong, the patch needs to be "-p1" not "-p0" rooted.
Documentation/SubmittingPatches seems to be outdated then. I used "git
diff"; I hope the format is correct this time
Alex
[-- Attachment #2: rhine.patch --]
[-- Type: text/x-patch, Size: 1377 bytes --]
via-rhine drops out of the init code if the hardware provides an invalid
MAC address. Roger Luethi has had several reports of Rhine NICs doing just
that. The hardware still works, though; assigning a random MAC address
allows the NIC to be used as usual. Tested as a standalone interface,
as carrier for ppp, and as bonding slave.
Signed-off-by Alexandru Gagniuc <mr.nuke.me@gmail.com>
diff --git a/drivers/net/via-rhine.c.orig b/drivers/net/via-rhine.c
index 4930f9d..4c1b9e7 100644
--- a/drivers/net/via-rhine.c.orig
+++ b/drivers/net/via-rhine.c
@@ -762,13 +762,16 @@ static int __devinit rhine_init_one(struct pci_dev *pdev,
for (i = 0; i < 6; i++)
dev->dev_addr[i] = ioread8(ioaddr + StationAddr + i);
- memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
- if (!is_valid_ether_addr(dev->perm_addr)) {
- rc = -EIO;
- printk(KERN_ERR "Invalid MAC address\n");
- goto err_out_unmap;
+ if (!is_valid_ether_addr(dev->dev_addr)) {
+ printk(KERN_ERR "via-rhine: Invalid MAC address: %pM. \n",
+ dev->dev_addr);
+ /* The device may still be used normally if a valid MAC is configured */
+ random_ether_addr(dev->dev_addr);
+ printk(KERN_ERR "via-rhine: Using randomly generated address: %pM instead. \n",
+ dev->dev_addr);
}
+ memcpy(dev->perm_addr, dev->dev_addr, dev->addr_len);
/* For Rhine-I/II, phy_id is loaded from EEPROM */
if (!phy_id)
next prev parent reply other threads:[~2011-03-03 22:13 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-02 16:32 [PATCH] via-rhine: do not abort due to invalid MAC address Roger Luethi
2011-03-02 18:01 ` Florian Fainelli
2011-03-02 18:11 ` Alex G.
2011-03-02 19:36 ` David Miller
2011-03-02 19:52 ` Roger Luethi
2011-03-02 19:49 ` Alex G.
2011-03-02 20:06 ` Alex G.
2011-03-03 21:42 ` David Miller
2011-03-03 21:51 ` Alex G.
2011-03-03 22:01 ` David Miller
2011-03-03 22:08 ` Alex G. [this message]
2011-03-09 21:30 ` 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=4D701178.8000102@gmail.com \
--to=mr.nuke.me@gmail.com \
--cc=davem@davemloft.net \
--cc=florian@openwrt.org \
--cc=netdev@vger.kernel.org \
--cc=rl@hellgate.ch \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).