From 173083fcbf381c607ab566aafee9425e6a66d256 Mon Sep 17 00:00:00 2001 From: nbd Date: Fri, 16 Nov 2007 03:11:09 +0000 Subject: fix adm switch misdetection, which led to bogus button events that caused the system to shut down git-svn-id: svn://svn.openwrt.org/openwrt/trunk@9555 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- package/broadcom-diag/src/diag.c | 2 +- package/switch/src/switch-adm.c | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'package') diff --git a/package/broadcom-diag/src/diag.c b/package/broadcom-diag/src/diag.c index c7b3ead36..94ab384d3 100644 --- a/package/broadcom-diag/src/diag.c +++ b/package/broadcom-diag/src/diag.c @@ -738,7 +738,7 @@ static struct platform_t __init *platform_detect(void) return &platforms[WR850GV2V3]; } - if (!strcmp(boardnum, "44")) { /* Trendware TEW-411BRP+ */ + if (!strcmp(boardnum, "44") && !strcmp(getvar("boardflags"),"0x0388")) { /* Trendware TEW-411BRP+ */ return &platforms[TEW411BRPP]; } diff --git a/package/switch/src/switch-adm.c b/package/switch/src/switch-adm.c index 0fb21ffaa..8d5de04b4 100644 --- a/package/switch/src/switch-adm.c +++ b/package/switch/src/switch-adm.c @@ -500,13 +500,13 @@ static int detect_adm(void) int boardflags = atoi(nvram_get("boardflags")); int boardnum = atoi(nvram_get("boardnum")); - if (boardnum == 44) { /* Trendware TEW-411BRP+ */ - ret = 1; + if ((boardnum == 44) && (boardflags == 0x0388)) { /* Trendware TEW-411BRP+ */ + ret = 1; - eecs = get_gpiopin("adm_eecs", 2); - eesk = get_gpiopin("adm_eesk", 3); - eedi = get_gpiopin("adm_eedi", 4); - eerc = get_gpiopin("adm_rc", 5); + eecs = get_gpiopin("adm_eecs", 2); + eesk = get_gpiopin("adm_eesk", 3); + eedi = get_gpiopin("adm_eedi", 4); + eerc = get_gpiopin("adm_rc", 5); } else if ((boardflags & 0x80) || force) { ret = 1; -- cgit v1.2.3