diff options
Diffstat (limited to 'drivers/net/wireless/mwl8k.c')
-rw-r--r-- | drivers/net/wireless/mwl8k.c | 52 |
1 files changed, 33 insertions, 19 deletions
diff --git a/drivers/net/wireless/mwl8k.c b/drivers/net/wireless/mwl8k.c index d8eff68978f1..fa7b4fe074f5 100644 --- a/drivers/net/wireless/mwl8k.c +++ b/drivers/net/wireless/mwl8k.c | |||
@@ -2958,57 +2958,71 @@ static void mwl8k_bss_info_changed(struct ieee80211_hw *hw, | |||
2958 | u32 changed) | 2958 | u32 changed) |
2959 | { | 2959 | { |
2960 | struct mwl8k_priv *priv = hw->priv; | 2960 | struct mwl8k_priv *priv = hw->priv; |
2961 | u32 ap_legacy_rates; | ||
2961 | int rc; | 2962 | int rc; |
2962 | 2963 | ||
2963 | if ((changed & BSS_CHANGED_ASSOC) == 0) | 2964 | if (mwl8k_fw_lock(hw)) |
2964 | return; | 2965 | return; |
2965 | 2966 | ||
2966 | priv->capture_beacon = false; | 2967 | /* |
2967 | 2968 | * No need to capture a beacon if we're no longer associated. | |
2968 | rc = mwl8k_fw_lock(hw); | 2969 | */ |
2969 | if (rc) | 2970 | if ((changed & BSS_CHANGED_ASSOC) && !vif->bss_conf.assoc) |
2970 | return; | 2971 | priv->capture_beacon = false; |
2971 | 2972 | ||
2973 | /* | ||
2974 | * Get the AP's legacy rates. | ||
2975 | */ | ||
2976 | ap_legacy_rates = 0; | ||
2972 | if (vif->bss_conf.assoc) { | 2977 | if (vif->bss_conf.assoc) { |
2973 | struct ieee80211_sta *ap; | 2978 | struct ieee80211_sta *ap; |
2974 | u32 legacy_rate_mask; | ||
2975 | 2979 | ||
2976 | rcu_read_lock(); | 2980 | rcu_read_lock(); |
2977 | ap = ieee80211_find_sta(vif, vif->bss_conf.bssid); | ||
2978 | if (ap != NULL) | ||
2979 | legacy_rate_mask = ap->supp_rates[IEEE80211_BAND_2GHZ]; | ||
2980 | rcu_read_unlock(); | ||
2981 | 2981 | ||
2982 | if (ap == NULL) | 2982 | ap = ieee80211_find_sta(vif, vif->bss_conf.bssid); |
2983 | if (ap == NULL) { | ||
2984 | rcu_read_unlock(); | ||
2983 | goto out; | 2985 | goto out; |
2986 | } | ||
2984 | 2987 | ||
2985 | /* Install rates */ | 2988 | ap_legacy_rates = ap->supp_rates[IEEE80211_BAND_2GHZ]; |
2986 | rc = mwl8k_cmd_set_rate(hw, vif, legacy_rate_mask); | 2989 | |
2990 | rcu_read_unlock(); | ||
2991 | } | ||
2992 | |||
2993 | if ((changed & BSS_CHANGED_ASSOC) && vif->bss_conf.assoc) { | ||
2994 | rc = mwl8k_cmd_set_rate(hw, vif, ap_legacy_rates); | ||
2987 | if (rc) | 2995 | if (rc) |
2988 | goto out; | 2996 | goto out; |
2989 | 2997 | ||
2990 | /* Turn on rate adaptation */ | ||
2991 | rc = mwl8k_cmd_use_fixed_rate(hw, MWL8K_USE_AUTO_RATE, | 2998 | rc = mwl8k_cmd_use_fixed_rate(hw, MWL8K_USE_AUTO_RATE, |
2992 | MWL8K_UCAST_RATE, NULL); | 2999 | MWL8K_UCAST_RATE, NULL); |
2993 | if (rc) | 3000 | if (rc) |
2994 | goto out; | 3001 | goto out; |
3002 | } | ||
2995 | 3003 | ||
2996 | /* Set radio preamble */ | 3004 | if (changed & BSS_CHANGED_ERP_PREAMBLE) { |
2997 | rc = mwl8k_set_radio_preamble(hw, | 3005 | rc = mwl8k_set_radio_preamble(hw, |
2998 | vif->bss_conf.use_short_preamble); | 3006 | vif->bss_conf.use_short_preamble); |
2999 | if (rc) | 3007 | if (rc) |
3000 | goto out; | 3008 | goto out; |
3009 | } | ||
3001 | 3010 | ||
3002 | /* Set slot time */ | 3011 | if (changed & BSS_CHANGED_ERP_SLOT) { |
3003 | rc = mwl8k_cmd_set_slot(hw, vif->bss_conf.use_short_slot); | 3012 | rc = mwl8k_cmd_set_slot(hw, vif->bss_conf.use_short_slot); |
3004 | if (rc) | 3013 | if (rc) |
3005 | goto out; | 3014 | goto out; |
3015 | } | ||
3006 | 3016 | ||
3007 | /* Set AID */ | 3017 | if (((changed & BSS_CHANGED_ASSOC) && vif->bss_conf.assoc) || |
3008 | rc = mwl8k_cmd_set_aid(hw, vif, legacy_rate_mask); | 3018 | (changed & (BSS_CHANGED_ERP_CTS_PROT | BSS_CHANGED_HT))) { |
3019 | rc = mwl8k_cmd_set_aid(hw, vif, ap_legacy_rates); | ||
3009 | if (rc) | 3020 | if (rc) |
3010 | goto out; | 3021 | goto out; |
3022 | } | ||
3011 | 3023 | ||
3024 | if (vif->bss_conf.assoc && | ||
3025 | (changed & (BSS_CHANGED_ASSOC | BSS_CHANGED_BEACON_INT))) { | ||
3012 | /* | 3026 | /* |
3013 | * Finalize the join. Tell rx handler to process | 3027 | * Finalize the join. Tell rx handler to process |
3014 | * next beacon from our BSSID. | 3028 | * next beacon from our BSSID. |