aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl4965-base.c
diff options
context:
space:
mode:
authorTomas Winkler <tomas.winkler@intel.com>2008-06-11 21:47:08 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-06-14 12:18:08 -0400
commit630fe9b6f774dd55b71fe94392101eb00df58762 (patch)
treea4835d1d28195321f52f877f89d5bf1dbe8bf436 /drivers/net/wireless/iwlwifi/iwl4965-base.c
parent25a6572cc13ba2a3fefc02a63a077ff3664a1ca9 (diff)
iwlwifi: refactor setting tx power
This patch 1. Refactors settings of tx power 2. enables iwconfig txpower <value> 3. adds 5000 HW tx power Signed-off-by: Tomas Winkler <tomas.winkler@intel.com> Signed-off-by: Zhu Yi <yi.zhu@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl4965-base.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl4965-base.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl4965-base.c b/drivers/net/wireless/iwlwifi/iwl4965-base.c
index 510e40348a30..af448197cc05 100644
--- a/drivers/net/wireless/iwlwifi/iwl4965-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl4965-base.c
@@ -367,9 +367,9 @@ static int iwl4965_commit_rxon(struct iwl_priv *priv)
367 367
368 /* If we issue a new RXON command which required a tune then we must 368 /* If we issue a new RXON command which required a tune then we must
369 * send a new TXPOWER command or we won't be able to Tx any frames */ 369 * send a new TXPOWER command or we won't be able to Tx any frames */
370 rc = iwl4965_hw_reg_send_txpower(priv); 370 rc = iwl_set_tx_power(priv, priv->tx_power_user_lmt, true);
371 if (rc) { 371 if (rc) {
372 IWL_ERROR("Error setting Tx power (%d).\n", rc); 372 IWL_ERROR("Error sending TX power (%d).\n", rc);
373 return rc; 373 return rc;
374 } 374 }
375 375
@@ -3637,7 +3637,7 @@ static void iwl4965_bg_scan_completed(struct work_struct *work)
3637 struct iwl_priv *priv = 3637 struct iwl_priv *priv =
3638 container_of(work, struct iwl_priv, scan_completed); 3638 container_of(work, struct iwl_priv, scan_completed);
3639 3639
3640 IWL_DEBUG(IWL_DL_SCAN, "SCAN complete scan\n"); 3640 IWL_DEBUG_SCAN("SCAN complete scan\n");
3641 3641
3642 if (test_bit(STATUS_EXIT_PENDING, &priv->status)) 3642 if (test_bit(STATUS_EXIT_PENDING, &priv->status))
3643 return; 3643 return;
@@ -3650,7 +3650,7 @@ static void iwl4965_bg_scan_completed(struct work_struct *work)
3650 /* Since setting the TXPOWER may have been deferred while 3650 /* Since setting the TXPOWER may have been deferred while
3651 * performing the scan, fire one off */ 3651 * performing the scan, fire one off */
3652 mutex_lock(&priv->mutex); 3652 mutex_lock(&priv->mutex);
3653 iwl4965_hw_reg_send_txpower(priv); 3653 iwl_set_tx_power(priv, priv->tx_power_user_lmt, true);
3654 mutex_unlock(&priv->mutex); 3654 mutex_unlock(&priv->mutex);
3655} 3655}
3656 3656
@@ -3930,6 +3930,11 @@ static int iwl4965_mac_config(struct ieee80211_hw *hw, struct ieee80211_conf *co
3930 goto out; 3930 goto out;
3931 } 3931 }
3932 3932
3933 IWL_DEBUG_MAC80211("TX Power old=%d new=%d\n",
3934 priv->tx_power_user_lmt, conf->power_level);
3935
3936 iwl_set_tx_power(priv, conf->power_level, false);
3937
3933 iwl4965_set_rate(priv); 3938 iwl4965_set_rate(priv);
3934 3939
3935 if (memcmp(&priv->active_rxon, 3940 if (memcmp(&priv->active_rxon,
@@ -4713,7 +4718,7 @@ static ssize_t show_tx_power(struct device *d,
4713 struct device_attribute *attr, char *buf) 4718 struct device_attribute *attr, char *buf)
4714{ 4719{
4715 struct iwl_priv *priv = (struct iwl_priv *)d->driver_data; 4720 struct iwl_priv *priv = (struct iwl_priv *)d->driver_data;
4716 return sprintf(buf, "%d\n", priv->user_txpower_limit); 4721 return sprintf(buf, "%d\n", priv->tx_power_user_lmt);
4717} 4722}
4718 4723
4719static ssize_t store_tx_power(struct device *d, 4724static ssize_t store_tx_power(struct device *d,
@@ -4729,7 +4734,7 @@ static ssize_t store_tx_power(struct device *d,
4729 printk(KERN_INFO DRV_NAME 4734 printk(KERN_INFO DRV_NAME
4730 ": %s is not in decimal form.\n", buf); 4735 ": %s is not in decimal form.\n", buf);
4731 else 4736 else
4732 iwl4965_hw_reg_set_txpower(priv, val); 4737 iwl_set_tx_power(priv, val, false);
4733 4738
4734 return count; 4739 return count;
4735} 4740}