Hi,

first time commit.

 nvram variable "boardtype" is unique for now.
- button gpio were taken from nvram.
- led information was taken from dd-wrt
( http://svn.dd-wrt.com/browser/src/router/libutils/utils.c )
I hope that I changed the values correctly.


Signed-off-by: Dirk Neukirchen <dirkneukirc...@web.de>
---

diff --git a/package/broadcom-diag/src/diag.c b/package/broadcom-diag/src/diag.c
index 997fbe8..74091fc 100644
--- a/package/broadcom-diag/src/diag.c
+++ b/package/broadcom-diag/src/diag.c
@@ -120,6 +120,7 @@ enum {
     WGT634U,
     WNR834BV1,
     WNR834BV2,
+    WNDR3400V1,

     /* Trendware */
     TEW411BRPP,
@@ -896,6 +897,21 @@ static struct platform_t __initdata platforms[] = {
{ .name = "connected", .gpio = 1 << 7, .polarity = NORMAL },
         },
     },
+    [WNDR3400V1] = {
+        .name         = "Netgear WNDR3400 V1",
+        .buttons    = {
+            /* nvram get gpio5=robo_reset */
+            { .name = "reset",    .gpio = 1 << 4 },
+            { .name = "ses",    .gpio = 1 << 6 },
+        },
+        .leds        = {
+ { .name = "wlan", .gpio = 0 << 0, .polarity = NORMAL }, + { .name = "connected", .gpio = 1 << 0, .polarity = NORMAL }, + { .name = "power", .gpio = 1 << 3, .polarity = NORMAL }, + { .name = "diag", .gpio = 1 << 7, .polarity = NORMAL }, + { .name = "usb", .gpio = 1 << 2, .polarity = REVERSE },
+        },
+    },
     /* Trendware */
     [TEW411BRPP] = {
         .name           = "Trendware TEW411BRP+",
@@ -1095,6 +1111,12 @@ static struct platform_t __init *platform_detect(void)
             return &platforms[WE800G];
     }

+    if ((buf = nvram_get("boardtype"))) {
+        if (!strcmp(buf, "0xb4cf")) { /* Netgear WNDR3400 V1 */
+            return &platforms[WNDR3400V1];
+        }
+    }
+
     /* Buffalo */
     if ((buf = (nvram_get("melco_id") ?: nvram_get("buffalo_id")))) {
         /* Buffalo hardware, check id for specific hardware matches */
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to