tweak distance control based on experimentation and fix minor glitch in start_bcom...
authorFelix Fietkau <nbd@openwrt.org>
Mon, 27 Feb 2006 22:21:47 +0000 (22:21 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 27 Feb 2006 22:21:47 +0000 (22:21 +0000)
SVN-Revision: 3278

openwrt/package/wificonf/wificonf.c

index 4906641a6d942494316997283f467cdd323c8865..5ac28762ef154b5fcb54069d24b30e7bb9176863 100644 (file)
@@ -225,12 +225,15 @@ static void start_bcom(int skfd, char *ifname)
        if (bcom_ioctl(skfd, ifname, WLC_GET_MAGIC, &val, sizeof(val)) < 0)
                return;
 
+       bcom_ioctl(skfd, ifname, WLC_UP, &val, sizeof(val));
+       set_wext_ssid(skfd, ifname);
+
        if (v = nvram_get(wl_var("distance"))) {
                rw_reg_t reg;
                uint32 shm;
                
                val = atoi(v);
-               val = 9+(val/300)+((val%300)?1:0);
+               val = 9+(val/150)+((val%150)?1:0);
                
                shm = 0x10;
                shm |= (val << 16);
@@ -241,7 +244,6 @@ static void start_bcom(int skfd, char *ifname)
                reg.size = 2;
                bcom_ioctl(skfd, ifname, 102, &reg, sizeof(reg));
        }
-
 }
 
 static int setup_bcom_wds(int skfd, char *ifname)
@@ -512,7 +514,6 @@ static void setup_bcom(int skfd, char *ifname)
        }
 
        bcom_ioctl(skfd, ifname, WLC_UP, &val, sizeof(val));
-       set_wext_ssid(skfd, ifname);
 
        if (!(v = nvram_get(wl_var("akm"))))
                v = nvram_safe_get(wl_var("auth_mode"));