aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-5000.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/iwl-5000.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/iwl-5000.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-5000.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index 2a30306b7ed0..da8750b97eec 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -1424,6 +1424,19 @@ static int iwl5000_send_rxon_assoc(struct iwl_priv *priv)
1424 1424
1425 return ret; 1425 return ret;
1426} 1426}
1427static int iwl5000_send_tx_power(struct iwl_priv *priv)
1428{
1429 struct iwl5000_tx_power_dbm_cmd tx_power_cmd;
1430
1431 /* half dBm need to multiply */
1432 tx_power_cmd.global_lmt = (s8)(2 * priv->tx_power_user_lmt);
1433 tx_power_cmd.flags = 0;
1434 tx_power_cmd.srv_chan_lmt = IWL50_TX_POWER_AUTO;
1435 return iwl_send_cmd_pdu_async(priv, REPLY_TX_POWER_DBM_CMD,
1436 sizeof(tx_power_cmd), &tx_power_cmd,
1437 NULL);
1438}
1439
1427 1440
1428static struct iwl_hcmd_ops iwl5000_hcmd = { 1441static struct iwl_hcmd_ops iwl5000_hcmd = {
1429 .rxon_assoc = iwl5000_send_rxon_assoc, 1442 .rxon_assoc = iwl5000_send_rxon_assoc,
@@ -1452,6 +1465,7 @@ static struct iwl_lib_ops iwl5000_lib = {
1452 .load_ucode = iwl5000_load_ucode, 1465 .load_ucode = iwl5000_load_ucode,
1453 .init_alive_start = iwl5000_init_alive_start, 1466 .init_alive_start = iwl5000_init_alive_start,
1454 .alive_notify = iwl5000_alive_notify, 1467 .alive_notify = iwl5000_alive_notify,
1468 .send_tx_power = iwl5000_send_tx_power,
1455 .apm_ops = { 1469 .apm_ops = {
1456 .init = iwl5000_apm_init, 1470 .init = iwl5000_apm_init,
1457 .reset = iwl5000_apm_reset, 1471 .reset = iwl5000_apm_reset,