diff options
author | Vasilis Tsiligiannis <b_tsiligiannis@silverton.gr> | 2009-12-24 21:34:57 +0000 |
---|---|---|
committer | Vasilis Tsiligiannis <b_tsiligiannis@silverton.gr> | 2009-12-24 21:34:57 +0000 |
commit | b9b4d9a2ab2c74b284ecbaa6afae52f7792659f7 (patch) | |
tree | c357ac0dafabf45db8fad7327110c5ea44aa4a43 /libs/iwinfo/src | |
parent | f790aae15a343a99bedf6fa482787d2c311af90d (diff) |
libs/iwinfo: Respect IW_TXPOW_DBM flag over IW_TXPOW_MWATT when both are set
Diffstat (limited to 'libs/iwinfo/src')
-rw-r--r-- | libs/iwinfo/src/iwinfo_wext.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/libs/iwinfo/src/iwinfo_wext.c b/libs/iwinfo/src/iwinfo_wext.c index eebaea6af8..2a1b685c46 100644 --- a/libs/iwinfo/src/iwinfo_wext.c +++ b/libs/iwinfo/src/iwinfo_wext.c @@ -373,17 +373,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_MWATT ) - { - entry.dbm = wext_mw2dbm(range.txpower[i]); - entry.mw = range.txpower[i]; - } - else + if( range.txpower_capa & IW_TXPOW_DBM ) { entry.dbm = range.txpower[i]; entry.mw = wext_dbm2mw(range.txpower[i]); } + else if( range.txpower_capa & IW_TXPOW_MWATT ) + { + entry.dbm = wext_mw2dbm(range.txpower[i]); + entry.mw = range.txpower[i]; + } + memcpy(&buf[i*sizeof(entry)], &entry, sizeof(entry)); } |