diff options
author | Johannes Berg <johannes.berg@intel.com> | 2010-06-10 04:21:32 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-06-14 15:38:17 -0400 |
commit | 1fa57d017366fb26b58af110a38b36a4f0214a62 (patch) | |
tree | 9bf7e82b3e429908498a70aa5c75c2af06b261b6 /net/mac80211/mesh.c | |
parent | 64592c8fc0e99d445fc3fdedddeb6088e20086f1 (diff) |
mac80211: use common work function
Even with the previous patch, IBSS, managed
and mesh modes all attach their own work
function to the shared work struct, which
means some duplicated code. Change that to
only have a frame processing function and a
further work function for each of them and
share some common code.
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.c | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c index be9aa980e941..0f1f593c8477 100644 --- a/net/mac80211/mesh.c +++ b/net/mac80211/mesh.c | |||
@@ -596,8 +596,8 @@ static void ieee80211_mesh_rx_mgmt_action(struct ieee80211_sub_if_data *sdata, | |||
596 | } | 596 | } |
597 | } | 597 | } |
598 | 598 | ||
599 | static void ieee80211_mesh_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, | 599 | void ieee80211_mesh_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, |
600 | struct sk_buff *skb) | 600 | struct sk_buff *skb) |
601 | { | 601 | { |
602 | struct ieee80211_rx_status *rx_status; | 602 | struct ieee80211_rx_status *rx_status; |
603 | struct ieee80211_if_mesh *ifmsh; | 603 | struct ieee80211_if_mesh *ifmsh; |
@@ -624,22 +624,9 @@ static void ieee80211_mesh_rx_queued_mgmt(struct ieee80211_sub_if_data *sdata, | |||
624 | kfree_skb(skb); | 624 | kfree_skb(skb); |
625 | } | 625 | } |
626 | 626 | ||
627 | static void ieee80211_mesh_work(struct work_struct *work) | 627 | void ieee80211_mesh_work(struct ieee80211_sub_if_data *sdata) |
628 | { | 628 | { |
629 | struct ieee80211_sub_if_data *sdata = | ||
630 | container_of(work, struct ieee80211_sub_if_data, work); | ||
631 | struct ieee80211_local *local = sdata->local; | ||
632 | struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; | 629 | struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; |
633 | struct sk_buff *skb; | ||
634 | |||
635 | if (!ieee80211_sdata_running(sdata)) | ||
636 | return; | ||
637 | |||
638 | if (local->scanning) | ||
639 | return; | ||
640 | |||
641 | while ((skb = skb_dequeue(&sdata->skb_queue))) | ||
642 | ieee80211_mesh_rx_queued_mgmt(sdata, skb); | ||
643 | 630 | ||
644 | if (ifmsh->preq_queue_len && | 631 | if (ifmsh->preq_queue_len && |
645 | time_after(jiffies, | 632 | time_after(jiffies, |
@@ -674,7 +661,6 @@ void ieee80211_mesh_init_sdata(struct ieee80211_sub_if_data *sdata) | |||
674 | { | 661 | { |
675 | struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; | 662 | struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; |
676 | 663 | ||
677 | INIT_WORK(&sdata->work, ieee80211_mesh_work); | ||
678 | setup_timer(&ifmsh->housekeeping_timer, | 664 | setup_timer(&ifmsh->housekeeping_timer, |
679 | ieee80211_mesh_housekeeping_timer, | 665 | ieee80211_mesh_housekeeping_timer, |
680 | (unsigned long) sdata); | 666 | (unsigned long) sdata); |