X-Git-Url: http://git.rohieb.name/openwrt.git/blobdiff_plain/e82b98c8f442e4f9474c0b8b453d37063111301f..2e636bda64e3e8118acfbc32308138044cf393b8:/openwrt/package/wificonf/wificonf.c diff --git a/openwrt/package/wificonf/wificonf.c b/openwrt/package/wificonf/wificonf.c index 519596c19..7a9cde5a1 100644 --- a/openwrt/package/wificonf/wificonf.c +++ b/openwrt/package/wificonf/wificonf.c @@ -36,21 +36,18 @@ do { \ ERR_SET_EXT(rname, request); \ fprintf(stderr, " too few arguments.\n"); \ - return; \ } while(0) #define ABORT_ARG_TYPE(rname, request, arg) \ do { \ ERR_SET_EXT(rname, request); \ fprintf(stderr, " invalid argument \"%s\".\n", arg); \ - return; \ } while(0) #define ABORT_ARG_SIZE(rname, request, max) \ do { \ ERR_SET_EXT(rname, request); \ fprintf(stderr, " argument too big (max %d)\n", max); \ - return; \ } while(0) /*------------------------------------------------------------------*/ @@ -64,7 +61,6 @@ ERR_SET_EXT(rname, request); \ fprintf(stderr, " SET failed on device %-1.16s ; %s.\n", \ ifname, strerror(errno)); \ - return; \ } } while(0) /*------------------------------------------------------------------*/ @@ -78,7 +74,6 @@ ERR_SET_EXT(rname, request); \ fprintf(stderr, " GET failed on device %-1.16s ; %s.\n", \ ifname, strerror(errno)); \ - return; \ } } while(0) char *prefix; @@ -115,8 +110,6 @@ int bcom_ioctl(int skfd, char *ifname, int cmd, void *buf, int len) strncpy(ifr.ifr_name, ifname, IFNAMSIZ); ret = ioctl(skfd, SIOCDEVPRIVATE, &ifr); - if (ret < 0) - fprintf(stderr, "bcom_ioctl [cmd=%d, buf=%08x, len=%d] failed: %d\n", cmd, buf, len, ret); return ret; } @@ -290,7 +283,17 @@ void setup_bcom(int skfd, char *ifname) } bcom_ioctl(skfd, ifname, WLC_SET_GMODE_PROTECTION_CONTROL, &override, sizeof(control)); bcom_ioctl(skfd, ifname, WLC_SET_GMODE_PROTECTION_OVERRIDE, &override, sizeof(override)); + + if (val = 0) { + if (nvram_match(wl_var("plcphdr"), "long")) + val = WLC_PLCP_AUTO; + else + val = WLC_PLCP_SHORT; + + bcom_ioctl(skfd, ifname, WLC_SET_PLCPHDR, &val, sizeof(val)); + } } + } void set_wext_ssid(int skfd, char *ifname) @@ -393,7 +396,7 @@ void setup_wext(int skfd, char *ifname) wrq.u.txpower.value = -1; wrq.u.txpower.fixed = 1; - wrq.u.txpower.flags = IW_TXPOW_MWATT; + wrq.u.txpower.flags = IW_TXPOW_DBM; IW_SET_EXT_ERR(skfd, ifname, SIOCSIWTXPOW, &wrq, "Set Tx Power"); /* Set up WEP */