diff options
Diffstat (limited to 'drivers/net/wireless/hostap/hostap_ioctl.c')
-rw-r--r-- | drivers/net/wireless/hostap/hostap_ioctl.c | 43 |
1 files changed, 7 insertions, 36 deletions
diff --git a/drivers/net/wireless/hostap/hostap_ioctl.c b/drivers/net/wireless/hostap/hostap_ioctl.c index 7e28b8300..3e5fa7872 100644 --- a/drivers/net/wireless/hostap/hostap_ioctl.c +++ b/drivers/net/wireless/hostap/hostap_ioctl.c @@ -1479,20 +1479,23 @@ static int prism2_txpower_hfa386x_to_dBm(u16 val) val = 255; tmp = val; + tmp >>= 2; - return tmp; + return -12 - tmp; } static u16 prism2_txpower_dBm_to_hfa386x(int val) { signed char tmp; - if (val > 127) - return 127; - else if (val < -128) + if (val > 20) return 128; + else if (val < -43) + return 127; tmp = val; + tmp = -12 - tmp; + tmp <<= 2; return (unsigned char) tmp; } @@ -4049,35 +4052,3 @@ int hostap_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd) return ret; } - -/* BUG FIX: Restore power setting value when lost due to F/W bug */ - -int hostap_restore_power(struct net_device *dev) -{ - struct hostap_interface *iface = netdev_priv(dev); - local_info_t *local = iface->local; - - u16 val; - int ret = 0; - - if (local->txpower_type == PRISM2_TXPOWER_OFF) { - val = 0xff; /* use all standby and sleep modes */ - ret = local->func->cmd(dev, HFA384X_CMDCODE_WRITEMIF, - HFA386X_CR_A_D_TEST_MODES2, - &val, NULL); - } - -#ifdef RAW_TXPOWER_SETTING - if (local->txpower_type == PRISM2_TXPOWER_FIXED) { - val = HFA384X_TEST_CFG_BIT_ALC; - local->func->cmd(dev, HFA384X_CMDCODE_TEST | - (HFA384X_TEST_CFG_BITS << 8), 0, &val, NULL); - val = prism2_txpower_dBm_to_hfa386x(local->txpower); - ret = (local->func->cmd(dev, HFA384X_CMDCODE_WRITEMIF, - HFA386X_CR_MANUAL_TX_POWER, &val, NULL)); - } -#endif /* RAW_TXPOWER_SETTING */ - return (ret ? -EOPNOTSUPP : 0); -} - -EXPORT_SYMBOL(hostap_restore_power); |