aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorMeenakshi Venkataraman <meenakshi.venkataraman@intel.com>2012-03-13 19:25:38 -0400
committerWey-Yi Guy <wey-yi.w.guy@intel.com>2012-04-12 17:21:02 -0400
commitdd64173e37082dcfffa8982622e2fd49f6c41432 (patch)
tree6139e14d0f310320adebfadd415f087e4c6576a7 /drivers/net
parent5edc565d6081b115fa78eb6c0c4f77f646e95aaa (diff)
iwlwifi: move iwl_set_rxon_ht to iwl-agn-rxon.c
Moving 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')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn-rxon.c90
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.h1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c75
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.h1
4 files changed, 91 insertions, 76 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
index 369cd8b2ad0..944ad735593 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn-rxon.c
@@ -501,6 +501,96 @@ int iwlagn_set_pan_params(struct iwl_priv *priv)
501 return ret; 501 return ret;
502} 502}
503 503
504static void _iwl_set_rxon_ht(struct iwl_priv *priv,
505 struct iwl_ht_config *ht_conf,
506 struct iwl_rxon_context *ctx)
507{
508 struct iwl_rxon_cmd *rxon = &ctx->staging;
509
510 if (!ctx->ht.enabled) {
511 rxon->flags &= ~(RXON_FLG_CHANNEL_MODE_MSK |
512 RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK |
513 RXON_FLG_HT40_PROT_MSK |
514 RXON_FLG_HT_PROT_MSK);
515 return;
516 }
517
518 /* FIXME: if the definition of ht.protection changed, the "translation"
519 * will be needed for rxon->flags
520 */
521 rxon->flags |= cpu_to_le32(ctx->ht.protection <<
522 RXON_FLG_HT_OPERATING_MODE_POS);
523
524 /* Set up channel bandwidth:
525 * 20 MHz only, 20/40 mixed or pure 40 if ht40 ok */
526 /* clear the HT channel mode before set the mode */
527 rxon->flags &= ~(RXON_FLG_CHANNEL_MODE_MSK |
528 RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK);
529 if (iwl_is_ht40_tx_allowed(priv, ctx, NULL)) {
530 /* pure ht40 */
531 if (ctx->ht.protection ==
532 IEEE80211_HT_OP_MODE_PROTECTION_20MHZ) {
533 rxon->flags |= RXON_FLG_CHANNEL_MODE_PURE_40;
534 /*
535 * Note: control channel is opposite of extension
536 * channel
537 */
538 switch (ctx->ht.extension_chan_offset) {
539 case IEEE80211_HT_PARAM_CHA_SEC_ABOVE:
540 rxon->flags &=
541 ~RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK;
542 break;
543 case IEEE80211_HT_PARAM_CHA_SEC_BELOW:
544 rxon->flags |=
545 RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK;
546 break;
547 }
548 } else {
549 /*
550 * Note: control channel is opposite of extension
551 * channel
552 */
553 switch (ctx->ht.extension_chan_offset) {
554 case IEEE80211_HT_PARAM_CHA_SEC_ABOVE:
555 rxon->flags &=
556 ~(RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK);
557 rxon->flags |= RXON_FLG_CHANNEL_MODE_MIXED;
558 break;
559 case IEEE80211_HT_PARAM_CHA_SEC_BELOW:
560 rxon->flags |= RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK;
561 rxon->flags |= RXON_FLG_CHANNEL_MODE_MIXED;
562 break;
563 case IEEE80211_HT_PARAM_CHA_SEC_NONE:
564 default:
565 /*
566 * channel location only valid if in Mixed
567 * mode
568 */
569 IWL_ERR(priv,
570 "invalid extension channel offset\n");
571 break;
572 }
573 }
574 } else {
575 rxon->flags |= RXON_FLG_CHANNEL_MODE_LEGACY;
576 }
577
578 iwlagn_set_rxon_chain(priv, ctx);
579
580 IWL_DEBUG_ASSOC(priv, "rxon flags 0x%X operation mode :0x%X "
581 "extension channel offset 0x%x\n",
582 le32_to_cpu(rxon->flags), ctx->ht.protection,
583 ctx->ht.extension_chan_offset);
584}
585
586void iwl_set_rxon_ht(struct iwl_priv *priv, struct iwl_ht_config *ht_conf)
587{
588 struct iwl_rxon_context *ctx;
589
590 for_each_context(priv, ctx)
591 _iwl_set_rxon_ht(priv, ht_conf, ctx);
592}
593
504static void iwl_set_rxon_hwcrypto(struct iwl_priv *priv, 594static void iwl_set_rxon_hwcrypto(struct iwl_priv *priv,
505 struct iwl_rxon_context *ctx, int hw_decrypt) 595 struct iwl_rxon_context *ctx, int hw_decrypt)
506{ 596{
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.h b/drivers/net/wireless/iwlwifi/iwl-agn.h
index 90b1f3a7ac3..d7b1bd8d6bd 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.h
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.h
@@ -127,6 +127,7 @@ void iwlagn_bss_info_changed(struct ieee80211_hw *hw,
127 u32 changes); 127 u32 changes);
128void iwlagn_config_ht40(struct ieee80211_conf *conf, 128void iwlagn_config_ht40(struct ieee80211_conf *conf,
129 struct iwl_rxon_context *ctx); 129 struct iwl_rxon_context *ctx);
130void iwl_set_rxon_ht(struct iwl_priv *priv, struct iwl_ht_config *ht_conf);
130 131
131/* uCode */ 132/* uCode */
132int iwl_send_bt_env(struct iwl_priv *priv, u8 action, u8 type); 133int iwl_send_bt_env(struct iwl_priv *priv, u8 action, u8 type);
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 42b5f90acd0..ab5db2e7141 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -43,81 +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
46static void _iwl_set_rxon_ht(struct iwl_priv *priv,
47 struct iwl_ht_config *ht_conf,
48 struct iwl_rxon_context *ctx)
49{
50 struct iwl_rxon_cmd *rxon = &ctx->staging;
51
52 if (!ctx->ht.enabled) {
53 rxon->flags &= ~(RXON_FLG_CHANNEL_MODE_MSK |
54 RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK |
55 RXON_FLG_HT40_PROT_MSK |
56 RXON_FLG_HT_PROT_MSK);
57 return;
58 }
59
60 /* FIXME: if the definition of ht.protection changed, the "translation"
61 * will be needed for rxon->flags
62 */
63 rxon->flags |= cpu_to_le32(ctx->ht.protection << RXON_FLG_HT_OPERATING_MODE_POS);
64
65 /* Set up channel bandwidth:
66 * 20 MHz only, 20/40 mixed or pure 40 if ht40 ok */
67 /* clear the HT channel mode before set the mode */
68 rxon->flags &= ~(RXON_FLG_CHANNEL_MODE_MSK |
69 RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK);
70 if (iwl_is_ht40_tx_allowed(priv, ctx, NULL)) {
71 /* pure ht40 */
72 if (ctx->ht.protection == IEEE80211_HT_OP_MODE_PROTECTION_20MHZ) {
73 rxon->flags |= RXON_FLG_CHANNEL_MODE_PURE_40;
74 /* Note: control channel is opposite of extension channel */
75 switch (ctx->ht.extension_chan_offset) {
76 case IEEE80211_HT_PARAM_CHA_SEC_ABOVE:
77 rxon->flags &= ~RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK;
78 break;
79 case IEEE80211_HT_PARAM_CHA_SEC_BELOW:
80 rxon->flags |= RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK;
81 break;
82 }
83 } else {
84 /* Note: control channel is opposite of extension channel */
85 switch (ctx->ht.extension_chan_offset) {
86 case IEEE80211_HT_PARAM_CHA_SEC_ABOVE:
87 rxon->flags &= ~(RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK);
88 rxon->flags |= RXON_FLG_CHANNEL_MODE_MIXED;
89 break;
90 case IEEE80211_HT_PARAM_CHA_SEC_BELOW:
91 rxon->flags |= RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK;
92 rxon->flags |= RXON_FLG_CHANNEL_MODE_MIXED;
93 break;
94 case IEEE80211_HT_PARAM_CHA_SEC_NONE:
95 default:
96 /* channel location only valid if in Mixed mode */
97 IWL_ERR(priv, "invalid extension channel offset\n");
98 break;
99 }
100 }
101 } else {
102 rxon->flags |= RXON_FLG_CHANNEL_MODE_LEGACY;
103 }
104
105 iwlagn_set_rxon_chain(priv, ctx);
106
107 IWL_DEBUG_ASSOC(priv, "rxon flags 0x%X operation mode :0x%X "
108 "extension channel offset 0x%x\n",
109 le32_to_cpu(rxon->flags), ctx->ht.protection,
110 ctx->ht.extension_chan_offset);
111}
112
113void iwl_set_rxon_ht(struct iwl_priv *priv, struct iwl_ht_config *ht_conf)
114{
115 struct iwl_rxon_context *ctx;
116
117 for_each_context(priv, ctx)
118 _iwl_set_rxon_ht(priv, ht_conf, ctx);
119}
120
121/** 46/**
122 * iwl_set_rxon_channel - Set the band and channel values in staging RXON 47 * iwl_set_rxon_channel - Set the band and channel values in staging RXON
123 * @ch: requested channel as a pointer to struct ieee80211_channel 48 * @ch: requested channel as a pointer to struct ieee80211_channel
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.h b/drivers/net/wireless/iwlwifi/iwl-core.h
index eb0e78587a5..e793b1606a9 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.h
+++ b/drivers/net/wireless/iwlwifi/iwl-core.h
@@ -84,7 +84,6 @@ void iwl_set_flags_for_band(struct iwl_priv *priv,
84 struct iwl_rxon_context *ctx, 84 struct iwl_rxon_context *ctx,
85 enum ieee80211_band band, 85 enum ieee80211_band band,
86 struct ieee80211_vif *vif); 86 struct ieee80211_vif *vif);
87void iwl_set_rxon_ht(struct iwl_priv *priv, struct iwl_ht_config *ht_conf);
88void iwl_connection_init_rx_config(struct iwl_priv *priv, 87void iwl_connection_init_rx_config(struct iwl_priv *priv,
89 struct iwl_rxon_context *ctx); 88 struct iwl_rxon_context *ctx);
90void iwl_set_rate(struct iwl_priv *priv); 89void iwl_set_rate(struct iwl_priv *priv);