aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2012-09-30 11:07:19 -0400
committerJohannes Berg <johannes.berg@intel.com>2012-10-18 03:01:56 -0400
commit8ba7acf376e39ff2b987bc8fb71eb599023af314 (patch)
tree248c5e3f51b7a408784f4f4f81f0f6067ada3012 /net/mac80211
parent3821b4247b40d6b95a59a2895ea6e9bd3f983f04 (diff)
mac80211: remove unimplemented mesh vendor sync
There's no vendor-specific mesh sync implemented and there don't need to be dummy handlers that only print messages, so remove that code. While at it, also constify the mesh sync ops. Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r--net/mac80211/ieee80211_i.h2
-rw-r--r--net/mac80211/mesh.h2
-rw-r--r--net/mac80211/mesh_sync.c55
3 files changed, 5 insertions, 54 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 02e47930964f..ebc1b5dc4127 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -610,7 +610,7 @@ struct ieee80211_if_mesh {
610 IEEE80211_MESH_SEC_SECURED = 0x2, 610 IEEE80211_MESH_SEC_SECURED = 0x2,
611 } security; 611 } security;
612 /* Extensible Synchronization Framework */ 612 /* Extensible Synchronization Framework */
613 struct ieee80211_mesh_sync_ops *sync_ops; 613 const struct ieee80211_mesh_sync_ops *sync_ops;
614 s64 sync_offset_clockdrift_max; 614 s64 sync_offset_clockdrift_max;
615 spinlock_t sync_offset_lock; 615 spinlock_t sync_offset_lock;
616 bool adjusting_tbtt; 616 bool adjusting_tbtt;
diff --git a/net/mac80211/mesh.h b/net/mac80211/mesh.h
index 8334e9445195..9285f3f67e66 100644
--- a/net/mac80211/mesh.h
+++ b/net/mac80211/mesh.h
@@ -256,7 +256,7 @@ void ieee80211_mesh_init_sdata(struct ieee80211_sub_if_data *sdata);
256void ieee80211_start_mesh(struct ieee80211_sub_if_data *sdata); 256void ieee80211_start_mesh(struct ieee80211_sub_if_data *sdata);
257void ieee80211_stop_mesh(struct ieee80211_sub_if_data *sdata); 257void ieee80211_stop_mesh(struct ieee80211_sub_if_data *sdata);
258void ieee80211_mesh_root_setup(struct ieee80211_if_mesh *ifmsh); 258void ieee80211_mesh_root_setup(struct ieee80211_if_mesh *ifmsh);
259struct ieee80211_mesh_sync_ops *ieee80211_mesh_sync_ops_get(u8 method); 259const struct ieee80211_mesh_sync_ops *ieee80211_mesh_sync_ops_get(u8 method);
260 260
261/* Mesh paths */ 261/* Mesh paths */
262int mesh_nexthop_lookup(struct sk_buff *skb, 262int mesh_nexthop_lookup(struct sk_buff *skb,
diff --git a/net/mac80211/mesh_sync.c b/net/mac80211/mesh_sync.c
index a16b7b4b1e02..407c8705e10d 100644
--- a/net/mac80211/mesh_sync.c
+++ b/net/mac80211/mesh_sync.c
@@ -234,49 +234,7 @@ static void mesh_sync_offset_adjust_tbtt(struct ieee80211_sub_if_data *sdata)
234 spin_unlock_bh(&ifmsh->sync_offset_lock); 234 spin_unlock_bh(&ifmsh->sync_offset_lock);
235} 235}
236 236
237static const u8 *mesh_get_vendor_oui(struct ieee80211_sub_if_data *sdata) 237static const struct sync_method sync_methods[] = {
238{
239 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
240 u8 offset;
241
242 if (!ifmsh->ie || !ifmsh->ie_len)
243 return NULL;
244
245 offset = ieee80211_ie_split_vendor(ifmsh->ie,
246 ifmsh->ie_len, 0);
247
248 if (!offset)
249 return NULL;
250
251 return ifmsh->ie + offset + 2;
252}
253
254static void mesh_sync_vendor_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,
255 u16 stype,
256 struct ieee80211_mgmt *mgmt,
257 struct ieee802_11_elems *elems,
258 struct ieee80211_rx_status *rx_status)
259{
260 const u8 *oui;
261
262 WARN_ON(sdata->u.mesh.mesh_sp_id != IEEE80211_SYNC_METHOD_VENDOR);
263 msync_dbg(sdata, "called mesh_sync_vendor_rx_bcn_presp\n");
264 oui = mesh_get_vendor_oui(sdata);
265 /* here you would implement the vendor offset tracking for this oui */
266}
267
268static void mesh_sync_vendor_adjust_tbtt(struct ieee80211_sub_if_data *sdata)
269{
270 const u8 *oui;
271
272 WARN_ON(sdata->u.mesh.mesh_sp_id != IEEE80211_SYNC_METHOD_VENDOR);
273 msync_dbg(sdata, "called mesh_sync_vendor_adjust_tbtt\n");
274 oui = mesh_get_vendor_oui(sdata);
275 /* here you would implement the vendor tsf adjustment for this oui */
276}
277
278/* global variable */
279static struct sync_method sync_methods[] = {
280 { 238 {
281 .method = IEEE80211_SYNC_METHOD_NEIGHBOR_OFFSET, 239 .method = IEEE80211_SYNC_METHOD_NEIGHBOR_OFFSET,
282 .ops = { 240 .ops = {
@@ -284,18 +242,11 @@ static struct sync_method sync_methods[] = {
284 .adjust_tbtt = &mesh_sync_offset_adjust_tbtt, 242 .adjust_tbtt = &mesh_sync_offset_adjust_tbtt,
285 } 243 }
286 }, 244 },
287 {
288 .method = IEEE80211_SYNC_METHOD_VENDOR,
289 .ops = {
290 .rx_bcn_presp = &mesh_sync_vendor_rx_bcn_presp,
291 .adjust_tbtt = &mesh_sync_vendor_adjust_tbtt,
292 }
293 },
294}; 245};
295 246
296struct ieee80211_mesh_sync_ops *ieee80211_mesh_sync_ops_get(u8 method) 247const struct ieee80211_mesh_sync_ops *ieee80211_mesh_sync_ops_get(u8 method)
297{ 248{
298 struct ieee80211_mesh_sync_ops *ops = NULL; 249 const struct ieee80211_mesh_sync_ops *ops = NULL;
299 u8 i; 250 u8 i;
300 251
301 for (i = 0 ; i < ARRAY_SIZE(sync_methods); ++i) { 252 for (i = 0 ; i < ARRAY_SIZE(sync_methods); ++i) {