aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi
diff options
context:
space:
mode:
authorAbhijeet Kolekar <abhijeet.kolekar@intel.com>2009-10-09 16:20:30 -0400
committerJohn W. Linville <linville@tuxdriver.com>2009-10-27 16:48:00 -0400
commit37dc70fea870ced8fbd9ae786701529e7ce48f03 (patch)
tree27edb05a98dac5c501fff4fad9edffbb1175f73e /drivers/net/wireless/iwlwifi
parent92a35bda792cf9295b1d399f7c937d4560292b1e (diff)
iwlwifi/iwl3945: unify rts_tx_cmd_flag
3945 and 4965 share the functionality for setting RTS and CTS to the tx_cmd. Unify these functions and move the common functionality to core. Signed-off-by: Abhijeet Kolekar <abhijeet.kolekar@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-3945.c1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-4965.c14
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c17
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.h2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c9
5 files changed, 22 insertions, 21 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-3945.c b/drivers/net/wireless/iwlwifi/iwl-3945.c
index cee03e7fc2d..1372ce4a407 100644
--- a/drivers/net/wireless/iwlwifi/iwl-3945.c
+++ b/drivers/net/wireless/iwlwifi/iwl-3945.c
@@ -2826,6 +2826,7 @@ static struct iwl_lib_ops iwl3945_lib = {
2826static struct iwl_hcmd_utils_ops iwl3945_hcmd_utils = { 2826static struct iwl_hcmd_utils_ops iwl3945_hcmd_utils = {
2827 .get_hcmd_size = iwl3945_get_hcmd_size, 2827 .get_hcmd_size = iwl3945_get_hcmd_size,
2828 .build_addsta_hcmd = iwl3945_build_addsta_hcmd, 2828 .build_addsta_hcmd = iwl3945_build_addsta_hcmd,
2829 .rts_tx_cmd_flag = iwlcore_rts_tx_cmd_flag,
2829}; 2830};
2830 2831
2831static struct iwl_ops iwl3945_ops = { 2832static struct iwl_ops iwl3945_ops = {
diff --git a/drivers/net/wireless/iwlwifi/iwl-4965.c b/drivers/net/wireless/iwlwifi/iwl-4965.c
index c9d90169ab1..6d77039b4ed 100644
--- a/drivers/net/wireless/iwlwifi/iwl-4965.c
+++ b/drivers/net/wireless/iwlwifi/iwl-4965.c
@@ -484,18 +484,6 @@ static void iwl4965_gain_computation(struct iwl_priv *priv,
484 data->beacon_count = 0; 484 data->beacon_count = 0;
485} 485}
486 486
487static void iwl4965_rts_tx_cmd_flag(struct ieee80211_tx_info *info,
488 __le32 *tx_flags)
489{
490 if (info->control.rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS) {
491 *tx_flags |= TX_CMD_FLG_RTS_MSK;
492 *tx_flags &= ~TX_CMD_FLG_CTS_MSK;
493 } else if (info->control.rates[0].flags & IEEE80211_TX_RC_USE_CTS_PROTECT) {
494 *tx_flags &= ~TX_CMD_FLG_RTS_MSK;
495 *tx_flags |= TX_CMD_FLG_CTS_MSK;
496 }
497}
498
499static void iwl4965_bg_txpower_work(struct work_struct *work) 487static void iwl4965_bg_txpower_work(struct work_struct *work)
500{ 488{
501 struct iwl_priv *priv = container_of(work, struct iwl_priv, 489 struct iwl_priv *priv = container_of(work, struct iwl_priv,
@@ -2212,7 +2200,7 @@ static struct iwl_hcmd_utils_ops iwl4965_hcmd_utils = {
2212 .build_addsta_hcmd = iwl4965_build_addsta_hcmd, 2200 .build_addsta_hcmd = iwl4965_build_addsta_hcmd,
2213 .chain_noise_reset = iwl4965_chain_noise_reset, 2201 .chain_noise_reset = iwl4965_chain_noise_reset,
2214 .gain_computation = iwl4965_gain_computation, 2202 .gain_computation = iwl4965_gain_computation,
2215 .rts_tx_cmd_flag = iwl4965_rts_tx_cmd_flag, 2203 .rts_tx_cmd_flag = iwlcore_rts_tx_cmd_flag,
2216 .calc_rssi = iwl4965_calc_rssi, 2204 .calc_rssi = iwl4965_calc_rssi,
2217}; 2205};
2218 2206
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index c40c7e2dacf..1e0021f9681 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -604,6 +604,23 @@ void iwlcore_free_geos(struct iwl_priv *priv)
604} 604}
605EXPORT_SYMBOL(iwlcore_free_geos); 605EXPORT_SYMBOL(iwlcore_free_geos);
606 606
607/*
608 * iwlcore_rts_tx_cmd_flag: Set rts/cts. 3945 and 4965 only share this
609 * function.
610 */
611void iwlcore_rts_tx_cmd_flag(struct ieee80211_tx_info *info,
612 __le32 *tx_flags)
613{
614 if (info->control.rates[0].flags & IEEE80211_TX_RC_USE_RTS_CTS) {
615 *tx_flags |= TX_CMD_FLG_RTS_MSK;
616 *tx_flags &= ~TX_CMD_FLG_CTS_MSK;
617 } else if (info->control.rates[0].flags & IEEE80211_TX_RC_USE_CTS_PROTECT) {
618 *tx_flags &= ~TX_CMD_FLG_RTS_MSK;
619 *tx_flags |= TX_CMD_FLG_CTS_MSK;
620 }
621}
622EXPORT_SYMBOL(iwlcore_rts_tx_cmd_flag);
623
607static bool is_single_rx_stream(struct iwl_priv *priv) 624static bool is_single_rx_stream(struct iwl_priv *priv)
608{ 625{
609 return !priv->current_ht_config.is_ht || 626 return !priv->current_ht_config.is_ht ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index 3679c2ced04..cec673badf0 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -329,6 +329,8 @@ int iwl_mac_get_tx_stats(struct ieee80211_hw *hw,
329void iwl_mac_reset_tsf(struct ieee80211_hw *hw); 329void iwl_mac_reset_tsf(struct ieee80211_hw *hw);
330int iwl_alloc_txq_mem(struct iwl_priv *priv); 330int iwl_alloc_txq_mem(struct iwl_priv *priv);
331void iwl_free_txq_mem(struct iwl_priv *priv); 331void iwl_free_txq_mem(struct iwl_priv *priv);
332void iwlcore_rts_tx_cmd_flag(struct ieee80211_tx_info *info,
333 __le32 *tx_flags);
332#ifdef CONFIG_IWLWIFI_DEBUGFS 334#ifdef CONFIG_IWLWIFI_DEBUGFS
333int iwl_alloc_traffic_mem(struct iwl_priv *priv); 335int iwl_alloc_traffic_mem(struct iwl_priv *priv);
334void iwl_free_traffic_mem(struct iwl_priv *priv); 336void iwl_free_traffic_mem(struct iwl_priv *priv);
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 66da441fe36..f4d43531bfa 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -408,7 +408,6 @@ static void iwl3945_build_tx_cmd_basic(struct iwl_priv *priv,
408 struct iwl3945_tx_cmd *tx = (struct iwl3945_tx_cmd *)cmd->cmd.payload; 408 struct iwl3945_tx_cmd *tx = (struct iwl3945_tx_cmd *)cmd->cmd.payload;
409 __le32 tx_flags = tx->tx_flags; 409 __le32 tx_flags = tx->tx_flags;
410 __le16 fc = hdr->frame_control; 410 __le16 fc = hdr->frame_control;
411 u8 rc_flags = info->control.rates[0].flags;
412 411
413 tx->stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE; 412 tx->stop_time.life_time = TX_CMD_LIFE_TIME_INFINITE;
414 if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) { 413 if (!(info->flags & IEEE80211_TX_CTL_NO_ACK)) {
@@ -435,13 +434,7 @@ static void iwl3945_build_tx_cmd_basic(struct iwl_priv *priv,
435 tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK; 434 tx_flags |= TX_CMD_FLG_SEQ_CTL_MSK;
436 } 435 }
437 436
438 if (rc_flags & IEEE80211_TX_RC_USE_RTS_CTS) { 437 priv->cfg->ops->utils->rts_tx_cmd_flag(info, &tx_flags);
439 tx_flags |= TX_CMD_FLG_RTS_MSK;
440 tx_flags &= ~TX_CMD_FLG_CTS_MSK;
441 } else if (rc_flags & IEEE80211_TX_RC_USE_CTS_PROTECT) {
442 tx_flags &= ~TX_CMD_FLG_RTS_MSK;
443 tx_flags |= TX_CMD_FLG_CTS_MSK;
444 }
445 438
446 if ((tx_flags & TX_CMD_FLG_RTS_MSK) || (tx_flags & TX_CMD_FLG_CTS_MSK)) 439 if ((tx_flags & TX_CMD_FLG_RTS_MSK) || (tx_flags & TX_CMD_FLG_CTS_MSK))
447 tx_flags |= TX_CMD_FLG_FULL_TXOP_PROT_MSK; 440 tx_flags |= TX_CMD_FLG_FULL_TXOP_PROT_MSK;