diff options
Diffstat (limited to 'drivers/net/wireless/libertas/wext.c')
-rw-r--r-- | drivers/net/wireless/libertas/wext.c | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/drivers/net/wireless/libertas/wext.c b/drivers/net/wireless/libertas/wext.c index 426f1fe3bb42..e8cadad2c863 100644 --- a/drivers/net/wireless/libertas/wext.c +++ b/drivers/net/wireless/libertas/wext.c | |||
@@ -1820,7 +1820,21 @@ static int lbs_set_txpow(struct net_device *dev, struct iw_request_info *info, | |||
1820 | } | 1820 | } |
1821 | 1821 | ||
1822 | if (vwrq->fixed == 0) { | 1822 | if (vwrq->fixed == 0) { |
1823 | /* Auto power control */ | 1823 | /* User requests automatic tx power control, however there are |
1824 | * many auto tx settings. For now use firmware defaults until | ||
1825 | * we come up with a good way to expose these to the user. */ | ||
1826 | if (priv->fwrelease < 0x09000000) { | ||
1827 | ret = lbs_set_power_adapt_cfg(priv, 1, | ||
1828 | POW_ADAPT_DEFAULT_P0, | ||
1829 | POW_ADAPT_DEFAULT_P1, | ||
1830 | POW_ADAPT_DEFAULT_P2); | ||
1831 | if (ret) | ||
1832 | goto out; | ||
1833 | } | ||
1834 | ret = lbs_set_tpc_cfg(priv, 0, TPC_DEFAULT_P0, TPC_DEFAULT_P1, | ||
1835 | TPC_DEFAULT_P2, 1); | ||
1836 | if (ret) | ||
1837 | goto out; | ||
1824 | dbm = priv->txpower_max; | 1838 | dbm = priv->txpower_max; |
1825 | } else { | 1839 | } else { |
1826 | /* Userspace check in iwrange if it should use dBm or mW, | 1840 | /* Userspace check in iwrange if it should use dBm or mW, |
@@ -1830,7 +1844,8 @@ static int lbs_set_txpow(struct net_device *dev, struct iw_request_info *info, | |||
1830 | goto out; | 1844 | goto out; |
1831 | } | 1845 | } |
1832 | 1846 | ||
1833 | /* Validate requested power level against firmware allowed levels */ | 1847 | /* Validate requested power level against firmware allowed |
1848 | * levels */ | ||
1834 | if (priv->txpower_min && (dbm < priv->txpower_min)) { | 1849 | if (priv->txpower_min && (dbm < priv->txpower_min)) { |
1835 | ret = -EINVAL; | 1850 | ret = -EINVAL; |
1836 | goto out; | 1851 | goto out; |
@@ -1840,6 +1855,18 @@ static int lbs_set_txpow(struct net_device *dev, struct iw_request_info *info, | |||
1840 | ret = -EINVAL; | 1855 | ret = -EINVAL; |
1841 | goto out; | 1856 | goto out; |
1842 | } | 1857 | } |
1858 | if (priv->fwrelease < 0x09000000) { | ||
1859 | ret = lbs_set_power_adapt_cfg(priv, 0, | ||
1860 | POW_ADAPT_DEFAULT_P0, | ||
1861 | POW_ADAPT_DEFAULT_P1, | ||
1862 | POW_ADAPT_DEFAULT_P2); | ||
1863 | if (ret) | ||
1864 | goto out; | ||
1865 | } | ||
1866 | ret = lbs_set_tpc_cfg(priv, 0, TPC_DEFAULT_P0, TPC_DEFAULT_P1, | ||
1867 | TPC_DEFAULT_P2, 1); | ||
1868 | if (ret) | ||
1869 | goto out; | ||
1843 | } | 1870 | } |
1844 | 1871 | ||
1845 | /* If the radio was off, turn it on */ | 1872 | /* If the radio was off, turn it on */ |