aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
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
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')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rxon.c72
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.h2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c71
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.h2
4 files changed, 74 insertions, 73 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)
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.h b/drivers/net/wireless/iwlwifi/iwl-agn.h
index ecc217c7c625..8f9ea33e950e 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.h
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.h
@@ -117,6 +117,8 @@ int iwl_dvm_send_cmd_pdu(struct iwl_priv *priv, u8 id,
117 u32 flags, u16 len, const void *data); 117 u32 flags, u16 len, const void *data);
118 118
119/* RXON */ 119/* RXON */
120void iwl_connection_init_rx_config(struct iwl_priv *priv,
121 struct iwl_rxon_context *ctx);
120int iwlagn_set_pan_params(struct iwl_priv *priv); 122int iwlagn_set_pan_params(struct iwl_priv *priv);
121int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx); 123int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx);
122void iwlagn_set_rxon_chain(struct iwl_priv *priv, struct iwl_rxon_context *ctx); 124void iwlagn_set_rxon_chain(struct iwl_priv *priv, struct iwl_rxon_context *ctx);
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index fdca7abd31c4..942cbdbfa021 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -43,77 +43,6 @@
43 43
44const u8 iwl_bcast_addr[ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }; 44const u8 iwl_bcast_addr[ETH_ALEN] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
45 45
46/*
47 * initialize rxon structure with default values from eeprom
48 */
49void iwl_connection_init_rx_config(struct iwl_priv *priv,
50 struct iwl_rxon_context *ctx)
51{
52 const struct iwl_channel_info *ch_info;
53
54 memset(&ctx->staging, 0, sizeof(ctx->staging));
55
56 if (!ctx->vif) {
57 ctx->staging.dev_type = ctx->unused_devtype;
58 } else switch (ctx->vif->type) {
59 case NL80211_IFTYPE_AP:
60 ctx->staging.dev_type = ctx->ap_devtype;
61 break;
62
63 case NL80211_IFTYPE_STATION:
64 ctx->staging.dev_type = ctx->station_devtype;
65 ctx->staging.filter_flags = RXON_FILTER_ACCEPT_GRP_MSK;
66 break;
67
68 case NL80211_IFTYPE_ADHOC:
69 ctx->staging.dev_type = ctx->ibss_devtype;
70 ctx->staging.flags = RXON_FLG_SHORT_PREAMBLE_MSK;
71 ctx->staging.filter_flags = RXON_FILTER_BCON_AWARE_MSK |
72 RXON_FILTER_ACCEPT_GRP_MSK;
73 break;
74
75 default:
76 IWL_ERR(priv, "Unsupported interface type %d\n",
77 ctx->vif->type);
78 break;
79 }
80
81#if 0
82 /* TODO: Figure out when short_preamble would be set and cache from
83 * that */
84 if (!hw_to_local(priv->hw)->short_preamble)
85 ctx->staging.flags &= ~RXON_FLG_SHORT_PREAMBLE_MSK;
86 else
87 ctx->staging.flags |= RXON_FLG_SHORT_PREAMBLE_MSK;
88#endif
89
90 ch_info = iwl_get_channel_info(priv, priv->band,
91 le16_to_cpu(ctx->active.channel));
92
93 if (!ch_info)
94 ch_info = &priv->channel_info[0];
95
96 ctx->staging.channel = cpu_to_le16(ch_info->channel);
97 priv->band = ch_info->band;
98
99 iwl_set_flags_for_band(priv, ctx, priv->band, ctx->vif);
100
101 ctx->staging.ofdm_basic_rates =
102 (IWL_OFDM_RATES_MASK >> IWL_FIRST_OFDM_RATE) & 0xFF;
103 ctx->staging.cck_basic_rates =
104 (IWL_CCK_RATES_MASK >> IWL_FIRST_CCK_RATE) & 0xF;
105
106 /* clear both MIX and PURE40 mode flag */
107 ctx->staging.flags &= ~(RXON_FLG_CHANNEL_MODE_MIXED |
108 RXON_FLG_CHANNEL_MODE_PURE_40);
109 if (ctx->vif)
110 memcpy(ctx->staging.node_addr, ctx->vif->addr, ETH_ALEN);
111
112 ctx->staging.ofdm_ht_single_stream_basic_rates = 0xff;
113 ctx->staging.ofdm_ht_dual_stream_basic_rates = 0xff;
114 ctx->staging.ofdm_ht_triple_stream_basic_rates = 0xff;
115}
116
117void iwl_set_rate(struct iwl_priv *priv) 46void iwl_set_rate(struct iwl_priv *priv)
118{ 47{
119 struct iwl_rxon_context *ctx; 48 struct iwl_rxon_context *ctx;
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index a2b131a16198..8f6b16b80d9a 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -78,8 +78,6 @@ struct iwl_cmd;
78 * L i b * 78 * L i b *
79 ***************************/ 79 ***************************/
80 80
81void iwl_connection_init_rx_config(struct iwl_priv *priv,
82 struct iwl_rxon_context *ctx);
83void iwl_set_rate(struct iwl_priv *priv); 81void iwl_set_rate(struct iwl_priv *priv);
84int iwl_cmd_echo_test(struct iwl_priv *priv); 82int iwl_cmd_echo_test(struct iwl_priv *priv);
85#ifdef CONFIG_IWLWIFI_DEBUGFS 83#ifdef CONFIG_IWLWIFI_DEBUGFS