Lines Matching refs:rx

875 static void ieee80211_parse_qos(struct ieee80211_rx_data *rx)  in ieee80211_parse_qos()  argument
877 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; in ieee80211_parse_qos()
878 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); in ieee80211_parse_qos()
910 rx->seqno_idx = seqno_idx; in ieee80211_parse_qos()
911 rx->security_idx = security_idx; in ieee80211_parse_qos()
914 rx->skb->priority = (tid > 7) ? 0 : tid; in ieee80211_parse_qos()
942 static void ieee80211_verify_alignment(struct ieee80211_rx_data *rx) in ieee80211_verify_alignment() argument
945 WARN_ON_ONCE((unsigned long)rx->skb->data & 1); in ieee80211_verify_alignment()
1022 static ieee80211_rx_result ieee80211_rx_mesh_check(struct ieee80211_rx_data *rx) in ieee80211_rx_mesh_check() argument
1024 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; in ieee80211_rx_mesh_check()
1025 char *dev_addr = rx->sdata->vif.addr; in ieee80211_rx_mesh_check()
1046 if (!rx->sta || sta_plink_state(rx->sta) != NL80211_PLINK_ESTAB) { in ieee80211_rx_mesh_check()
1056 if (rx->skb->len < IEEE80211_MIN_ACTION_SIZE) in ieee80211_rx_mesh_check()
1337 static void ieee80211_rx_reorder_ampdu(struct ieee80211_rx_data *rx, in ieee80211_rx_reorder_ampdu() argument
1340 struct sk_buff *skb = rx->skb; in ieee80211_rx_reorder_ampdu()
1342 struct sta_info *sta = rx->sta; in ieee80211_rx_reorder_ampdu()
1366 !test_bit(tid, rx->sta->ampdu_mlme.agg_session_valid) && in ieee80211_rx_reorder_ampdu()
1367 !test_and_set_bit(tid, rx->sta->ampdu_mlme.unexpected_agg)) in ieee80211_rx_reorder_ampdu()
1368 ieee80211_send_delba(rx->sdata, rx->sta->sta.addr, tid, in ieee80211_rx_reorder_ampdu()
1391 ieee80211_queue_skb_to_iface(rx->sdata, rx->link_id, NULL, skb); in ieee80211_rx_reorder_ampdu()
1402 if (ieee80211_sta_manage_reorder_buf(rx->sdata, tid_agg_rx, skb, in ieee80211_rx_reorder_ampdu()
1411 ieee80211_rx_h_check_dup(struct ieee80211_rx_data *rx) in ieee80211_rx_h_check_dup() argument
1413 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; in ieee80211_rx_h_check_dup()
1414 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); in ieee80211_rx_h_check_dup()
1424 if (rx->skb->len < 24) in ieee80211_rx_h_check_dup()
1432 if (!rx->sta) in ieee80211_rx_h_check_dup()
1436 rx->sta->last_seq_ctrl[rx->seqno_idx] == hdr->seq_ctrl)) { in ieee80211_rx_h_check_dup()
1437 I802_DEBUG_INC(rx->local->dot11FrameDuplicateCount); in ieee80211_rx_h_check_dup()
1438 rx->link_sta->rx_stats.num_duplicates++; in ieee80211_rx_h_check_dup()
1441 rx->sta->last_seq_ctrl[rx->seqno_idx] = hdr->seq_ctrl; in ieee80211_rx_h_check_dup()
1448 ieee80211_rx_h_check(struct ieee80211_rx_data *rx) in ieee80211_rx_h_check() argument
1450 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; in ieee80211_rx_h_check()
1461 if (ieee80211_vif_is_mesh(&rx->sdata->vif)) in ieee80211_rx_h_check()
1462 return ieee80211_rx_mesh_check(rx); in ieee80211_rx_h_check()
1466 rx->sdata->vif.type != NL80211_IFTYPE_ADHOC && in ieee80211_rx_h_check()
1467 rx->sdata->vif.type != NL80211_IFTYPE_OCB && in ieee80211_rx_h_check()
1468 (!rx->sta || !test_sta_flag(rx->sta, WLAN_STA_ASSOC)))) { in ieee80211_rx_h_check()
1474 if (rx->sta && rx->sdata->vif.type == NL80211_IFTYPE_STATION && in ieee80211_rx_h_check()
1481 if (rx->skb->len < hdrlen + 8) in ieee80211_rx_h_check()
1484 skb_copy_bits(rx->skb, hdrlen + 6, &ethertype, 2); in ieee80211_rx_h_check()
1485 if (ethertype == rx->sdata->control_port_protocol) in ieee80211_rx_h_check()
1489 if (rx->sdata->vif.type == NL80211_IFTYPE_AP && in ieee80211_rx_h_check()
1490 cfg80211_rx_spurious_frame(rx->sdata->dev, in ieee80211_rx_h_check()
1503 ieee80211_rx_h_check_more_data(struct ieee80211_rx_data *rx) in ieee80211_rx_h_check_more_data() argument
1509 local = rx->local; in ieee80211_rx_h_check_more_data()
1510 skb = rx->skb; in ieee80211_rx_h_check_more_data()
1530 ieee80211_send_pspoll(local, rx->sdata); in ieee80211_rx_h_check_more_data()
1660 ieee80211_rx_h_uapsd_and_pspoll(struct ieee80211_rx_data *rx) in ieee80211_rx_h_uapsd_and_pspoll() argument
1662 struct ieee80211_sub_if_data *sdata = rx->sdata; in ieee80211_rx_h_uapsd_and_pspoll()
1663 struct ieee80211_hdr *hdr = (void *)rx->skb->data; in ieee80211_rx_h_uapsd_and_pspoll()
1664 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); in ieee80211_rx_h_uapsd_and_pspoll()
1666 if (!rx->sta) in ieee80211_rx_h_uapsd_and_pspoll()
1686 if (!test_sta_flag(rx->sta, WLAN_STA_PS_STA)) in ieee80211_rx_h_uapsd_and_pspoll()
1690 ieee80211_sta_pspoll(&rx->sta->sta); in ieee80211_rx_h_uapsd_and_pspoll()
1694 dev_kfree_skb(rx->skb); in ieee80211_rx_h_uapsd_and_pspoll()
1704 ieee80211_sta_uapsd_trigger(&rx->sta->sta, tid); in ieee80211_rx_h_uapsd_and_pspoll()
1711 ieee80211_rx_h_sta_process(struct ieee80211_rx_data *rx) in ieee80211_rx_h_sta_process() argument
1713 struct sta_info *sta = rx->sta; in ieee80211_rx_h_sta_process()
1714 struct link_sta_info *link_sta = rx->link_sta; in ieee80211_rx_h_sta_process()
1715 struct sk_buff *skb = rx->skb; in ieee80211_rx_h_sta_process()
1731 if (rx->sdata->vif.type == NL80211_IFTYPE_ADHOC) { in ieee80211_rx_h_sta_process()
1732 u8 *bssid = ieee80211_get_bssid(hdr, rx->skb->len, in ieee80211_rx_h_sta_process()
1734 if (ether_addr_equal(bssid, rx->sdata->u.ibss.bssid) && in ieee80211_rx_h_sta_process()
1742 } else if (rx->sdata->vif.type == NL80211_IFTYPE_OCB) { in ieee80211_rx_h_sta_process()
1758 link_sta->rx_stats.bytes += rx->skb->len; in ieee80211_rx_h_sta_process()
1795 (rx->sdata->vif.type == NL80211_IFTYPE_AP || in ieee80211_rx_h_sta_process()
1796 rx->sdata->vif.type == NL80211_IFTYPE_AP_VLAN)) { in ieee80211_rx_h_sta_process()
1807 if (ieee80211_vif_is_mesh(&rx->sdata->vif)) in ieee80211_rx_h_sta_process()
1815 I802_DEBUG_INC(rx->local->rx_handlers_drop_nullfunc); in ieee80211_rx_h_sta_process()
1824 (rx->sdata->vif.type == NL80211_IFTYPE_AP || in ieee80211_rx_h_sta_process()
1825 (rx->sdata->vif.type == NL80211_IFTYPE_AP_VLAN && in ieee80211_rx_h_sta_process()
1826 !rx->sdata->u.vlan.sta))) { in ieee80211_rx_h_sta_process()
1829 rx->sdata->dev, sta->sta.addr, in ieee80211_rx_h_sta_process()
1838 dev_kfree_skb(rx->skb); in ieee80211_rx_h_sta_process()
1846 ieee80211_rx_get_bigtk(struct ieee80211_rx_data *rx, int idx) in ieee80211_rx_get_bigtk() argument
1867 if (rx->link_sta) in ieee80211_rx_get_bigtk()
1868 key = rcu_dereference(rx->link_sta->gtk[idx]); in ieee80211_rx_get_bigtk()
1870 key = rcu_dereference(rx->link->gtk[idx]); in ieee80211_rx_get_bigtk()
1871 if (!key && rx->link_sta) in ieee80211_rx_get_bigtk()
1872 key = rcu_dereference(rx->link_sta->gtk[idx2]); in ieee80211_rx_get_bigtk()
1874 key = rcu_dereference(rx->link->gtk[idx2]); in ieee80211_rx_get_bigtk()
1880 ieee80211_rx_h_decrypt(struct ieee80211_rx_data *rx) in ieee80211_rx_h_decrypt() argument
1882 struct sk_buff *skb = rx->skb; in ieee80211_rx_h_decrypt()
1924 rx->key = NULL; in ieee80211_rx_h_decrypt()
1927 if (rx->sta) { in ieee80211_rx_h_decrypt()
1928 int keyid = rx->sta->ptk_idx; in ieee80211_rx_h_decrypt()
1929 sta_ptk = rcu_dereference(rx->sta->ptk[keyid]); in ieee80211_rx_h_decrypt()
1933 keyid = ieee80211_get_keyid(rx->skb); in ieee80211_rx_h_decrypt()
1938 ptk_idx = rcu_dereference(rx->sta->ptk[keyid]); in ieee80211_rx_h_decrypt()
1943 mmie_keyidx = ieee80211_get_mmie_keyidx(rx->skb); in ieee80211_rx_h_decrypt()
1946 rx->key = ptk_idx ? ptk_idx : sta_ptk; in ieee80211_rx_h_decrypt()
1962 if (rx->sdata->dev) in ieee80211_rx_h_decrypt()
1963 cfg80211_rx_unprot_mlme_mgmt(rx->sdata->dev, in ieee80211_rx_h_decrypt()
1969 rx->key = ieee80211_rx_get_bigtk(rx, mmie_keyidx); in ieee80211_rx_h_decrypt()
1970 if (!rx->key) in ieee80211_rx_h_decrypt()
1981 if (rx->link_sta) { in ieee80211_rx_h_decrypt()
1983 test_sta_flag(rx->sta, WLAN_STA_MFP)) in ieee80211_rx_h_decrypt()
1986 rx->key = rcu_dereference(rx->link_sta->gtk[mmie_keyidx]); in ieee80211_rx_h_decrypt()
1988 if (!rx->key) in ieee80211_rx_h_decrypt()
1989 rx->key = rcu_dereference(rx->link->gtk[mmie_keyidx]); in ieee80211_rx_h_decrypt()
2001 key = ieee80211_rx_get_bigtk(rx, -1); in ieee80211_rx_h_decrypt()
2004 key = rcu_dereference(rx->link->default_mgmt_key); in ieee80211_rx_h_decrypt()
2006 if (rx->link_sta) { in ieee80211_rx_h_decrypt()
2008 key = rcu_dereference(rx->link_sta->gtk[i]); in ieee80211_rx_h_decrypt()
2015 key = rcu_dereference(rx->link->gtk[i]); in ieee80211_rx_h_decrypt()
2022 rx->key = key; in ieee80211_rx_h_decrypt()
2038 keyidx = ieee80211_get_keyid(rx->skb); in ieee80211_rx_h_decrypt()
2044 if (is_multicast_ether_addr(hdr->addr1) && rx->link_sta) in ieee80211_rx_h_decrypt()
2045 rx->key = rcu_dereference(rx->link_sta->gtk[keyidx]); in ieee80211_rx_h_decrypt()
2048 if (!rx->key) { in ieee80211_rx_h_decrypt()
2050 rx->key = rcu_dereference(rx->link->gtk[keyidx]); in ieee80211_rx_h_decrypt()
2051 if (!rx->key) in ieee80211_rx_h_decrypt()
2052 rx->key = rcu_dereference(rx->sdata->keys[keyidx]); in ieee80211_rx_h_decrypt()
2059 if (rx->key && in ieee80211_rx_h_decrypt()
2060 rx->key->conf.cipher != WLAN_CIPHER_SUITE_WEP40 && in ieee80211_rx_h_decrypt()
2061 rx->key->conf.cipher != WLAN_CIPHER_SUITE_WEP104 && in ieee80211_rx_h_decrypt()
2063 rx->key = NULL; in ieee80211_rx_h_decrypt()
2067 if (rx->key) { in ieee80211_rx_h_decrypt()
2068 if (unlikely(rx->key->flags & KEY_FLAG_TAINTED)) in ieee80211_rx_h_decrypt()
2076 switch (rx->key->conf.cipher) { in ieee80211_rx_h_decrypt()
2079 result = ieee80211_crypto_wep_decrypt(rx); in ieee80211_rx_h_decrypt()
2082 result = ieee80211_crypto_tkip_decrypt(rx); in ieee80211_rx_h_decrypt()
2086 rx, IEEE80211_CCMP_MIC_LEN); in ieee80211_rx_h_decrypt()
2090 rx, IEEE80211_CCMP_256_MIC_LEN); in ieee80211_rx_h_decrypt()
2093 result = ieee80211_crypto_aes_cmac_decrypt(rx); in ieee80211_rx_h_decrypt()
2096 result = ieee80211_crypto_aes_cmac_256_decrypt(rx); in ieee80211_rx_h_decrypt()
2100 result = ieee80211_crypto_aes_gmac_decrypt(rx); in ieee80211_rx_h_decrypt()
2104 result = ieee80211_crypto_gcmp_decrypt(rx); in ieee80211_rx_h_decrypt()
2116 rx->sdata->dev)) in ieee80211_rx_h_decrypt()
2117 cfg80211_rx_unprot_mlme_mgmt(rx->sdata->dev, in ieee80211_rx_h_decrypt()
2209 static bool requires_sequential_pn(struct ieee80211_rx_data *rx, __le16 fc) in requires_sequential_pn() argument
2211 return rx->key && in requires_sequential_pn()
2212 (rx->key->conf.cipher == WLAN_CIPHER_SUITE_CCMP || in requires_sequential_pn()
2213 rx->key->conf.cipher == WLAN_CIPHER_SUITE_CCMP_256 || in requires_sequential_pn()
2214 rx->key->conf.cipher == WLAN_CIPHER_SUITE_GCMP || in requires_sequential_pn()
2215 rx->key->conf.cipher == WLAN_CIPHER_SUITE_GCMP_256) && in requires_sequential_pn()
2220 ieee80211_rx_h_defragment(struct ieee80211_rx_data *rx) in ieee80211_rx_h_defragment() argument
2222 struct ieee80211_fragment_cache *cache = &rx->sdata->frags; in ieee80211_rx_h_defragment()
2229 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); in ieee80211_rx_h_defragment()
2231 hdr = (struct ieee80211_hdr *)rx->skb->data; in ieee80211_rx_h_defragment()
2240 if (rx->sta) in ieee80211_rx_h_defragment()
2241 cache = &rx->sta->frags; in ieee80211_rx_h_defragment()
2249 I802_DEBUG_INC(rx->local->rx_handlers_fragments); in ieee80211_rx_h_defragment()
2251 if (skb_linearize(rx->skb)) in ieee80211_rx_h_defragment()
2259 hdr = (struct ieee80211_hdr *)rx->skb->data; in ieee80211_rx_h_defragment()
2265 rx->seqno_idx, &(rx->skb)); in ieee80211_rx_h_defragment()
2266 if (requires_sequential_pn(rx, fc)) { in ieee80211_rx_h_defragment()
2267 int queue = rx->security_idx; in ieee80211_rx_h_defragment()
2274 entry->key_color = rx->key->color; in ieee80211_rx_h_defragment()
2276 rx->key->u.ccmp.rx_pn[queue], in ieee80211_rx_h_defragment()
2282 BUILD_BUG_ON(sizeof(rx->key->u.ccmp.rx_pn[queue]) != in ieee80211_rx_h_defragment()
2283 sizeof(rx->key->u.gcmp.rx_pn[queue])); in ieee80211_rx_h_defragment()
2286 } else if (rx->key && in ieee80211_rx_h_defragment()
2290 entry->key_color = rx->key->color; in ieee80211_rx_h_defragment()
2299 rx->seqno_idx, hdr); in ieee80211_rx_h_defragment()
2301 I802_DEBUG_INC(rx->local->rx_handlers_drop_defrag); in ieee80211_rx_h_defragment()
2314 if (!requires_sequential_pn(rx, fc)) in ieee80211_rx_h_defragment()
2318 if (entry->key_color != rx->key->color) in ieee80211_rx_h_defragment()
2328 rpn = rx->ccm_gcm.pn; in ieee80211_rx_h_defragment()
2333 (!rx->key || in ieee80211_rx_h_defragment()
2336 rx->key->color != entry->key_color)) { in ieee80211_rx_h_defragment()
2342 } else if (entry->is_protected && rx->key && in ieee80211_rx_h_defragment()
2343 entry->key_color != rx->key->color && in ieee80211_rx_h_defragment()
2348 skb_pull(rx->skb, ieee80211_hdrlen(fc)); in ieee80211_rx_h_defragment()
2349 __skb_queue_tail(&entry->skb_list, rx->skb); in ieee80211_rx_h_defragment()
2351 entry->extra_len += rx->skb->len; in ieee80211_rx_h_defragment()
2353 rx->skb = NULL; in ieee80211_rx_h_defragment()
2357 rx->skb = __skb_dequeue(&entry->skb_list); in ieee80211_rx_h_defragment()
2358 if (skb_tailroom(rx->skb) < entry->extra_len) { in ieee80211_rx_h_defragment()
2359 I802_DEBUG_INC(rx->local->rx_expand_skb_head_defrag); in ieee80211_rx_h_defragment()
2360 if (unlikely(pskb_expand_head(rx->skb, 0, entry->extra_len, in ieee80211_rx_h_defragment()
2362 I802_DEBUG_INC(rx->local->rx_handlers_drop_defrag); in ieee80211_rx_h_defragment()
2368 skb_put_data(rx->skb, skb->data, skb->len); in ieee80211_rx_h_defragment()
2373 ieee80211_led_rx(rx->local); in ieee80211_rx_h_defragment()
2374 if (rx->sta) in ieee80211_rx_h_defragment()
2375 rx->link_sta->rx_stats.packets++; in ieee80211_rx_h_defragment()
2379 static int ieee80211_802_1x_port_control(struct ieee80211_rx_data *rx) in ieee80211_802_1x_port_control() argument
2381 if (unlikely(!rx->sta || !test_sta_flag(rx->sta, WLAN_STA_AUTHORIZED))) in ieee80211_802_1x_port_control()
2387 static int ieee80211_drop_unencrypted(struct ieee80211_rx_data *rx, __le16 fc) in ieee80211_drop_unencrypted() argument
2389 struct sk_buff *skb = rx->skb; in ieee80211_drop_unencrypted()
2402 ieee80211_is_data(fc) && rx->key)) in ieee80211_drop_unencrypted()
2408 static int ieee80211_drop_unencrypted_mgmt(struct ieee80211_rx_data *rx) in ieee80211_drop_unencrypted_mgmt() argument
2410 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); in ieee80211_drop_unencrypted_mgmt()
2411 struct ieee80211_mgmt *mgmt = (void *)rx->skb->data; in ieee80211_drop_unencrypted_mgmt()
2426 if (rx->sta && test_sta_flag(rx->sta, WLAN_STA_MFP)) { in ieee80211_drop_unencrypted_mgmt()
2428 ieee80211_is_unicast_robust_mgmt_frame(rx->skb))) { in ieee80211_drop_unencrypted_mgmt()
2435 if (!rx->key) in ieee80211_drop_unencrypted_mgmt()
2438 cfg80211_rx_unprot_mlme_mgmt(rx->sdata->dev, in ieee80211_drop_unencrypted_mgmt()
2439 rx->skb->data, in ieee80211_drop_unencrypted_mgmt()
2440 rx->skb->len); in ieee80211_drop_unencrypted_mgmt()
2445 if (unlikely(ieee80211_is_multicast_robust_mgmt_frame(rx->skb) && in ieee80211_drop_unencrypted_mgmt()
2446 ieee80211_get_mmie_keyidx(rx->skb) < 0)) { in ieee80211_drop_unencrypted_mgmt()
2449 cfg80211_rx_unprot_mlme_mgmt(rx->sdata->dev, in ieee80211_drop_unencrypted_mgmt()
2450 rx->skb->data, in ieee80211_drop_unencrypted_mgmt()
2451 rx->skb->len); in ieee80211_drop_unencrypted_mgmt()
2454 if (unlikely(ieee80211_is_beacon(fc) && rx->key && in ieee80211_drop_unencrypted_mgmt()
2455 ieee80211_get_mmie_keyidx(rx->skb) < 0)) { in ieee80211_drop_unencrypted_mgmt()
2456 cfg80211_rx_unprot_mlme_mgmt(rx->sdata->dev, in ieee80211_drop_unencrypted_mgmt()
2457 rx->skb->data, in ieee80211_drop_unencrypted_mgmt()
2458 rx->skb->len); in ieee80211_drop_unencrypted_mgmt()
2465 if (unlikely(ieee80211_is_action(fc) && !rx->key && in ieee80211_drop_unencrypted_mgmt()
2466 ieee80211_is_robust_mgmt_frame(rx->skb))) in ieee80211_drop_unencrypted_mgmt()
2471 ieee80211_is_protected_dual_of_public_action(rx->skb)) in ieee80211_drop_unencrypted_mgmt()
2479 __ieee80211_data_to_8023(struct ieee80211_rx_data *rx, bool *port_control) in __ieee80211_data_to_8023() argument
2481 struct ieee80211_sub_if_data *sdata = rx->sdata; in __ieee80211_data_to_8023()
2482 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; in __ieee80211_data_to_8023()
2505 ret = ieee80211_data_to_8023(rx->skb, sdata->vif.addr, sdata->vif.type); in __ieee80211_data_to_8023()
2509 ehdr = (struct ethhdr *) rx->skb->data; in __ieee80211_data_to_8023()
2510 if (ehdr->h_proto == rx->sdata->control_port_protocol) in __ieee80211_data_to_8023()
2550 static bool ieee80211_frame_allowed(struct ieee80211_rx_data *rx, __le16 fc) in ieee80211_frame_allowed() argument
2554 struct ethhdr *ehdr = (struct ethhdr *) rx->skb->data; in ieee80211_frame_allowed()
2561 if (unlikely(ehdr->h_proto == rx->sdata->control_port_protocol)) in ieee80211_frame_allowed()
2562 return ieee80211_is_our_addr(rx->sdata, ehdr->h_dest, NULL) || in ieee80211_frame_allowed()
2565 if (ieee80211_802_1x_port_control(rx) || in ieee80211_frame_allowed()
2566 ieee80211_drop_unencrypted(rx, fc)) in ieee80211_frame_allowed()
2573 struct ieee80211_rx_data *rx) in ieee80211_deliver_skb_to_local_stack() argument
2575 struct ieee80211_sub_if_data *sdata = rx->sdata; in ieee80211_deliver_skb_to_local_stack()
2585 cfg80211_rx_control_port(dev, skb, noencrypt, rx->link_id); in ieee80211_deliver_skb_to_local_stack()
2612 if (rx->list) in ieee80211_deliver_skb_to_local_stack()
2613 list_add_tail(&skb->list, rx->list); in ieee80211_deliver_skb_to_local_stack()
2623 ieee80211_deliver_skb(struct ieee80211_rx_data *rx) in ieee80211_deliver_skb() argument
2625 struct ieee80211_sub_if_data *sdata = rx->sdata; in ieee80211_deliver_skb()
2628 struct ethhdr *ehdr = (struct ethhdr *) rx->skb->data; in ieee80211_deliver_skb()
2631 skb = rx->skb; in ieee80211_deliver_skb()
2636 if (rx->sta) { in ieee80211_deliver_skb()
2642 u64_stats_update_begin(&rx->link_sta->rx_stats.syncp); in ieee80211_deliver_skb()
2643 rx->link_sta->rx_stats.msdu[rx->seqno_idx]++; in ieee80211_deliver_skb()
2644 u64_stats_update_end(&rx->link_sta->rx_stats.syncp); in ieee80211_deliver_skb()
2650 ehdr->h_proto != rx->sdata->control_port_protocol && in ieee80211_deliver_skb()
2706 ieee80211_deliver_skb_to_local_stack(skb, rx); in ieee80211_deliver_skb()
2966 __ieee80211_rx_h_amsdu(struct ieee80211_rx_data *rx, u8 data_offset) in __ieee80211_rx_h_amsdu() argument
2968 struct net_device *dev = rx->sdata->dev; in __ieee80211_rx_h_amsdu()
2969 struct sk_buff *skb = rx->skb; in __ieee80211_rx_h_amsdu()
2980 } else switch (rx->sdata->vif.type) { in __ieee80211_rx_h_amsdu()
2986 if (!rx->sta || in __ieee80211_rx_h_amsdu()
2987 !test_sta_flag(rx->sta, WLAN_STA_TDLS_PEER)) in __ieee80211_rx_h_amsdu()
3002 rx->sdata->vif.addr, in __ieee80211_rx_h_amsdu()
3003 rx->sdata->vif.type, in __ieee80211_rx_h_amsdu()
3007 if (rx->sta->amsdu_mesh_control < 0) { in __ieee80211_rx_h_amsdu()
3024 rx->sta->amsdu_mesh_control = valid; in __ieee80211_rx_h_amsdu()
3028 rx->sdata->vif.type, in __ieee80211_rx_h_amsdu()
3029 rx->local->hw.extra_tx_headroom, in __ieee80211_rx_h_amsdu()
3031 rx->sta->amsdu_mesh_control); in __ieee80211_rx_h_amsdu()
3034 rx->skb = __skb_dequeue(&frame_list); in __ieee80211_rx_h_amsdu()
3036 res = ieee80211_rx_mesh_data(rx->sdata, rx->sta, rx->skb); in __ieee80211_rx_h_amsdu()
3046 if (!ieee80211_frame_allowed(rx, fc)) in __ieee80211_rx_h_amsdu()
3049 ieee80211_deliver_skb(rx); in __ieee80211_rx_h_amsdu()
3053 dev_kfree_skb(rx->skb); in __ieee80211_rx_h_amsdu()
3060 ieee80211_rx_h_amsdu(struct ieee80211_rx_data *rx) in ieee80211_rx_h_amsdu() argument
3062 struct sk_buff *skb = rx->skb; in ieee80211_rx_h_amsdu()
3077 switch (rx->sdata->vif.type) { in ieee80211_rx_h_amsdu()
3079 if (!rx->sdata->u.vlan.sta) in ieee80211_rx_h_amsdu()
3083 if (!rx->sdata->u.mgd.use_4addr) in ieee80211_rx_h_amsdu()
3093 if (is_multicast_ether_addr(hdr->addr1) || !rx->sta) in ieee80211_rx_h_amsdu()
3096 if (rx->key) { in ieee80211_rx_h_amsdu()
3103 switch (rx->key->conf.cipher) { in ieee80211_rx_h_amsdu()
3113 return __ieee80211_rx_h_amsdu(rx, 0); in ieee80211_rx_h_amsdu()
3117 ieee80211_rx_h_data(struct ieee80211_rx_data *rx) in ieee80211_rx_h_data() argument
3119 struct ieee80211_sub_if_data *sdata = rx->sdata; in ieee80211_rx_h_data()
3120 struct ieee80211_local *local = rx->local; in ieee80211_rx_h_data()
3122 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; in ieee80211_rx_h_data()
3140 if (rx->sta && in ieee80211_rx_h_data()
3141 !test_and_set_sta_flag(rx->sta, WLAN_STA_4ADDR_EVENT)) in ieee80211_rx_h_data()
3143 rx->sdata->dev, rx->sta->sta.addr, GFP_ATOMIC); in ieee80211_rx_h_data()
3147 err = __ieee80211_data_to_8023(rx, &port_control); in ieee80211_rx_h_data()
3151 res = ieee80211_rx_mesh_data(rx->sdata, rx->sta, rx->skb); in ieee80211_rx_h_data()
3155 if (!ieee80211_frame_allowed(rx, fc)) in ieee80211_rx_h_data()
3159 if (unlikely(((struct ethhdr *)rx->skb->data)->h_proto == in ieee80211_rx_h_data()
3161 struct ieee80211_tdls_data *tf = (void *)rx->skb->data; in ieee80211_rx_h_data()
3163 if (pskb_may_pull(rx->skb, in ieee80211_rx_h_data()
3169 rx->skb->protocol = cpu_to_be16(ETH_P_TDLS); in ieee80211_rx_h_data()
3170 __ieee80211_queue_skb_to_iface(sdata, rx->link_id, in ieee80211_rx_h_data()
3171 rx->sta, rx->skb); in ieee80211_rx_h_data()
3176 if (rx->sdata->vif.type == NL80211_IFTYPE_AP_VLAN && in ieee80211_rx_h_data()
3181 rx->sdata = sdata; in ieee80211_rx_h_data()
3184 rx->skb->dev = dev; in ieee80211_rx_h_data()
3189 ((struct ethhdr *)rx->skb->data)->h_dest) && in ieee80211_rx_h_data()
3195 ieee80211_deliver_skb(rx); in ieee80211_rx_h_data()
3201 ieee80211_rx_h_ctrl(struct ieee80211_rx_data *rx, struct sk_buff_head *frames) in ieee80211_rx_h_ctrl() argument
3203 struct sk_buff *skb = rx->skb; in ieee80211_rx_h_ctrl()
3220 if (!rx->sta) in ieee80211_rx_h_ctrl()
3229 if (!test_bit(tid, rx->sta->ampdu_mlme.agg_session_valid) && in ieee80211_rx_h_ctrl()
3230 !test_and_set_bit(tid, rx->sta->ampdu_mlme.unexpected_agg)) in ieee80211_rx_h_ctrl()
3231 ieee80211_send_delba(rx->sdata, rx->sta->sta.addr, tid, in ieee80211_rx_h_ctrl()
3235 tid_agg_rx = rcu_dereference(rx->sta->ampdu_mlme.tid_rx[tid]); in ieee80211_rx_h_ctrl()
3242 event.u.ba.sta = &rx->sta->sta; in ieee80211_rx_h_ctrl()
3251 ieee80211_release_reorder_frames(rx->sdata, tid_agg_rx, in ieee80211_rx_h_ctrl()
3255 drv_event_callback(rx->local, rx->sdata, &event); in ieee80211_rx_h_ctrl()
3315 ieee80211_rx_check_bss_color_collision(struct ieee80211_rx_data *rx) in ieee80211_rx_check_bss_color_collision() argument
3317 struct ieee80211_mgmt *mgmt = (void *)rx->skb->data; in ieee80211_rx_check_bss_color_collision()
3321 if (!wiphy_ext_feature_isset(rx->local->hw.wiphy, in ieee80211_rx_check_bss_color_collision()
3325 if (ieee80211_hw_check(&rx->local->hw, DETECTS_COLOR_COLLISION)) in ieee80211_rx_check_bss_color_collision()
3328 if (rx->sdata->vif.bss_conf.csa_active) in ieee80211_rx_check_bss_color_collision()
3331 baselen = mgmt->u.beacon.variable - rx->skb->data; in ieee80211_rx_check_bss_color_collision()
3332 if (baselen > rx->skb->len) in ieee80211_rx_check_bss_color_collision()
3337 rx->skb->len - baselen); in ieee80211_rx_check_bss_color_collision()
3340 struct ieee80211_bss_conf *bss_conf = &rx->sdata->vif.bss_conf; in ieee80211_rx_check_bss_color_collision()
3352 ieee80211_obss_color_collision_notify(&rx->sdata->vif, in ieee80211_rx_check_bss_color_collision()
3359 ieee80211_rx_h_mgmt_check(struct ieee80211_rx_data *rx) in ieee80211_rx_h_mgmt_check() argument
3361 struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *) rx->skb->data; in ieee80211_rx_h_mgmt_check()
3362 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); in ieee80211_rx_h_mgmt_check()
3372 if (rx->skb->len < 24) in ieee80211_rx_h_mgmt_check()
3380 rx->skb->len < IEEE80211_MIN_ACTION_SIZE) in ieee80211_rx_h_mgmt_check()
3383 if (rx->sdata->vif.type == NL80211_IFTYPE_AP && in ieee80211_rx_h_mgmt_check()
3385 !(rx->flags & IEEE80211_RX_BEACON_REPORTED)) { in ieee80211_rx_h_mgmt_check()
3389 ieee80211_rx_check_bss_color_collision(rx); in ieee80211_rx_h_mgmt_check()
3391 if (ieee80211_hw_check(&rx->local->hw, SIGNAL_DBM) && in ieee80211_rx_h_mgmt_check()
3395 cfg80211_report_obss_beacon_khz(rx->local->hw.wiphy, in ieee80211_rx_h_mgmt_check()
3396 rx->skb->data, rx->skb->len, in ieee80211_rx_h_mgmt_check()
3399 rx->flags |= IEEE80211_RX_BEACON_REPORTED; in ieee80211_rx_h_mgmt_check()
3402 if (ieee80211_drop_unencrypted_mgmt(rx)) in ieee80211_rx_h_mgmt_check()
3409 ieee80211_process_rx_twt_action(struct ieee80211_rx_data *rx) in ieee80211_process_rx_twt_action() argument
3411 struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)rx->skb->data; in ieee80211_process_rx_twt_action()
3412 struct ieee80211_sub_if_data *sdata = rx->sdata; in ieee80211_process_rx_twt_action()
3418 if (!rx->local->ops->add_twt_setup) in ieee80211_process_rx_twt_action()
3424 if (!rx->sta) in ieee80211_process_rx_twt_action()
3431 if (rx->skb->len < IEEE80211_MIN_ACTION_SIZE + in ieee80211_process_rx_twt_action()
3441 if (rx->skb->len < IEEE80211_MIN_ACTION_SIZE + in ieee80211_process_rx_twt_action()
3449 if (rx->skb->len < IEEE80211_MIN_ACTION_SIZE + 2) in ieee80211_process_rx_twt_action()
3461 ieee80211_rx_h_action(struct ieee80211_rx_data *rx) in ieee80211_rx_h_action() argument
3463 struct ieee80211_local *local = rx->local; in ieee80211_rx_h_action()
3464 struct ieee80211_sub_if_data *sdata = rx->sdata; in ieee80211_rx_h_action()
3465 struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *) rx->skb->data; in ieee80211_rx_h_action()
3466 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); in ieee80211_rx_h_action()
3467 int len = rx->skb->len; in ieee80211_rx_h_action()
3472 if (!rx->sta && mgmt->u.action.category != WLAN_CATEGORY_PUBLIC && in ieee80211_rx_h_action()
3480 if (!rx->link_sta->pub->ht_cap.ht_supported) in ieee80211_rx_h_action()
3520 if (rx->link_sta->pub->smps_mode == smps_mode) in ieee80211_rx_h_action()
3522 rx->link_sta->pub->smps_mode = smps_mode; in ieee80211_rx_h_action()
3527 sband = rx->local->hw.wiphy->bands[status->band]; in ieee80211_rx_h_action()
3529 rate_control_rate_update(local, sband, rx->sta, 0, in ieee80211_rx_h_action()
3532 rx->sta->addr, in ieee80211_rx_h_action()
3544 if (!(rx->link_sta->pub->ht_cap.cap & in ieee80211_rx_h_action()
3551 max_bw = ieee80211_sta_cap_rx_bw(rx->link_sta); in ieee80211_rx_h_action()
3554 rx->link_sta->cur_max_bandwidth = max_bw; in ieee80211_rx_h_action()
3555 new_bw = ieee80211_sta_cur_vht_bw(rx->link_sta); in ieee80211_rx_h_action()
3557 if (rx->link_sta->pub->bandwidth == new_bw) in ieee80211_rx_h_action()
3560 rx->link_sta->pub->bandwidth = new_bw; in ieee80211_rx_h_action()
3561 sband = rx->local->hw.wiphy->bands[status->band]; in ieee80211_rx_h_action()
3563 ieee80211_sta_rx_bw_to_chan_width(rx->link_sta); in ieee80211_rx_h_action()
3566 rate_control_rate_update(local, sband, rx->sta, 0, in ieee80211_rx_h_action()
3569 rx->sta->addr, in ieee80211_rx_h_action()
3584 if (!rx->sta) in ieee80211_rx_h_action()
3743 if (ieee80211_process_rx_twt_action(rx)) in ieee80211_rx_h_action()
3760 if (rx->sta) in ieee80211_rx_h_action()
3761 rx->link_sta->rx_stats.packets++; in ieee80211_rx_h_action()
3762 dev_kfree_skb(rx->skb); in ieee80211_rx_h_action()
3766 ieee80211_queue_skb_to_iface(sdata, rx->link_id, rx->sta, rx->skb); in ieee80211_rx_h_action()
3771 ieee80211_rx_h_userspace_mgmt(struct ieee80211_rx_data *rx) in ieee80211_rx_h_userspace_mgmt() argument
3773 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); in ieee80211_rx_h_userspace_mgmt()
3776 .buf = rx->skb->data, in ieee80211_rx_h_userspace_mgmt()
3777 .len = rx->skb->len, in ieee80211_rx_h_userspace_mgmt()
3778 .link_id = rx->link_id, in ieee80211_rx_h_userspace_mgmt()
3779 .have_link_id = rx->link_id >= 0, in ieee80211_rx_h_userspace_mgmt()
3793 if (ieee80211_hw_check(&rx->local->hw, SIGNAL_DBM) && in ieee80211_rx_h_userspace_mgmt()
3797 if (ieee80211_is_timing_measurement(rx->skb) || in ieee80211_rx_h_userspace_mgmt()
3798 ieee80211_is_ftm(rx->skb)) { in ieee80211_rx_h_userspace_mgmt()
3799 info.rx_tstamp = ktime_to_ns(skb_hwtstamps(rx->skb)->hwtstamp); in ieee80211_rx_h_userspace_mgmt()
3803 if (cfg80211_rx_mgmt_ext(&rx->sdata->wdev, &info)) { in ieee80211_rx_h_userspace_mgmt()
3804 if (rx->sta) in ieee80211_rx_h_userspace_mgmt()
3805 rx->link_sta->rx_stats.packets++; in ieee80211_rx_h_userspace_mgmt()
3806 dev_kfree_skb(rx->skb); in ieee80211_rx_h_userspace_mgmt()
3814 ieee80211_rx_h_action_post_userspace(struct ieee80211_rx_data *rx) in ieee80211_rx_h_action_post_userspace() argument
3816 struct ieee80211_sub_if_data *sdata = rx->sdata; in ieee80211_rx_h_action_post_userspace()
3817 struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *) rx->skb->data; in ieee80211_rx_h_action_post_userspace()
3818 int len = rx->skb->len; in ieee80211_rx_h_action_post_userspace()
3842 if (rx->sta) in ieee80211_rx_h_action_post_userspace()
3843 rx->link_sta->rx_stats.packets++; in ieee80211_rx_h_action_post_userspace()
3844 dev_kfree_skb(rx->skb); in ieee80211_rx_h_action_post_userspace()
3849 ieee80211_rx_h_action_return(struct ieee80211_rx_data *rx) in ieee80211_rx_h_action_return() argument
3851 struct ieee80211_local *local = rx->local; in ieee80211_rx_h_action_return()
3852 struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *) rx->skb->data; in ieee80211_rx_h_action_return()
3854 struct ieee80211_sub_if_data *sdata = rx->sdata; in ieee80211_rx_h_action_return()
3855 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); in ieee80211_rx_h_action_return()
3882 nskb = skb_copy_expand(rx->skb, local->hw.extra_tx_headroom, 0, in ieee80211_rx_h_action_return()
3889 memcpy(nmgmt->sa, rx->sdata->vif.addr, ETH_ALEN); in ieee80211_rx_h_action_return()
3893 if (rx->sdata->vif.type == NL80211_IFTYPE_P2P_DEVICE) { in ieee80211_rx_h_action_return()
3904 __ieee80211_tx_skb_tid_band(rx->sdata, nskb, 7, -1, in ieee80211_rx_h_action_return()
3907 dev_kfree_skb(rx->skb); in ieee80211_rx_h_action_return()
3912 ieee80211_rx_h_ext(struct ieee80211_rx_data *rx) in ieee80211_rx_h_ext() argument
3914 struct ieee80211_sub_if_data *sdata = rx->sdata; in ieee80211_rx_h_ext()
3915 struct ieee80211_hdr *hdr = (void *)rx->skb->data; in ieee80211_rx_h_ext()
3924 ieee80211_queue_skb_to_iface(sdata, rx->link_id, rx->sta, rx->skb); in ieee80211_rx_h_ext()
3930 ieee80211_rx_h_mgmt(struct ieee80211_rx_data *rx) in ieee80211_rx_h_mgmt() argument
3932 struct ieee80211_sub_if_data *sdata = rx->sdata; in ieee80211_rx_h_mgmt()
3933 struct ieee80211_mgmt *mgmt = (void *)rx->skb->data; in ieee80211_rx_h_mgmt()
3981 ieee80211_queue_skb_to_iface(sdata, rx->link_id, rx->sta, rx->skb); in ieee80211_rx_h_mgmt()
3986 static void ieee80211_rx_cooked_monitor(struct ieee80211_rx_data *rx, in ieee80211_rx_cooked_monitor() argument
3991 struct ieee80211_local *local = rx->local; in ieee80211_rx_cooked_monitor()
3992 struct sk_buff *skb = rx->skb, *skb2; in ieee80211_rx_cooked_monitor()
4001 if (rx->flags & IEEE80211_RX_CMNTR) in ieee80211_rx_cooked_monitor()
4003 rx->flags |= IEEE80211_RX_CMNTR; in ieee80211_rx_cooked_monitor()
4055 static void ieee80211_rx_handlers_result(struct ieee80211_rx_data *rx, in ieee80211_rx_handlers_result() argument
4058 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); in ieee80211_rx_handlers_result()
4063 I802_DEBUG_INC(rx->sdata->local->rx_handlers_queued); in ieee80211_rx_handlers_result()
4068 I802_DEBUG_INC(rx->sdata->local->rx_handlers_drop); in ieee80211_rx_handlers_result()
4069 if (rx->sta) in ieee80211_rx_handlers_result()
4070 rx->link_sta->rx_stats.dropped++; in ieee80211_rx_handlers_result()
4075 kfree_skb_reason(rx->skb, (__force u32)res); in ieee80211_rx_handlers_result()
4079 sband = rx->local->hw.wiphy->bands[status->band]; in ieee80211_rx_handlers_result()
4083 ieee80211_rx_cooked_monitor(rx, rate, res); in ieee80211_rx_handlers_result()
4086 static void ieee80211_rx_handlers(struct ieee80211_rx_data *rx, in ieee80211_rx_handlers() argument
4094 res = rxh(rx); \ in ieee80211_rx_handlers()
4105 spin_lock_bh(&rx->local->rx_path_lock); in ieee80211_rx_handlers()
4113 rx->skb = skb; in ieee80211_rx_handlers()
4115 if (WARN_ON_ONCE(!rx->link)) in ieee80211_rx_handlers()
4129 res = ieee80211_rx_h_ctrl(rx, frames); in ieee80211_rx_handlers()
4142 ieee80211_rx_handlers_result(rx, res); in ieee80211_rx_handlers()
4147 spin_unlock_bh(&rx->local->rx_path_lock); in ieee80211_rx_handlers()
4150 static void ieee80211_invoke_rx_handlers(struct ieee80211_rx_data *rx) in ieee80211_invoke_rx_handlers() argument
4159 res = rxh(rx); \ in ieee80211_invoke_rx_handlers()
4167 ieee80211_rx_reorder_ampdu(rx, &reorder_release); in ieee80211_invoke_rx_handlers()
4169 ieee80211_rx_handlers(rx, &reorder_release); in ieee80211_invoke_rx_handlers()
4173 ieee80211_rx_handlers_result(rx, res); in ieee80211_invoke_rx_handlers()
4184 static bool ieee80211_rx_data_set_link(struct ieee80211_rx_data *rx, in ieee80211_rx_data_set_link() argument
4187 rx->link_id = link_id; in ieee80211_rx_data_set_link()
4188 rx->link = rcu_dereference(rx->sdata->link[link_id]); in ieee80211_rx_data_set_link()
4190 if (!rx->sta) in ieee80211_rx_data_set_link()
4191 return rx->link; in ieee80211_rx_data_set_link()
4193 if (!ieee80211_rx_is_valid_sta_link_id(&rx->sta->sta, link_id)) in ieee80211_rx_data_set_link()
4196 rx->link_sta = rcu_dereference(rx->sta->link[link_id]); in ieee80211_rx_data_set_link()
4198 return rx->link && rx->link_sta; in ieee80211_rx_data_set_link()
4201 static bool ieee80211_rx_data_set_sta(struct ieee80211_rx_data *rx, in ieee80211_rx_data_set_sta() argument
4204 rx->link_id = link_id; in ieee80211_rx_data_set_sta()
4205 rx->sta = sta; in ieee80211_rx_data_set_sta()
4208 rx->local = sta->sdata->local; in ieee80211_rx_data_set_sta()
4209 if (!rx->sdata) in ieee80211_rx_data_set_sta()
4210 rx->sdata = sta->sdata; in ieee80211_rx_data_set_sta()
4211 rx->link_sta = &sta->deflink; in ieee80211_rx_data_set_sta()
4213 rx->link_sta = NULL; in ieee80211_rx_data_set_sta()
4217 rx->link = &rx->sdata->deflink; in ieee80211_rx_data_set_sta()
4218 else if (!ieee80211_rx_data_set_link(rx, link_id)) in ieee80211_rx_data_set_sta()
4231 struct ieee80211_rx_data rx = { in ieee80211_release_reorder_timeout() local
4243 if (!ieee80211_rx_data_set_sta(&rx, sta, link_id)) in ieee80211_release_reorder_timeout()
4262 drv_event_callback(rx.local, rx.sdata, &event); in ieee80211_release_reorder_timeout()
4265 ieee80211_rx_handlers(&rx, &frames); in ieee80211_release_reorder_timeout()
4276 struct ieee80211_rx_data rx = { in ieee80211_mark_rx_ba_filtered_frames() local
4295 if (!ieee80211_rx_data_set_sta(&rx, sta, -1)) in ieee80211_mark_rx_ba_filtered_frames()
4345 ieee80211_rx_handlers(&rx, &frames); in ieee80211_mark_rx_ba_filtered_frames()
4360 static bool ieee80211_accept_frame(struct ieee80211_rx_data *rx) in ieee80211_accept_frame() argument
4362 struct ieee80211_sub_if_data *sdata = rx->sdata; in ieee80211_accept_frame()
4363 struct sk_buff *skb = rx->skb; in ieee80211_accept_frame()
4375 ieee80211_is_robust_mgmt_frame(skb) && !rx->sta) in ieee80211_accept_frame()
4379 return ieee80211_is_our_addr(sdata, hdr->addr1, &rx->link_id); in ieee80211_accept_frame()
4394 if (!rx->sta) { in ieee80211_accept_frame()
4414 if (!rx->sta) { in ieee80211_accept_frame()
4434 &rx->link_id); in ieee80211_accept_frame()
4446 &rx->link_id)) in ieee80211_accept_frame()
4690 static void ieee80211_rx_8023(struct ieee80211_rx_data *rx, in ieee80211_rx_8023() argument
4695 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); in ieee80211_rx_8023()
4696 struct sta_info *sta = rx->sta; in ieee80211_rx_8023()
4698 struct sk_buff *skb = rx->skb; in ieee80211_rx_8023()
4702 if (rx->link_id >= 0) { in ieee80211_rx_8023()
4703 link_sta = rcu_dereference(sta->link[rx->link_id]); in ieee80211_rx_8023()
4705 dev_kfree_skb(rx->skb); in ieee80211_rx_8023()
4758 stats->msdu[rx->seqno_idx]++; in ieee80211_rx_8023()
4767 sta_info_get(rx->sdata, da)) { in ieee80211_rx_8023()
4791 ieee80211_deliver_skb_to_local_stack(skb, rx); in ieee80211_rx_8023()
4794 static bool ieee80211_invoke_fast_rx(struct ieee80211_rx_data *rx, in ieee80211_invoke_fast_rx() argument
4797 struct sk_buff *skb = rx->skb; in ieee80211_invoke_fast_rx()
4862 if (!ieee80211_vif_is_mesh(&rx->sdata->vif) && in ieee80211_invoke_fast_rx()
4884 if (rx->key && !(status->flag & RX_FLAG_MIC_STRIPPED) && in ieee80211_invoke_fast_rx()
4888 if (rx->key && !ieee80211_has_protected(hdr->frame_control)) in ieee80211_invoke_fast_rx()
4892 if (__ieee80211_rx_h_amsdu(rx, snap_offs - hdrlen) != in ieee80211_invoke_fast_rx()
4902 if (ieee80211_vif_is_mesh(&rx->sdata->vif)) { in ieee80211_invoke_fast_rx()
4915 res = ieee80211_rx_mesh_data(rx->sdata, rx->sta, rx->skb); in ieee80211_invoke_fast_rx()
4925 ieee80211_rx_8023(rx, fast_rx, orig_len); in ieee80211_invoke_fast_rx()
4932 stats = this_cpu_ptr(rx->link_sta->pcpu_rx_stats); in ieee80211_invoke_fast_rx()
4934 stats = &rx->link_sta->rx_stats; in ieee80211_invoke_fast_rx()
4946 static bool ieee80211_prepare_and_rx_handle(struct ieee80211_rx_data *rx, in ieee80211_prepare_and_rx_handle() argument
4949 struct ieee80211_local *local = rx->local; in ieee80211_prepare_and_rx_handle()
4950 struct ieee80211_sub_if_data *sdata = rx->sdata; in ieee80211_prepare_and_rx_handle()
4952 struct link_sta_info *link_sta = rx->link_sta; in ieee80211_prepare_and_rx_handle()
4953 struct ieee80211_link_data *link = rx->link; in ieee80211_prepare_and_rx_handle()
4955 rx->skb = skb; in ieee80211_prepare_and_rx_handle()
4964 if (consume && rx->sta) { in ieee80211_prepare_and_rx_handle()
4967 fast_rx = rcu_dereference(rx->sta->fast_rx); in ieee80211_prepare_and_rx_handle()
4968 if (fast_rx && ieee80211_invoke_fast_rx(rx, fast_rx)) in ieee80211_prepare_and_rx_handle()
4972 if (!ieee80211_accept_frame(rx)) in ieee80211_prepare_and_rx_handle()
4978 rx->skb = skb_copy(skb, GFP_ATOMIC); in ieee80211_prepare_and_rx_handle()
4979 if (!rx->skb) { in ieee80211_prepare_and_rx_handle()
4990 shwt = skb_hwtstamps(rx->skb); in ieee80211_prepare_and_rx_handle()
4994 hdr = (struct ieee80211_hdr *)rx->skb->data; in ieee80211_prepare_and_rx_handle()
4997 if (unlikely(rx->sta && rx->sta->sta.mlo) && in ieee80211_prepare_and_rx_handle()
5003 ether_addr_copy(hdr->addr1, rx->sdata->vif.addr); in ieee80211_prepare_and_rx_handle()
5005 ether_addr_copy(hdr->addr2, rx->sta->addr); in ieee80211_prepare_and_rx_handle()
5010 ether_addr_copy(hdr->addr3, rx->sta->addr); in ieee80211_prepare_and_rx_handle()
5012 ether_addr_copy(hdr->addr3, rx->sdata->vif.addr); in ieee80211_prepare_and_rx_handle()
5017 ieee80211_invoke_rx_handlers(rx); in ieee80211_prepare_and_rx_handle()
5029 struct ieee80211_rx_data rx; in __ieee80211_rx_handle_8023() local
5033 memset(&rx, 0, sizeof(rx)); in __ieee80211_rx_handle_8023()
5034 rx.skb = skb; in __ieee80211_rx_handle_8023()
5035 rx.local = local; in __ieee80211_rx_handle_8023()
5036 rx.list = list; in __ieee80211_rx_handle_8023()
5037 rx.link_id = -1; in __ieee80211_rx_handle_8023()
5059 if (!ieee80211_rx_data_set_sta(&rx, sta, link_id)) in __ieee80211_rx_handle_8023()
5062 fast_rx = rcu_dereference(rx.sta->fast_rx); in __ieee80211_rx_handle_8023()
5066 ieee80211_rx_8023(&rx, fast_rx, skb->len); in __ieee80211_rx_handle_8023()
5073 static bool ieee80211_rx_for_interface(struct ieee80211_rx_data *rx, in ieee80211_rx_for_interface() argument
5087 link_sta = link_sta_info_get_bss(rx->sdata, hdr->addr2); in ieee80211_rx_for_interface()
5094 sta = sta_info_get_bss(rx->sdata, hdr->addr2); in ieee80211_rx_for_interface()
5099 if (!ieee80211_rx_data_set_sta(rx, sta, link_id)) in ieee80211_rx_for_interface()
5102 return ieee80211_prepare_and_rx_handle(rx, skb, consume); in ieee80211_rx_for_interface()
5119 struct ieee80211_rx_data rx; in __ieee80211_rx_handle_packet() local
5125 memset(&rx, 0, sizeof(rx)); in __ieee80211_rx_handle_packet()
5126 rx.skb = skb; in __ieee80211_rx_handle_packet()
5127 rx.local = local; in __ieee80211_rx_handle_packet()
5128 rx.list = list; in __ieee80211_rx_handle_packet()
5129 rx.link_id = -1; in __ieee80211_rx_handle_packet()
5150 ieee80211_parse_qos(&rx); in __ieee80211_rx_handle_packet()
5151 ieee80211_verify_alignment(&rx); in __ieee80211_rx_handle_packet()
5167 if (!ieee80211_rx_data_set_sta(&rx, sta, link_id)) in __ieee80211_rx_handle_packet()
5182 link_sta = link_sta_info_get_bss(rx.sdata, in __ieee80211_rx_handle_packet()
5187 ieee80211_rx_data_set_link(&rx, link_sta->link_id); in __ieee80211_rx_handle_packet()
5190 if (ieee80211_prepare_and_rx_handle(&rx, skb, true)) in __ieee80211_rx_handle_packet()
5203 rx.sdata = prev_sta->sdata; in __ieee80211_rx_handle_packet()
5204 if (!ieee80211_rx_data_set_sta(&rx, prev_sta, link_id)) in __ieee80211_rx_handle_packet()
5210 ieee80211_prepare_and_rx_handle(&rx, skb, false); in __ieee80211_rx_handle_packet()
5216 rx.sdata = prev_sta->sdata; in __ieee80211_rx_handle_packet()
5217 if (!ieee80211_rx_data_set_sta(&rx, prev_sta, link_id)) in __ieee80211_rx_handle_packet()
5223 if (ieee80211_prepare_and_rx_handle(&rx, skb, true)) in __ieee80211_rx_handle_packet()
5250 rx.sdata = prev; in __ieee80211_rx_handle_packet()
5251 ieee80211_rx_for_interface(&rx, skb, false); in __ieee80211_rx_handle_packet()
5257 rx.sdata = prev; in __ieee80211_rx_handle_packet()
5259 if (ieee80211_rx_for_interface(&rx, skb, true)) in __ieee80211_rx_handle_packet()