]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.18.85/mac80211-remove-invalid-flag-operations-in-mesh-tsf-synchronization.patch
4.9-stable patches
[thirdparty/kernel/stable-queue.git] / releases / 3.18.85 / mac80211-remove-invalid-flag-operations-in-mesh-tsf-synchronization.patch
1 From foo@baz Tue Nov 28 10:58:31 CET 2017
2 From: Masashi Honma <masashi.honma@gmail.com>
3 Date: Thu, 8 Dec 2016 10:15:50 +0900
4 Subject: mac80211: Remove invalid flag operations in mesh TSF synchronization
5
6 From: Masashi Honma <masashi.honma@gmail.com>
7
8
9 [ Upstream commit 76f43b4c0a9337af22827d78de4f2b8fd5328489 ]
10
11 mesh_sync_offset_adjust_tbtt() implements Extensible synchronization
12 framework ([1] 13.13.2 Extensible synchronization framework). It shall
13 not operate the flag "TBTT Adjusting subfield" ([1] 8.4.2.100.8 Mesh
14 Capability), since it is used only for MBCA ([1] 13.13.4 Mesh beacon
15 collision avoidance, see 13.13.4.4.3 TBTT scanning and adjustment
16 procedures for detail). So this patch remove the flag operations.
17
18 [1] IEEE Std 802.11 2012
19
20 Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
21 [remove adjusting_tbtt entirely, since it's now unused]
22 Signed-off-by: Johannes Berg <johannes.berg@intel.com>
23
24 Signed-off-by: Sasha Levin <alexander.levin@verizon.com>
25 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
26 ---
27 net/mac80211/ieee80211_i.h | 1 -
28 net/mac80211/mesh.c | 3 ---
29 net/mac80211/mesh_sync.c | 11 -----------
30 3 files changed, 15 deletions(-)
31
32 --- a/net/mac80211/ieee80211_i.h
33 +++ b/net/mac80211/ieee80211_i.h
34 @@ -640,7 +640,6 @@ struct ieee80211_if_mesh {
35 const struct ieee80211_mesh_sync_ops *sync_ops;
36 s64 sync_offset_clockdrift_max;
37 spinlock_t sync_offset_lock;
38 - bool adjusting_tbtt;
39 /* mesh power save */
40 enum nl80211_mesh_power_mode nonpeer_pm;
41 int ps_peers_light_sleep;
42 --- a/net/mac80211/mesh.c
43 +++ b/net/mac80211/mesh.c
44 @@ -289,8 +289,6 @@ int mesh_add_meshconf_ie(struct ieee8021
45 /* Mesh PS mode. See IEEE802.11-2012 8.4.2.100.8 */
46 *pos |= ifmsh->ps_peers_deep_sleep ?
47 IEEE80211_MESHCONF_CAPAB_POWER_SAVE_LEVEL : 0x00;
48 - *pos++ |= ifmsh->adjusting_tbtt ?
49 - IEEE80211_MESHCONF_CAPAB_TBTT_ADJUSTING : 0x00;
50 *pos++ = 0x00;
51
52 return 0;
53 @@ -790,7 +788,6 @@ int ieee80211_start_mesh(struct ieee8021
54 ifmsh->mesh_cc_id = 0; /* Disabled */
55 /* register sync ops from extensible synchronization framework */
56 ifmsh->sync_ops = ieee80211_mesh_sync_ops_get(ifmsh->mesh_sp_id);
57 - ifmsh->adjusting_tbtt = false;
58 ifmsh->sync_offset_clockdrift_max = 0;
59 set_bit(MESH_WORK_HOUSEKEEPING, &ifmsh->wrkq_flags);
60 ieee80211_mesh_root_setup(ifmsh);
61 --- a/net/mac80211/mesh_sync.c
62 +++ b/net/mac80211/mesh_sync.c
63 @@ -119,7 +119,6 @@ static void mesh_sync_offset_rx_bcn_pres
64 */
65
66 if (elems->mesh_config && mesh_peer_tbtt_adjusting(elems)) {
67 - clear_sta_flag(sta, WLAN_STA_TOFFSET_KNOWN);
68 msync_dbg(sdata, "STA %pM : is adjusting TBTT\n",
69 sta->sta.addr);
70 goto no_sync;
71 @@ -168,11 +167,9 @@ static void mesh_sync_offset_adjust_tbtt
72 struct beacon_data *beacon)
73 {
74 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
75 - u8 cap;
76
77 WARN_ON(ifmsh->mesh_sp_id != IEEE80211_SYNC_METHOD_NEIGHBOR_OFFSET);
78 WARN_ON(!rcu_read_lock_held());
79 - cap = beacon->meshconf->meshconf_cap;
80
81 spin_lock_bh(&ifmsh->sync_offset_lock);
82
83 @@ -186,21 +183,13 @@ static void mesh_sync_offset_adjust_tbtt
84 "TBTT : kicking off TBTT adjustment with clockdrift_max=%lld\n",
85 ifmsh->sync_offset_clockdrift_max);
86 set_bit(MESH_WORK_DRIFT_ADJUST, &ifmsh->wrkq_flags);
87 -
88 - ifmsh->adjusting_tbtt = true;
89 } else {
90 msync_dbg(sdata,
91 "TBTT : max clockdrift=%lld; too small to adjust\n",
92 (long long)ifmsh->sync_offset_clockdrift_max);
93 ifmsh->sync_offset_clockdrift_max = 0;
94 -
95 - ifmsh->adjusting_tbtt = false;
96 }
97 spin_unlock_bh(&ifmsh->sync_offset_lock);
98 -
99 - beacon->meshconf->meshconf_cap = ifmsh->adjusting_tbtt ?
100 - IEEE80211_MESHCONF_CAPAB_TBTT_ADJUSTING | cap :
101 - ~IEEE80211_MESHCONF_CAPAB_TBTT_ADJUSTING & cap;
102 }
103
104 static const struct sync_method sync_methods[] = {