summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuinn Jensen <quinn.jensen@freescale.com>2007-10-24 21:27:26 -0600
committerQuinn Jensen <quinn.jensen@freescale.com>2007-10-24 21:27:26 -0600
commit9e4175807497c24b82d5866076d8c7c80cdd5a94 (patch)
treec85e2485ec12f879d21396ee06f6f3180a1b6ff7
parentaea2c59fab46904c36b9d7af1b777f9faeb290f3 (diff)
Bugzilla 677. Allow FEC MAC address override.
Patch for Bugzilla 677. Allow FEC MAC address override. FEC MAC addresses on some MX27 TO2 chips are not preprogrammed and cannot be overridden by Redboot. This patch gets around this issue by allowing the FEC MAC address to be specified on the kernel command line using the following option: fec_mac=xx:xx:xx:xx:xx:xx where the "xx"s are replaced with the hex MAC address listed on the sticker for your board. Valid MAC addresses from the chip or from Redboot will not be overridden using this option. Applies to linux 2.6.22 kernel on MX27 platforms. http://www.bitshrine.org/gpp/linux-2.6.22-mx-Bugzilla-677.-Allow-FEC-MAC-address-overri.patch
-rw-r--r--drivers/net/fec.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 938426953149..4c396e2f0641 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -340,6 +340,24 @@ static int mii_queue(struct net_device *dev, int request,
#define PHY_STAT_100FDX 0x8000 /* 100 Mbit full duplex selected */
+#ifndef MODULE
+static int fec_mac_setup(char *p)
+{
+ int i;
+
+ for (i = 0; i < 6; i++) {
+ if (!p || !*p)
+ break;
+ fec_mac_default[i] = simple_strtoul(p, &p, 16);
+ if (*p == ':')
+ p++;
+ }
+ return 0;
+}
+
+__setup("fec_mac=", fec_mac_setup);
+#endif
+
static int
fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
{