aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
diff options
context:
space:
mode:
authorMeenakshi Venkataraman <meenakshi.venkataraman@intel.com>2012-03-13 20:07:48 -0400
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2012-04-12 17:21:42 -0400
commit47042ac28569bb40ec10fe75af3f6d9a75a23c80 (patch)
tree1ac1a162087f056b21261c00f7d51cc2b980fda9 /drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
parent50319f74f5ef9e4fe070a17ce2b65f04280504ae (diff)
iwlwifi: move iwl_connection_init_rx_config to iwl-agn-rxon.c
Move this as part of iwl-core.c cleanup. Signed-off-by: Meenakshi Venkataraman <meenakshi.venkataraman@intel.com> Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi/iwl-agn-rxon.c')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rxon.c72
1 files changed, 72 insertions, 0 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
index fd091812af53..994fb21a0a87 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
@@ -32,6 +32,78 @@
32#include "iwl-trans.h" 32#include "iwl-trans.h"
33#include "iwl-shared.h" 33#include "iwl-shared.h"
34 34
35/*
36 * initialize rxon structure with default values from eeprom
37 */
38void iwl_connection_init_rx_config(struct iwl_priv *priv,
39 struct iwl_rxon_context *ctx)
40{
41 const struct iwl_channel_info *ch_info;
42
43 memset(&ctx->staging, 0, sizeof(ctx->staging));
44
45 if (!ctx->vif) {
46 ctx->staging.dev_type = ctx->unused_devtype;
47 } else
48 switch (ctx->vif->type) {
49 case NL80211_IFTYPE_AP:
50 ctx->staging.dev_type = ctx->ap_devtype;
51 break;
52
53 case NL80211_IFTYPE_STATION:
54 ctx->staging.dev_type = ctx->station_devtype;
55 ctx->staging.filter_flags = RXON_FILTER_ACCEPT_GRP_MSK;
56 break;
57
58 case NL80211_IFTYPE_ADHOC:
59 ctx->staging.dev_type = ctx->ibss_devtype;
60 ctx->staging.flags = RXON_FLG_SHORT_PREAMBLE_MSK;
61 ctx->staging.filter_flags = RXON_FILTER_BCON_AWARE_MSK |
62 RXON_FILTER_ACCEPT_GRP_MSK;
63 break;
64
65 default:
66 IWL_ERR(priv, "Unsupported interface type %d\n",
67 ctx->vif->type);
68 break;
69 }
70
71#if 0
72 /* TODO: Figure out when short_preamble would be set and cache from
73 * that */
74 if (!hw_to_local(priv->hw)->short_preamble)
75 ctx->staging.flags &= ~RXON_FLG_SHORT_PREAMBLE_MSK;
76 else
77 ctx->staging.flags |= RXON_FLG_SHORT_PREAMBLE_MSK;
78#endif
79
80 ch_info = iwl_get_channel_info(priv, priv->band,
81 le16_to_cpu(ctx->active.channel));
82
83 if (!ch_info)
84 ch_info = &priv->channel_info[0];
85
86 ctx->staging.channel = cpu_to_le16(ch_info->channel);
87 priv->band = ch_info->band;
88
89 iwl_set_flags_for_band(priv, ctx, priv->band, ctx->vif);
90
91 ctx->staging.ofdm_basic_rates =
92 (IWL_OFDM_RATES_MASK >> IWL_FIRST_OFDM_RATE) & 0xFF;
93 ctx->staging.cck_basic_rates =
94 (IWL_CCK_RATES_MASK >> IWL_FIRST_CCK_RATE) & 0xF;
95
96 /* clear both MIX and PURE40 mode flag */
97 ctx->staging.flags &= ~(RXON_FLG_CHANNEL_MODE_MIXED |
98 RXON_FLG_CHANNEL_MODE_PURE_40);
99 if (ctx->vif)
100 memcpy(ctx->staging.node_addr, ctx->vif->addr, ETH_ALEN);
101
102 ctx->staging.ofdm_ht_single_stream_basic_rates = 0xff;
103 ctx->staging.ofdm_ht_dual_stream_basic_rates = 0xff;
104 ctx->staging.ofdm_ht_triple_stream_basic_rates = 0xff;
105}
106
35static int iwlagn_disable_bss(struct iwl_priv *priv, 107static int iwlagn_disable_bss(struct iwl_priv *priv,
36 struct iwl_rxon_context *ctx, 108 struct iwl_rxon_context *ctx,
37 struct iwl_rxon_cmd *send) 109 struct iwl_rxon_cmd *send)