fix wan configuration on wr850g v2/v3
authorMike Baker <mbm@openwrt.org>
Sat, 25 Aug 2007 12:27:01 +0000 (12:27 +0000)
committerMike Baker <mbm@openwrt.org>
Sat, 25 Aug 2007 12:27:01 +0000 (12:27 +0000)
SVN-Revision: 8482

package/broadcom-diag/src/diag.c
package/broadcom-diag/src/diag.h
target/linux/brcm-2.4/base-files/default/etc/init.d/netconfig

index e8da3129a8089cd5238f8308e678cb92e8c08126..ef586baaedb86f9322d5d17ac514f4ff9eb18c4c 100644 (file)
@@ -492,7 +492,7 @@ static struct platform_t __initdata platforms[] = {
                .leds           = {
                        { .name = "power",      .gpio = 1 << 1, .polarity = NORMAL },
                        { .name = "wlan",       .gpio = 1 << 0, .polarity = REVERSE },
-                       { .name = "dmz",        .gpio = 1 << 6, .polarity = REVERSE },
+                       { .name = "wan",        .gpio = 1 << 6, .polarity = INPUT },
                        { .name = "diag",       .gpio = 1 << 7, .polarity = REVERSE },
                },
        },
@@ -893,6 +893,7 @@ static void register_leds(struct led_t *l)
 {
        struct proc_dir_entry *p;
        u32 mask = 0;
+       u32 oe_mask = 0;
        u32 val = 0;
 
        leds = proc_mkdir("led", diag);
@@ -907,10 +908,13 @@ static void register_leds(struct led_t *l)
                        l->state = 0;
                        set_led_extif(l);
                } else {
+                       if (l->polarity != INPUT) oe_mask != l->gpio;
                        mask |= l->gpio;
                        val |= (l->polarity == NORMAL)?0:l->gpio;
                }
 
+               if (l->polarity == INPUT) continue;
+
                if ((p = create_proc_entry(l->name, S_IRUSR, leds))) {
                        l->proc.type = PROC_LED;
                        l->proc.ptr = l;
@@ -919,7 +923,7 @@ static void register_leds(struct led_t *l)
                }
        }
 
-       gpio_outen(mask, mask);
+       gpio_outen(mask, oe_mask);
        gpio_control(mask, 0);
        gpio_out(mask, val);
 }
index 93fdedb85cbd3b4a5ce5ae3ceca2b027ba755f1b..5f46d9dd8c9e6fb7d532c9e5edb425c0a26ccfe2 100644 (file)
@@ -30,6 +30,7 @@
 enum polarity_t {
        REVERSE = 0,
        NORMAL = 1,
+       INPUT = 2,
 };
 
 enum {
index 8d204862ca8a661f712b2d93a9c95135587c5785..2b56963365d36adfdb8be96d15b6a65369729df6 100755 (executable)
@@ -111,6 +111,11 @@ start() {
                        c["vlan0ports"]="1 2 3 4 5*"
                        c["vlan1ports"]="0 5"
                }
+
+               if (model == "Motorola WR850G V2/V3") {
+                       c["vlan0ports"]="0 1 2 3 5*"
+                       c["vlan1ports"]="4 5"
+               }
                
                print "#### VLAN configuration "
                print "config switch eth0"