aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/iwlwifi
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-05-06 15:21:40 -0400
committerReinette Chatre <reinette.chatre@intel.com>2010-05-13 13:45:24 -0400
commitc213d745b25b24b68f790fe55fc0a2159218a079 (patch)
tree0167dab957cdea2fde74386410cd74ec7ec6c803 /drivers/net/wireless/iwlwifi
parentd73e4923d1b3311dda4cd1bd5d3596d75af1d1c3 (diff)
iwlwifi: use proper short slot/preamble settings
The short preamble setting might change on the fly, and then we already use the right mac80211 variable. However, in other places we don't, which is especially wrong in the AP code since in that case the assoc_capability is invalid. Also, the IBSS special case is not needed since "use_short_slot" will be properly cleared, but the "assoc_capability" might be invalid (which must be the reason for the special case). Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Reinette Chatre <reinette.chatre@intel.com>
Diffstat (limited to 'drivers/net/wireless/iwlwifi')
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-agn.c18
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-core.c5
-rw-r--r--drivers/net/wireless/iwlwifi/iwl3945-base.c17
3 files changed, 9 insertions, 31 deletions
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn.c b/drivers/net/wireless/iwlwifi/iwl-agn.c
index 5bfa7b310c1a..eb74f2803448 100644
--- a/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ b/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -2860,20 +2860,16 @@ void iwl_post_associate(struct iwl_priv *priv, struct ieee80211_vif *vif)
2860 IWL_DEBUG_ASSOC(priv, "assoc id %d beacon interval %d\n", 2860 IWL_DEBUG_ASSOC(priv, "assoc id %d beacon interval %d\n",
2861 vif->bss_conf.aid, vif->bss_conf.beacon_int); 2861 vif->bss_conf.aid, vif->bss_conf.beacon_int);
2862 2862
2863 if (vif->bss_conf.assoc_capability & WLAN_CAPABILITY_SHORT_PREAMBLE) 2863 if (vif->bss_conf.use_short_preamble)
2864 priv->staging_rxon.flags |= RXON_FLG_SHORT_PREAMBLE_MSK; 2864 priv->staging_rxon.flags |= RXON_FLG_SHORT_PREAMBLE_MSK;
2865 else 2865 else
2866 priv->staging_rxon.flags &= ~RXON_FLG_SHORT_PREAMBLE_MSK; 2866 priv->staging_rxon.flags &= ~RXON_FLG_SHORT_PREAMBLE_MSK;
2867 2867
2868 if (priv->staging_rxon.flags & RXON_FLG_BAND_24G_MSK) { 2868 if (priv->staging_rxon.flags & RXON_FLG_BAND_24G_MSK) {
2869 if (vif->bss_conf.assoc_capability & 2869 if (vif->bss_conf.use_short_slot)
2870 WLAN_CAPABILITY_SHORT_SLOT_TIME)
2871 priv->staging_rxon.flags |= RXON_FLG_SHORT_SLOT_MSK; 2870 priv->staging_rxon.flags |= RXON_FLG_SHORT_SLOT_MSK;
2872 else 2871 else
2873 priv->staging_rxon.flags &= ~RXON_FLG_SHORT_SLOT_MSK; 2872 priv->staging_rxon.flags &= ~RXON_FLG_SHORT_SLOT_MSK;
2874
2875 if (vif->type == NL80211_IFTYPE_ADHOC)
2876 priv->staging_rxon.flags &= ~RXON_FLG_SHORT_SLOT_MSK;
2877 } 2873 }
2878 2874
2879 iwlcore_commit_rxon(priv); 2875 iwlcore_commit_rxon(priv);
@@ -3099,8 +3095,7 @@ void iwl_config_ap(struct iwl_priv *priv, struct ieee80211_vif *vif)
3099 3095
3100 priv->staging_rxon.assoc_id = 0; 3096 priv->staging_rxon.assoc_id = 0;
3101 3097
3102 if (vif->bss_conf.assoc_capability & 3098 if (vif->bss_conf.use_short_preamble)
3103 WLAN_CAPABILITY_SHORT_PREAMBLE)
3104 priv->staging_rxon.flags |= 3099 priv->staging_rxon.flags |=
3105 RXON_FLG_SHORT_PREAMBLE_MSK; 3100 RXON_FLG_SHORT_PREAMBLE_MSK;
3106 else 3101 else
@@ -3108,17 +3103,12 @@ void iwl_config_ap(struct iwl_priv *priv, struct ieee80211_vif *vif)
3108 ~RXON_FLG_SHORT_PREAMBLE_MSK; 3103 ~RXON_FLG_SHORT_PREAMBLE_MSK;
3109 3104
3110 if (priv->staging_rxon.flags & RXON_FLG_BAND_24G_MSK) { 3105 if (priv->staging_rxon.flags & RXON_FLG_BAND_24G_MSK) {
3111 if (vif->bss_conf.assoc_capability & 3106 if (vif->bss_conf.use_short_slot)
3112 WLAN_CAPABILITY_SHORT_SLOT_TIME)
3113 priv->staging_rxon.flags |= 3107 priv->staging_rxon.flags |=
3114 RXON_FLG_SHORT_SLOT_MSK; 3108 RXON_FLG_SHORT_SLOT_MSK;
3115 else 3109 else
3116 priv->staging_rxon.flags &= 3110 priv->staging_rxon.flags &=
3117 ~RXON_FLG_SHORT_SLOT_MSK; 3111 ~RXON_FLG_SHORT_SLOT_MSK;
3118
3119 if (vif->type == NL80211_IFTYPE_ADHOC)
3120 priv->staging_rxon.flags &=
3121 ~RXON_FLG_SHORT_SLOT_MSK;
3122 } 3112 }
3123 /* restore RXON assoc */ 3113 /* restore RXON assoc */
3124 priv->staging_rxon.filter_flags |= RXON_FILTER_ASSOC_MSK; 3114 priv->staging_rxon.filter_flags |= RXON_FILTER_ASSOC_MSK;
diff --git a/drivers/net/wireless/iwlwifi/iwl-core.c b/drivers/net/wireless/iwlwifi/iwl-core.c
index 5f56a0e539b1..10ce00854af4 100644
--- a/drivers/net/wireless/iwlwifi/iwl-core.c
+++ b/drivers/net/wireless/iwlwifi/iwl-core.c
@@ -904,14 +904,11 @@ static void iwl_set_flags_for_band(struct iwl_priv *priv,
904 priv->staging_rxon.flags |= RXON_FLG_SHORT_SLOT_MSK; 904 priv->staging_rxon.flags |= RXON_FLG_SHORT_SLOT_MSK;
905 } else { 905 } else {
906 /* Copied from iwl_post_associate() */ 906 /* Copied from iwl_post_associate() */
907 if (vif && vif->bss_conf.assoc_capability & WLAN_CAPABILITY_SHORT_SLOT_TIME) 907 if (vif && vif->bss_conf.use_short_slot)
908 priv->staging_rxon.flags |= RXON_FLG_SHORT_SLOT_MSK; 908 priv->staging_rxon.flags |= RXON_FLG_SHORT_SLOT_MSK;
909 else 909 else
910 priv->staging_rxon.flags &= ~RXON_FLG_SHORT_SLOT_MSK; 910 priv->staging_rxon.flags &= ~RXON_FLG_SHORT_SLOT_MSK;
911 911
912 if (vif && vif->type == NL80211_IFTYPE_ADHOC)
913 priv->staging_rxon.flags &= ~RXON_FLG_SHORT_SLOT_MSK;
914
915 priv->staging_rxon.flags |= RXON_FLG_BAND_24G_MSK; 912 priv->staging_rxon.flags |= RXON_FLG_BAND_24G_MSK;
916 priv->staging_rxon.flags |= RXON_FLG_AUTO_DETECT_MSK; 913 priv->staging_rxon.flags |= RXON_FLG_AUTO_DETECT_MSK;
917 priv->staging_rxon.flags &= ~RXON_FLG_CCK_MSK; 914 priv->staging_rxon.flags &= ~RXON_FLG_CCK_MSK;
diff --git a/drivers/net/wireless/iwlwifi/iwl3945-base.c b/drivers/net/wireless/iwlwifi/iwl3945-base.c
index 82beeb5a2af9..09f8acae48d3 100644
--- a/drivers/net/wireless/iwlwifi/iwl3945-base.c
+++ b/drivers/net/wireless/iwlwifi/iwl3945-base.c
@@ -3096,19 +3096,16 @@ void iwl3945_post_associate(struct iwl_priv *priv, struct ieee80211_vif *vif)
3096 IWL_DEBUG_ASSOC(priv, "assoc id %d beacon interval %d\n", 3096 IWL_DEBUG_ASSOC(priv, "assoc id %d beacon interval %d\n",
3097 vif->bss_conf.aid, vif->bss_conf.beacon_int); 3097 vif->bss_conf.aid, vif->bss_conf.beacon_int);
3098 3098
3099 if (vif->bss_conf.assoc_capability & WLAN_CAPABILITY_SHORT_PREAMBLE) 3099 if (vif->bss_conf.use_short_preamble)
3100 priv->staging_rxon.flags |= RXON_FLG_SHORT_PREAMBLE_MSK; 3100 priv->staging_rxon.flags |= RXON_FLG_SHORT_PREAMBLE_MSK;
3101 else 3101 else
3102 priv->staging_rxon.flags &= ~RXON_FLG_SHORT_PREAMBLE_MSK; 3102 priv->staging_rxon.flags &= ~RXON_FLG_SHORT_PREAMBLE_MSK;
3103 3103
3104 if (priv->staging_rxon.flags & RXON_FLG_BAND_24G_MSK) { 3104 if (priv->staging_rxon.flags & RXON_FLG_BAND_24G_MSK) {
3105 if (vif->bss_conf.assoc_capability & WLAN_CAPABILITY_SHORT_SLOT_TIME) 3105 if (vif->bss_conf.use_short_slot)
3106 priv->staging_rxon.flags |= RXON_FLG_SHORT_SLOT_MSK; 3106 priv->staging_rxon.flags |= RXON_FLG_SHORT_SLOT_MSK;
3107 else 3107 else
3108 priv->staging_rxon.flags &= ~RXON_FLG_SHORT_SLOT_MSK; 3108 priv->staging_rxon.flags &= ~RXON_FLG_SHORT_SLOT_MSK;
3109
3110 if (vif->type == NL80211_IFTYPE_ADHOC)
3111 priv->staging_rxon.flags &= ~RXON_FLG_SHORT_SLOT_MSK;
3112 } 3109 }
3113 3110
3114 iwlcore_commit_rxon(priv); 3111 iwlcore_commit_rxon(priv);
@@ -3272,8 +3269,7 @@ void iwl3945_config_ap(struct iwl_priv *priv, struct ieee80211_vif *vif)
3272 3269
3273 priv->staging_rxon.assoc_id = 0; 3270 priv->staging_rxon.assoc_id = 0;
3274 3271
3275 if (vif->bss_conf.assoc_capability & 3272 if (vif->bss_conf.use_short_preamble)
3276 WLAN_CAPABILITY_SHORT_PREAMBLE)
3277 priv->staging_rxon.flags |= 3273 priv->staging_rxon.flags |=
3278 RXON_FLG_SHORT_PREAMBLE_MSK; 3274 RXON_FLG_SHORT_PREAMBLE_MSK;
3279 else 3275 else
@@ -3281,17 +3277,12 @@ void iwl3945_config_ap(struct iwl_priv *priv, struct ieee80211_vif *vif)
3281 ~RXON_FLG_SHORT_PREAMBLE_MSK; 3277 ~RXON_FLG_SHORT_PREAMBLE_MSK;
3282 3278
3283 if (priv->staging_rxon.flags & RXON_FLG_BAND_24G_MSK) { 3279 if (priv->staging_rxon.flags & RXON_FLG_BAND_24G_MSK) {
3284 if (vif->bss_conf.assoc_capability & 3280 if (vif->bss_conf.use_short_slot)
3285 WLAN_CAPABILITY_SHORT_SLOT_TIME)
3286 priv->staging_rxon.flags |= 3281 priv->staging_rxon.flags |=
3287 RXON_FLG_SHORT_SLOT_MSK; 3282 RXON_FLG_SHORT_SLOT_MSK;
3288 else 3283 else
3289 priv->staging_rxon.flags &= 3284 priv->staging_rxon.flags &=
3290 ~RXON_FLG_SHORT_SLOT_MSK; 3285 ~RXON_FLG_SHORT_SLOT_MSK;
3291
3292 if (vif->type == NL80211_IFTYPE_ADHOC)
3293 priv->staging_rxon.flags &=
3294 ~RXON_FLG_SHORT_SLOT_MSK;
3295 } 3286 }
3296 /* restore RXON assoc */ 3287 /* restore RXON assoc */
3297 priv->staging_rxon.filter_flags |= RXON_FILTER_ASSOC_MSK; 3288 priv->staging_rxon.filter_flags |= RXON_FILTER_ASSOC_MSK;