aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-1000.c1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-2000.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-5000.c2
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-6000.c4
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c16
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-lib.c11
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rxon.c19
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c23
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.h1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c6
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.h9
11 files changed, 23 insertions, 73 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-1000.c b/drivers/net/wireless/iwlwifi/iwl-1000.c
index e57fad9f1f09..8c5a829c4119 100644
--- a/drivers/net/wireless/iwlwifi/iwl-1000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-1000.c
@@ -197,7 +197,6 @@ static struct iwl_lib_ops iwl1000_lib = {
197 197
198static const struct iwl_ops iwl1000_ops = { 198static const struct iwl_ops iwl1000_ops = {
199 .lib = &iwl1000_lib, 199 .lib = &iwl1000_lib,
200 .hcmd = &iwlagn_hcmd,
201 .utils = &iwlagn_hcmd_utils, 200 .utils = &iwlagn_hcmd_utils,
202}; 201};
203 202
diff --git a/drivers/net/wireless/iwlwifi/iwl-2000.c b/drivers/net/wireless/iwlwifi/iwl-2000.c
index 76a3e42a4ff4..75d63e6ee7f4 100644
--- a/drivers/net/wireless/iwlwifi/iwl-2000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-2000.c
@@ -198,25 +198,21 @@ static struct iwl_lib_ops iwl2000_lib = {
198 198
199static const struct iwl_ops iwl2000_ops = { 199static const struct iwl_ops iwl2000_ops = {
200 .lib = &iwl2000_lib, 200 .lib = &iwl2000_lib,
201 .hcmd = &iwlagn_hcmd,
202 .utils = &iwlagn_hcmd_utils, 201 .utils = &iwlagn_hcmd_utils,
203}; 202};
204 203
205static const struct iwl_ops iwl2030_ops = { 204static const struct iwl_ops iwl2030_ops = {
206 .lib = &iwl2000_lib, 205 .lib = &iwl2000_lib,
207 .hcmd = &iwlagn_bt_hcmd,
208 .utils = &iwlagn_hcmd_utils, 206 .utils = &iwlagn_hcmd_utils,
209}; 207};
210 208
211static const struct iwl_ops iwl105_ops = { 209static const struct iwl_ops iwl105_ops = {
212 .lib = &iwl2000_lib, 210 .lib = &iwl2000_lib,
213 .hcmd = &iwlagn_hcmd,
214 .utils = &iwlagn_hcmd_utils, 211 .utils = &iwlagn_hcmd_utils,
215}; 212};
216 213
217static const struct iwl_ops iwl135_ops = { 214static const struct iwl_ops iwl135_ops = {
218 .lib = &iwl2000_lib, 215 .lib = &iwl2000_lib,
219 .hcmd = &iwlagn_bt_hcmd,
220 .utils = &iwlagn_hcmd_utils, 216 .utils = &iwlagn_hcmd_utils,
221}; 217};
222 218
diff --git a/drivers/net/wireless/iwlwifi/iwl-5000.c b/drivers/net/wireless/iwlwifi/iwl-5000.c
index 269dfdb9fe1a..5ebf5d225b89 100644
--- a/drivers/net/wireless/iwlwifi/iwl-5000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-5000.c
@@ -379,13 +379,11 @@ static struct iwl_lib_ops iwl5150_lib = {
379 379
380static const struct iwl_ops iwl5000_ops = { 380static const struct iwl_ops iwl5000_ops = {
381 .lib = &iwl5000_lib, 381 .lib = &iwl5000_lib,
382 .hcmd = &iwlagn_hcmd,
383 .utils = &iwlagn_hcmd_utils, 382 .utils = &iwlagn_hcmd_utils,
384}; 383};
385 384
386static const struct iwl_ops iwl5150_ops = { 385static const struct iwl_ops iwl5150_ops = {
387 .lib = &iwl5150_lib, 386 .lib = &iwl5150_lib,
388 .hcmd = &iwlagn_hcmd,
389 .utils = &iwlagn_hcmd_utils, 387 .utils = &iwlagn_hcmd_utils,
390}; 388};
391 389
diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c
index f1c1db76b9da..94ad57cf3ea6 100644
--- a/drivers/net/wireless/iwlwifi/iwl-6000.c
+++ b/drivers/net/wireless/iwlwifi/iwl-6000.c
@@ -328,27 +328,23 @@ static struct iwl_nic_ops iwl6150_nic_ops = {
328 328
329static const struct iwl_ops iwl6000_ops = { 329static const struct iwl_ops iwl6000_ops = {
330 .lib = &iwl6000_lib, 330 .lib = &iwl6000_lib,
331 .hcmd = &iwlagn_hcmd,
332 .utils = &iwlagn_hcmd_utils, 331 .utils = &iwlagn_hcmd_utils,
333}; 332};
334 333
335static const struct iwl_ops iwl6050_ops = { 334static const struct iwl_ops iwl6050_ops = {
336 .lib = &iwl6000_lib, 335 .lib = &iwl6000_lib,
337 .hcmd = &iwlagn_hcmd,
338 .utils = &iwlagn_hcmd_utils, 336 .utils = &iwlagn_hcmd_utils,
339 .nic = &iwl6050_nic_ops, 337 .nic = &iwl6050_nic_ops,
340}; 338};
341 339
342static const struct iwl_ops iwl6150_ops = { 340static const struct iwl_ops iwl6150_ops = {
343 .lib = &iwl6000_lib, 341 .lib = &iwl6000_lib,
344 .hcmd = &iwlagn_hcmd,
345 .utils = &iwlagn_hcmd_utils, 342 .utils = &iwlagn_hcmd_utils,
346 .nic = &iwl6150_nic_ops, 343 .nic = &iwl6150_nic_ops,
347}; 344};
348 345
349static const struct iwl_ops iwl6030_ops = { 346static const struct iwl_ops iwl6030_ops = {
350 .lib = &iwl6030_lib, 347 .lib = &iwl6030_lib,
351 .hcmd = &iwlagn_bt_hcmd,
352 .utils = &iwlagn_hcmd_utils, 348 .utils = &iwlagn_hcmd_utils,
353}; 349};
354 350
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c b/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c
index ba7ed9157c92..ce7d4b56d9b2 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-hcmd.c
@@ -205,7 +205,7 @@ static int iwlagn_calc_rssi(struct iwl_priv *priv,
205 return max_rssi - agc - IWLAGN_RSSI_OFFSET; 205 return max_rssi - agc - IWLAGN_RSSI_OFFSET;
206} 206}
207 207
208static int iwlagn_set_pan_params(struct iwl_priv *priv) 208int iwlagn_set_pan_params(struct iwl_priv *priv)
209{ 209{
210 struct iwl_wipan_params_cmd cmd; 210 struct iwl_wipan_params_cmd cmd;
211 struct iwl_rxon_context *ctx_bss, *ctx_pan; 211 struct iwl_rxon_context *ctx_bss, *ctx_pan;
@@ -297,20 +297,6 @@ static int iwlagn_set_pan_params(struct iwl_priv *priv)
297 return ret; 297 return ret;
298} 298}
299 299
300struct iwl_hcmd_ops iwlagn_hcmd = {
301 .set_rxon_chain = iwlagn_set_rxon_chain,
302 .set_tx_ant = iwlagn_send_tx_ant_config,
303 .send_bt_config = iwl_send_bt_config,
304 .set_pan_params = iwlagn_set_pan_params,
305};
306
307struct iwl_hcmd_ops iwlagn_bt_hcmd = {
308 .set_rxon_chain = iwlagn_set_rxon_chain,
309 .set_tx_ant = iwlagn_send_tx_ant_config,
310 .send_bt_config = iwlagn_send_advance_bt_config,
311 .set_pan_params = iwlagn_set_pan_params,
312};
313
314struct iwl_hcmd_utils_ops iwlagn_hcmd_utils = { 300struct iwl_hcmd_utils_ops iwlagn_hcmd_utils = {
315 .build_addsta_hcmd = iwlagn_build_addsta_hcmd, 301 .build_addsta_hcmd = iwlagn_build_addsta_hcmd,
316 .gain_computation = iwlagn_gain_computation, 302 .gain_computation = iwlagn_gain_computation,
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
index ea83aa5bf29c..90d366e15d2f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-lib.c
@@ -1366,17 +1366,14 @@ int iwlagn_request_scan(struct iwl_priv *priv, struct ieee80211_vif *vif)
1366 /* set scan bit here for PAN params */ 1366 /* set scan bit here for PAN params */
1367 set_bit(STATUS_SCAN_HW, &priv->status); 1367 set_bit(STATUS_SCAN_HW, &priv->status);
1368 1368
1369 if (priv->cfg->ops->hcmd->set_pan_params) { 1369 ret = iwlagn_set_pan_params(priv);
1370 ret = priv->cfg->ops->hcmd->set_pan_params(priv); 1370 if (ret)
1371 if (ret) 1371 return ret;
1372 return ret;
1373 }
1374 1372
1375 ret = iwl_send_cmd_sync(priv, &cmd); 1373 ret = iwl_send_cmd_sync(priv, &cmd);
1376 if (ret) { 1374 if (ret) {
1377 clear_bit(STATUS_SCAN_HW, &priv->status); 1375 clear_bit(STATUS_SCAN_HW, &priv->status);
1378 if (priv->cfg->ops->hcmd->set_pan_params) 1376 iwlagn_set_pan_params(priv);
1379 priv->cfg->ops->hcmd->set_pan_params(priv);
1380 } 1377 }
1381 1378
1382 return ret; 1379 return ret;
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
index 8fa43d427811..c6bb73a66d9f 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
@@ -436,11 +436,9 @@ int iwlagn_commit_rxon(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
436 if (ret) 436 if (ret)
437 return ret; 437 return ret;
438 438
439 if (priv->cfg->ops->hcmd->set_pan_params) { 439 ret = iwlagn_set_pan_params(priv);
440 ret = priv->cfg->ops->hcmd->set_pan_params(priv); 440 if (ret)
441 if (ret) 441 return ret;
442 return ret;
443 }
444 442
445 if (new_assoc) 443 if (new_assoc)
446 return iwlagn_rxon_connect(priv, ctx); 444 return iwlagn_rxon_connect(priv, ctx);
@@ -483,9 +481,8 @@ int iwlagn_mac_config(struct ieee80211_hw *hw, u32 changed)
483 * set up the SM PS mode to OFF if an HT channel is 481 * set up the SM PS mode to OFF if an HT channel is
484 * configured. 482 * configured.
485 */ 483 */
486 if (priv->cfg->ops->hcmd->set_rxon_chain) 484 for_each_context(priv, ctx)
487 for_each_context(priv, ctx) 485 iwlagn_set_rxon_chain(priv, ctx);
488 priv->cfg->ops->hcmd->set_rxon_chain(priv, ctx);
489 } 486 }
490 487
491 if (changed & IEEE80211_CONF_CHANGE_CHANNEL) { 488 if (changed & IEEE80211_CONF_CHANGE_CHANNEL) {
@@ -741,8 +738,7 @@ void iwlagn_bss_info_changed(struct ieee80211_hw *hw,
741 iwl_set_rxon_ht(priv, &priv->current_ht_config); 738 iwl_set_rxon_ht(priv, &priv->current_ht_config);
742 } 739 }
743 740
744 if (priv->cfg->ops->hcmd->set_rxon_chain) 741 iwlagn_set_rxon_chain(priv, ctx);
745 priv->cfg->ops->hcmd->set_rxon_chain(priv, ctx);
746 742
747 if (bss_conf->use_cts_prot && (priv->band != IEEE80211_BAND_5GHZ)) 743 if (bss_conf->use_cts_prot && (priv->band != IEEE80211_BAND_5GHZ))
748 ctx->staging.flags |= RXON_FLG_TGG_PROTECT_MSK; 744 ctx->staging.flags |= RXON_FLG_TGG_PROTECT_MSK;
@@ -821,6 +817,5 @@ void iwlagn_post_scan(struct iwl_priv *priv)
821 if (memcmp(&ctx->staging, &ctx->active, sizeof(ctx->staging))) 817 if (memcmp(&ctx->staging, &ctx->active, sizeof(ctx->staging)))
822 iwlagn_commit_rxon(priv, ctx); 818 iwlagn_commit_rxon(priv, ctx);
823 819
824 if (priv->cfg->ops->hcmd->set_pan_params) 820 iwlagn_set_pan_params(priv);
825 priv->cfg->ops->hcmd->set_pan_params(priv);
826} 821}
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index ffb0b192270d..7e6c463abbdf 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -90,12 +90,10 @@ void iwl_update_chain_flags(struct iwl_priv *priv)
90{ 90{
91 struct iwl_rxon_context *ctx; 91 struct iwl_rxon_context *ctx;
92 92
93 if (priv->cfg->ops->hcmd->set_rxon_chain) { 93 for_each_context(priv, ctx) {
94 for_each_context(priv, ctx) { 94 iwlagn_set_rxon_chain(priv, ctx);
95 priv->cfg->ops->hcmd->set_rxon_chain(priv, ctx); 95 if (ctx->active.rx_chain != ctx->staging.rx_chain)
96 if (ctx->active.rx_chain != ctx->staging.rx_chain) 96 iwlagn_commit_rxon(priv, ctx);
97 iwlagn_commit_rxon(priv, ctx);
98 }
99 } 97 }
100} 98}
101 99
@@ -287,8 +285,7 @@ static void iwl_bg_bt_full_concurrency(struct work_struct *work)
287 * to avoid 3-wire collisions 285 * to avoid 3-wire collisions
288 */ 286 */
289 for_each_context(priv, ctx) { 287 for_each_context(priv, ctx) {
290 if (priv->cfg->ops->hcmd->set_rxon_chain) 288 iwlagn_set_rxon_chain(priv, ctx);
291 priv->cfg->ops->hcmd->set_rxon_chain(priv, ctx);
292 iwlagn_commit_rxon(priv, ctx); 289 iwlagn_commit_rxon(priv, ctx);
293 } 290 }
294 291
@@ -2045,8 +2042,7 @@ int iwl_alive_start(struct iwl_priv *priv)
2045 priv->active_rate = IWL_RATES_MASK; 2042 priv->active_rate = IWL_RATES_MASK;
2046 2043
2047 /* Configure Tx antenna selection based on H/W config */ 2044 /* Configure Tx antenna selection based on H/W config */
2048 if (priv->cfg->ops->hcmd->set_tx_ant) 2045 iwlagn_send_tx_ant_config(priv, priv->cfg->valid_tx_ant);
2049 priv->cfg->ops->hcmd->set_tx_ant(priv, priv->cfg->valid_tx_ant);
2050 2046
2051 if (iwl_is_associated_ctx(ctx)) { 2047 if (iwl_is_associated_ctx(ctx)) {
2052 struct iwl_rxon_cmd *active_rxon = 2048 struct iwl_rxon_cmd *active_rxon =
@@ -2060,8 +2056,7 @@ int iwl_alive_start(struct iwl_priv *priv)
2060 for_each_context(priv, tmp) 2056 for_each_context(priv, tmp)
2061 iwl_connection_init_rx_config(priv, tmp); 2057 iwl_connection_init_rx_config(priv, tmp);
2062 2058
2063 if (priv->cfg->ops->hcmd->set_rxon_chain) 2059 iwlagn_set_rxon_chain(priv, ctx);
2064 priv->cfg->ops->hcmd->set_rxon_chain(priv, ctx);
2065 } 2060 }
2066 2061
2067 iwl_reset_run_time_calib(priv); 2062 iwl_reset_run_time_calib(priv);
@@ -3286,9 +3281,7 @@ static int iwl_init_drv(struct iwl_priv *priv)
3286 priv->rx_statistics_jiffies = jiffies; 3281 priv->rx_statistics_jiffies = jiffies;
3287 3282
3288 /* Choose which receivers/antennas to use */ 3283 /* Choose which receivers/antennas to use */
3289 if (priv->cfg->ops->hcmd->set_rxon_chain) 3284 iwlagn_set_rxon_chain(priv, &priv->contexts[IWL_RXON_CTX_BSS]);
3290 priv->cfg->ops->hcmd->set_rxon_chain(priv,
3291 &priv->contexts[IWL_RXON_CTX_BSS]);
3292 3285
3293 iwl_init_scan_params(priv); 3286 iwl_init_scan_params(priv);
3294 3287
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.h b/drivers/net/wireless/iwlwifi/iwl-agn.h
index 5d0c911a3207..4351151e2a91 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.h
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.h
@@ -256,6 +256,7 @@ int iwlagn_manage_ibss_station(struct iwl_priv *priv,
256/* hcmd */ 256/* hcmd */
257int iwlagn_send_tx_ant_config(struct iwl_priv *priv, u8 valid_tx_ant); 257int iwlagn_send_tx_ant_config(struct iwl_priv *priv, u8 valid_tx_ant);
258int iwlagn_send_beacon_cmd(struct iwl_priv *priv); 258int iwlagn_send_beacon_cmd(struct iwl_priv *priv);
259int iwlagn_set_pan_params(struct iwl_priv *priv);
259 260
260/* bt coex */ 261/* bt coex */
261void iwlagn_send_advance_bt_config(struct iwl_priv *priv); 262void iwlagn_send_advance_bt_config(struct iwl_priv *priv);
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index b63a7d60ebe4..f91e306c2498 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -585,8 +585,7 @@ static void _iwl_set_rxon_ht(struct iwl_priv *priv,
585 rxon->flags |= RXON_FLG_CHANNEL_MODE_LEGACY; 585 rxon->flags |= RXON_FLG_CHANNEL_MODE_LEGACY;
586 } 586 }
587 587
588 if (priv->cfg->ops->hcmd->set_rxon_chain) 588 iwlagn_set_rxon_chain(priv, ctx);
589 priv->cfg->ops->hcmd->set_rxon_chain(priv, ctx);
590 589
591 IWL_DEBUG_ASSOC(priv, "rxon flags 0x%X operation mode :0x%X " 590 IWL_DEBUG_ASSOC(priv, "rxon flags 0x%X operation mode :0x%X "
592 "extension channel offset 0x%x\n", 591 "extension channel offset 0x%x\n",
@@ -1216,8 +1215,7 @@ static int iwl_set_mode(struct iwl_priv *priv, struct iwl_rxon_context *ctx)
1216{ 1215{
1217 iwl_connection_init_rx_config(priv, ctx); 1216 iwl_connection_init_rx_config(priv, ctx);
1218 1217
1219 if (priv->cfg->ops->hcmd->set_rxon_chain) 1218 iwlagn_set_rxon_chain(priv, ctx);
1220 priv->cfg->ops->hcmd->set_rxon_chain(priv, ctx);
1221 1219
1222 return iwlagn_commit_rxon(priv, ctx); 1220 return iwlagn_commit_rxon(priv, ctx);
1223} 1221}
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index 91e7279597c0..6c21de9f5b60 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -80,14 +80,6 @@ struct iwl_cmd;
80 80
81#define IWL_CMD(x) case x: return #x 81#define IWL_CMD(x) case x: return #x
82 82
83struct iwl_hcmd_ops {
84 void (*set_rxon_chain)(struct iwl_priv *priv,
85 struct iwl_rxon_context *ctx);
86 int (*set_tx_ant)(struct iwl_priv *priv, u8 valid_tx_ant);
87 void (*send_bt_config)(struct iwl_priv *priv);
88 int (*set_pan_params)(struct iwl_priv *priv);
89};
90
91struct iwl_hcmd_utils_ops { 83struct iwl_hcmd_utils_ops {
92 u16 (*build_addsta_hcmd)(const struct iwl_addsta_cmd *cmd, u8 *data); 84 u16 (*build_addsta_hcmd)(const struct iwl_addsta_cmd *cmd, u8 *data);
93 void (*gain_computation)(struct iwl_priv *priv, 85 void (*gain_computation)(struct iwl_priv *priv,
@@ -146,7 +138,6 @@ struct iwl_nic_ops {
146 138
147struct iwl_ops { 139struct iwl_ops {
148 const struct iwl_lib_ops *lib; 140 const struct iwl_lib_ops *lib;
149 const struct iwl_hcmd_ops *hcmd;
150 const struct iwl_hcmd_utils_ops *utils; 141 const struct iwl_hcmd_utils_ops *utils;
151 const struct iwl_nic_ops *nic; 142 const struct iwl_nic_ops *nic;
152}; 143};