Commit c3cbbe8a authored by Lennert Buytenhek's avatar Lennert Buytenhek Committed by John W. Linville

mwl8k: fix changed flags handling in mwl8k_bss_info_changed()

Previously, mwl8k_bss_info_changed() would refuse to do anything if
the 'changed' argument indicated that the association status hadn't
changed.  Fix this up so that it will allow changing things like the
preamble type, the slot time and the CTS-to-self protection method
without having to reassociate.
Signed-off-by: default avatarLennert Buytenhek <buytenh@marvell.com>
Signed-off-by: default avatarJohn W. Linville <linville@tuxdriver.com>
parent c6e96010
...@@ -2958,57 +2958,71 @@ static void mwl8k_bss_info_changed(struct ieee80211_hw *hw, ...@@ -2958,57 +2958,71 @@ static void mwl8k_bss_info_changed(struct ieee80211_hw *hw,
u32 changed) u32 changed)
{ {
struct mwl8k_priv *priv = hw->priv; struct mwl8k_priv *priv = hw->priv;
u32 ap_legacy_rates;
int rc; int rc;
if ((changed & BSS_CHANGED_ASSOC) == 0) if (mwl8k_fw_lock(hw))
return; return;
/*
* No need to capture a beacon if we're no longer associated.
*/
if ((changed & BSS_CHANGED_ASSOC) && !vif->bss_conf.assoc)
priv->capture_beacon = false; priv->capture_beacon = false;
rc = mwl8k_fw_lock(hw); /*
if (rc) * Get the AP's legacy rates.
return; */
ap_legacy_rates = 0;
if (vif->bss_conf.assoc) { if (vif->bss_conf.assoc) {
struct ieee80211_sta *ap; struct ieee80211_sta *ap;
u32 legacy_rate_mask;
rcu_read_lock(); rcu_read_lock();
ap = ieee80211_find_sta(vif, vif->bss_conf.bssid); ap = ieee80211_find_sta(vif, vif->bss_conf.bssid);
if (ap != NULL) if (ap == NULL) {
legacy_rate_mask = ap->supp_rates[IEEE80211_BAND_2GHZ];
rcu_read_unlock(); rcu_read_unlock();
if (ap == NULL)
goto out; goto out;
}
ap_legacy_rates = ap->supp_rates[IEEE80211_BAND_2GHZ];
rcu_read_unlock();
}
/* Install rates */ if ((changed & BSS_CHANGED_ASSOC) && vif->bss_conf.assoc) {
rc = mwl8k_cmd_set_rate(hw, vif, legacy_rate_mask); rc = mwl8k_cmd_set_rate(hw, vif, ap_legacy_rates);
if (rc) if (rc)
goto out; goto out;
/* Turn on rate adaptation */
rc = mwl8k_cmd_use_fixed_rate(hw, MWL8K_USE_AUTO_RATE, rc = mwl8k_cmd_use_fixed_rate(hw, MWL8K_USE_AUTO_RATE,
MWL8K_UCAST_RATE, NULL); MWL8K_UCAST_RATE, NULL);
if (rc) if (rc)
goto out; goto out;
}
/* Set radio preamble */ if (changed & BSS_CHANGED_ERP_PREAMBLE) {
rc = mwl8k_set_radio_preamble(hw, rc = mwl8k_set_radio_preamble(hw,
vif->bss_conf.use_short_preamble); vif->bss_conf.use_short_preamble);
if (rc) if (rc)
goto out; goto out;
}
/* Set slot time */ if (changed & BSS_CHANGED_ERP_SLOT) {
rc = mwl8k_cmd_set_slot(hw, vif->bss_conf.use_short_slot); rc = mwl8k_cmd_set_slot(hw, vif->bss_conf.use_short_slot);
if (rc) if (rc)
goto out; goto out;
}
/* Set AID */ if (((changed & BSS_CHANGED_ASSOC) && vif->bss_conf.assoc) ||
rc = mwl8k_cmd_set_aid(hw, vif, legacy_rate_mask); (changed & (BSS_CHANGED_ERP_CTS_PROT | BSS_CHANGED_HT))) {
rc = mwl8k_cmd_set_aid(hw, vif, ap_legacy_rates);
if (rc) if (rc)
goto out; goto out;
}
if (vif->bss_conf.assoc &&
(changed & (BSS_CHANGED_ASSOC | BSS_CHANGED_BEACON_INT))) {
/* /*
* Finalize the join. Tell rx handler to process * Finalize the join. Tell rx handler to process
* next beacon from our BSSID. * next beacon from our BSSID.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment