diff options
author | Johannes Berg <johannes@sipsolutions.net> | 2008-09-10 18:01:49 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2008-09-15 16:48:20 -0400 |
commit | 472dbc45dc1966284de72d7de15690c17ed2cf33 (patch) | |
tree | e8bfb88067f7fd8845978d1613f868e6a4499999 /net/mac80211/ieee80211_i.h | |
parent | 7c95069522d02ff144cd421be6618dce619caf7e (diff) |
mac80211: split off mesh handling entirely
This patch splits off mesh handling from the STA/IBSS.
Unfortunately it increases mesh code size a bit, but I
think it makes things clearer. The patch also reduces
per-interface run-time memory usage.
Also clean up a few places where ifdef is not required.
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/ieee80211_i.h')
-rw-r--r-- | net/mac80211/ieee80211_i.h | 101 |
1 files changed, 54 insertions, 47 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h index 6f334e4c3d66..cac0b1334548 100644 --- a/net/mac80211/ieee80211_i.h +++ b/net/mac80211/ieee80211_i.h | |||
@@ -308,7 +308,6 @@ enum ieee80211_sta_mlme_state { | |||
308 | IEEE80211_STA_MLME_ASSOCIATED, | 308 | IEEE80211_STA_MLME_ASSOCIATED, |
309 | IEEE80211_STA_MLME_IBSS_SEARCH, | 309 | IEEE80211_STA_MLME_IBSS_SEARCH, |
310 | IEEE80211_STA_MLME_IBSS_JOINED, | 310 | IEEE80211_STA_MLME_IBSS_JOINED, |
311 | IEEE80211_STA_MLME_MESH_UP | ||
312 | }; | 311 | }; |
313 | 312 | ||
314 | /* bitfield of allowed auth algs */ | 313 | /* bitfield of allowed auth algs */ |
@@ -325,34 +324,6 @@ struct ieee80211_if_sta { | |||
325 | size_t ssid_len; | 324 | size_t ssid_len; |
326 | u8 scan_ssid[IEEE80211_MAX_SSID_LEN]; | 325 | u8 scan_ssid[IEEE80211_MAX_SSID_LEN]; |
327 | size_t scan_ssid_len; | 326 | size_t scan_ssid_len; |
328 | #ifdef CONFIG_MAC80211_MESH | ||
329 | struct timer_list mesh_path_timer; | ||
330 | u8 mesh_id[IEEE80211_MAX_MESH_ID_LEN]; | ||
331 | size_t mesh_id_len; | ||
332 | /* Active Path Selection Protocol Identifier */ | ||
333 | u8 mesh_pp_id[4]; | ||
334 | /* Active Path Selection Metric Identifier */ | ||
335 | u8 mesh_pm_id[4]; | ||
336 | /* Congestion Control Mode Identifier */ | ||
337 | u8 mesh_cc_id[4]; | ||
338 | /* Local mesh Destination Sequence Number */ | ||
339 | u32 dsn; | ||
340 | /* Last used PREQ ID */ | ||
341 | u32 preq_id; | ||
342 | atomic_t mpaths; | ||
343 | /* Timestamp of last DSN update */ | ||
344 | unsigned long last_dsn_update; | ||
345 | /* Timestamp of last DSN sent */ | ||
346 | unsigned long last_preq; | ||
347 | struct mesh_rmc *rmc; | ||
348 | spinlock_t mesh_preq_queue_lock; | ||
349 | struct mesh_preq_queue preq_queue; | ||
350 | int preq_queue_len; | ||
351 | struct mesh_stats mshstats; | ||
352 | struct mesh_config mshcfg; | ||
353 | u32 mesh_seqnum; | ||
354 | bool accepting_plinks; | ||
355 | #endif | ||
356 | u16 aid; | 327 | u16 aid; |
357 | u16 ap_capab, capab; | 328 | u16 ap_capab, capab; |
358 | u8 *extra_ie; /* to be added to the end of AssocReq */ | 329 | u8 *extra_ie; /* to be added to the end of AssocReq */ |
@@ -387,20 +358,47 @@ struct ieee80211_if_sta { | |||
387 | int num_beacons; /* number of TXed beacon frames by this STA */ | 358 | int num_beacons; /* number of TXed beacon frames by this STA */ |
388 | }; | 359 | }; |
389 | 360 | ||
390 | static inline void ieee80211_if_sta_set_mesh_id(struct ieee80211_if_sta *ifsta, | 361 | struct ieee80211_if_mesh { |
391 | u8 mesh_id_len, u8 *mesh_id) | 362 | struct work_struct work; |
392 | { | 363 | struct timer_list housekeeping_timer; |
393 | #ifdef CONFIG_MAC80211_MESH | 364 | struct timer_list mesh_path_timer; |
394 | ifsta->mesh_id_len = mesh_id_len; | 365 | struct sk_buff_head skb_queue; |
395 | memcpy(ifsta->mesh_id, mesh_id, mesh_id_len); | 366 | |
396 | #endif | 367 | bool housekeeping; |
397 | } | 368 | |
369 | u8 mesh_id[IEEE80211_MAX_MESH_ID_LEN]; | ||
370 | size_t mesh_id_len; | ||
371 | /* Active Path Selection Protocol Identifier */ | ||
372 | u8 mesh_pp_id[4]; | ||
373 | /* Active Path Selection Metric Identifier */ | ||
374 | u8 mesh_pm_id[4]; | ||
375 | /* Congestion Control Mode Identifier */ | ||
376 | u8 mesh_cc_id[4]; | ||
377 | /* Local mesh Destination Sequence Number */ | ||
378 | u32 dsn; | ||
379 | /* Last used PREQ ID */ | ||
380 | u32 preq_id; | ||
381 | atomic_t mpaths; | ||
382 | /* Timestamp of last DSN update */ | ||
383 | unsigned long last_dsn_update; | ||
384 | /* Timestamp of last DSN sent */ | ||
385 | unsigned long last_preq; | ||
386 | struct mesh_rmc *rmc; | ||
387 | spinlock_t mesh_preq_queue_lock; | ||
388 | struct mesh_preq_queue preq_queue; | ||
389 | int preq_queue_len; | ||
390 | struct mesh_stats mshstats; | ||
391 | struct mesh_config mshcfg; | ||
392 | u32 mesh_seqnum; | ||
393 | bool accepting_plinks; | ||
394 | int num_beacons; | ||
395 | }; | ||
398 | 396 | ||
399 | #ifdef CONFIG_MAC80211_MESH | 397 | #ifdef CONFIG_MAC80211_MESH |
400 | #define IEEE80211_IFSTA_MESH_CTR_INC(sta, name) \ | 398 | #define IEEE80211_IFSTA_MESH_CTR_INC(msh, name) \ |
401 | do { (sta)->mshstats.name++; } while (0) | 399 | do { (msh)->mshstats.name++; } while (0) |
402 | #else | 400 | #else |
403 | #define IEEE80211_IFSTA_MESH_CTR_INC(sta, name) \ | 401 | #define IEEE80211_IFSTA_MESH_CTR_INC(msh, name) \ |
404 | do { } while (0) | 402 | do { } while (0) |
405 | #endif | 403 | #endif |
406 | 404 | ||
@@ -455,6 +453,9 @@ struct ieee80211_sub_if_data { | |||
455 | struct ieee80211_if_wds wds; | 453 | struct ieee80211_if_wds wds; |
456 | struct ieee80211_if_vlan vlan; | 454 | struct ieee80211_if_vlan vlan; |
457 | struct ieee80211_if_sta sta; | 455 | struct ieee80211_if_sta sta; |
456 | #ifdef CONFIG_MAC80211_MESH | ||
457 | struct ieee80211_if_mesh mesh; | ||
458 | #endif | ||
458 | u32 mntr_flags; | 459 | u32 mntr_flags; |
459 | } u; | 460 | } u; |
460 | 461 | ||
@@ -548,6 +549,19 @@ struct ieee80211_sub_if_data *vif_to_sdata(struct ieee80211_vif *p) | |||
548 | return container_of(p, struct ieee80211_sub_if_data, vif); | 549 | return container_of(p, struct ieee80211_sub_if_data, vif); |
549 | } | 550 | } |
550 | 551 | ||
552 | static inline void | ||
553 | ieee80211_sdata_set_mesh_id(struct ieee80211_sub_if_data *sdata, | ||
554 | u8 mesh_id_len, u8 *mesh_id) | ||
555 | { | ||
556 | #ifdef CONFIG_MAC80211_MESH | ||
557 | struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; | ||
558 | ifmsh->mesh_id_len = mesh_id_len; | ||
559 | memcpy(ifmsh->mesh_id, mesh_id, mesh_id_len); | ||
560 | #else | ||
561 | WARN_ON(1); | ||
562 | #endif | ||
563 | } | ||
564 | |||
551 | enum { | 565 | enum { |
552 | IEEE80211_RX_MSG = 1, | 566 | IEEE80211_RX_MSG = 1, |
553 | IEEE80211_TX_STATUS_MSG = 2, | 567 | IEEE80211_TX_STATUS_MSG = 2, |
@@ -935,13 +949,6 @@ ieee80211_rx_bss_get(struct ieee80211_local *local, u8 *bssid, int freq, | |||
935 | void ieee80211_rx_bss_put(struct ieee80211_local *local, | 949 | void ieee80211_rx_bss_put(struct ieee80211_local *local, |
936 | struct ieee80211_sta_bss *bss); | 950 | struct ieee80211_sta_bss *bss); |
937 | 951 | ||
938 | #ifdef CONFIG_MAC80211_MESH | ||
939 | void ieee80211_start_mesh(struct ieee80211_sub_if_data *sdata); | ||
940 | #else | ||
941 | static inline void ieee80211_start_mesh(struct ieee80211_sub_if_data *sdata) | ||
942 | {} | ||
943 | #endif | ||
944 | |||
945 | /* interface handling */ | 952 | /* interface handling */ |
946 | void ieee80211_if_setup(struct net_device *dev); | 953 | void ieee80211_if_setup(struct net_device *dev); |
947 | int ieee80211_if_add(struct ieee80211_local *local, const char *name, | 954 | int ieee80211_if_add(struct ieee80211_local *local, const char *name, |