summaryrefslogtreecommitdiff
path: root/openwrt
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2005-11-19 01:07:50 +0000
committerFelix Fietkau <nbd@openwrt.org>2005-11-19 01:07:50 +0000
commit9a8a69c0b82a6c128831e75200489ed397d44f44 (patch)
tree7f88141790732eff3e27c9bf13f96d078e52992b /openwrt
parent894e2f118ea101b4c6df7d6624afe582d16e89de (diff)
downloadmtk-20170518-9a8a69c0b82a6c128831e75200489ed397d44f44.zip
mtk-20170518-9a8a69c0b82a6c128831e75200489ed397d44f44.tar.gz
mtk-20170518-9a8a69c0b82a6c128831e75200489ed397d44f44.tar.bz2
make wlcompat display 19 dBm max. when regulatory override is disabled
SVN-Revision: 2530
Diffstat (limited to 'openwrt')
-rw-r--r--openwrt/target/linux/package/wlcompat/wlcompat.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/openwrt/target/linux/package/wlcompat/wlcompat.c b/openwrt/target/linux/package/wlcompat/wlcompat.c
index d86a9bd..7063c80 100644
--- a/openwrt/target/linux/package/wlcompat/wlcompat.c
+++ b/openwrt/target/linux/package/wlcompat/wlcompat.c
@@ -494,14 +494,17 @@ static int wlcompat_ioctl(struct net_device *dev,
}
case SIOCGIWTXPOW:
{
- int radio;
+ int radio, override;
wl_ioctl(dev, WLC_GET_RADIO, &radio, sizeof(int));
if (wl_get_val(dev, "qtxpower", &(wrqu->txpower.value), sizeof(int)) < 0)
return -EINVAL;
+ override = (wrqu->txpower.value & WL_TXPWR_OVERRIDE) == WL_TXPWR_OVERRIDE;
wrqu->txpower.value &= ~WL_TXPWR_OVERRIDE;
+ if (!override && (wrqu->txpower.value > 76))
+ wrqu->txpower.value = 76;
wrqu->txpower.value /= 4;
wrqu->txpower.fixed = 0;