aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlegacy
diff options
context:
space:
mode:
authorStanislaw Gruszka <sgruszka@redhat.com>2012-02-03 11:31:52 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-02-06 14:56:07 -0500
commit1c03c4620edc551b5bbcc87c7aca02b482d8bc51 (patch)
tree748ed469ac864e906a4b70c2173ff5d4e76a84a1 /drivers/net/wireless/iwlegacy
parent8d44f2bd7554734913f1256e4f45c35454167161 (diff)
iwlegacy: move ht out of ctx structure
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/iwlegacy')
-rw-r--r--drivers/net/wireless/iwlegacy/4965-mac.c18
-rw-r--r--drivers/net/wireless/iwlegacy/4965-rs.c13
-rw-r--r--drivers/net/wireless/iwlegacy/common.c49
-rw-r--r--drivers/net/wireless/iwlegacy/common.h15
4 files changed, 46 insertions, 49 deletions
diff --git a/drivers/net/wireless/iwlegacy/4965-mac.c b/drivers/net/wireless/iwlegacy/4965-mac.c
index 1dd001475522..94984c850e84 100644
--- a/drivers/net/wireless/iwlegacy/4965-mac.c
+++ b/drivers/net/wireless/iwlegacy/4965-mac.c
@@ -5793,23 +5793,23 @@ il4965_mac_channel_switch(struct ieee80211_hw *hw,
5793 il->current_ht_config.smps = conf->smps_mode; 5793 il->current_ht_config.smps = conf->smps_mode;
5794 5794
5795 /* Configure HT40 channels */ 5795 /* Configure HT40 channels */
5796 ctx->ht.enabled = conf_is_ht(conf); 5796 il->ht.enabled = conf_is_ht(conf);
5797 if (ctx->ht.enabled) { 5797 if (il->ht.enabled) {
5798 if (conf_is_ht40_minus(conf)) { 5798 if (conf_is_ht40_minus(conf)) {
5799 ctx->ht.extension_chan_offset = 5799 il->ht.extension_chan_offset =
5800 IEEE80211_HT_PARAM_CHA_SEC_BELOW; 5800 IEEE80211_HT_PARAM_CHA_SEC_BELOW;
5801 ctx->ht.is_40mhz = true; 5801 il->ht.is_40mhz = true;
5802 } else if (conf_is_ht40_plus(conf)) { 5802 } else if (conf_is_ht40_plus(conf)) {
5803 ctx->ht.extension_chan_offset = 5803 il->ht.extension_chan_offset =
5804 IEEE80211_HT_PARAM_CHA_SEC_ABOVE; 5804 IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
5805 ctx->ht.is_40mhz = true; 5805 il->ht.is_40mhz = true;
5806 } else { 5806 } else {
5807 ctx->ht.extension_chan_offset = 5807 il->ht.extension_chan_offset =
5808 IEEE80211_HT_PARAM_CHA_SEC_NONE; 5808 IEEE80211_HT_PARAM_CHA_SEC_NONE;
5809 ctx->ht.is_40mhz = false; 5809 il->ht.is_40mhz = false;
5810 } 5810 }
5811 } else 5811 } else
5812 ctx->ht.is_40mhz = false; 5812 il->ht.is_40mhz = false;
5813 5813
5814 if ((le16_to_cpu(il->staging.channel) != ch)) 5814 if ((le16_to_cpu(il->staging.channel) != ch))
5815 il->staging.flags = 0; 5815 il->staging.flags = 0;
diff --git a/drivers/net/wireless/iwlegacy/4965-rs.c b/drivers/net/wireless/iwlegacy/4965-rs.c
index 467d0cb14ecd..ad186d9a598f 100644
--- a/drivers/net/wireless/iwlegacy/4965-rs.c
+++ b/drivers/net/wireless/iwlegacy/4965-rs.c
@@ -641,13 +641,10 @@ il4965_rs_toggle_antenna(u32 valid_ant, u32 *rate_n_flags,
641 * there are no non-GF stations present in the BSS. 641 * there are no non-GF stations present in the BSS.
642 */ 642 */
643static bool 643static bool
644il4965_rs_use_green(struct ieee80211_sta *sta) 644il4965_rs_use_green(struct il_priv *il, struct ieee80211_sta *sta)
645{ 645{
646 struct il_station_priv *sta_priv = (void *)sta->drv_priv;
647 struct il_rxon_context *ctx = sta_priv->common.ctx;
648
649 return (sta->ht_cap.cap & IEEE80211_HT_CAP_GRN_FLD) && 646 return (sta->ht_cap.cap & IEEE80211_HT_CAP_GRN_FLD) &&
650 !(ctx->ht.non_gf_sta_present); 647 !il->ht.non_gf_sta_present;
651} 648}
652 649
653/** 650/**
@@ -1815,7 +1812,7 @@ il4965_rs_rate_scale_perform(struct il_priv *il, struct sk_buff *skb,
1815 if (is_legacy(tbl->lq_type)) 1812 if (is_legacy(tbl->lq_type))
1816 lq_sta->is_green = 0; 1813 lq_sta->is_green = 0;
1817 else 1814 else
1818 lq_sta->is_green = il4965_rs_use_green(sta); 1815 lq_sta->is_green = il4965_rs_use_green(il, sta);
1819 is_green = lq_sta->is_green; 1816 is_green = lq_sta->is_green;
1820 1817
1821 /* current tx rate */ 1818 /* current tx rate */
@@ -2166,7 +2163,7 @@ il4965_rs_initialize_lq(struct il_priv *il, struct ieee80211_conf *conf,
2166 int rate_idx; 2163 int rate_idx;
2167 int i; 2164 int i;
2168 u32 rate; 2165 u32 rate;
2169 u8 use_green = il4965_rs_use_green(sta); 2166 u8 use_green = il4965_rs_use_green(il, sta);
2170 u8 active_tbl = 0; 2167 u8 active_tbl = 0;
2171 u8 valid_tx_ant; 2168 u8 valid_tx_ant;
2172 struct il_station_priv *sta_priv; 2169 struct il_station_priv *sta_priv;
@@ -2341,7 +2338,7 @@ il4965_rs_rate_init(struct il_priv *il, struct ieee80211_sta *sta, u8 sta_id)
2341 lq_sta->is_dup = 0; 2338 lq_sta->is_dup = 0;
2342 lq_sta->max_rate_idx = -1; 2339 lq_sta->max_rate_idx = -1;
2343 lq_sta->missed_rate_counter = IL_MISSED_RATE_MAX; 2340 lq_sta->missed_rate_counter = IL_MISSED_RATE_MAX;
2344 lq_sta->is_green = il4965_rs_use_green(sta); 2341 lq_sta->is_green = il4965_rs_use_green(il, sta);
2345 lq_sta->active_legacy_rate = il->active_rate & ~(0x1000); 2342 lq_sta->active_legacy_rate = il->active_rate & ~(0x1000);
2346 lq_sta->band = il->band; 2343 lq_sta->band = il->band;
2347 /* 2344 /*
diff --git a/drivers/net/wireless/iwlegacy/common.c b/drivers/net/wireless/iwlegacy/common.c
index c93fa1b85da5..db2e8bb11fa1 100644
--- a/drivers/net/wireless/iwlegacy/common.c
+++ b/drivers/net/wireless/iwlegacy/common.c
@@ -2352,7 +2352,7 @@ il_is_lq_table_valid(struct il_priv *il, struct il_rxon_context *ctx,
2352{ 2352{
2353 int i; 2353 int i;
2354 2354
2355 if (ctx->ht.enabled) 2355 if (il->ht.enabled)
2356 return true; 2356 return true;
2357 2357
2358 D_INFO("Channel %u is not an HT channel\n", il->active.channel); 2358 D_INFO("Channel %u is not an HT channel\n", il->active.channel);
@@ -3559,7 +3559,7 @@ bool
3559il_is_ht40_tx_allowed(struct il_priv *il, struct il_rxon_context *ctx, 3559il_is_ht40_tx_allowed(struct il_priv *il, struct il_rxon_context *ctx,
3560 struct ieee80211_sta_ht_cap *ht_cap) 3560 struct ieee80211_sta_ht_cap *ht_cap)
3561{ 3561{
3562 if (!ctx->ht.enabled || !ctx->ht.is_40mhz) 3562 if (!il->ht.enabled || !il->ht.is_40mhz)
3563 return false; 3563 return false;
3564 3564
3565 /* 3565 /*
@@ -3576,7 +3576,7 @@ il_is_ht40_tx_allowed(struct il_priv *il, struct il_rxon_context *ctx,
3576 3576
3577 return il_is_channel_extension(il, il->band, 3577 return il_is_channel_extension(il, il->band,
3578 le16_to_cpu(il->staging.channel), 3578 le16_to_cpu(il->staging.channel),
3579 ctx->ht.extension_chan_offset); 3579 il->ht.extension_chan_offset);
3580} 3580}
3581EXPORT_SYMBOL(il_is_ht40_tx_allowed); 3581EXPORT_SYMBOL(il_is_ht40_tx_allowed);
3582 3582
@@ -3832,7 +3832,7 @@ _il_set_rxon_ht(struct il_priv *il, struct il_ht_config *ht_conf,
3832{ 3832{
3833 struct il_rxon_cmd *rxon = &il->staging; 3833 struct il_rxon_cmd *rxon = &il->staging;
3834 3834
3835 if (!ctx->ht.enabled) { 3835 if (!il->ht.enabled) {
3836 rxon->flags &= 3836 rxon->flags &=
3837 ~(RXON_FLG_CHANNEL_MODE_MSK | 3837 ~(RXON_FLG_CHANNEL_MODE_MSK |
3838 RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK | RXON_FLG_HT40_PROT_MSK 3838 RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK | RXON_FLG_HT40_PROT_MSK
@@ -3841,7 +3841,7 @@ _il_set_rxon_ht(struct il_priv *il, struct il_ht_config *ht_conf,
3841 } 3841 }
3842 3842
3843 rxon->flags |= 3843 rxon->flags |=
3844 cpu_to_le32(ctx->ht.protection << RXON_FLG_HT_OPERATING_MODE_POS); 3844 cpu_to_le32(il->ht.protection << RXON_FLG_HT_OPERATING_MODE_POS);
3845 3845
3846 /* Set up channel bandwidth: 3846 /* Set up channel bandwidth:
3847 * 20 MHz only, 20/40 mixed or pure 40 if ht40 ok */ 3847 * 20 MHz only, 20/40 mixed or pure 40 if ht40 ok */
@@ -3850,10 +3850,10 @@ _il_set_rxon_ht(struct il_priv *il, struct il_ht_config *ht_conf,
3850 ~(RXON_FLG_CHANNEL_MODE_MSK | RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK); 3850 ~(RXON_FLG_CHANNEL_MODE_MSK | RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK);
3851 if (il_is_ht40_tx_allowed(il, ctx, NULL)) { 3851 if (il_is_ht40_tx_allowed(il, ctx, NULL)) {
3852 /* pure ht40 */ 3852 /* pure ht40 */
3853 if (ctx->ht.protection == IEEE80211_HT_OP_MODE_PROTECTION_20MHZ) { 3853 if (il->ht.protection == IEEE80211_HT_OP_MODE_PROTECTION_20MHZ) {
3854 rxon->flags |= RXON_FLG_CHANNEL_MODE_PURE_40; 3854 rxon->flags |= RXON_FLG_CHANNEL_MODE_PURE_40;
3855 /* Note: control channel is opposite of extension channel */ 3855 /* Note: control channel is opposite of extension channel */
3856 switch (ctx->ht.extension_chan_offset) { 3856 switch (il->ht.extension_chan_offset) {
3857 case IEEE80211_HT_PARAM_CHA_SEC_ABOVE: 3857 case IEEE80211_HT_PARAM_CHA_SEC_ABOVE:
3858 rxon->flags &= 3858 rxon->flags &=
3859 ~RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK; 3859 ~RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK;
@@ -3864,7 +3864,7 @@ _il_set_rxon_ht(struct il_priv *il, struct il_ht_config *ht_conf,
3864 } 3864 }
3865 } else { 3865 } else {
3866 /* Note: control channel is opposite of extension channel */ 3866 /* Note: control channel is opposite of extension channel */
3867 switch (ctx->ht.extension_chan_offset) { 3867 switch (il->ht.extension_chan_offset) {
3868 case IEEE80211_HT_PARAM_CHA_SEC_ABOVE: 3868 case IEEE80211_HT_PARAM_CHA_SEC_ABOVE:
3869 rxon->flags &= 3869 rxon->flags &=
3870 ~(RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK); 3870 ~(RXON_FLG_CTRL_CHANNEL_LOC_HI_MSK);
@@ -3890,7 +3890,7 @@ _il_set_rxon_ht(struct il_priv *il, struct il_ht_config *ht_conf,
3890 3890
3891 D_ASSOC("rxon flags 0x%X operation mode :0x%X " 3891 D_ASSOC("rxon flags 0x%X operation mode :0x%X "
3892 "extension channel offset 0x%x\n", le32_to_cpu(rxon->flags), 3892 "extension channel offset 0x%x\n", le32_to_cpu(rxon->flags),
3893 ctx->ht.protection, ctx->ht.extension_chan_offset); 3893 il->ht.protection, il->ht.extension_chan_offset);
3894} 3894}
3895 3895
3896void 3896void
@@ -5236,7 +5236,7 @@ il_update_qos(struct il_priv *il, struct il_rxon_context *ctx)
5236 il->qos_data.def_qos_parm.qos_flags |= 5236 il->qos_data.def_qos_parm.qos_flags |=
5237 QOS_PARAM_FLG_UPDATE_EDCA_MSK; 5237 QOS_PARAM_FLG_UPDATE_EDCA_MSK;
5238 5238
5239 if (ctx->ht.enabled) 5239 if (il->ht.enabled)
5240 il->qos_data.def_qos_parm.qos_flags |= QOS_PARAM_FLG_TGN_MSK; 5240 il->qos_data.def_qos_parm.qos_flags |= QOS_PARAM_FLG_TGN_MSK;
5241 5241
5242 D_QOS("send QoS cmd with Qos active=%d FLAGS=0x%X\n", 5242 D_QOS("send QoS cmd with Qos active=%d FLAGS=0x%X\n",
@@ -5319,32 +5319,32 @@ il_mac_config(struct ieee80211_hw *hw, u32 changed)
5319 spin_lock_irqsave(&il->lock, flags); 5319 spin_lock_irqsave(&il->lock, flags);
5320 5320
5321 /* Configure HT40 channels */ 5321 /* Configure HT40 channels */
5322 if (ctx->ht.enabled != conf_is_ht(conf)) { 5322 if (il->ht.enabled != conf_is_ht(conf)) {
5323 ctx->ht.enabled = conf_is_ht(conf); 5323 il->ht.enabled = conf_is_ht(conf);
5324 ht_changed = true; 5324 ht_changed = true;
5325 } 5325 }
5326 if (ctx->ht.enabled) { 5326 if (il->ht.enabled) {
5327 if (conf_is_ht40_minus(conf)) { 5327 if (conf_is_ht40_minus(conf)) {
5328 ctx->ht.extension_chan_offset = 5328 il->ht.extension_chan_offset =
5329 IEEE80211_HT_PARAM_CHA_SEC_BELOW; 5329 IEEE80211_HT_PARAM_CHA_SEC_BELOW;
5330 ctx->ht.is_40mhz = true; 5330 il->ht.is_40mhz = true;
5331 } else if (conf_is_ht40_plus(conf)) { 5331 } else if (conf_is_ht40_plus(conf)) {
5332 ctx->ht.extension_chan_offset = 5332 il->ht.extension_chan_offset =
5333 IEEE80211_HT_PARAM_CHA_SEC_ABOVE; 5333 IEEE80211_HT_PARAM_CHA_SEC_ABOVE;
5334 ctx->ht.is_40mhz = true; 5334 il->ht.is_40mhz = true;
5335 } else { 5335 } else {
5336 ctx->ht.extension_chan_offset = 5336 il->ht.extension_chan_offset =
5337 IEEE80211_HT_PARAM_CHA_SEC_NONE; 5337 IEEE80211_HT_PARAM_CHA_SEC_NONE;
5338 ctx->ht.is_40mhz = false; 5338 il->ht.is_40mhz = false;
5339 } 5339 }
5340 } else 5340 } else
5341 ctx->ht.is_40mhz = false; 5341 il->ht.is_40mhz = false;
5342 5342
5343 /* 5343 /*
5344 * Default to no protection. Protection mode will 5344 * Default to no protection. Protection mode will
5345 * later be set from BSS config in il_ht_conf 5345 * later be set from BSS config in il_ht_conf
5346 */ 5346 */
5347 ctx->ht.protection = IEEE80211_HT_OP_MODE_PROTECTION_NONE; 5347 il->ht.protection = IEEE80211_HT_OP_MODE_PROTECTION_NONE;
5348 5348
5349 /* if we are switching from ht to 2.4 clear flags 5349 /* if we are switching from ht to 2.4 clear flags
5350 * from any ht related info since 2.4 does not 5350 * from any ht related info since 2.4 does not
@@ -5460,16 +5460,15 @@ il_ht_conf(struct il_priv *il, struct ieee80211_vif *vif)
5460 struct il_ht_config *ht_conf = &il->current_ht_config; 5460 struct il_ht_config *ht_conf = &il->current_ht_config;
5461 struct ieee80211_sta *sta; 5461 struct ieee80211_sta *sta;
5462 struct ieee80211_bss_conf *bss_conf = &vif->bss_conf; 5462 struct ieee80211_bss_conf *bss_conf = &vif->bss_conf;
5463 struct il_rxon_context *ctx = il_rxon_ctx_from_vif(vif);
5464 5463
5465 D_ASSOC("enter:\n"); 5464 D_ASSOC("enter:\n");
5466 5465
5467 if (!ctx->ht.enabled) 5466 if (!il->ht.enabled)
5468 return; 5467 return;
5469 5468
5470 ctx->ht.protection = 5469 il->ht.protection =
5471 bss_conf->ht_operation_mode & IEEE80211_HT_OP_MODE_PROTECTION; 5470 bss_conf->ht_operation_mode & IEEE80211_HT_OP_MODE_PROTECTION;
5472 ctx->ht.non_gf_sta_present = 5471 il->ht.non_gf_sta_present =
5473 !!(bss_conf-> 5472 !!(bss_conf->
5474 ht_operation_mode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT); 5473 ht_operation_mode & IEEE80211_HT_OP_MODE_NON_GF_STA_PRSNT);
5475 5474
diff --git a/drivers/net/wireless/iwlegacy/common.h b/drivers/net/wireless/iwlegacy/common.h
index 18375cb7904c..df4d1602289c 100644
--- a/drivers/net/wireless/iwlegacy/common.h
+++ b/drivers/net/wireless/iwlegacy/common.h
@@ -1164,13 +1164,6 @@ struct il_rxon_context {
1164 * we already removed the vif for type setting. 1164 * we already removed the vif for type setting.
1165 */ 1165 */
1166 bool always_active, is_active; 1166 bool always_active, is_active;
1167
1168 struct {
1169 bool non_gf_sta_present;
1170 u8 protection;
1171 bool enabled, is_40mhz;
1172 u8 extension_chan_offset;
1173 } ht;
1174}; 1167};
1175 1168
1176struct il_power_mgr { 1169struct il_power_mgr {
@@ -1278,6 +1271,14 @@ struct il_priv {
1278 1271
1279 struct il_qos_info qos_data; 1272 struct il_qos_info qos_data;
1280 1273
1274 struct {
1275 bool enabled;
1276 bool is_40mhz;
1277 bool non_gf_sta_present;
1278 u8 protection;
1279 u8 extension_chan_offset;
1280 } ht;
1281
1281 /* 1282 /*
1282 * We declare this const so it can only be 1283 * We declare this const so it can only be
1283 * changed via explicit cast within the 1284 * changed via explicit cast within the