diff options
Diffstat (limited to 'net/mac80211/util.c')
| -rw-r--r-- | net/mac80211/util.c | 43 | 
1 files changed, 31 insertions, 12 deletions
| diff --git a/net/mac80211/util.c b/net/mac80211/util.c index 39fa2a50385d..f71b042a5c8b 100644 --- a/net/mac80211/util.c +++ b/net/mac80211/util.c @@ -796,7 +796,7 @@ static void __iterate_interfaces(struct ieee80211_local *local,  	sdata = rcu_dereference_check(local->monitor_sdata,  				      lockdep_is_held(&local->iflist_mtx) || -				      lockdep_rtnl_is_held()); +				      lockdep_is_held(&local->hw.wiphy->mtx));  	if (sdata &&  	    (iter_flags & IEEE80211_IFACE_ITER_RESUME_ALL || !active_only ||  	     sdata->flags & IEEE80211_SDATA_IN_DRIVER)) @@ -862,6 +862,19 @@ static void __iterate_stations(struct ieee80211_local *local,  	}  } +void ieee80211_iterate_stations(struct ieee80211_hw *hw, +				void (*iterator)(void *data, +						 struct ieee80211_sta *sta), +				void *data) +{ +	struct ieee80211_local *local = hw_to_local(hw); + +	mutex_lock(&local->sta_mtx); +	__iterate_stations(local, iterator, data); +	mutex_unlock(&local->sta_mtx); +} +EXPORT_SYMBOL_GPL(ieee80211_iterate_stations); +  void ieee80211_iterate_stations_atomic(struct ieee80211_hw *hw,  			void (*iterator)(void *data,  					 struct ieee80211_sta *sta), @@ -943,7 +956,12 @@ static void ieee80211_parse_extension_element(u32 *crc,  					      struct ieee802_11_elems *elems)  {  	const void *data = elem->data + 1; -	u8 len = elem->datalen - 1; +	u8 len; + +	if (!elem->datalen) +		return; + +	len = elem->datalen - 1;  	switch (elem->data[0]) {  	case WLAN_EID_EXT_HE_MU_EDCA: @@ -2063,7 +2081,7 @@ struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,  		chandef.chan = chan;  	skb = ieee80211_probereq_get(&local->hw, src, ssid, ssid_len, -				     100 + ie_len); +				     local->scan_ies_len + ie_len);  	if (!skb)  		return NULL; @@ -2381,7 +2399,7 @@ int ieee80211_reconfig(struct ieee80211_local *local)  				   IEEE80211_TPT_LEDTRIG_FL_RADIO, 0);  	/* add interfaces */ -	sdata = rtnl_dereference(local->monitor_sdata); +	sdata = wiphy_dereference(local->hw.wiphy, local->monitor_sdata);  	if (sdata) {  		/* in HW restart it exists already */  		WARN_ON(local->resuming); @@ -2426,7 +2444,8 @@ int ieee80211_reconfig(struct ieee80211_local *local)  				WARN_ON(drv_add_chanctx(local, ctx));  		mutex_unlock(&local->chanctx_mtx); -		sdata = rtnl_dereference(local->monitor_sdata); +		sdata = wiphy_dereference(local->hw.wiphy, +					  local->monitor_sdata);  		if (sdata && ieee80211_sdata_running(sdata))  			ieee80211_assign_chanctx(local, sdata);  	} @@ -2645,6 +2664,13 @@ int ieee80211_reconfig(struct ieee80211_local *local)  		mutex_unlock(&local->sta_mtx);  	} +	/* +	 * If this is for hw restart things are still running. +	 * We may want to change that later, however. +	 */ +	if (local->open_count && (!suspended || reconfig_due_to_wowlan)) +		drv_reconfig_complete(local, IEEE80211_RECONFIG_TYPE_RESTART); +  	if (local->in_reconfig) {  		local->in_reconfig = false;  		barrier(); @@ -2663,13 +2689,6 @@ int ieee80211_reconfig(struct ieee80211_local *local)  					IEEE80211_QUEUE_STOP_REASON_SUSPEND,  					false); -	/* -	 * If this is for hw restart things are still running. -	 * We may want to change that later, however. -	 */ -	if (local->open_count && (!suspended || reconfig_due_to_wowlan)) -		drv_reconfig_complete(local, IEEE80211_RECONFIG_TYPE_RESTART); -  	if (!suspended)  		return 0; |