Lines Matching full:rx

717 		 * RX header they pull before we get here, and that should  in ieee80211_make_monitor_skb()
793 * (2) the other RX handlers will modify the skb we got. in ieee80211_rx_monitor()
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()
950 /* rx handlers */
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()
1150 * Timeout (in jiffies) for skb's that are waiting in the RX reorder buffer. If
1194 "release an RX reorder frame due to timeout on earlier frames\n"); in ieee80211_sta_reorder_release()
1233 * As this function belongs to the RX path it must be under
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()
1352 * filter the QoS data rx stream according to 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()
1388 /* if this mpdu is fragmented - terminate rx aggregation session */ in ieee80211_rx_reorder_ampdu()
1391 ieee80211_queue_skb_to_iface(rx->sdata, rx->link_id, NULL, skb); in ieee80211_rx_reorder_ampdu()
1397 * RX packet at a time, and thus own tid_agg_rx. All 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()
1993 * need to set rx->key if there is a key that could have been 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()
2548 * requires that rx->skb is a frame with ethernet header
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()
2620 * requires that rx->skb is a frame with ethernet header
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()
2973 __ieee80211_rx_h_amsdu(struct ieee80211_rx_data *rx, u8 data_offset) in __ieee80211_rx_h_amsdu() argument
2975 struct net_device *dev = rx->sdata->dev; in __ieee80211_rx_h_amsdu()
2976 struct sk_buff *skb = rx->skb; in __ieee80211_rx_h_amsdu()
2987 } else switch (rx->sdata->vif.type) { in __ieee80211_rx_h_amsdu()
2993 if (!rx->sta || in __ieee80211_rx_h_amsdu()
2994 !test_sta_flag(rx->sta, WLAN_STA_TDLS_PEER)) in __ieee80211_rx_h_amsdu()
3009 rx->sdata->vif.addr, in __ieee80211_rx_h_amsdu()
3010 rx->sdata->vif.type, in __ieee80211_rx_h_amsdu()
3014 if (rx->sta->amsdu_mesh_control < 0) { in __ieee80211_rx_h_amsdu()
3031 rx->sta->amsdu_mesh_control = valid; in __ieee80211_rx_h_amsdu()
3035 rx->sdata->vif.type, in __ieee80211_rx_h_amsdu()
3036 rx->local->hw.extra_tx_headroom, in __ieee80211_rx_h_amsdu()
3038 rx->sta->amsdu_mesh_control); in __ieee80211_rx_h_amsdu()
3041 rx->skb = __skb_dequeue(&frame_list); in __ieee80211_rx_h_amsdu()
3043 res = ieee80211_rx_mesh_data(rx->sdata, rx->sta, rx->skb); in __ieee80211_rx_h_amsdu()
3053 if (!ieee80211_frame_allowed(rx, fc)) in __ieee80211_rx_h_amsdu()
3056 ieee80211_deliver_skb(rx); in __ieee80211_rx_h_amsdu()
3060 dev_kfree_skb(rx->skb); in __ieee80211_rx_h_amsdu()
3067 ieee80211_rx_h_amsdu(struct ieee80211_rx_data *rx) in ieee80211_rx_h_amsdu() argument
3069 struct sk_buff *skb = rx->skb; in ieee80211_rx_h_amsdu()
3084 switch (rx->sdata->vif.type) { in ieee80211_rx_h_amsdu()
3086 if (!rx->sdata->u.vlan.sta) in ieee80211_rx_h_amsdu()
3090 if (!rx->sdata->u.mgd.use_4addr) in ieee80211_rx_h_amsdu()
3100 if (is_multicast_ether_addr(hdr->addr1) || !rx->sta) in ieee80211_rx_h_amsdu()
3103 if (rx->key) { in ieee80211_rx_h_amsdu()
3110 switch (rx->key->conf.cipher) { in ieee80211_rx_h_amsdu()
3120 return __ieee80211_rx_h_amsdu(rx, 0); in ieee80211_rx_h_amsdu()
3124 ieee80211_rx_h_data(struct ieee80211_rx_data *rx) in ieee80211_rx_h_data() argument
3126 struct ieee80211_sub_if_data *sdata = rx->sdata; in ieee80211_rx_h_data()
3127 struct ieee80211_local *local = rx->local; in ieee80211_rx_h_data()
3129 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; in ieee80211_rx_h_data()
3147 if (rx->sta && in ieee80211_rx_h_data()
3148 !test_and_set_sta_flag(rx->sta, WLAN_STA_4ADDR_EVENT)) in ieee80211_rx_h_data()
3150 rx->sdata->dev, rx->sta->sta.addr, GFP_ATOMIC); in ieee80211_rx_h_data()
3154 err = __ieee80211_data_to_8023(rx, &port_control); in ieee80211_rx_h_data()
3158 res = ieee80211_rx_mesh_data(rx->sdata, rx->sta, rx->skb); in ieee80211_rx_h_data()
3162 if (!ieee80211_frame_allowed(rx, fc)) in ieee80211_rx_h_data()
3166 if (unlikely(((struct ethhdr *)rx->skb->data)->h_proto == in ieee80211_rx_h_data()
3168 struct ieee80211_tdls_data *tf = (void *)rx->skb->data; in ieee80211_rx_h_data()
3170 if (pskb_may_pull(rx->skb, in ieee80211_rx_h_data()
3176 rx->skb->protocol = cpu_to_be16(ETH_P_TDLS); in ieee80211_rx_h_data()
3177 __ieee80211_queue_skb_to_iface(sdata, rx->link_id, in ieee80211_rx_h_data()
3178 rx->sta, rx->skb); in ieee80211_rx_h_data()
3183 if (rx->sdata->vif.type == NL80211_IFTYPE_AP_VLAN && in ieee80211_rx_h_data()
3188 rx->sdata = sdata; in ieee80211_rx_h_data()
3191 rx->skb->dev = dev; in ieee80211_rx_h_data()
3196 ((struct ethhdr *)rx->skb->data)->h_dest) && in ieee80211_rx_h_data()
3202 ieee80211_deliver_skb(rx); in ieee80211_rx_h_data()
3208 ieee80211_rx_h_ctrl(struct ieee80211_rx_data *rx, struct sk_buff_head *frames) in ieee80211_rx_h_ctrl() argument
3210 struct sk_buff *skb = rx->skb; in ieee80211_rx_h_ctrl()
3227 if (!rx->sta) in ieee80211_rx_h_ctrl()
3236 if (!test_bit(tid, rx->sta->ampdu_mlme.agg_session_valid) && in ieee80211_rx_h_ctrl()
3237 !test_and_set_bit(tid, rx->sta->ampdu_mlme.unexpected_agg)) in ieee80211_rx_h_ctrl()
3238 ieee80211_send_delba(rx->sdata, rx->sta->sta.addr, tid, in ieee80211_rx_h_ctrl()
3242 tid_agg_rx = rcu_dereference(rx->sta->ampdu_mlme.tid_rx[tid]); in ieee80211_rx_h_ctrl()
3249 event.u.ba.sta = &rx->sta->sta; in ieee80211_rx_h_ctrl()
3258 ieee80211_release_reorder_frames(rx->sdata, tid_agg_rx, in ieee80211_rx_h_ctrl()
3262 drv_event_callback(rx->local, rx->sdata, &event); in ieee80211_rx_h_ctrl()
3322 ieee80211_rx_check_bss_color_collision(struct ieee80211_rx_data *rx) in ieee80211_rx_check_bss_color_collision() argument
3324 struct ieee80211_mgmt *mgmt = (void *)rx->skb->data; in ieee80211_rx_check_bss_color_collision()
3328 if (!wiphy_ext_feature_isset(rx->local->hw.wiphy, in ieee80211_rx_check_bss_color_collision()
3332 if (ieee80211_hw_check(&rx->local->hw, DETECTS_COLOR_COLLISION)) in ieee80211_rx_check_bss_color_collision()
3335 if (rx->sdata->vif.bss_conf.csa_active) in ieee80211_rx_check_bss_color_collision()
3338 baselen = mgmt->u.beacon.variable - rx->skb->data; in ieee80211_rx_check_bss_color_collision()
3339 if (baselen > rx->skb->len) in ieee80211_rx_check_bss_color_collision()
3344 rx->skb->len - baselen); in ieee80211_rx_check_bss_color_collision()
3347 struct ieee80211_bss_conf *bss_conf = &rx->sdata->vif.bss_conf; in ieee80211_rx_check_bss_color_collision()
3359 ieee80211_obss_color_collision_notify(&rx->sdata->vif, in ieee80211_rx_check_bss_color_collision()
3366 ieee80211_rx_h_mgmt_check(struct ieee80211_rx_data *rx) in ieee80211_rx_h_mgmt_check() argument
3368 struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *) rx->skb->data; in ieee80211_rx_h_mgmt_check()
3369 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); in ieee80211_rx_h_mgmt_check()
3379 if (rx->skb->len < 24) in ieee80211_rx_h_mgmt_check()
3387 rx->skb->len < IEEE80211_MIN_ACTION_SIZE) in ieee80211_rx_h_mgmt_check()
3390 if (rx->sdata->vif.type == NL80211_IFTYPE_AP && in ieee80211_rx_h_mgmt_check()
3392 !(rx->flags & IEEE80211_RX_BEACON_REPORTED)) { in ieee80211_rx_h_mgmt_check()
3396 ieee80211_rx_check_bss_color_collision(rx); in ieee80211_rx_h_mgmt_check()
3398 if (ieee80211_hw_check(&rx->local->hw, SIGNAL_DBM) && in ieee80211_rx_h_mgmt_check()
3402 cfg80211_report_obss_beacon_khz(rx->local->hw.wiphy, in ieee80211_rx_h_mgmt_check()
3403 rx->skb->data, rx->skb->len, in ieee80211_rx_h_mgmt_check()
3406 rx->flags |= IEEE80211_RX_BEACON_REPORTED; in ieee80211_rx_h_mgmt_check()
3409 if (ieee80211_drop_unencrypted_mgmt(rx)) in ieee80211_rx_h_mgmt_check()
3416 ieee80211_process_rx_twt_action(struct ieee80211_rx_data *rx) in ieee80211_process_rx_twt_action() argument
3418 struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)rx->skb->data; in ieee80211_process_rx_twt_action()
3419 struct ieee80211_sub_if_data *sdata = rx->sdata; in ieee80211_process_rx_twt_action()
3425 if (!rx->local->ops->add_twt_setup) in ieee80211_process_rx_twt_action()
3431 if (!rx->sta) in ieee80211_process_rx_twt_action()
3438 if (rx->skb->len < IEEE80211_MIN_ACTION_SIZE + in ieee80211_process_rx_twt_action()
3448 if (rx->skb->len < IEEE80211_MIN_ACTION_SIZE + in ieee80211_process_rx_twt_action()
3456 if (rx->skb->len < IEEE80211_MIN_ACTION_SIZE + 2) in ieee80211_process_rx_twt_action()
3468 ieee80211_rx_h_action(struct ieee80211_rx_data *rx) in ieee80211_rx_h_action() argument
3470 struct ieee80211_local *local = rx->local; in ieee80211_rx_h_action()
3471 struct ieee80211_sub_if_data *sdata = rx->sdata; in ieee80211_rx_h_action()
3472 struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *) rx->skb->data; in ieee80211_rx_h_action()
3473 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); in ieee80211_rx_h_action()
3474 int len = rx->skb->len; in ieee80211_rx_h_action()
3479 if (!rx->sta && mgmt->u.action.category != WLAN_CATEGORY_PUBLIC && in ieee80211_rx_h_action()
3487 if (!rx->link_sta->pub->ht_cap.ht_supported) in ieee80211_rx_h_action()
3527 if (rx->link_sta->pub->smps_mode == smps_mode) in ieee80211_rx_h_action()
3529 rx->link_sta->pub->smps_mode = smps_mode; in ieee80211_rx_h_action()
3534 sband = rx->local->hw.wiphy->bands[status->band]; in ieee80211_rx_h_action()
3536 rate_control_rate_update(local, sband, rx->sta, 0, in ieee80211_rx_h_action()
3539 rx->sta->addr, in ieee80211_rx_h_action()
3551 if (!(rx->link_sta->pub->ht_cap.cap & in ieee80211_rx_h_action()
3558 max_bw = ieee80211_sta_cap_rx_bw(rx->link_sta); in ieee80211_rx_h_action()
3561 rx->link_sta->cur_max_bandwidth = max_bw; in ieee80211_rx_h_action()
3562 new_bw = ieee80211_sta_cur_vht_bw(rx->link_sta); in ieee80211_rx_h_action()
3564 if (rx->link_sta->pub->bandwidth == new_bw) in ieee80211_rx_h_action()
3567 rx->link_sta->pub->bandwidth = new_bw; in ieee80211_rx_h_action()
3568 sband = rx->local->hw.wiphy->bands[status->band]; in ieee80211_rx_h_action()
3570 ieee80211_sta_rx_bw_to_chan_width(rx->link_sta); in ieee80211_rx_h_action()
3573 rate_control_rate_update(local, sband, rx->sta, 0, in ieee80211_rx_h_action()
3576 rx->sta->addr, in ieee80211_rx_h_action()
3591 if (!rx->sta) in ieee80211_rx_h_action()
3750 if (ieee80211_process_rx_twt_action(rx)) in ieee80211_rx_h_action()
3767 if (rx->sta) in ieee80211_rx_h_action()
3768 rx->link_sta->rx_stats.packets++; in ieee80211_rx_h_action()
3769 dev_kfree_skb(rx->skb); in ieee80211_rx_h_action()
3773 ieee80211_queue_skb_to_iface(sdata, rx->link_id, rx->sta, rx->skb); in ieee80211_rx_h_action()
3778 ieee80211_rx_h_userspace_mgmt(struct ieee80211_rx_data *rx) in ieee80211_rx_h_userspace_mgmt() argument
3780 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); in ieee80211_rx_h_userspace_mgmt()
3783 .buf = rx->skb->data, in ieee80211_rx_h_userspace_mgmt()
3784 .len = rx->skb->len, in ieee80211_rx_h_userspace_mgmt()
3785 .link_id = rx->link_id, in ieee80211_rx_h_userspace_mgmt()
3786 .have_link_id = rx->link_id >= 0, in ieee80211_rx_h_userspace_mgmt()
3800 if (ieee80211_hw_check(&rx->local->hw, SIGNAL_DBM) && in ieee80211_rx_h_userspace_mgmt()
3804 if (ieee80211_is_timing_measurement(rx->skb) || in ieee80211_rx_h_userspace_mgmt()
3805 ieee80211_is_ftm(rx->skb)) { in ieee80211_rx_h_userspace_mgmt()
3806 info.rx_tstamp = ktime_to_ns(skb_hwtstamps(rx->skb)->hwtstamp); in ieee80211_rx_h_userspace_mgmt()
3810 if (cfg80211_rx_mgmt_ext(&rx->sdata->wdev, &info)) { in ieee80211_rx_h_userspace_mgmt()
3811 if (rx->sta) in ieee80211_rx_h_userspace_mgmt()
3812 rx->link_sta->rx_stats.packets++; in ieee80211_rx_h_userspace_mgmt()
3813 dev_kfree_skb(rx->skb); in ieee80211_rx_h_userspace_mgmt()
3821 ieee80211_rx_h_action_post_userspace(struct ieee80211_rx_data *rx) in ieee80211_rx_h_action_post_userspace() argument
3823 struct ieee80211_sub_if_data *sdata = rx->sdata; in ieee80211_rx_h_action_post_userspace()
3824 struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *) rx->skb->data; in ieee80211_rx_h_action_post_userspace()
3825 int len = rx->skb->len; in ieee80211_rx_h_action_post_userspace()
3849 if (rx->sta) in ieee80211_rx_h_action_post_userspace()
3850 rx->link_sta->rx_stats.packets++; in ieee80211_rx_h_action_post_userspace()
3851 dev_kfree_skb(rx->skb); in ieee80211_rx_h_action_post_userspace()
3856 ieee80211_rx_h_action_return(struct ieee80211_rx_data *rx) in ieee80211_rx_h_action_return() argument
3858 struct ieee80211_local *local = rx->local; in ieee80211_rx_h_action_return()
3859 struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *) rx->skb->data; in ieee80211_rx_h_action_return()
3861 struct ieee80211_sub_if_data *sdata = rx->sdata; in ieee80211_rx_h_action_return()
3862 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); in ieee80211_rx_h_action_return()
3889 nskb = skb_copy_expand(rx->skb, local->hw.extra_tx_headroom, 0, in ieee80211_rx_h_action_return()
3896 memcpy(nmgmt->sa, rx->sdata->vif.addr, ETH_ALEN); in ieee80211_rx_h_action_return()
3900 if (rx->sdata->vif.type == NL80211_IFTYPE_P2P_DEVICE) { in ieee80211_rx_h_action_return()
3911 __ieee80211_tx_skb_tid_band(rx->sdata, nskb, 7, -1, in ieee80211_rx_h_action_return()
3914 dev_kfree_skb(rx->skb); in ieee80211_rx_h_action_return()
3919 ieee80211_rx_h_ext(struct ieee80211_rx_data *rx) in ieee80211_rx_h_ext() argument
3921 struct ieee80211_sub_if_data *sdata = rx->sdata; in ieee80211_rx_h_ext()
3922 struct ieee80211_hdr *hdr = (void *)rx->skb->data; in ieee80211_rx_h_ext()
3931 ieee80211_queue_skb_to_iface(sdata, rx->link_id, rx->sta, rx->skb); in ieee80211_rx_h_ext()
3937 ieee80211_rx_h_mgmt(struct ieee80211_rx_data *rx) in ieee80211_rx_h_mgmt() argument
3939 struct ieee80211_sub_if_data *sdata = rx->sdata; in ieee80211_rx_h_mgmt()
3940 struct ieee80211_mgmt *mgmt = (void *)rx->skb->data; in ieee80211_rx_h_mgmt()
3988 ieee80211_queue_skb_to_iface(sdata, rx->link_id, rx->sta, rx->skb); in ieee80211_rx_h_mgmt()
3993 static void ieee80211_rx_cooked_monitor(struct ieee80211_rx_data *rx, in ieee80211_rx_cooked_monitor() argument
3998 struct ieee80211_local *local = rx->local; in ieee80211_rx_cooked_monitor()
3999 struct sk_buff *skb = rx->skb, *skb2; in ieee80211_rx_cooked_monitor()
4008 if (rx->flags & IEEE80211_RX_CMNTR) in ieee80211_rx_cooked_monitor()
4010 rx->flags |= IEEE80211_RX_CMNTR; in ieee80211_rx_cooked_monitor()
4062 static void ieee80211_rx_handlers_result(struct ieee80211_rx_data *rx, in ieee80211_rx_handlers_result() argument
4065 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); in ieee80211_rx_handlers_result()
4070 I802_DEBUG_INC(rx->sdata->local->rx_handlers_queued); in ieee80211_rx_handlers_result()
4075 I802_DEBUG_INC(rx->sdata->local->rx_handlers_drop); in ieee80211_rx_handlers_result()
4076 if (rx->sta) in ieee80211_rx_handlers_result()
4077 rx->link_sta->rx_stats.dropped++; in ieee80211_rx_handlers_result()
4082 kfree_skb_reason(rx->skb, (__force u32)res); in ieee80211_rx_handlers_result()
4086 sband = rx->local->hw.wiphy->bands[status->band]; in ieee80211_rx_handlers_result()
4090 ieee80211_rx_cooked_monitor(rx, rate, res); in ieee80211_rx_handlers_result()
4093 static void ieee80211_rx_handlers(struct ieee80211_rx_data *rx, in ieee80211_rx_handlers() argument
4101 res = rxh(rx); \ in ieee80211_rx_handlers()
4106 /* Lock here to avoid hitting all of the data used in the RX in ieee80211_rx_handlers()
4109 * from the timer, potentially concurrently with RX from the in ieee80211_rx_handlers()
4112 spin_lock_bh(&rx->local->rx_path_lock); in ieee80211_rx_handlers()
4120 rx->skb = skb; in ieee80211_rx_handlers()
4122 if (WARN_ON_ONCE(!rx->link)) in ieee80211_rx_handlers()
4136 res = ieee80211_rx_h_ctrl(rx, frames); in ieee80211_rx_handlers()
4149 ieee80211_rx_handlers_result(rx, res); in ieee80211_rx_handlers()
4154 spin_unlock_bh(&rx->local->rx_path_lock); in ieee80211_rx_handlers()
4157 static void ieee80211_invoke_rx_handlers(struct ieee80211_rx_data *rx) in ieee80211_invoke_rx_handlers() argument
4166 res = rxh(rx); \ in ieee80211_invoke_rx_handlers()
4174 ieee80211_rx_reorder_ampdu(rx, &reorder_release); in ieee80211_invoke_rx_handlers()
4176 ieee80211_rx_handlers(rx, &reorder_release); in ieee80211_invoke_rx_handlers()
4180 ieee80211_rx_handlers_result(rx, res); in ieee80211_invoke_rx_handlers()
4191 static bool ieee80211_rx_data_set_link(struct ieee80211_rx_data *rx, in ieee80211_rx_data_set_link() argument
4194 rx->link_id = link_id; in ieee80211_rx_data_set_link()
4195 rx->link = rcu_dereference(rx->sdata->link[link_id]); in ieee80211_rx_data_set_link()
4197 if (!rx->sta) in ieee80211_rx_data_set_link()
4198 return rx->link; in ieee80211_rx_data_set_link()
4200 if (!ieee80211_rx_is_valid_sta_link_id(&rx->sta->sta, link_id)) in ieee80211_rx_data_set_link()
4203 rx->link_sta = rcu_dereference(rx->sta->link[link_id]); in ieee80211_rx_data_set_link()
4205 return rx->link && rx->link_sta; in ieee80211_rx_data_set_link()
4208 static bool ieee80211_rx_data_set_sta(struct ieee80211_rx_data *rx, in ieee80211_rx_data_set_sta() argument
4211 rx->link_id = link_id; in ieee80211_rx_data_set_sta()
4212 rx->sta = sta; in ieee80211_rx_data_set_sta()
4215 rx->local = sta->sdata->local; in ieee80211_rx_data_set_sta()
4216 if (!rx->sdata) in ieee80211_rx_data_set_sta()
4217 rx->sdata = sta->sdata; in ieee80211_rx_data_set_sta()
4218 rx->link_sta = &sta->deflink; in ieee80211_rx_data_set_sta()
4220 rx->link_sta = NULL; in ieee80211_rx_data_set_sta()
4224 rx->link = &rx->sdata->deflink; in ieee80211_rx_data_set_sta()
4225 else if (!ieee80211_rx_data_set_link(rx, link_id)) in ieee80211_rx_data_set_sta()
4232 * This function makes calls into the RX path, therefore
4238 struct ieee80211_rx_data rx = { in ieee80211_release_reorder_timeout() local
4250 if (!ieee80211_rx_data_set_sta(&rx, sta, link_id)) in ieee80211_release_reorder_timeout()
4269 drv_event_callback(rx.local, rx.sdata, &event); in ieee80211_release_reorder_timeout()
4272 ieee80211_rx_handlers(&rx, &frames); in ieee80211_release_reorder_timeout()
4283 struct ieee80211_rx_data rx = { in ieee80211_mark_rx_ba_filtered_frames() local
4299 "RX BA marker can't support max_rx_aggregation_subframes %u > 64\n", in ieee80211_mark_rx_ba_filtered_frames()
4302 if (!ieee80211_rx_data_set_sta(&rx, sta, -1)) in ieee80211_mark_rx_ba_filtered_frames()
4352 ieee80211_rx_handlers(&rx, &frames); in ieee80211_mark_rx_ba_filtered_frames()
4367 static bool ieee80211_accept_frame(struct ieee80211_rx_data *rx) in ieee80211_accept_frame() argument
4369 struct ieee80211_sub_if_data *sdata = rx->sdata; in ieee80211_accept_frame()
4370 struct sk_buff *skb = rx->skb; in ieee80211_accept_frame()
4382 ieee80211_is_robust_mgmt_frame(skb) && !rx->sta) in ieee80211_accept_frame()
4386 return ieee80211_is_our_addr(sdata, hdr->addr1, &rx->link_id); in ieee80211_accept_frame()
4401 if (!rx->sta) { in ieee80211_accept_frame()
4421 if (!rx->sta) { in ieee80211_accept_frame()
4441 &rx->link_id); in ieee80211_accept_frame()
4453 &rx->link_id)) in ieee80211_accept_frame()
4533 /* fast-rx doesn't do reordering */ in ieee80211_check_fast_rx()
4570 /* parallel-rx requires this, at least with calls to in ieee80211_check_fast_rx()
4613 /* we don't want to deal with MMIC in fast-rx */ in ieee80211_check_fast_rx()
4697 static void ieee80211_rx_8023(struct ieee80211_rx_data *rx, in ieee80211_rx_8023() argument
4702 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); in ieee80211_rx_8023()
4703 struct sta_info *sta = rx->sta; in ieee80211_rx_8023()
4705 struct sk_buff *skb = rx->skb; in ieee80211_rx_8023()
4709 if (rx->link_id >= 0) { in ieee80211_rx_8023()
4710 link_sta = rcu_dereference(sta->link[rx->link_id]); in ieee80211_rx_8023()
4712 dev_kfree_skb(rx->skb); in ieee80211_rx_8023()
4765 stats->msdu[rx->seqno_idx]++; in ieee80211_rx_8023()
4774 sta_info_get(rx->sdata, da)) { in ieee80211_rx_8023()
4798 ieee80211_deliver_skb_to_local_stack(skb, rx); in ieee80211_rx_8023()
4801 static bool ieee80211_invoke_fast_rx(struct ieee80211_rx_data *rx, in ieee80211_invoke_fast_rx() argument
4804 struct sk_buff *skb = rx->skb; in ieee80211_invoke_fast_rx()
4821 /* for parallel-rx, we need to have DUP_VALIDATED, otherwise we write in ieee80211_invoke_fast_rx()
4869 if (!ieee80211_vif_is_mesh(&rx->sdata->vif) && in ieee80211_invoke_fast_rx()
4891 if (rx->key && !(status->flag & RX_FLAG_MIC_STRIPPED) && in ieee80211_invoke_fast_rx()
4895 if (rx->key && !ieee80211_has_protected(hdr->frame_control)) in ieee80211_invoke_fast_rx()
4899 if (__ieee80211_rx_h_amsdu(rx, snap_offs - hdrlen) != in ieee80211_invoke_fast_rx()
4909 if (ieee80211_vif_is_mesh(&rx->sdata->vif)) { in ieee80211_invoke_fast_rx()
4922 res = ieee80211_rx_mesh_data(rx->sdata, rx->sta, rx->skb); in ieee80211_invoke_fast_rx()
4932 ieee80211_rx_8023(rx, fast_rx, orig_len); in ieee80211_invoke_fast_rx()
4939 stats = this_cpu_ptr(rx->link_sta->pcpu_rx_stats); in ieee80211_invoke_fast_rx()
4941 stats = &rx->link_sta->rx_stats; in ieee80211_invoke_fast_rx()
4949 * was destined for RX processing or not, which,
4953 static bool ieee80211_prepare_and_rx_handle(struct ieee80211_rx_data *rx, in ieee80211_prepare_and_rx_handle() argument
4956 struct ieee80211_local *local = rx->local; in ieee80211_prepare_and_rx_handle()
4957 struct ieee80211_sub_if_data *sdata = rx->sdata; in ieee80211_prepare_and_rx_handle()
4959 struct link_sta_info *link_sta = rx->link_sta; in ieee80211_prepare_and_rx_handle()
4960 struct ieee80211_link_data *link = rx->link; in ieee80211_prepare_and_rx_handle()
4962 rx->skb = skb; in ieee80211_prepare_and_rx_handle()
4964 /* See if we can do fast-rx; if we have to copy we already lost, in ieee80211_prepare_and_rx_handle()
4971 if (consume && rx->sta) { in ieee80211_prepare_and_rx_handle()
4974 fast_rx = rcu_dereference(rx->sta->fast_rx); in ieee80211_prepare_and_rx_handle()
4975 if (fast_rx && ieee80211_invoke_fast_rx(rx, fast_rx)) in ieee80211_prepare_and_rx_handle()
4979 if (!ieee80211_accept_frame(rx)) in ieee80211_prepare_and_rx_handle()
4985 rx->skb = skb_copy(skb, GFP_ATOMIC); in ieee80211_prepare_and_rx_handle()
4986 if (!rx->skb) { in ieee80211_prepare_and_rx_handle()
4997 shwt = skb_hwtstamps(rx->skb); in ieee80211_prepare_and_rx_handle()
5001 hdr = (struct ieee80211_hdr *)rx->skb->data; in ieee80211_prepare_and_rx_handle()
5004 if (unlikely(rx->sta && rx->sta->sta.mlo) && in ieee80211_prepare_and_rx_handle()
5010 ether_addr_copy(hdr->addr1, rx->sdata->vif.addr); in ieee80211_prepare_and_rx_handle()
5012 ether_addr_copy(hdr->addr2, rx->sta->addr); in ieee80211_prepare_and_rx_handle()
5017 ether_addr_copy(hdr->addr3, rx->sta->addr); in ieee80211_prepare_and_rx_handle()
5019 ether_addr_copy(hdr->addr3, rx->sdata->vif.addr); in ieee80211_prepare_and_rx_handle()
5024 ieee80211_invoke_rx_handlers(rx); in ieee80211_prepare_and_rx_handle()
5036 struct ieee80211_rx_data rx; in __ieee80211_rx_handle_8023() local
5040 memset(&rx, 0, sizeof(rx)); in __ieee80211_rx_handle_8023()
5041 rx.skb = skb; in __ieee80211_rx_handle_8023()
5042 rx.local = local; in __ieee80211_rx_handle_8023()
5043 rx.list = list; in __ieee80211_rx_handle_8023()
5044 rx.link_id = -1; in __ieee80211_rx_handle_8023()
5066 if (!ieee80211_rx_data_set_sta(&rx, sta, link_id)) in __ieee80211_rx_handle_8023()
5069 fast_rx = rcu_dereference(rx.sta->fast_rx); in __ieee80211_rx_handle_8023()
5073 ieee80211_rx_8023(&rx, fast_rx, skb->len); in __ieee80211_rx_handle_8023()
5080 static bool ieee80211_rx_for_interface(struct ieee80211_rx_data *rx, in ieee80211_rx_for_interface() argument
5094 link_sta = link_sta_info_get_bss(rx->sdata, hdr->addr2); in ieee80211_rx_for_interface()
5101 sta = sta_info_get_bss(rx->sdata, hdr->addr2); in ieee80211_rx_for_interface()
5106 if (!ieee80211_rx_data_set_sta(rx, sta, link_id)) in ieee80211_rx_for_interface()
5109 return ieee80211_prepare_and_rx_handle(rx, skb, consume); in ieee80211_rx_for_interface()
5113 * This is the actual Rx frames handler. as it belongs to Rx path it must
5126 struct ieee80211_rx_data rx; in __ieee80211_rx_handle_packet() local
5132 memset(&rx, 0, sizeof(rx)); in __ieee80211_rx_handle_packet()
5133 rx.skb = skb; in __ieee80211_rx_handle_packet()
5134 rx.local = local; in __ieee80211_rx_handle_packet()
5135 rx.list = list; in __ieee80211_rx_handle_packet()
5136 rx.link_id = -1; in __ieee80211_rx_handle_packet()
5157 ieee80211_parse_qos(&rx); in __ieee80211_rx_handle_packet()
5158 ieee80211_verify_alignment(&rx); in __ieee80211_rx_handle_packet()
5174 if (!ieee80211_rx_data_set_sta(&rx, sta, link_id)) in __ieee80211_rx_handle_packet()
5189 link_sta = link_sta_info_get_bss(rx.sdata, in __ieee80211_rx_handle_packet()
5194 ieee80211_rx_data_set_link(&rx, link_sta->link_id); in __ieee80211_rx_handle_packet()
5197 if (ieee80211_prepare_and_rx_handle(&rx, skb, true)) in __ieee80211_rx_handle_packet()
5210 rx.sdata = prev_sta->sdata; in __ieee80211_rx_handle_packet()
5211 if (!ieee80211_rx_data_set_sta(&rx, prev_sta, link_id)) in __ieee80211_rx_handle_packet()
5217 ieee80211_prepare_and_rx_handle(&rx, skb, false); in __ieee80211_rx_handle_packet()
5223 rx.sdata = prev_sta->sdata; in __ieee80211_rx_handle_packet()
5224 if (!ieee80211_rx_data_set_sta(&rx, prev_sta, link_id)) in __ieee80211_rx_handle_packet()
5230 if (ieee80211_prepare_and_rx_handle(&rx, skb, true)) in __ieee80211_rx_handle_packet()
5257 rx.sdata = prev; in __ieee80211_rx_handle_packet()
5258 ieee80211_rx_for_interface(&rx, skb, false); in __ieee80211_rx_handle_packet()
5264 rx.sdata = prev; in __ieee80211_rx_handle_packet()
5266 if (ieee80211_rx_for_interface(&rx, skb, true)) in __ieee80211_rx_handle_packet()
5306 /* We might be during a HW reconfig, prevent Rx for the same reason */ in ieee80211_rx_list()
5439 /* This is a version of the rx handler that can be called from hard irq