diff options
author | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2011-04-19 19:52:57 -0400 |
---|---|---|
committer | Wey-Yi Guy <wey-yi.w.guy@intel.com> | 2011-04-30 11:39:44 -0400 |
commit | c3f6e9cff950c312d409e5767365aeb2475b2ab7 (patch) | |
tree | 9e62afe76207ab71e1878f88b369283cba74c657 /drivers | |
parent | e43e85c40d83f0a7a6ff5631d1009d142b72dbca (diff) |
iwlagn: make rxon_assoc static function
Move rxon_assoc to static function from ops
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c | 50 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn-rxon.c | 50 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-agn.h | 2 | ||||
-rw-r--r-- | drivers/net/wireless/iwlwifi/iwl-core.h | 6 |
4 files changed, 49 insertions, 59 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c b/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c index 861cc93957a9..49dd03f9feda 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c | |||
@@ -37,54 +37,6 @@ | |||
37 | #include "iwl-io.h" | 37 | #include "iwl-io.h" |
38 | #include "iwl-agn.h" | 38 | #include "iwl-agn.h" |
39 | 39 | ||
40 | int iwlagn_send_rxon_assoc(struct iwl_priv *priv, | ||
41 | struct iwl_rxon_context *ctx) | ||
42 | { | ||
43 | int ret = 0; | ||
44 | struct iwl5000_rxon_assoc_cmd rxon_assoc; | ||
45 | const struct iwl_rxon_cmd *rxon1 = &ctx->staging; | ||
46 | const struct iwl_rxon_cmd *rxon2 = &ctx->active; | ||
47 | |||
48 | if ((rxon1->flags == rxon2->flags) && | ||
49 | (rxon1->filter_flags == rxon2->filter_flags) && | ||
50 | (rxon1->cck_basic_rates == rxon2->cck_basic_rates) && | ||
51 | (rxon1->ofdm_ht_single_stream_basic_rates == | ||
52 | rxon2->ofdm_ht_single_stream_basic_rates) && | ||
53 | (rxon1->ofdm_ht_dual_stream_basic_rates == | ||
54 | rxon2->ofdm_ht_dual_stream_basic_rates) && | ||
55 | (rxon1->ofdm_ht_triple_stream_basic_rates == | ||
56 | rxon2->ofdm_ht_triple_stream_basic_rates) && | ||
57 | (rxon1->acquisition_data == rxon2->acquisition_data) && | ||
58 | (rxon1->rx_chain == rxon2->rx_chain) && | ||
59 | (rxon1->ofdm_basic_rates == rxon2->ofdm_basic_rates)) { | ||
60 | IWL_DEBUG_INFO(priv, "Using current RXON_ASSOC. Not resending.\n"); | ||
61 | return 0; | ||
62 | } | ||
63 | |||
64 | rxon_assoc.flags = ctx->staging.flags; | ||
65 | rxon_assoc.filter_flags = ctx->staging.filter_flags; | ||
66 | rxon_assoc.ofdm_basic_rates = ctx->staging.ofdm_basic_rates; | ||
67 | rxon_assoc.cck_basic_rates = ctx->staging.cck_basic_rates; | ||
68 | rxon_assoc.reserved1 = 0; | ||
69 | rxon_assoc.reserved2 = 0; | ||
70 | rxon_assoc.reserved3 = 0; | ||
71 | rxon_assoc.ofdm_ht_single_stream_basic_rates = | ||
72 | ctx->staging.ofdm_ht_single_stream_basic_rates; | ||
73 | rxon_assoc.ofdm_ht_dual_stream_basic_rates = | ||
74 | ctx->staging.ofdm_ht_dual_stream_basic_rates; | ||
75 | rxon_assoc.rx_chain_select_flags = ctx->staging.rx_chain; | ||
76 | rxon_assoc.ofdm_ht_triple_stream_basic_rates = | ||
77 | ctx->staging.ofdm_ht_triple_stream_basic_rates; | ||
78 | rxon_assoc.acquisition_data = ctx->staging.acquisition_data; | ||
79 | |||
80 | ret = iwl_send_cmd_pdu_async(priv, ctx->rxon_assoc_cmd, | ||
81 | sizeof(rxon_assoc), &rxon_assoc, NULL); | ||
82 | if (ret) | ||
83 | return ret; | ||
84 | |||
85 | return ret; | ||
86 | } | ||
87 | |||
88 | int iwlagn_send_tx_ant_config(struct iwl_priv *priv, u8 valid_tx_ant) | 40 | int iwlagn_send_tx_ant_config(struct iwl_priv *priv, u8 valid_tx_ant) |
89 | { | 41 | { |
90 | struct iwl_tx_ant_config_cmd tx_ant_cmd = { | 42 | struct iwl_tx_ant_config_cmd tx_ant_cmd = { |
@@ -364,7 +316,6 @@ static int iwlagn_set_pan_params(struct iwl_priv *priv) | |||
364 | } | 316 | } |
365 | 317 | ||
366 | struct iwl_hcmd_ops iwlagn_hcmd = { | 318 | struct iwl_hcmd_ops iwlagn_hcmd = { |
367 | .rxon_assoc = iwlagn_send_rxon_assoc, | ||
368 | .commit_rxon = iwlagn_commit_rxon, | 319 | .commit_rxon = iwlagn_commit_rxon, |
369 | .set_rxon_chain = iwlagn_set_rxon_chain, | 320 | .set_rxon_chain = iwlagn_set_rxon_chain, |
370 | .set_tx_ant = iwlagn_send_tx_ant_config, | 321 | .set_tx_ant = iwlagn_send_tx_ant_config, |
@@ -373,7 +324,6 @@ struct iwl_hcmd_ops iwlagn_hcmd = { | |||
373 | }; | 324 | }; |
374 | 325 | ||
375 | struct iwl_hcmd_ops iwlagn_bt_hcmd = { | 326 | struct iwl_hcmd_ops iwlagn_bt_hcmd = { |
376 | .rxon_assoc = iwlagn_send_rxon_assoc, | ||
377 | .commit_rxon = iwlagn_commit_rxon, | 327 | .commit_rxon = iwlagn_commit_rxon, |
378 | .set_rxon_chain = iwlagn_set_rxon_chain, | 328 | .set_rxon_chain = iwlagn_set_rxon_chain, |
379 | .set_tx_ant = iwlagn_send_tx_ant_config, | 329 | .set_tx_ant = iwlagn_send_tx_ant_config, |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c index 202ef64a14d5..aba5bc9cf6e0 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c | |||
@@ -121,6 +121,54 @@ static int iwlagn_update_beacon(struct iwl_priv *priv, | |||
121 | return iwlagn_send_beacon_cmd(priv); | 121 | return iwlagn_send_beacon_cmd(priv); |
122 | } | 122 | } |
123 | 123 | ||
124 | static int iwlagn_send_rxon_assoc(struct iwl_priv *priv, | ||
125 | struct iwl_rxon_context *ctx) | ||
126 | { | ||
127 | int ret = 0; | ||
128 | struct iwl5000_rxon_assoc_cmd rxon_assoc; | ||
129 | const struct iwl_rxon_cmd *rxon1 = &ctx->staging; | ||
130 | const struct iwl_rxon_cmd *rxon2 = &ctx->active; | ||
131 | |||
132 | if ((rxon1->flags == rxon2->flags) && | ||
133 | (rxon1->filter_flags == rxon2->filter_flags) && | ||
134 | (rxon1->cck_basic_rates == rxon2->cck_basic_rates) && | ||
135 | (rxon1->ofdm_ht_single_stream_basic_rates == | ||
136 | rxon2->ofdm_ht_single_stream_basic_rates) && | ||
137 | (rxon1->ofdm_ht_dual_stream_basic_rates == | ||
138 | rxon2->ofdm_ht_dual_stream_basic_rates) && | ||
139 | (rxon1->ofdm_ht_triple_stream_basic_rates == | ||
140 | rxon2->ofdm_ht_triple_stream_basic_rates) && | ||
141 | (rxon1->acquisition_data == rxon2->acquisition_data) && | ||
142 | (rxon1->rx_chain == rxon2->rx_chain) && | ||
143 | (rxon1->ofdm_basic_rates == rxon2->ofdm_basic_rates)) { | ||
144 | IWL_DEBUG_INFO(priv, "Using current RXON_ASSOC. Not resending.\n"); | ||
145 | return 0; | ||
146 | } | ||
147 | |||
148 | rxon_assoc.flags = ctx->staging.flags; | ||
149 | rxon_assoc.filter_flags = ctx->staging.filter_flags; | ||
150 | rxon_assoc.ofdm_basic_rates = ctx->staging.ofdm_basic_rates; | ||
151 | rxon_assoc.cck_basic_rates = ctx->staging.cck_basic_rates; | ||
152 | rxon_assoc.reserved1 = 0; | ||
153 | rxon_assoc.reserved2 = 0; | ||
154 | rxon_assoc.reserved3 = 0; | ||
155 | rxon_assoc.ofdm_ht_single_stream_basic_rates = | ||
156 | ctx->staging.ofdm_ht_single_stream_basic_rates; | ||
157 | rxon_assoc.ofdm_ht_dual_stream_basic_rates = | ||
158 | ctx->staging.ofdm_ht_dual_stream_basic_rates; | ||
159 | rxon_assoc.rx_chain_select_flags = ctx->staging.rx_chain; | ||
160 | rxon_assoc.ofdm_ht_triple_stream_basic_rates = | ||
161 | ctx->staging.ofdm_ht_triple_stream_basic_rates; | ||
162 | rxon_assoc.acquisition_data = ctx->staging.acquisition_data; | ||
163 | |||
164 | ret = iwl_send_cmd_pdu_async(priv, ctx->rxon_assoc_cmd, | ||
165 | sizeof(rxon_assoc), &rxon_assoc, NULL); | ||
166 | if (ret) | ||
167 | return ret; | ||
168 | |||
169 | return ret; | ||
170 | } | ||
171 | |||
124 | /** | 172 | /** |
125 | * iwlagn_commit_rxon - commit staging_rxon to hardware | 173 | * iwlagn_commit_rxon - commit staging_rxon to hardware |
126 | * | 174 | * |
@@ -200,7 +248,7 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx) | |||
200 | * and other flags for the current radio configuration. | 248 | * and other flags for the current radio configuration. |
201 | */ | 249 | */ |
202 | if (!iwl_full_rxon_required(priv, ctx)) { | 250 | if (!iwl_full_rxon_required(priv, ctx)) { |
203 | ret = iwl_send_rxon_assoc(priv, ctx); | 251 | ret = iwlagn_send_rxon_assoc(priv, ctx); |
204 | if (ret) { | 252 | if (ret) { |
205 | IWL_ERR(priv, "Error setting RXON_ASSOC (%d)\n", ret); | 253 | IWL_ERR(priv, "Error setting RXON_ASSOC (%d)\n", ret); |
206 | return ret; | 254 | return ret; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.h b/drivers/net/wireless/iwlwifi/iwl-agn.h index c475ac427596..7d8e16ec608c 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn.h +++ b/drivers/net/wireless/iwlwifi/iwl-agn.h | |||
@@ -256,8 +256,6 @@ int iwlagn_manage_ibss_station(struct iwl_priv *priv, | |||
256 | struct ieee80211_vif *vif, bool add); | 256 | struct ieee80211_vif *vif, bool add); |
257 | 257 | ||
258 | /* hcmd */ | 258 | /* hcmd */ |
259 | int iwlagn_send_rxon_assoc(struct iwl_priv *priv, | ||
260 | struct iwl_rxon_context *ctx); | ||
261 | int iwlagn_send_tx_ant_config(struct iwl_priv *priv, u8 valid_tx_ant); | 259 | int iwlagn_send_tx_ant_config(struct iwl_priv *priv, u8 valid_tx_ant); |
262 | int iwlagn_send_beacon_cmd(struct iwl_priv *priv); | 260 | int iwlagn_send_beacon_cmd(struct iwl_priv *priv); |
263 | 261 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h index 6226e3d9f101..4cdb85d971ce 100644 --- a/drivers/net/wireless/iwlwifi/iwl-core.h +++ b/drivers/net/wireless/iwlwifi/iwl-core.h | |||
@@ -90,7 +90,6 @@ struct iwl_cmd; | |||
90 | #define IWL_CMD(x) case x: return #x | 90 | #define IWL_CMD(x) case x: return #x |
91 | 91 | ||
92 | struct iwl_hcmd_ops { | 92 | struct iwl_hcmd_ops { |
93 | int (*rxon_assoc)(struct iwl_priv *priv, struct iwl_rxon_context *ctx); | ||
94 | int (*commit_rxon)(struct iwl_priv *priv, struct iwl_rxon_context *ctx); | 93 | int (*commit_rxon)(struct iwl_priv *priv, struct iwl_rxon_context *ctx); |
95 | void (*set_rxon_chain)(struct iwl_priv *priv, | 94 | void (*set_rxon_chain)(struct iwl_priv *priv, |
96 | struct iwl_rxon_context *ctx); | 95 | struct iwl_rxon_context *ctx); |
@@ -645,11 +644,6 @@ void iwl_apm_stop(struct iwl_priv *priv); | |||
645 | int iwl_apm_init(struct iwl_priv *priv); | 644 | int iwl_apm_init(struct iwl_priv *priv); |
646 | 645 | ||
647 | int iwl_send_rxon_timing(struct iwl_priv *priv, struct iwl_rxon_context *ctx); | 646 | int iwl_send_rxon_timing(struct iwl_priv *priv, struct iwl_rxon_context *ctx); |
648 | static inline int iwl_send_rxon_assoc(struct iwl_priv *priv, | ||
649 | struct iwl_rxon_context *ctx) | ||
650 | { | ||
651 | return priv->cfg->ops->hcmd->rxon_assoc(priv, ctx); | ||
652 | } | ||
653 | static inline int iwlcore_commit_rxon(struct iwl_priv *priv, | 647 | static inline int iwlcore_commit_rxon(struct iwl_priv *priv, |
654 | struct iwl_rxon_context *ctx) | 648 | struct iwl_rxon_context *ctx) |
655 | { | 649 | { |