1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-11-29 14:21:52 +02:00

fix networking

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@2968 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
mbm 2006-01-14 01:55:48 +00:00
parent d8c4e25ad5
commit 6f9851834f
2 changed files with 101 additions and 1 deletions

View File

@ -11748,3 +11748,103 @@ diff -Nur linux-2.6.15/Makefile linux-2.6.15-openwrt/Makefile
# Cross compiling and selecting different set of gcc/bin-utils
# ---------------------------------------------------------------------------
diff -Nur linux-2.6.15/drivers/net/natsemi.c linux-2.6.15-openwrt/drivers/net/natsemi.c
--- linux-2.6.15/drivers/net/natsemi.c 2006-01-02 19:21:10.000000000 -0800
+++ linux-2.6.15-openwrt/drivers/net/natsemi.c 2006-01-10 07:29:49.581994000 -0800
@@ -771,6 +771,49 @@
static int netdev_get_eeprom(struct net_device *dev, u8 *buf);
static struct ethtool_ops ethtool_ops;
+#ifdef CONFIG_MACH_ARUBA
+
+#include <linux/ctype.h>
+
+#ifndef ERR
+#define ERR(fmt, args...) printk("%s: " fmt, __func__, ##args)
+#endif
+
+static int parse_mac_addr(struct net_device *dev, char* macstr)
+{
+ int i, j;
+ unsigned char result, value;
+
+ for (i=0; i<6; i++) {
+ result = 0;
+ if (i != 5 && *(macstr+2) != ':') {
+ ERR("invalid mac address format: %d %c\n",
+ i, *(macstr+2));
+ return -EINVAL;
+ }
+ for (j=0; j<2; j++) {
+ if (isxdigit(*macstr) && (value = isdigit(*macstr) ? *macstr-'0' :
+ toupper(*macstr)-'A'+10) < 16) {
+ result = result*16 + value;
+ macstr++;
+ }
+ else {
+ ERR("invalid mac address "
+ "character: %c\n", *macstr);
+ return -EINVAL;
+ }
+ }
+
+ macstr++;
+ dev->dev_addr[i] = result;
+ }
+
+ dev->dev_addr[5]++;
+ return 0;
+}
+
+#endif
+
static inline void __iomem *ns_ioaddr(struct net_device *dev)
{
return (void __iomem *) dev->base_addr;
@@ -859,6 +902,7 @@
goto err_ioremap;
}
+#ifndef CONFIG_MACH_ARUBA
/* Work around the dropped serial bit. */
prev_eedata = eeprom_read(ioaddr, 6);
for (i = 0; i < 3; i++) {
@@ -867,6 +911,19 @@
dev->dev_addr[i*2+1] = eedata >> 7;
prev_eedata = eedata;
}
+#else
+ {
+ char mac[32];
+ unsigned char def_mac[6] = {00, 0x0b, 0x86, 0xba, 0xdb, 0xad};
+ extern char *getenv(char *e);
+ memset(mac, 0, 32);
+ memcpy(mac, getenv("ethaddr"), 17);
+ if (parse_mac_addr(dev, mac)){
+ printk("%s: MAC address not found\n", __func__);
+ memcpy(dev->dev_addr, def_mac, 6);
+ }
+ }
+#endif
dev->base_addr = (unsigned long __force) ioaddr;
dev->irq = irq;
diff -Nur linux-2.6.15/drivers/net/Makefile linux-2.6.15-openwrt/drivers/net/Makefile
--- linux-2.6.15/drivers/net/Makefile 2006-01-13 09:19:55.000000000 -0800
+++ linux-2.6.15-openwrt/drivers/net/Makefile 2006-01-09 20:44:10.378339000 -0800
@@ -35,6 +35,7 @@
obj-$(CONFIG_OAKNET) += oaknet.o 8390.o
+obj-$(CONFIG_IDT_RC32434_ETH) += rc32434_eth.o
obj-$(CONFIG_DGRS) += dgrs.o
obj-$(CONFIG_VORTEX) += 3c59x.o
obj-$(CONFIG_TYPHOON) += typhoon.o
@@ -190,7 +189,6 @@
obj-$(CONFIG_SMC91X) += smc91x.o
obj-$(CONFIG_DM9000) += dm9000.o
obj-$(CONFIG_FEC_8XX) += fec_8xx/
-obj-$(CONFIG_IDT_RC32434_ETH) += rc32434_eth.o
obj-$(CONFIG_ARM) += arm/
obj-$(CONFIG_DEV_APPLETALK) += appletalk/

View File

@ -11,7 +11,7 @@ DEFAULT_lan_ifname="br0"
DEFAULT_lan_ifnames="eth0"
DEFAULT_lan_ipaddr=${BR2_SYSCONF_FAILSAFE_IP:-"192.168.1.1"}
DEFAULT_lan_netmask=${BR2_SYSCONF_FAILSAFE_NETMASK:-"255.255.255.0"}
DEFAULT_lan_hwaddr=${BR2_SYSCONF_FAILSAFE_MAC:-"00:0B:AD:0A:DD:00"}
# DEFAULT_lan_hwaddr=${BR2_SYSCONF_FAILSAFE_MAC:-"00:0B:AD:0A:DD:00"}
# failsafe if reset is held
[ "$FAILSAFE" = "true" ] && {