aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mesh_sync.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-06-22 05:29:50 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-06-24 05:32:29 -0400
commitbdcbd8e0e3ffdad32b14b6373e67bfcf5fd3f002 (patch)
treeb636f2229570dc95edef997272bd0656cf19224d /net/mac80211/mesh_sync.c
parentd3b2fb53c7f82903880769d406c11c7e619b11a4 (diff)
mac80211: clean up debugging
There are a few things that make the logging and debugging in mac80211 less useful than it should be right now: * a lot of messages should be pr_info, not pr_debug * wholesale use of pr_debug makes it require *both* Kconfig and dynamic configuration * there are still a lot of ifdefs * the style is very inconsistent, sometimes the sdata->name is printed in front Clean up everything, introducing new macros and separating out the station MLME debugging into a new Kconfig symbol. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211/mesh_sync.c')
-rw-r--r--net/mac80211/mesh_sync.c47
1 files changed, 20 insertions, 27 deletions
diff --git a/net/mac80211/mesh_sync.c b/net/mac80211/mesh_sync.c
index 0ccdad49f987..accfa00ffcdf 100644
--- a/net/mac80211/mesh_sync.c
+++ b/net/mac80211/mesh_sync.c
@@ -12,13 +12,6 @@
12#include "mesh.h" 12#include "mesh.h"
13#include "driver-ops.h" 13#include "driver-ops.h"
14 14
15#ifdef CONFIG_MAC80211_VERBOSE_MESH_SYNC_DEBUG
16#define msync_dbg(fmt, args...) \
17 pr_debug("Mesh sync (%s): " fmt "\n", sdata->name, ##args)
18#else
19#define msync_dbg(fmt, args...) do { (void)(0); } while (0)
20#endif
21
22/* This is not in the standard. It represents a tolerable tbtt drift below 15/* This is not in the standard. It represents a tolerable tbtt drift below
23 * which we do no TSF adjustment. 16 * which we do no TSF adjustment.
24 */ 17 */
@@ -65,14 +58,14 @@ void mesh_sync_adjust_tbtt(struct ieee80211_sub_if_data *sdata)
65 spin_lock_bh(&ifmsh->sync_offset_lock); 58 spin_lock_bh(&ifmsh->sync_offset_lock);
66 59
67 if (ifmsh->sync_offset_clockdrift_max < beacon_int_fraction) { 60 if (ifmsh->sync_offset_clockdrift_max < beacon_int_fraction) {
68 msync_dbg("TBTT : max clockdrift=%lld; adjusting", 61 msync_dbg(sdata, "TBTT : max clockdrift=%lld; adjusting\n",
69 (long long) ifmsh->sync_offset_clockdrift_max); 62 (long long) ifmsh->sync_offset_clockdrift_max);
70 tsfdelta = -ifmsh->sync_offset_clockdrift_max; 63 tsfdelta = -ifmsh->sync_offset_clockdrift_max;
71 ifmsh->sync_offset_clockdrift_max = 0; 64 ifmsh->sync_offset_clockdrift_max = 0;
72 } else { 65 } else {
73 msync_dbg("TBTT : max clockdrift=%lld; adjusting by %llu", 66 msync_dbg(sdata, "TBTT : max clockdrift=%lld; adjusting by %llu\n",
74 (long long) ifmsh->sync_offset_clockdrift_max, 67 (long long) ifmsh->sync_offset_clockdrift_max,
75 (unsigned long long) beacon_int_fraction); 68 (unsigned long long) beacon_int_fraction);
76 tsfdelta = -beacon_int_fraction; 69 tsfdelta = -beacon_int_fraction;
77 ifmsh->sync_offset_clockdrift_max -= beacon_int_fraction; 70 ifmsh->sync_offset_clockdrift_max -= beacon_int_fraction;
78 } 71 }
@@ -120,7 +113,7 @@ static void mesh_sync_offset_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,
120 113
121 if (elems->mesh_config && mesh_peer_tbtt_adjusting(elems)) { 114 if (elems->mesh_config && mesh_peer_tbtt_adjusting(elems)) {
122 clear_sta_flag(sta, WLAN_STA_TOFFSET_KNOWN); 115 clear_sta_flag(sta, WLAN_STA_TOFFSET_KNOWN);
123 msync_dbg("STA %pM : is adjusting TBTT", sta->sta.addr); 116 msync_dbg(sdata, "STA %pM : is adjusting TBTT\n", sta->sta.addr);
124 goto no_sync; 117 goto no_sync;
125 } 118 }
126 119
@@ -169,7 +162,8 @@ static void mesh_sync_offset_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,
169 if (test_sta_flag(sta, WLAN_STA_TOFFSET_KNOWN)) { 162 if (test_sta_flag(sta, WLAN_STA_TOFFSET_KNOWN)) {
170 s64 t_clockdrift = sta->t_offset_setpoint 163 s64 t_clockdrift = sta->t_offset_setpoint
171 - sta->t_offset; 164 - sta->t_offset;
172 msync_dbg("STA %pM : sta->t_offset=%lld, sta->t_offset_setpoint=%lld, t_clockdrift=%lld", 165 msync_dbg(sdata,
166 "STA %pM : sta->t_offset=%lld, sta->t_offset_setpoint=%lld, t_clockdrift=%lld\n",
173 sta->sta.addr, 167 sta->sta.addr,
174 (long long) sta->t_offset, 168 (long long) sta->t_offset,
175 (long long) 169 (long long)
@@ -178,7 +172,8 @@ static void mesh_sync_offset_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,
178 172
179 if (t_clockdrift > TOFFSET_MAXIMUM_ADJUSTMENT || 173 if (t_clockdrift > TOFFSET_MAXIMUM_ADJUSTMENT ||
180 t_clockdrift < -TOFFSET_MAXIMUM_ADJUSTMENT) { 174 t_clockdrift < -TOFFSET_MAXIMUM_ADJUSTMENT) {
181 msync_dbg("STA %pM : t_clockdrift=%lld too large, setpoint reset", 175 msync_dbg(sdata,
176 "STA %pM : t_clockdrift=%lld too large, setpoint reset\n",
182 sta->sta.addr, 177 sta->sta.addr,
183 (long long) t_clockdrift); 178 (long long) t_clockdrift);
184 clear_sta_flag(sta, WLAN_STA_TOFFSET_KNOWN); 179 clear_sta_flag(sta, WLAN_STA_TOFFSET_KNOWN);
@@ -197,8 +192,8 @@ static void mesh_sync_offset_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,
197 } else { 192 } else {
198 sta->t_offset_setpoint = sta->t_offset - TOFFSET_SET_MARGIN; 193 sta->t_offset_setpoint = sta->t_offset - TOFFSET_SET_MARGIN;
199 set_sta_flag(sta, WLAN_STA_TOFFSET_KNOWN); 194 set_sta_flag(sta, WLAN_STA_TOFFSET_KNOWN);
200 msync_dbg("STA %pM : offset was invalid, " 195 msync_dbg(sdata,
201 " sta->t_offset=%lld", 196 "STA %pM : offset was invalid, sta->t_offset=%lld\n",
202 sta->sta.addr, 197 sta->sta.addr,
203 (long long) sta->t_offset); 198 (long long) sta->t_offset);
204 rcu_read_unlock(); 199 rcu_read_unlock();
@@ -226,17 +221,15 @@ static void mesh_sync_offset_adjust_tbtt(struct ieee80211_sub_if_data *sdata)
226 * to the driver tsf setter, we punt 221 * to the driver tsf setter, we punt
227 * the tsf adjustment to the mesh tasklet 222 * the tsf adjustment to the mesh tasklet
228 */ 223 */
229 msync_dbg("TBTT : kicking off TBTT " 224 msync_dbg(sdata,
230 "adjustment with " 225 "TBTT : kicking off TBTT adjustment with clockdrift_max=%lld\n",
231 "clockdrift_max=%lld", 226 ifmsh->sync_offset_clockdrift_max);
232 ifmsh->sync_offset_clockdrift_max);
233 set_bit(MESH_WORK_DRIFT_ADJUST, 227 set_bit(MESH_WORK_DRIFT_ADJUST,
234 &ifmsh->wrkq_flags); 228 &ifmsh->wrkq_flags);
235 } else { 229 } else {
236 msync_dbg("TBTT : max clockdrift=%lld; " 230 msync_dbg(sdata,
237 "too small to adjust", 231 "TBTT : max clockdrift=%lld; too small to adjust\n",
238 (long long) 232 (long long)ifmsh->sync_offset_clockdrift_max);
239 ifmsh->sync_offset_clockdrift_max);
240 ifmsh->sync_offset_clockdrift_max = 0; 233 ifmsh->sync_offset_clockdrift_max = 0;
241 } 234 }
242 spin_unlock_bh(&ifmsh->sync_offset_lock); 235 spin_unlock_bh(&ifmsh->sync_offset_lock);
@@ -268,7 +261,7 @@ static void mesh_sync_vendor_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,
268 const u8 *oui; 261 const u8 *oui;
269 262
270 WARN_ON(sdata->u.mesh.mesh_sp_id != IEEE80211_SYNC_METHOD_VENDOR); 263 WARN_ON(sdata->u.mesh.mesh_sp_id != IEEE80211_SYNC_METHOD_VENDOR);
271 msync_dbg("called mesh_sync_vendor_rx_bcn_presp"); 264 msync_dbg(sdata, "called mesh_sync_vendor_rx_bcn_presp\n");
272 oui = mesh_get_vendor_oui(sdata); 265 oui = mesh_get_vendor_oui(sdata);
273 /* here you would implement the vendor offset tracking for this oui */ 266 /* here you would implement the vendor offset tracking for this oui */
274} 267}
@@ -278,7 +271,7 @@ static void mesh_sync_vendor_adjust_tbtt(struct ieee80211_sub_if_data *sdata)
278 const u8 *oui; 271 const u8 *oui;
279 272
280 WARN_ON(sdata->u.mesh.mesh_sp_id != IEEE80211_SYNC_METHOD_VENDOR); 273 WARN_ON(sdata->u.mesh.mesh_sp_id != IEEE80211_SYNC_METHOD_VENDOR);
281 msync_dbg("called mesh_sync_vendor_adjust_tbtt"); 274 msync_dbg(sdata, "called mesh_sync_vendor_adjust_tbtt\n");
282 oui = mesh_get_vendor_oui(sdata); 275 oui = mesh_get_vendor_oui(sdata);
283 /* here you would implement the vendor tsf adjustment for this oui */ 276 /* here you would implement the vendor tsf adjustment for this oui */
284} 277}