1
0
mirror of git://projects.qi-hardware.com/openwrt-xburst.git synced 2024-11-10 21:11:54 +02:00

fix txpower setting in wlcompat

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@1363 3c298f89-4303-0410-b956-a3cf2f4a3e73
This commit is contained in:
nbd 2005-07-06 16:00:20 +00:00
parent 1ccd08f0e7
commit 4fdaa39bf2

View File

@ -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) if (wl_ioctl(dev, WLC_GET_FRAG, &range->max_frag, sizeof(int)) < 0)
range->max_frag = 2346; range->max_frag = 2346;
range->txpower_capa = IW_TXPOW_MWATT; range->txpower_capa = IW_TXPOW_DBM;
return 0; return 0;
} }
@ -419,10 +419,11 @@ static int wlcompat_ioctl(struct net_device *dev,
return -EINVAL; return -EINVAL;
wrqu->txpower.value &= ~WL_TXPWR_OVERRIDE; wrqu->txpower.value &= ~WL_TXPWR_OVERRIDE;
wrqu->txpower.value /= 4;
wrqu->txpower.fixed = 0; wrqu->txpower.fixed = 0;
wrqu->txpower.disabled = radio; wrqu->txpower.disabled = radio;
wrqu->txpower.flags = IW_TXPOW_MWATT; wrqu->txpower.flags = IW_TXPOW_DBM;
break; break;
} }
case SIOCSIWTXPOW: case SIOCSIWTXPOW:
@ -440,9 +441,10 @@ static int wlcompat_ioctl(struct net_device *dev,
return -EINVAL; return -EINVAL;
value &= WL_TXPWR_OVERRIDE; value &= WL_TXPWR_OVERRIDE;
wrqu->txpower.value *= 4;
wrqu->txpower.value |= value; wrqu->txpower.value |= value;
if (wrqu->txpower.flags != IW_TXPOW_MWATT) if (wrqu->txpower.flags != IW_TXPOW_DBM)
return -EINVAL; return -EINVAL;
if (wrqu->txpower.value > 0) if (wrqu->txpower.value > 0)