aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2006-01-15 16:18:50 +0000
committerFelix Fietkau <nbd@openwrt.org>2006-01-15 16:18:50 +0000
commit6d0d61e4ee9d10c7d9de0271fe108e4a1ae72dc5 (patch)
tree874c587aeb6a3af049031dc21f0361ad06e5f66e
parente9ce0524d0cc1722757d024439288cbaecdbde15 (diff)
downloadupstream-6d0d61e4ee9d10c7d9de0271fe108e4a1ae72dc5.tar.gz
upstream-6d0d61e4ee9d10c7d9de0271fe108e4a1ae72dc5.tar.bz2
upstream-6d0d61e4ee9d10c7d9de0271fe108e4a1ae72dc5.zip
sync kmod-switch with whiterussian
git-svn-id: svn://svn.openwrt.org/openwrt/trunk/openwrt@2989 3c298f89-4303-0410-b956-a3cf2f4a3e73
-rw-r--r--target/linux/package/switch/src/switch-adm.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/target/linux/package/switch/src/switch-adm.c b/target/linux/package/switch/src/switch-adm.c
index 2ce87e777f..919d685cbd 100644
--- a/target/linux/package/switch/src/switch-adm.c
+++ b/target/linux/package/switch/src/switch-adm.c
@@ -413,6 +413,7 @@ static int handle_vlan_enable_write(void *driver, char *buf, int nr)
static int handle_reset(void *driver, char *buf, int nr)
{
int i;
+ u32 cfg;
/*
* Reset sequence: RC high->low(100ms)->high(30ms)
@@ -438,14 +439,15 @@ static int handle_reset(void *driver, char *buf, int nr)
udelay(1000);
/* Leave RC high and disable GPIO outputs */
adm_disout((__u8)(eecs | eesk | eedi));
+
}
- /* set up initial configuration for ports */
- for (i = 0; i <= 5; i++) {
- int cfg = 0x8000 | /* Auto MDIX */
- (((i == 5) ? 1 : 0) << 4) | /* Tagging */
- 0xf; /* full duplex, 100Mbps, auto neg, flow ctrl */
- adm_wreg(port_conf[i], cfg);
- }
+
+ /* set up initial configuration for cpu port */
+ cfg = (0x8000 | /* Auto MDIX */
+ (0xf << 10) | /* PVID */
+ (1 << 4) | /* Tagging */
+ 0xf); /* full duplex, 100Mbps, auto neg, flow ctrl */
+ adm_wreg(port_conf[5], cfg);
/* vlan mode select register (0x11): vlan on, mac clone */
adm_wreg(0x11, 0xff30);
@@ -490,13 +492,12 @@ static int detect_adm()
eedi = getgpiopin("adm_eedi", 4);
eerc = getgpiopin("adm_rc", 0);
- } else if ((strcmp(nvram_get("boardtype"), "bcm94710dev") == 0) &&
- (strncmp(nvram_get("boardnum"), "42", 2) == 0)) {
+ } else if ((strcmp(nvram_get("boardtype") ?: "", "bcm94710dev") == 0) &&
+ (strncmp(nvram_get("boardnum") ?: "", "42", 2) == 0)) {
/* WRT54G v1.1 hack */
eecs = 2;
eesk = 3;
eedi = 5;
- eerc = 6;
ret = 1;
} else