aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwmc3200wifi/cfg80211.c
diff options
context:
space:
mode:
authorJuuso Oikarinen <juuso.oikarinen@nokia.com>2010-06-23 05:12:37 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-06-24 15:42:33 -0400
commitfa61cf70a6ae1089e459e4b59b2e8d8e90d8535e (patch)
tree1bd81709faaa15fb207de7db4df1ceed96374208 /drivers/net/wireless/iwmc3200wifi/cfg80211.c
parenta185045c8da1ec6627236b4ade0d949b15da43b3 (diff)
cfg80211/mac80211: Update set_tx_power to use mBm instead of dBm units
In preparation for a TX power setting interface in the nl80211, change the .set_tx_power function to use mBm units instead of dBm for greater accuracy and smaller power levels. Also, already in advance move the tx_power_setting enumeration to nl80211. This change affects the .tx_set_power function prototype. As a result, the corresponding changes are needed to modules using it. These are mac80211, iwmc3200wifi and rndis_wlan. Cc: Samuel Ortiz <samuel.ortiz@intel.com> Cc: Jussi Kivilinna <jussi.kivilinna@mbnet.fi> Signed-off-by: Juuso Oikarinen <juuso.oikarinen@nokia.com> Acked-by: Samuel Ortiz <samuel.ortiz@intel.com> Acked-by: Jussi Kivilinna <jussi.kivilinna@mbnet.fi> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwmc3200wifi/cfg80211.c')
-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