diff options
author | Stanislaw Gruszka <sgruszka@redhat.com> | 2012-02-03 11:31:52 -0500 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2012-02-06 14:56:07 -0500 |
commit | 1c03c4620edc551b5bbcc87c7aca02b482d8bc51 (patch) | |
tree | 748ed469ac864e906a4b70c2173ff5d4e76a84a1 /drivers/net/wireless/iwlegacy/common.c | |
parent | 8d44f2bd7554734913f1256e4f45c35454167161 (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/common.c')
-rw-r--r-- | drivers/net/wireless/iwlegacy/common.c | 49 |
1 files changed, 24 insertions, 25 deletions
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 | |||
3559 | il_is_ht40_tx_allowed(struct il_priv *il, struct il_rxon_context *ctx, | 3559 | il_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 | } |
3581 | EXPORT_SYMBOL(il_is_ht40_tx_allowed); | 3581 | EXPORT_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 | ||
3896 | void | 3896 | void |
@@ -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 | ||