Commit 74e1309a authored by Johannes Berg's avatar Johannes Berg

wifi: mac80211: mlme: look up beacon elems only if needed

If NEED_DTIM_BEFORE_ASSOC isn't set, then we don't need
to enter an RCU critical section and look up the beacon
elements.
Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 1845c1d4
...@@ -6270,7 +6270,6 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata, ...@@ -6270,7 +6270,6 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
struct ieee80211_if_managed *ifmgd = &sdata->u.mgd; struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
struct ieee80211_bss *bss = (void *)req->bss->priv; struct ieee80211_bss *bss = (void *)req->bss->priv;
struct ieee80211_mgd_assoc_data *assoc_data; struct ieee80211_mgd_assoc_data *assoc_data;
const struct cfg80211_bss_ies *beacon_ies;
struct ieee80211_vif_cfg *vif_cfg = &sdata->vif.cfg; struct ieee80211_vif_cfg *vif_cfg = &sdata->vif.cfg;
const struct element *ssid_elem; const struct element *ssid_elem;
struct ieee80211_link_data *link = &sdata->deflink; struct ieee80211_link_data *link = &sdata->deflink;
...@@ -6488,11 +6487,13 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata, ...@@ -6488,11 +6487,13 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
link->smps_mode = link->u.mgd.req_smps; link->smps_mode = link->u.mgd.req_smps;
} }
if (ieee80211_hw_check(&sdata->local->hw, NEED_DTIM_BEFORE_ASSOC)) {
const struct cfg80211_bss_ies *beacon_ies;
rcu_read_lock(); rcu_read_lock();
beacon_ies = rcu_dereference(req->bss->beacon_ies); beacon_ies = rcu_dereference(req->bss->beacon_ies);
if (ieee80211_hw_check(&sdata->local->hw, NEED_DTIM_BEFORE_ASSOC) && if (beacon_ies) {
!beacon_ies) {
/* /*
* Wait up to one beacon interval ... * Wait up to one beacon interval ...
* should this be more if we miss one? * should this be more if we miss one?
...@@ -6504,6 +6505,7 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata, ...@@ -6504,6 +6505,7 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
assoc_data->need_beacon = true; assoc_data->need_beacon = true;
} }
rcu_read_unlock(); rcu_read_unlock();
}
run_again(sdata, assoc_data->timeout); run_again(sdata, assoc_data->timeout);
......
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