Add updated support for buffalo routers (#1874)
[openwrt.git] / package / broadcom-diag / src / diag.c
index 5b9ff02..401adbf 100644 (file)
@@ -305,6 +305,7 @@ static struct platform_t __initdata platforms[] = {
                        { .name = "internal",   .gpio = 1 << 3, .polarity = REVERSE },
                        { .name = "ses",        .gpio = 1 << 6, .polarity = REVERSE },
                        { .name = "bridge",     .gpio = 1 << 1, .polarity = REVERSE },
+                       { .name = "wlan",       .gpio = 1 << 2, .polarity = REVERSE },
                },
        },
        [WBR2_G54] = {
@@ -326,8 +327,10 @@ static struct platform_t __initdata platforms[] = {
                },
                .leds           = {
                        { .name = "diag",       .gpio = 1 << 7, .polarity = REVERSE },
+                       { .name = "internal",   .gpio = 1 << 3, .polarity = REVERSE },
                        { .name = "bridge",     .gpio = 1 << 1, .polarity = REVERSE },
                        { .name = "ses",        .gpio = 1 << 6, .polarity = REVERSE },
+                       { .name = "wlan",       .gpio = 1 << 2, .polarity = REVERSE },
                },
        },
        [WHR2_A54G54] = {
@@ -503,7 +506,7 @@ static struct platform_t __initdata platforms[] = {
                        { .name = "reset",      .gpio = 1 << 2 },
                },
                .leds           = {
-                       { .name = "power",      .gpio = 1 << 3, .polarity = REVERSE },
+                       { .name = "power",      .gpio = 1 << 3, .polarity = NORMAL },
                },
        },
        /* Trendware */
@@ -539,8 +542,11 @@ static struct platform_t __init *platform_detect(void)
        boardnum = getvar("boardnum");
        boardtype = getvar("boardtype");
 
-       if (strncmp(getvar("model_no"), "WL700",5) == 0) {
-               return &platforms[WL700GE]; }
+       if (strcmp(getvar("nvram_type"), "cfe") == 0)
+               return &platforms[WGT634U];
+       
+       if (strncmp(getvar("model_no"), "WL700",5) == 0)
+               return &platforms[WL700GE];
 
        if (strncmp(getvar("pmon_ver"), "CFE", 3) == 0) {
                /* CFE based - newer hardware */
@@ -672,8 +678,14 @@ static void unregister_buttons(struct button_t *b)
        gpio_set_irqenable(0, button_handler);
 }
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
+static void hotplug_button(struct work_struct *work)
+{
+       struct event_t *event = container_of(work, struct event_t, wq);
+#else
 static void hotplug_button(struct event_t *event)
 {
+#endif
 #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
        call_usermodehelper (event->argv[0], event->argv, event->envp, 1);
 #else
@@ -721,7 +733,11 @@ static irqreturn_t button_handler(int irq, void *dev_id, struct pt_regs *regs)
                        scratch += sprintf (scratch, "SEEN=%ld", (jiffies - b->seen)/HZ) + 1;
                        event->envp[i] = 0;
 
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,20)
+                       INIT_WORK(&event->wq, (void *)(void *)hotplug_button);
+#else
                        INIT_WORK(&event->wq, (void *)(void *)hotplug_button, (void *)event);
+#endif
                        schedule_work(&event->wq);
                }
 
This page took 0.020376 seconds and 4 git commands to generate.