summaryrefslogtreecommitdiffhomepage
path: root/libs
diff options
context:
space:
mode:
authorVasilis Tsiligiannis <b_tsiligiannis@silverton.gr>2009-12-24 21:34:57 +0000
committerVasilis Tsiligiannis <b_tsiligiannis@silverton.gr>2009-12-24 21:34:57 +0000
commitb9b4d9a2ab2c74b284ecbaa6afae52f7792659f7 (patch)
treec357ac0dafabf45db8fad7327110c5ea44aa4a43 /libs
parentf790aae15a343a99bedf6fa482787d2c311af90d (diff)
libs/iwinfo: Respect IW_TXPOW_DBM flag over IW_TXPOW_MWATT when both are set
Diffstat (limited to 'libs')
-rw-r--r--libs/iwinfo/src/iwinfo_wext.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/libs/iwinfo/src/iwinfo_wext.c b/libs/iwinfo/src/iwinfo_wext.c
index eebaea6af..2a1b685c4 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));
}