From: Michael Buesch <mb@bu3sch.de>
To: stable@kernel.org
Cc: Jeff Garzik <jeff@garzik.org>,
agb@openwrt.org, Gary Zambrano <zambrano@broadcom.com>,
netdev@vger.kernel.org
Subject: [PATCH stable] b44: Truncate PHY address
Date: Wed, 26 Mar 2008 15:00:08 +0100 [thread overview]
Message-ID: <200803261500.08699.mb@bu3sch.de> (raw)
Some ROMs on embedded devices store incorrect values for
the PHY address of the ethernet device.
It looks like the number is sign-extended.
Truncate the value by applying the PHY-address mask to it.
The patch was tested on a bcm47xx embedded system (where the bug
triggers) and a bcm4400 PCI card.
Signed-off-by: Michael Buesch <mb@bu3sch.de>
---
This patch is applied to the netdev tree.
Commit is 5ea79631c0c47d28831a0635e8af9da539d449cd
Index: linux-2.6.24.3/drivers/net/b44.c
===================================================================
--- linux-2.6.24.3.orig/drivers/net/b44.c 2008-01-24 23:58:37.000000000 +0100
+++ linux-2.6.24.3/drivers/net/b44.c 2008-03-26 14:54:13.000000000 +0100
@@ -2066,6 +2066,11 @@ static int __devinit b44_get_invariants(
addr = sdev->bus->sprom.r1.et0mac;
bp->phy_addr = sdev->bus->sprom.r1.et0phyaddr;
}
+ /* Some ROMs have buggy PHY addresses with the high
+ * bits set (sign extension?). Truncate them to a
+ * valid PHY address. */
+ bp->phy_addr &= 0x1F;
+
memcpy(bp->dev->dev_addr, addr, 6);
if (!is_valid_ether_addr(&bp->dev->dev_addr[0])){
--
Greetings Michael.
reply other threads:[~2008-03-26 14:04 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=200803261500.08699.mb@bu3sch.de \
--to=mb@bu3sch.de \
--cc=agb@openwrt.org \
--cc=jeff@garzik.org \
--cc=netdev@vger.kernel.org \
--cc=stable@kernel.org \
--cc=zambrano@broadcom.com \
/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.