X-Git-Url: http://git.rohieb.name/openwrt.git/blobdiff_plain/f090d08794a075e61cb3912e1f15eaee55c1ba55..e2e1aff44f063dd354505f06e8e7f92dd966e194:/target/linux/package/wlcompat/wlcompat.c diff --git a/target/linux/package/wlcompat/wlcompat.c b/target/linux/package/wlcompat/wlcompat.c index d86a9bda9..7063c809a 100644 --- a/target/linux/package/wlcompat/wlcompat.c +++ b/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;