diff options
Diffstat (limited to 'net/mac80211/rx.c')
-rw-r--r-- | net/mac80211/rx.c | 62 |
1 files changed, 28 insertions, 34 deletions
diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c index d64e285400aa..8257a09eeed4 100644 --- a/net/mac80211/rx.c +++ b/net/mac80211/rx.c | |||
@@ -426,6 +426,7 @@ ieee80211_rx_h_passive_scan(struct ieee80211_rx_data *rx) | |||
426 | 426 | ||
427 | if (test_bit(SCAN_HW_SCANNING, &local->scanning) || | 427 | if (test_bit(SCAN_HW_SCANNING, &local->scanning) || |
428 | test_bit(SCAN_SW_SCANNING, &local->scanning) || | 428 | test_bit(SCAN_SW_SCANNING, &local->scanning) || |
429 | test_bit(SCAN_ONCHANNEL_SCANNING, &local->scanning) || | ||
429 | local->sched_scanning) | 430 | local->sched_scanning) |
430 | return ieee80211_scan_rx(rx->sdata, skb); | 431 | return ieee80211_scan_rx(rx->sdata, skb); |
431 | 432 | ||
@@ -491,12 +492,12 @@ ieee80211_rx_mesh_check(struct ieee80211_rx_data *rx) | |||
491 | if (ieee80211_has_tods(hdr->frame_control) || | 492 | if (ieee80211_has_tods(hdr->frame_control) || |
492 | !ieee80211_has_fromds(hdr->frame_control)) | 493 | !ieee80211_has_fromds(hdr->frame_control)) |
493 | return RX_DROP_MONITOR; | 494 | return RX_DROP_MONITOR; |
494 | if (compare_ether_addr(hdr->addr3, dev_addr) == 0) | 495 | if (ether_addr_equal(hdr->addr3, dev_addr)) |
495 | return RX_DROP_MONITOR; | 496 | return RX_DROP_MONITOR; |
496 | } else { | 497 | } else { |
497 | if (!ieee80211_has_a4(hdr->frame_control)) | 498 | if (!ieee80211_has_a4(hdr->frame_control)) |
498 | return RX_DROP_MONITOR; | 499 | return RX_DROP_MONITOR; |
499 | if (compare_ether_addr(hdr->addr4, dev_addr) == 0) | 500 | if (ether_addr_equal(hdr->addr4, dev_addr)) |
500 | return RX_DROP_MONITOR; | 501 | return RX_DROP_MONITOR; |
501 | } | 502 | } |
502 | } | 503 | } |
@@ -794,8 +795,7 @@ static void ieee80211_rx_reorder_ampdu(struct ieee80211_rx_data *rx) | |||
794 | 795 | ||
795 | /* reset session timer */ | 796 | /* reset session timer */ |
796 | if (tid_agg_rx->timeout) | 797 | if (tid_agg_rx->timeout) |
797 | mod_timer(&tid_agg_rx->session_timer, | 798 | tid_agg_rx->last_rx = jiffies; |
798 | TU_TO_EXP_TIME(tid_agg_rx->timeout)); | ||
799 | 799 | ||
800 | /* if this mpdu is fragmented - terminate rx aggregation session */ | 800 | /* if this mpdu is fragmented - terminate rx aggregation session */ |
801 | sc = le16_to_cpu(hdr->seq_ctrl); | 801 | sc = le16_to_cpu(hdr->seq_ctrl); |
@@ -1275,7 +1275,7 @@ ieee80211_rx_h_sta_process(struct ieee80211_rx_data *rx) | |||
1275 | if (rx->sdata->vif.type == NL80211_IFTYPE_ADHOC) { | 1275 | if (rx->sdata->vif.type == NL80211_IFTYPE_ADHOC) { |
1276 | u8 *bssid = ieee80211_get_bssid(hdr, rx->skb->len, | 1276 | u8 *bssid = ieee80211_get_bssid(hdr, rx->skb->len, |
1277 | NL80211_IFTYPE_ADHOC); | 1277 | NL80211_IFTYPE_ADHOC); |
1278 | if (compare_ether_addr(bssid, rx->sdata->u.ibss.bssid) == 0) { | 1278 | if (ether_addr_equal(bssid, rx->sdata->u.ibss.bssid)) { |
1279 | sta->last_rx = jiffies; | 1279 | sta->last_rx = jiffies; |
1280 | if (ieee80211_is_data(hdr->frame_control)) { | 1280 | if (ieee80211_is_data(hdr->frame_control)) { |
1281 | sta->last_rx_rate_idx = status->rate_idx; | 1281 | sta->last_rx_rate_idx = status->rate_idx; |
@@ -1438,8 +1438,8 @@ ieee80211_reassemble_find(struct ieee80211_sub_if_data *sdata, | |||
1438 | */ | 1438 | */ |
1439 | if (((hdr->frame_control ^ f_hdr->frame_control) & | 1439 | if (((hdr->frame_control ^ f_hdr->frame_control) & |
1440 | cpu_to_le16(IEEE80211_FCTL_FTYPE)) || | 1440 | cpu_to_le16(IEEE80211_FCTL_FTYPE)) || |
1441 | compare_ether_addr(hdr->addr1, f_hdr->addr1) != 0 || | 1441 | !ether_addr_equal(hdr->addr1, f_hdr->addr1) || |
1442 | compare_ether_addr(hdr->addr2, f_hdr->addr2) != 0) | 1442 | !ether_addr_equal(hdr->addr2, f_hdr->addr2)) |
1443 | continue; | 1443 | continue; |
1444 | 1444 | ||
1445 | if (time_after(jiffies, entry->first_frag_time + 2 * HZ)) { | 1445 | if (time_after(jiffies, entry->first_frag_time + 2 * HZ)) { |
@@ -1714,8 +1714,8 @@ static bool ieee80211_frame_allowed(struct ieee80211_rx_data *rx, __le16 fc) | |||
1714 | * of whether the frame was encrypted or not. | 1714 | * of whether the frame was encrypted or not. |
1715 | */ | 1715 | */ |
1716 | if (ehdr->h_proto == rx->sdata->control_port_protocol && | 1716 | if (ehdr->h_proto == rx->sdata->control_port_protocol && |
1717 | (compare_ether_addr(ehdr->h_dest, rx->sdata->vif.addr) == 0 || | 1717 | (ether_addr_equal(ehdr->h_dest, rx->sdata->vif.addr) || |
1718 | compare_ether_addr(ehdr->h_dest, pae_group_addr) == 0)) | 1718 | ether_addr_equal(ehdr->h_dest, pae_group_addr))) |
1719 | return true; | 1719 | return true; |
1720 | 1720 | ||
1721 | if (ieee80211_802_1x_port_control(rx) || | 1721 | if (ieee80211_802_1x_port_control(rx) || |
@@ -1752,9 +1752,9 @@ ieee80211_deliver_skb(struct ieee80211_rx_data *rx) | |||
1752 | * local net stack and back to the wireless medium | 1752 | * local net stack and back to the wireless medium |
1753 | */ | 1753 | */ |
1754 | xmit_skb = skb_copy(skb, GFP_ATOMIC); | 1754 | xmit_skb = skb_copy(skb, GFP_ATOMIC); |
1755 | if (!xmit_skb && net_ratelimit()) | 1755 | if (!xmit_skb) |
1756 | printk(KERN_DEBUG "%s: failed to clone " | 1756 | net_dbg_ratelimited("%s: failed to clone multicast frame\n", |
1757 | "multicast frame\n", dev->name); | 1757 | dev->name); |
1758 | } else { | 1758 | } else { |
1759 | dsta = sta_info_get(sdata, skb->data); | 1759 | dsta = sta_info_get(sdata, skb->data); |
1760 | if (dsta) { | 1760 | if (dsta) { |
@@ -1925,7 +1925,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) | |||
1925 | mpp_path_add(proxied_addr, mpp_addr, sdata); | 1925 | mpp_path_add(proxied_addr, mpp_addr, sdata); |
1926 | } else { | 1926 | } else { |
1927 | spin_lock_bh(&mppath->state_lock); | 1927 | spin_lock_bh(&mppath->state_lock); |
1928 | if (compare_ether_addr(mppath->mpp, mpp_addr) != 0) | 1928 | if (!ether_addr_equal(mppath->mpp, mpp_addr)) |
1929 | memcpy(mppath->mpp, mpp_addr, ETH_ALEN); | 1929 | memcpy(mppath->mpp, mpp_addr, ETH_ALEN); |
1930 | spin_unlock_bh(&mppath->state_lock); | 1930 | spin_unlock_bh(&mppath->state_lock); |
1931 | } | 1931 | } |
@@ -1934,7 +1934,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) | |||
1934 | 1934 | ||
1935 | /* Frame has reached destination. Don't forward */ | 1935 | /* Frame has reached destination. Don't forward */ |
1936 | if (!is_multicast_ether_addr(hdr->addr1) && | 1936 | if (!is_multicast_ether_addr(hdr->addr1) && |
1937 | compare_ether_addr(sdata->vif.addr, hdr->addr3) == 0) | 1937 | ether_addr_equal(sdata->vif.addr, hdr->addr3)) |
1938 | return RX_CONTINUE; | 1938 | return RX_CONTINUE; |
1939 | 1939 | ||
1940 | q = ieee80211_select_queue_80211(local, skb, hdr); | 1940 | q = ieee80211_select_queue_80211(local, skb, hdr); |
@@ -1957,9 +1957,8 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) | |||
1957 | 1957 | ||
1958 | fwd_skb = skb_copy(skb, GFP_ATOMIC); | 1958 | fwd_skb = skb_copy(skb, GFP_ATOMIC); |
1959 | if (!fwd_skb) { | 1959 | if (!fwd_skb) { |
1960 | if (net_ratelimit()) | 1960 | net_dbg_ratelimited("%s: failed to clone mesh frame\n", |
1961 | printk(KERN_DEBUG "%s: failed to clone mesh frame\n", | 1961 | sdata->name); |
1962 | sdata->name); | ||
1963 | goto out; | 1962 | goto out; |
1964 | } | 1963 | } |
1965 | 1964 | ||
@@ -2122,13 +2121,13 @@ static void ieee80211_process_sa_query_req(struct ieee80211_sub_if_data *sdata, | |||
2122 | struct sk_buff *skb; | 2121 | struct sk_buff *skb; |
2123 | struct ieee80211_mgmt *resp; | 2122 | struct ieee80211_mgmt *resp; |
2124 | 2123 | ||
2125 | if (compare_ether_addr(mgmt->da, sdata->vif.addr) != 0) { | 2124 | if (!ether_addr_equal(mgmt->da, sdata->vif.addr)) { |
2126 | /* Not to own unicast address */ | 2125 | /* Not to own unicast address */ |
2127 | return; | 2126 | return; |
2128 | } | 2127 | } |
2129 | 2128 | ||
2130 | if (compare_ether_addr(mgmt->sa, sdata->u.mgd.bssid) != 0 || | 2129 | if (!ether_addr_equal(mgmt->sa, sdata->u.mgd.bssid) || |
2131 | compare_ether_addr(mgmt->bssid, sdata->u.mgd.bssid) != 0) { | 2130 | !ether_addr_equal(mgmt->bssid, sdata->u.mgd.bssid)) { |
2132 | /* Not from the current AP or not associated yet. */ | 2131 | /* Not from the current AP or not associated yet. */ |
2133 | return; | 2132 | return; |
2134 | } | 2133 | } |
@@ -2270,11 +2269,8 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) | |||
2270 | 2269 | ||
2271 | sband = rx->local->hw.wiphy->bands[status->band]; | 2270 | sband = rx->local->hw.wiphy->bands[status->band]; |
2272 | 2271 | ||
2273 | rate_control_rate_update( | 2272 | rate_control_rate_update(local, sband, rx->sta, |
2274 | local, sband, rx->sta, | 2273 | IEEE80211_RC_SMPS_CHANGED); |
2275 | IEEE80211_RC_SMPS_CHANGED, | ||
2276 | ieee80211_get_tx_channel_type( | ||
2277 | local, local->_oper_channel_type)); | ||
2278 | goto handled; | 2274 | goto handled; |
2279 | } | 2275 | } |
2280 | default: | 2276 | default: |
@@ -2341,7 +2337,7 @@ ieee80211_rx_h_action(struct ieee80211_rx_data *rx) | |||
2341 | if (sdata->vif.type != NL80211_IFTYPE_STATION) | 2337 | if (sdata->vif.type != NL80211_IFTYPE_STATION) |
2342 | break; | 2338 | break; |
2343 | 2339 | ||
2344 | if (compare_ether_addr(mgmt->bssid, sdata->u.mgd.bssid)) | 2340 | if (!ether_addr_equal(mgmt->bssid, sdata->u.mgd.bssid)) |
2345 | break; | 2341 | break; |
2346 | 2342 | ||
2347 | goto queue; | 2343 | goto queue; |
@@ -2775,7 +2771,7 @@ static int prepare_for_handlers(struct ieee80211_rx_data *rx, | |||
2775 | if (!bssid && !sdata->u.mgd.use_4addr) | 2771 | if (!bssid && !sdata->u.mgd.use_4addr) |
2776 | return 0; | 2772 | return 0; |
2777 | if (!multicast && | 2773 | if (!multicast && |
2778 | compare_ether_addr(sdata->vif.addr, hdr->addr1) != 0) { | 2774 | !ether_addr_equal(sdata->vif.addr, hdr->addr1)) { |
2779 | if (!(sdata->dev->flags & IFF_PROMISC) || | 2775 | if (!(sdata->dev->flags & IFF_PROMISC) || |
2780 | sdata->u.mgd.use_4addr) | 2776 | sdata->u.mgd.use_4addr) |
2781 | return 0; | 2777 | return 0; |
@@ -2793,8 +2789,7 @@ static int prepare_for_handlers(struct ieee80211_rx_data *rx, | |||
2793 | return 0; | 2789 | return 0; |
2794 | status->rx_flags &= ~IEEE80211_RX_RA_MATCH; | 2790 | status->rx_flags &= ~IEEE80211_RX_RA_MATCH; |
2795 | } else if (!multicast && | 2791 | } else if (!multicast && |
2796 | compare_ether_addr(sdata->vif.addr, | 2792 | !ether_addr_equal(sdata->vif.addr, hdr->addr1)) { |
2797 | hdr->addr1) != 0) { | ||
2798 | if (!(sdata->dev->flags & IFF_PROMISC)) | 2793 | if (!(sdata->dev->flags & IFF_PROMISC)) |
2799 | return 0; | 2794 | return 0; |
2800 | status->rx_flags &= ~IEEE80211_RX_RA_MATCH; | 2795 | status->rx_flags &= ~IEEE80211_RX_RA_MATCH; |
@@ -2810,8 +2805,7 @@ static int prepare_for_handlers(struct ieee80211_rx_data *rx, | |||
2810 | break; | 2805 | break; |
2811 | case NL80211_IFTYPE_MESH_POINT: | 2806 | case NL80211_IFTYPE_MESH_POINT: |
2812 | if (!multicast && | 2807 | if (!multicast && |
2813 | compare_ether_addr(sdata->vif.addr, | 2808 | !ether_addr_equal(sdata->vif.addr, hdr->addr1)) { |
2814 | hdr->addr1) != 0) { | ||
2815 | if (!(sdata->dev->flags & IFF_PROMISC)) | 2809 | if (!(sdata->dev->flags & IFF_PROMISC)) |
2816 | return 0; | 2810 | return 0; |
2817 | 2811 | ||
@@ -2821,8 +2815,7 @@ static int prepare_for_handlers(struct ieee80211_rx_data *rx, | |||
2821 | case NL80211_IFTYPE_AP_VLAN: | 2815 | case NL80211_IFTYPE_AP_VLAN: |
2822 | case NL80211_IFTYPE_AP: | 2816 | case NL80211_IFTYPE_AP: |
2823 | if (!bssid) { | 2817 | if (!bssid) { |
2824 | if (compare_ether_addr(sdata->vif.addr, | 2818 | if (!ether_addr_equal(sdata->vif.addr, hdr->addr1)) |
2825 | hdr->addr1)) | ||
2826 | return 0; | 2819 | return 0; |
2827 | } else if (!ieee80211_bssid_match(bssid, | 2820 | } else if (!ieee80211_bssid_match(bssid, |
2828 | sdata->vif.addr)) { | 2821 | sdata->vif.addr)) { |
@@ -2844,7 +2837,7 @@ static int prepare_for_handlers(struct ieee80211_rx_data *rx, | |||
2844 | case NL80211_IFTYPE_WDS: | 2837 | case NL80211_IFTYPE_WDS: |
2845 | if (bssid || !ieee80211_is_data(hdr->frame_control)) | 2838 | if (bssid || !ieee80211_is_data(hdr->frame_control)) |
2846 | return 0; | 2839 | return 0; |
2847 | if (compare_ether_addr(sdata->u.wds.remote_addr, hdr->addr2)) | 2840 | if (!ether_addr_equal(sdata->u.wds.remote_addr, hdr->addr2)) |
2848 | return 0; | 2841 | return 0; |
2849 | break; | 2842 | break; |
2850 | default: | 2843 | default: |
@@ -2921,6 +2914,7 @@ static void __ieee80211_rx_handle_packet(struct ieee80211_hw *hw, | |||
2921 | local->dot11ReceivedFragmentCount++; | 2914 | local->dot11ReceivedFragmentCount++; |
2922 | 2915 | ||
2923 | if (unlikely(test_bit(SCAN_HW_SCANNING, &local->scanning) || | 2916 | if (unlikely(test_bit(SCAN_HW_SCANNING, &local->scanning) || |
2917 | test_bit(SCAN_ONCHANNEL_SCANNING, &local->scanning) || | ||
2924 | test_bit(SCAN_SW_SCANNING, &local->scanning))) | 2918 | test_bit(SCAN_SW_SCANNING, &local->scanning))) |
2925 | status->rx_flags |= IEEE80211_RX_IN_SCAN; | 2919 | status->rx_flags |= IEEE80211_RX_IN_SCAN; |
2926 | 2920 | ||