diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2010-10-23 17:50:24 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2010-10-23 17:50:24 +0000 |
commit | 6ef55ba3276ba85cb30d07c528266d92067725d4 (patch) | |
tree | a39136fabb5ebeb5711a4780ecae6ca175870f6b /contrib/package/iwinfo/src/iwinfo_wext.c | |
parent | 50bd4a979be2f56e9872f3a4dcd3c17fc4334957 (diff) |
libiwinfo: madwifi fixes, use direct ioctl calls for vap creation, ifup and ifdown, fix available txpower display
Diffstat (limited to 'contrib/package/iwinfo/src/iwinfo_wext.c')
-rw-r--r-- | contrib/package/iwinfo/src/iwinfo_wext.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/contrib/package/iwinfo/src/iwinfo_wext.c b/contrib/package/iwinfo/src/iwinfo_wext.c index 5eecd0da4d..5300f1b027 100644 --- a/contrib/package/iwinfo/src/iwinfo_wext.c +++ b/contrib/package/iwinfo/src/iwinfo_wext.c @@ -405,16 +405,18 @@ int wext_get_txpwrlist(const char *ifname, char *buf, int *len) ) { for( i = 0; i < range.num_txpower; i++ ) { - if( range.txpower_capa & IW_TXPOW_DBM ) + if( range.txpower_capa & IW_TXPOW_MWATT ) { - entry.dbm = range.txpower[i]; - entry.mw = wext_dbm2mw(range.txpower[i]); + entry.dbm = wext_mw2dbm(range.txpower[i]); + entry.mw = range.txpower[i]; } - else if( range.txpower_capa & IW_TXPOW_MWATT ) + /* Madwifi does neither set mW not dBm caps, also iwlist assumes + * dBm if mW is not set, so don't check here... */ + else /* if( range.txpower_capa & IW_TXPOW_DBM ) */ { - entry.dbm = wext_mw2dbm(range.txpower[i]); - entry.mw = range.txpower[i]; + entry.dbm = range.txpower[i]; + entry.mw = wext_dbm2mw(range.txpower[i]); } memcpy(&buf[i*sizeof(entry)], &entry, sizeof(entry)); |