aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/package/wlcompat/wlcompat.c
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2005-07-06 16:00:20 +0000
committerFelix Fietkau <nbd@openwrt.org>2005-07-06 16:00:20 +0000
commit80371fe03c889e9241fded589d76d1e8a591ffa7 (patch)
treeb63e69922d0247e8190e808053a405e1d2714a1b /target/linux/package/wlcompat/wlcompat.c
parentcec6de3ea8bf2aae4c6b51ece615d826783e405f (diff)
downloadmaster-187ad058-80371fe03c889e9241fded589d76d1e8a591ffa7.tar.gz
master-187ad058-80371fe03c889e9241fded589d76d1e8a591ffa7.tar.bz2
master-187ad058-80371fe03c889e9241fded589d76d1e8a591ffa7.zip
fix txpower setting in wlcompat
git-svn-id: svn://svn.openwrt.org/openwrt/trunk/openwrt@1363 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/package/wlcompat/wlcompat.c')
-rw-r--r--target/linux/package/wlcompat/wlcompat.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/target/linux/package/wlcompat/wlcompat.c b/target/linux/package/wlcompat/wlcompat.c
index 1d2a363251..652a3681bc 100644
--- a/target/linux/package/wlcompat/wlcompat.c
+++ b/target/linux/package/wlcompat/wlcompat.c
@@ -176,7 +176,7 @@ static int wlcompat_ioctl_getiwrange(struct net_device *dev,
if (wl_ioctl(dev, WLC_GET_FRAG, &range->max_frag, sizeof(int)) < 0)
range->max_frag = 2346;
- range->txpower_capa = IW_TXPOW_MWATT;
+ range->txpower_capa = IW_TXPOW_DBM;
return 0;
}
@@ -419,10 +419,11 @@ static int wlcompat_ioctl(struct net_device *dev,
return -EINVAL;
wrqu->txpower.value &= ~WL_TXPWR_OVERRIDE;
+ wrqu->txpower.value /= 4;
wrqu->txpower.fixed = 0;
wrqu->txpower.disabled = radio;
- wrqu->txpower.flags = IW_TXPOW_MWATT;
+ wrqu->txpower.flags = IW_TXPOW_DBM;
break;
}
case SIOCSIWTXPOW:
@@ -440,9 +441,10 @@ static int wlcompat_ioctl(struct net_device *dev,
return -EINVAL;
value &= WL_TXPWR_OVERRIDE;
+ wrqu->txpower.value *= 4;
wrqu->txpower.value |= value;
- if (wrqu->txpower.flags != IW_TXPOW_MWATT)
+ if (wrqu->txpower.flags != IW_TXPOW_DBM)
return -EINVAL;
if (wrqu->txpower.value > 0)