From 9e4175807497c24b82d5866076d8c7c80cdd5a94 Mon Sep 17 00:00:00 2001 From: Quinn Jensen Date: Wed, 24 Oct 2007 21:27:26 -0600 Subject: 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 --- drivers/net/fec.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) 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) { -- cgit v1.2.3