diff options
author | Johannes Berg <johannes.berg@intel.com> | 2010-09-24 05:21:07 -0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2010-09-27 15:57:52 -0400 |
commit | 4b0dd98e70b6516c2c26f28091c2fb09f0ecf215 (patch) | |
tree | 2d791b673851f15f596290e9848b5c2be409d3cd /net/mac80211 | |
parent | 4406c376895608375105013bf405ecac720ef558 (diff) |
mac80211: clean up rx handling wrt. found_sta
If a station was found, then we'll have exited
the function already, so it is not necessary to
have a variable keeping track of it.
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211')
-rw-r--r-- | net/mac80211/rx.c | 56 |
1 files changed, 25 insertions, 31 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index 13311f8960ab..2b6b4eab44dd 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -2651,7 +2651,6 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw, | |||
2651 | struct ieee80211_rx_data rx; | 2651 | struct ieee80211_rx_data rx; |
2652 | struct ieee80211_sub_if_data *prev; | 2652 | struct ieee80211_sub_if_data *prev; |
2653 | struct sta_info *sta, *tmp, *prev_sta; | 2653 | struct sta_info *sta, *tmp, *prev_sta; |
2654 | bool found_sta = false; | ||
2655 | int err = 0; | 2654 | int err = 0; |
2656 | 2655 | ||
2657 | fc = ((struct ieee80211_hdr *)skb->data)->frame_control; | 2656 | fc = ((struct ieee80211_hdr *)skb->data)->frame_control; |
@@ -2684,8 +2683,6 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw, | |||
2684 | prev_sta = NULL; | 2683 | prev_sta = NULL; |
2685 | 2684 | ||
2686 | for_each_sta_info(local, hdr->addr2, sta, tmp) { | 2685 | for_each_sta_info(local, hdr->addr2, sta, tmp) { |
2687 | found_sta = true; | ||
2688 | |||
2689 | if (!prev_sta) { | 2686 | if (!prev_sta) { |
2690 | prev_sta = sta; | 2687 | prev_sta = sta; |
2691 | continue; | 2688 | continue; |
@@ -2707,43 +2704,40 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw, | |||
2707 | } | 2704 | } |
2708 | } | 2705 | } |
2709 | 2706 | ||
2710 | if (!found_sta) { | 2707 | prev = NULL; |
2711 | prev = NULL; | ||
2712 | |||
2713 | list_for_each_entry_rcu(sdata, &local->interfaces, list) { | ||
2714 | if (!ieee80211_sdata_running(sdata)) | ||
2715 | continue; | ||
2716 | |||
2717 | if (sdata->vif.type == NL80211_IFTYPE_MONITOR || | ||
2718 | sdata->vif.type == NL80211_IFTYPE_AP_VLAN) | ||
2719 | continue; | ||
2720 | 2708 | ||
2721 | /* | 2709 | list_for_each_entry_rcu(sdata, &local->interfaces, list) { |
2722 | * frame is destined for this interface, but if it's | 2710 | if (!ieee80211_sdata_running(sdata)) |
2723 | * not also for the previous one we handle that after | 2711 | continue; |
2724 | * the loop to avoid copying the SKB once too much | ||
2725 | */ | ||
2726 | 2712 | ||
2727 | if (!prev) { | 2713 | if (sdata->vif.type == NL80211_IFTYPE_MONITOR || |
2728 | prev = sdata; | 2714 | sdata->vif.type == NL80211_IFTYPE_AP_VLAN) |
2729 | continue; | 2715 | continue; |
2730 | } | ||
2731 | 2716 | ||
2732 | rx.sta = sta_info_get_bss(prev, hdr->addr2); | 2717 | /* |
2733 | rx.sdata = prev; | 2718 | * frame is destined for this interface, but if it's |
2734 | ieee80211_prepare_and_rx_handle(&rx, skb, false); | 2719 | * not also for the previous one we handle that after |
2720 | * the loop to avoid copying the SKB once too much | ||
2721 | */ | ||
2735 | 2722 | ||
2723 | if (!prev) { | ||
2736 | prev = sdata; | 2724 | prev = sdata; |
2725 | continue; | ||
2737 | } | 2726 | } |
2738 | 2727 | ||
2739 | if (prev) { | 2728 | rx.sta = sta_info_get_bss(prev, hdr->addr2); |
2740 | rx.sta = sta_info_get_bss(prev, hdr->addr2); | 2729 | rx.sdata = prev; |
2741 | rx.sdata = prev; | 2730 | ieee80211_prepare_and_rx_handle(&rx, skb, false); |
2742 | 2731 | ||
2743 | if (ieee80211_prepare_and_rx_handle(&rx, skb, true)) | 2732 | prev = sdata; |
2744 | return; | 2733 | } |
2745 | } | 2734 | |
2735 | if (prev) { | ||
2736 | rx.sta = sta_info_get_bss(prev, hdr->addr2); | ||
2737 | rx.sdata = prev; | ||
2746 | 2738 | ||
2739 | if (ieee80211_prepare_and_rx_handle(&rx, skb, true)) | ||
2740 | return; | ||
2747 | } | 2741 | } |
2748 | 2742 | ||
2749 | dev_kfree_skb(skb); | 2743 | dev_kfree_skb(skb); |