diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2009-11-21 02:10:13 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2009-11-21 02:10:13 +0000 |
commit | a1ab9b51109d551edbff50a26c1ce127cfc5cbdc (patch) | |
tree | 053ded430cc68eee8632aa73388ffc324cbe32a3 /libs | |
parent | 0f9ee2bea2dfebbc34ba138b96fd2f51a0343a6e (diff) |
libs/iwinfo: support txpwrlist() for madwifi master devices
Diffstat (limited to 'libs')
-rw-r--r-- | libs/iwinfo/src/iwinfo_madwifi.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/libs/iwinfo/src/iwinfo_madwifi.c b/libs/iwinfo/src/iwinfo_madwifi.c index 83829cf39..33307022e 100644 --- a/libs/iwinfo/src/iwinfo_madwifi.c +++ b/libs/iwinfo/src/iwinfo_madwifi.c @@ -435,7 +435,29 @@ int madwifi_get_assoclist(const char *ifname, char *buf, int *len) int madwifi_get_txpwrlist(const char *ifname, char *buf, int *len) { - return wext_get_txpwrlist(ifname, buf, len); + int rc = -1; + char cmd[256]; + + /* A wifiX device? */ + if( madwifi_iswifi(ifname) ) + { + sprintf(cmd, "wlanconfig ath-txpwr create nounit " + "wlandev %s wlanmode ap >/dev/null", ifname); + + if( ! WEXITSTATUS(system(cmd)) ) + { + rc = wext_get_txpwrlist("ath-txpwr", buf, len); + (void) WEXITSTATUS(system("wlanconfig ath-txpwr destroy")); + } + } + + /* Its an athX ... */ + else if( madwifi_isvap(ifname, NULL) ) + { + rc = wext_get_txpwrlist(ifname, buf, len); + } + + return rc; } int madwifi_get_scanlist(const char *ifname, char *buf, int *len) |