aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/mesh.c
diff options
context:
space:
mode:
authorJohannes Berg <johannes.berg@intel.com>2010-06-10 04:21:31 -0400
committerJohn W. Linville <linville@tuxdriver.com>2010-06-14 15:38:17 -0400
commit64592c8fc0e99d445fc3fdedddeb6088e20086f1 (patch)
tree2493358821abc4050b25f8a0bd813b763b188d38 /net/mac80211/mesh.c
parent35f20c14a103ca2c7062999e934a513b83d84de6 (diff)
mac80211: use common work struct
IBSS, managed and mesh modes all have their own work struct, and in the future we want to also use it in other modes to process frames from the now common skb queue. This also makes the skb queue and work safe to use from other interface types. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/mesh.c')
-rw-r--r--net/mac80211/mesh.c22
1 files changed, 9 insertions, 13 deletions
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index 065533a37abe..be9aa980e941 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -54,7 +54,7 @@ static void ieee80211_mesh_housekeeping_timer(unsigned long data)
54 return; 54 return;
55 } 55 }
56 56
57 ieee80211_queue_work(&local->hw, &ifmsh->work); 57 ieee80211_queue_work(&local->hw, &sdata->work);
58} 58}
59 59
60/** 60/**
@@ -345,7 +345,7 @@ static void ieee80211_mesh_path_timer(unsigned long data)
345 return; 345 return;
346 } 346 }
347 347
348 ieee80211_queue_work(&local->hw, &ifmsh->work); 348 ieee80211_queue_work(&local->hw, &sdata->work);
349} 349}
350 350
351static void ieee80211_mesh_path_root_timer(unsigned long data) 351static void ieee80211_mesh_path_root_timer(unsigned long data)
@@ -362,7 +362,7 @@ static void ieee80211_mesh_path_root_timer(unsigned long data)
362 return; 362 return;
363 } 363 }
364 364
365 ieee80211_queue_work(&local->hw, &ifmsh->work); 365 ieee80211_queue_work(&local->hw, &sdata->work);
366} 366}
367 367
368void ieee80211_mesh_root_setup(struct ieee80211_if_mesh *ifmsh) 368void ieee80211_mesh_root_setup(struct ieee80211_if_mesh *ifmsh)
@@ -484,9 +484,6 @@ void ieee80211_mesh_quiesce(struct ieee80211_sub_if_data *sdata)
484{ 484{
485 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; 485 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
486 486
487 /* might restart the timer but that doesn't matter */
488 cancel_work_sync(&ifmsh->work);
489
490 /* use atomic bitops in case both timers fire at the same time */ 487 /* use atomic bitops in case both timers fire at the same time */
491 488
492 if (del_timer_sync(&ifmsh->housekeeping_timer)) 489 if (del_timer_sync(&ifmsh->housekeeping_timer))
@@ -518,7 +515,7 @@ void ieee80211_start_mesh(struct ieee80211_sub_if_data *sdata)
518 515
519 set_bit(MESH_WORK_HOUSEKEEPING, &ifmsh->wrkq_flags); 516 set_bit(MESH_WORK_HOUSEKEEPING, &ifmsh->wrkq_flags);
520 ieee80211_mesh_root_setup(ifmsh); 517 ieee80211_mesh_root_setup(ifmsh);
521 ieee80211_queue_work(&local->hw, &ifmsh->work); 518 ieee80211_queue_work(&local->hw, &sdata->work);
522 sdata->vif.bss_conf.beacon_int = MESH_DEFAULT_BEACON_INTERVAL; 519 sdata->vif.bss_conf.beacon_int = MESH_DEFAULT_BEACON_INTERVAL;
523 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON | 520 ieee80211_bss_info_change_notify(sdata, BSS_CHANGED_BEACON |
524 BSS_CHANGED_BEACON_ENABLED | 521 BSS_CHANGED_BEACON_ENABLED |
@@ -536,7 +533,7 @@ void ieee80211_stop_mesh(struct ieee80211_sub_if_data *sdata)
536 * whether the interface is running, which, at this point, 533 * whether the interface is running, which, at this point,
537 * it no longer is. 534 * it no longer is.
538 */ 535 */
539 cancel_work_sync(&sdata->u.mesh.work); 536 cancel_work_sync(&sdata->work);
540} 537}
541 538
542static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata, 539static void ieee80211_mesh_rx_bcn_presp(struct ieee80211_sub_if_data *sdata,
@@ -630,7 +627,7 @@ static void ieee80211_mesh_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata,
630static void ieee80211_mesh_work(struct work_struct *work) 627static void ieee80211_mesh_work(struct work_struct *work)
631{ 628{
632 struct ieee80211_sub_if_data *sdata = 629 struct ieee80211_sub_if_data *sdata =
633 container_of(work, struct ieee80211_sub_if_data, u.mesh.work); 630 container_of(work, struct ieee80211_sub_if_data, work);
634 struct ieee80211_local *local = sdata->local; 631 struct ieee80211_local *local = sdata->local;
635 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; 632 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
636 struct sk_buff *skb; 633 struct sk_buff *skb;
@@ -669,7 +666,7 @@ void ieee80211_mesh_notify_scan_completed(struct ieee80211_local *local)
669 rcu_read_lock(); 666 rcu_read_lock();
670 list_for_each_entry_rcu(sdata, &local->interfaces, list) 667 list_for_each_entry_rcu(sdata, &local->interfaces, list)
671 if (ieee80211_vif_is_mesh(&sdata->vif)) 668 if (ieee80211_vif_is_mesh(&sdata->vif))
672 ieee80211_queue_work(&local->hw, &sdata->u.mesh.work); 669 ieee80211_queue_work(&local->hw, &sdata->work);
673 rcu_read_unlock(); 670 rcu_read_unlock();
674} 671}
675 672
@@ -677,7 +674,7 @@ void ieee80211_mesh_init_sdata(struct ieee80211_sub_if_data *sdata)
677{ 674{
678 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; 675 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
679 676
680 INIT_WORK(&ifmsh->work, ieee80211_mesh_work); 677 INIT_WORK(&sdata->work, ieee80211_mesh_work);
681 setup_timer(&ifmsh->housekeeping_timer, 678 setup_timer(&ifmsh->housekeeping_timer,
682 ieee80211_mesh_housekeeping_timer, 679 ieee80211_mesh_housekeeping_timer,
683 (unsigned long) sdata); 680 (unsigned long) sdata);
@@ -726,7 +723,6 @@ ieee80211_rx_result
726ieee80211_mesh_rx_mgmt(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb) 723ieee80211_mesh_rx_mgmt(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb)
727{ 724{
728 struct ieee80211_local *local = sdata->local; 725 struct ieee80211_local *local = sdata->local;
729 struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh;
730 struct ieee80211_mgmt *mgmt; 726 struct ieee80211_mgmt *mgmt;
731 u16 fc; 727 u16 fc;
732 728
@@ -741,7 +737,7 @@ ieee80211_mesh_rx_mgmt(struct ieee80211_sub_if_data *sdata, struct sk_buff *skb)
741 case IEEE80211_STYPE_PROBE_RESP: 737 case IEEE80211_STYPE_PROBE_RESP:
742 case IEEE80211_STYPE_BEACON: 738 case IEEE80211_STYPE_BEACON:
743 skb_queue_tail(&sdata->skb_queue, skb); 739 skb_queue_tail(&sdata->skb_queue, skb);
744 ieee80211_queue_work(&local->hw, &ifmsh->work); 740 ieee80211_queue_work(&local->hw, &sdata->work);
745 return RX_QUEUED; 741 return RX_QUEUED;
746 } 742 }
747 743