aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorMeenakshi Venkataraman <meenakshi.venkataraman@intel.com>2012-03-15 16:27:02 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-04-09 16:37:44 -0400
commit5562092131bc2f055048df7fe3a536592fa6f04d (patch)
treed70d799c098283a8b6529429686b26e362888055 /drivers/net
parent8931b5761b6be28301abe5e2a89a48976436b36d (diff)
iwlwifi: move iwl_full_rxon_required and mark it static
iwl_full_rxon_required is used only in iwl-agn-rxon.c. Move it there and mark it static. Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rxon.c64
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c64
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.h1
3 files changed, 64 insertions, 65 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
index 7f0448c66b8..79d857d81b4 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
@@ -24,6 +24,7 @@
24 * 24 *
25 *****************************************************************************/ 25 *****************************************************************************/
26 26
27#include <linux/etherdevice.h>
27#include "iwl-dev.h" 28#include "iwl-dev.h"
28#include "iwl-agn.h" 29#include "iwl-agn.h"
29#include "iwl-core.h" 30#include "iwl-core.h"
@@ -586,6 +587,69 @@ static int iwl_check_rxon_cmd(struct iwl_priv *priv,
586} 587}
587 588
588/** 589/**
590 * iwl_full_rxon_required - check if full RXON (vs RXON_ASSOC) cmd is needed
591 * @priv: staging_rxon is compared to active_rxon
592 *
593 * If the RXON structure is changing enough to require a new tune,
594 * or is clearing the RXON_FILTER_ASSOC_MSK, then return 1 to indicate that
595 * a new tune (full RXON command, rather than RXON_ASSOC cmd) is required.
596 */
597static int iwl_full_rxon_required(struct iwl_priv *priv,
598 struct iwl_rxon_context *ctx)
599{
600 const struct iwl_rxon_cmd *staging = &ctx->staging;
601 const struct iwl_rxon_cmd *active = &ctx->active;
602
603#define CHK(cond) \
604 if ((cond)) { \
605 IWL_DEBUG_INFO(priv, "need full RXON - " #cond "\n"); \
606 return 1; \
607 }
608
609#define CHK_NEQ(c1, c2) \
610 if ((c1) != (c2)) { \
611 IWL_DEBUG_INFO(priv, "need full RXON - " \
612 #c1 " != " #c2 " - %d != %d\n", \
613 (c1), (c2)); \
614 return 1; \
615 }
616
617 /* These items are only settable from the full RXON command */
618 CHK(!iwl_is_associated_ctx(ctx));
619 CHK(compare_ether_addr(staging->bssid_addr, active->bssid_addr));
620 CHK(compare_ether_addr(staging->node_addr, active->node_addr));
621 CHK(compare_ether_addr(staging->wlap_bssid_addr,
622 active->wlap_bssid_addr));
623 CHK_NEQ(staging->dev_type, active->dev_type);
624 CHK_NEQ(staging->channel, active->channel);
625 CHK_NEQ(staging->air_propagation, active->air_propagation);
626 CHK_NEQ(staging->ofdm_ht_single_stream_basic_rates,
627 active->ofdm_ht_single_stream_basic_rates);
628 CHK_NEQ(staging->ofdm_ht_dual_stream_basic_rates,
629 active->ofdm_ht_dual_stream_basic_rates);
630 CHK_NEQ(staging->ofdm_ht_triple_stream_basic_rates,
631 active->ofdm_ht_triple_stream_basic_rates);
632 CHK_NEQ(staging->assoc_id, active->assoc_id);
633
634 /* flags, filter_flags, ofdm_basic_rates, and cck_basic_rates can
635 * be updated with the RXON_ASSOC command -- however only some
636 * flag transitions are allowed using RXON_ASSOC */
637
638 /* Check if we are not switching bands */
639 CHK_NEQ(staging->flags & RXON_FLG_BAND_24G_MSK,
640 active->flags & RXON_FLG_BAND_24G_MSK);
641
642 /* Check if we are switching association toggle */
643 CHK_NEQ(staging->filter_flags & RXON_FILTER_ASSOC_MSK,
644 active->filter_flags & RXON_FILTER_ASSOC_MSK);
645
646#undef CHK
647#undef CHK_NEQ
648
649 return 0;
650}
651
652/**
589 * iwlagn_commit_rxon - commit staging_rxon to hardware 653 * iwlagn_commit_rxon - commit staging_rxon to hardware
590 * 654 *
591 * The RXON command in staging_rxon is committed to the hardware and 655 * The RXON command in staging_rxon is committed to the hardware and
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 56338693d38..ec250b21352 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -28,7 +28,6 @@
28 28
29#include <linux/kernel.h> 29#include <linux/kernel.h>
30#include <linux/module.h> 30#include <linux/module.h>
31#include <linux/etherdevice.h>
32#include <linux/sched.h> 31#include <linux/sched.h>
33#include <linux/slab.h> 32#include <linux/slab.h>
34#include <net/mac80211.h> 33#include <net/mac80211.h>
@@ -88,69 +87,6 @@ bool iwl_is_ht40_tx_allowed(struct iwl_priv *priv,
88 ctx->ht.extension_chan_offset); 87 ctx->ht.extension_chan_offset);
89} 88}
90 89
91/**
92 * iwl_full_rxon_required - check if full RXON (vs RXON_ASSOC) cmd is needed
93 * @priv: staging_rxon is compared to active_rxon
94 *
95 * If the RXON structure is changing enough to require a new tune,
96 * or is clearing the RXON_FILTER_ASSOC_MSK, then return 1 to indicate that
97 * a new tune (full RXON command, rather than RXON_ASSOC cmd) is required.
98 */
99int iwl_full_rxon_required(struct iwl_priv *priv,
100 struct iwl_rxon_context *ctx)
101{
102 const struct iwl_rxon_cmd *staging = &ctx->staging;
103 const struct iwl_rxon_cmd *active = &ctx->active;
104
105#define CHK(cond) \
106 if ((cond)) { \
107 IWL_DEBUG_INFO(priv, "need full RXON - " #cond "\n"); \
108 return 1; \
109 }
110
111#define CHK_NEQ(c1, c2) \
112 if ((c1) != (c2)) { \
113 IWL_DEBUG_INFO(priv, "need full RXON - " \
114 #c1 " != " #c2 " - %d != %d\n", \
115 (c1), (c2)); \
116 return 1; \
117 }
118
119 /* These items are only settable from the full RXON command */
120 CHK(!iwl_is_associated_ctx(ctx));
121 CHK(compare_ether_addr(staging->bssid_addr, active->bssid_addr));
122 CHK(compare_ether_addr(staging->node_addr, active->node_addr));
123 CHK(compare_ether_addr(staging->wlap_bssid_addr,
124 active->wlap_bssid_addr));
125 CHK_NEQ(staging->dev_type, active->dev_type);
126 CHK_NEQ(staging->channel, active->channel);
127 CHK_NEQ(staging->air_propagation, active->air_propagation);
128 CHK_NEQ(staging->ofdm_ht_single_stream_basic_rates,
129 active->ofdm_ht_single_stream_basic_rates);
130 CHK_NEQ(staging->ofdm_ht_dual_stream_basic_rates,
131 active->ofdm_ht_dual_stream_basic_rates);
132 CHK_NEQ(staging->ofdm_ht_triple_stream_basic_rates,
133 active->ofdm_ht_triple_stream_basic_rates);
134 CHK_NEQ(staging->assoc_id, active->assoc_id);
135
136 /* flags, filter_flags, ofdm_basic_rates, and cck_basic_rates can
137 * be updated with the RXON_ASSOC command -- however only some
138 * flag transitions are allowed using RXON_ASSOC */
139
140 /* Check if we are not switching bands */
141 CHK_NEQ(staging->flags & RXON_FLG_BAND_24G_MSK,
142 active->flags & RXON_FLG_BAND_24G_MSK);
143
144 /* Check if we are switching association toggle */
145 CHK_NEQ(staging->filter_flags & RXON_FILTER_ASSOC_MSK,
146 active->filter_flags & RXON_FILTER_ASSOC_MSK);
147
148#undef CHK
149#undef CHK_NEQ
150
151 return 0;
152}
153
154static void _iwl_set_rxon_ht(struct iwl_priv *priv, 90static void _iwl_set_rxon_ht(struct iwl_priv *priv,
155 struct iwl_ht_config *ht_conf, 91 struct iwl_ht_config *ht_conf,
156 struct iwl_rxon_context *ctx) 92 struct iwl_rxon_context *ctx)
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index f49a69c9759..2488fc1c5cb 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -93,7 +93,6 @@ struct iwl_lib_ops {
93 * L i b * 93 * L i b *
94 ***************************/ 94 ***************************/
95 95
96int iwl_full_rxon_required(struct iwl_priv *priv, struct iwl_rxon_context *ctx);
97void iwl_set_rxon_channel(struct iwl_priv *priv, struct ieee80211_channel *ch, 96void iwl_set_rxon_channel(struct iwl_priv *priv, struct ieee80211_channel *ch,
98 struct iwl_rxon_context *ctx); 97 struct iwl_rxon_context *ctx);
99void iwl_set_flags_for_band(struct iwl_priv *priv, 98void iwl_set_flags_for_band(struct iwl_priv *priv,