image.mk: fix emitting profiles for targets that have no subtargets
[openwrt/staging/mkresin.git] / package / kernel / mac80211 / patches / 314-mac80211-Requeue-work-after-scan-complete-for-all-VI.patch
1 From: Sachin Kulkarni <Sachin.Kulkarni@imgtec.com>
2 Date: Tue, 12 Jan 2016 14:30:19 +0530
3 Subject: [PATCH] mac80211: Requeue work after scan complete for all VIF
4 types.
5
6 During a sw scan ieee80211_iface_work ignores work items for all vifs.
7 However after the scan complete work is requeued only for STA, ADHOC
8 and MESH iftypes.
9
10 This occasionally results in event processing getting delayed/not
11 processed for iftype AP when it coexists with a STA. This can result
12 in data halt and eventually disconnection on the AP interface.
13
14 Signed-off-by: Sachin Kulkarni <Sachin.Kulkarni@imgtec.com>
15 Cc: linux-wireless@vger.kernel.org
16 Cc: johannes@sipsolutions.net
17 ---
18
19 --- a/net/mac80211/ibss.c
20 +++ b/net/mac80211/ibss.c
21 @@ -1731,7 +1731,6 @@ void ieee80211_ibss_notify_scan_complete
22 if (sdata->vif.type != NL80211_IFTYPE_ADHOC)
23 continue;
24 sdata->u.ibss.last_scan_completed = jiffies;
25 - ieee80211_queue_work(&local->hw, &sdata->work);
26 }
27 mutex_unlock(&local->iflist_mtx);
28 }
29 --- a/net/mac80211/mesh.c
30 +++ b/net/mac80211/mesh.c
31 @@ -1369,17 +1369,6 @@ out:
32 sdata_unlock(sdata);
33 }
34
35 -void ieee80211_mesh_notify_scan_completed(struct ieee80211_local *local)
36 -{
37 - struct ieee80211_sub_if_data *sdata;
38 -
39 - rcu_read_lock();
40 - list_for_each_entry_rcu(sdata, &local->interfaces, list)
41 - if (ieee80211_vif_is_mesh(&sdata->vif) &&
42 - ieee80211_sdata_running(sdata))
43 - ieee80211_queue_work(&local->hw, &sdata->work);
44 - rcu_read_unlock();
45 -}
46
47 void ieee80211_mesh_init_sdata(struct ieee80211_sub_if_data *sdata)
48 {
49 --- a/net/mac80211/mesh.h
50 +++ b/net/mac80211/mesh.h
51 @@ -362,14 +362,10 @@ static inline bool mesh_path_sel_is_hwmp
52 return sdata->u.mesh.mesh_pp_id == IEEE80211_PATH_PROTOCOL_HWMP;
53 }
54
55 -void ieee80211_mesh_notify_scan_completed(struct ieee80211_local *local);
56 -
57 void mesh_path_flush_by_iface(struct ieee80211_sub_if_data *sdata);
58 void mesh_sync_adjust_tbtt(struct ieee80211_sub_if_data *sdata);
59 void ieee80211s_stop(void);
60 #else
61 -static inline void
62 -ieee80211_mesh_notify_scan_completed(struct ieee80211_local *local) {}
63 static inline bool mesh_path_sel_is_hwmp(struct ieee80211_sub_if_data *sdata)
64 { return false; }
65 static inline void mesh_path_flush_by_iface(struct ieee80211_sub_if_data *sdata)
66 --- a/net/mac80211/mlme.c
67 +++ b/net/mac80211/mlme.c
68 @@ -3978,8 +3978,6 @@ static void ieee80211_restart_sta_timer(
69 if (!ieee80211_hw_check(&sdata->local->hw, CONNECTION_MONITOR))
70 ieee80211_queue_work(&sdata->local->hw,
71 &sdata->u.mgd.monitor_work);
72 - /* and do all the other regular work too */
73 - ieee80211_queue_work(&sdata->local->hw, &sdata->work);
74 }
75 }
76
77 --- a/net/mac80211/scan.c
78 +++ b/net/mac80211/scan.c
79 @@ -314,6 +314,7 @@ static void __ieee80211_scan_completed(s
80 bool was_scanning = local->scanning;
81 struct cfg80211_scan_request *scan_req;
82 struct ieee80211_sub_if_data *scan_sdata;
83 + struct ieee80211_sub_if_data *sdata;
84
85 lockdep_assert_held(&local->mtx);
86
87 @@ -373,7 +374,15 @@ static void __ieee80211_scan_completed(s
88
89 ieee80211_mlme_notify_scan_completed(local);
90 ieee80211_ibss_notify_scan_completed(local);
91 - ieee80211_mesh_notify_scan_completed(local);
92 +
93 + /* Requeue all the work that might have been ignored while
94 + * the scan was in progress
95 + */
96 + list_for_each_entry_rcu(sdata, &local->interfaces, list) {
97 + if (ieee80211_sdata_running(sdata))
98 + ieee80211_queue_work(&sdata->local->hw, &sdata->work);
99 + }
100 +
101 if (was_scanning)
102 ieee80211_start_next_roc(local);
103 }