copy wificonf from whiterussian to head
authorFelix Fietkau <nbd@openwrt.org>
Mon, 25 Jul 2005 07:52:04 +0000 (07:52 +0000)
committerFelix Fietkau <nbd@openwrt.org>
Mon, 25 Jul 2005 07:52:04 +0000 (07:52 +0000)
SVN-Revision: 1552

openwrt/package/wificonf/Makefile
openwrt/package/wificonf/wificonf.c

index ed41e416c8de9971a1a119e70f32045d40990912..69cb2ec3009a691a620286b78dfa3292d849f833 100644 (file)
@@ -3,7 +3,7 @@
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=wificonf
 include $(TOPDIR)/rules.mk
 
 PKG_NAME:=wificonf
-PKG_RELEASE:=1
+PKG_RELEASE:=3
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/wificonf
 
 
 PKG_BUILD_DIR:=$(BUILD_DIR)/wificonf
 
index 24a9c2fe11a23fc37568eb8a6438f379d5da3391..b8eae257c1b98d3477111c84b1d0cb64fd38e9e4 100644 (file)
@@ -126,7 +126,7 @@ int bcom_set_val(int skfd, char *ifname, char *var, void *val, int len)
 
        strcpy(buf, var);
        
 
        strcpy(buf, var);
        
-       if ((ret = bcom_ioctl(skfd, ifname, WLC_GET_VAR, buf, sizeof(buf))))
+       if ((ret = bcom_ioctl(skfd, ifname, WLC_SET_VAR, buf, sizeof(buf))))
                return ret;
 
        memcpy(val, buf, len);
                return ret;
 
        memcpy(val, buf, len);
@@ -180,7 +180,7 @@ void setup_bcom(int skfd, char *ifname)
        /* Set Country */
        strncpy(buf, nvram_safe_get(wl_var("country_code")), 4);
        buf[3] = 0;
        /* Set Country */
        strncpy(buf, nvram_safe_get(wl_var("country_code")), 4);
        buf[3] = 0;
-       bcom_ioctl(skfd, ifname, 273, buf, 4);
+       bcom_ioctl(skfd, ifname, WLC_SET_COUNTRY, buf, 4);
        
        /* Set up afterburner */
        val = ABO_AUTO;
        
        /* Set up afterburner */
        val = ABO_AUTO;
@@ -416,9 +416,9 @@ void set_wext_mode(skfd, ifname)
        int ap = 0, infra = 0, wet = 0;
        
        /* Set operation mode */
        int ap = 0, infra = 0, wet = 0;
        
        /* Set operation mode */
-       ap = !nvram_match(wl_var("mode"), "sta");
+       ap = !nvram_match(wl_var("mode"), "sta") && !nvram_match(wl_var("mode"), "wet");
        infra = !nvram_disabled(wl_var("infra"));
        infra = !nvram_disabled(wl_var("infra"));
-       wet = nvram_enabled(wl_var("wet"));
+       wet = nvram_enabled(wl_var("wet")) || !nvram_match(wl_var("mode"), "wet");
 
        wrq.u.mode = (!infra ? IW_MODE_ADHOC : (ap ? IW_MODE_MASTER : (wet ? IW_MODE_REPEAT : IW_MODE_INFRA)));
        IW_SET_EXT_ERR(skfd, ifname, SIOCSIWMODE, &wrq, "Set Mode");
 
        wrq.u.mode = (!infra ? IW_MODE_ADHOC : (ap ? IW_MODE_MASTER : (wet ? IW_MODE_REPEAT : IW_MODE_INFRA)));
        IW_SET_EXT_ERR(skfd, ifname, SIOCSIWMODE, &wrq, "Set Mode");