aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwmc3200wifi
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/iwmc3200wifi')
-rw-r--r--drivers/net/wireless/iwmc3200wifi/cfg80211.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/net/wireless/iwmc3200wifi/cfg80211.c b/drivers/net/wireless/iwmc3200wifi/cfg80211.c
index 902e95f70f6e..60619678f4ec 100644
--- a/drivers/net/wireless/iwmc3200wifi/cfg80211.c
+++ b/drivers/net/wireless/iwmc3200wifi/cfg80211.c
@@ -670,20 +670,24 @@ static int iwm_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev,
670} 670}
671 671
672static int iwm_cfg80211_set_txpower(struct wiphy *wiphy, 672static int iwm_cfg80211_set_txpower(struct wiphy *wiphy,
673 enum tx_power_setting type, int dbm) 673 enum nl80211_tx_power_setting type, int mbm)
674{ 674{
675 struct iwm_priv *iwm = wiphy_to_iwm(wiphy); 675 struct iwm_priv *iwm = wiphy_to_iwm(wiphy);
676 int ret; 676 int ret;
677 677
678 switch (type) { 678 switch (type) {
679 case TX_POWER_AUTOMATIC: 679 case NL80211_TX_POWER_AUTOMATIC:
680 return 0; 680 return 0;
681 case TX_POWER_FIXED: 681 case NL80211_TX_POWER_FIXED:
682 if (mbm < 0 || (mbm % 100))
683 return -EOPNOTSUPP;
684
682 if (!test_bit(IWM_STATUS_READY, &iwm->status)) 685 if (!test_bit(IWM_STATUS_READY, &iwm->status))
683 return 0; 686 return 0;
684 687
685 ret = iwm_umac_set_config_fix(iwm, UMAC_PARAM_TBL_CFG_FIX, 688 ret = iwm_umac_set_config_fix(iwm, UMAC_PARAM_TBL_CFG_FIX,
686 CFG_TX_PWR_LIMIT_USR, dbm * 2); 689 CFG_TX_PWR_LIMIT_USR,
690 MBM_TO_DBM(mbm) * 2);
687 if (ret < 0) 691 if (ret < 0)
688 return ret; 692 return ret;
689 693