Lines Matching full:rx

739 		 * RX header they pull before we get here, and that should  in ieee80211_make_monitor_skb()
812 * (2) the other RX handlers will modify the skb we got. in ieee80211_rx_monitor()
894 static void ieee80211_parse_qos(struct ieee80211_rx_data *rx) in ieee80211_parse_qos() argument
896 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; in ieee80211_parse_qos()
897 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); in ieee80211_parse_qos()
929 rx->seqno_idx = seqno_idx; in ieee80211_parse_qos()
930 rx->security_idx = security_idx; in ieee80211_parse_qos()
933 rx->skb->priority = (tid > 7) ? 0 : tid; in ieee80211_parse_qos()
961 static void ieee80211_verify_alignment(struct ieee80211_rx_data *rx) in ieee80211_verify_alignment() argument
964 WARN_ON_ONCE((unsigned long)rx->skb->data & 1); in ieee80211_verify_alignment()
969 /* rx handlers */
1041 static ieee80211_rx_result ieee80211_rx_mesh_check(struct ieee80211_rx_data *rx) in ieee80211_rx_mesh_check() argument
1043 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; in ieee80211_rx_mesh_check()
1044 char *dev_addr = rx->sdata->vif.addr; in ieee80211_rx_mesh_check()
1065 if (!rx->sta || sta_plink_state(rx->sta) != NL80211_PLINK_ESTAB) { in ieee80211_rx_mesh_check()
1075 if (rx->skb->len < IEEE80211_MIN_ACTION_SIZE) in ieee80211_rx_mesh_check()
1167 * Timeout (in jiffies) for skb's that are waiting in the RX reorder buffer. If
1211 "release an RX reorder frame due to timeout on earlier frames\n"); in ieee80211_sta_reorder_release()
1250 * As this function belongs to the RX path it must be under
1354 static void ieee80211_rx_reorder_ampdu(struct ieee80211_rx_data *rx, in ieee80211_rx_reorder_ampdu() argument
1357 struct sk_buff *skb = rx->skb; in ieee80211_rx_reorder_ampdu()
1359 struct sta_info *sta = rx->sta; in ieee80211_rx_reorder_ampdu()
1369 * filter the QoS data rx stream according to in ieee80211_rx_reorder_ampdu()
1383 !test_bit(tid, rx->sta->ampdu_mlme.agg_session_valid) && in ieee80211_rx_reorder_ampdu()
1384 !test_and_set_bit(tid, rx->sta->ampdu_mlme.unexpected_agg)) in ieee80211_rx_reorder_ampdu()
1385 ieee80211_send_delba(rx->sdata, rx->sta->sta.addr, tid, in ieee80211_rx_reorder_ampdu()
1405 /* if this mpdu is fragmented - terminate rx aggregation session */ in ieee80211_rx_reorder_ampdu()
1408 ieee80211_queue_skb_to_iface(rx->sdata, rx->link_id, NULL, skb); in ieee80211_rx_reorder_ampdu()
1414 * RX packet at a time, and thus own tid_agg_rx. All in ieee80211_rx_reorder_ampdu()
1419 if (ieee80211_sta_manage_reorder_buf(rx->sdata, tid_agg_rx, skb, in ieee80211_rx_reorder_ampdu()
1428 ieee80211_rx_h_check_dup(struct ieee80211_rx_data *rx) in ieee80211_rx_h_check_dup() argument
1430 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; in ieee80211_rx_h_check_dup()
1431 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); in ieee80211_rx_h_check_dup()
1441 if (rx->skb->len < 24) in ieee80211_rx_h_check_dup()
1449 if (!rx->sta) in ieee80211_rx_h_check_dup()
1453 rx->sta->last_seq_ctrl[rx->seqno_idx] == hdr->seq_ctrl)) { in ieee80211_rx_h_check_dup()
1454 I802_DEBUG_INC(rx->local->dot11FrameDuplicateCount); in ieee80211_rx_h_check_dup()
1455 rx->link_sta->rx_stats.num_duplicates++; in ieee80211_rx_h_check_dup()
1458 rx->sta->last_seq_ctrl[rx->seqno_idx] = hdr->seq_ctrl; in ieee80211_rx_h_check_dup()
1465 ieee80211_rx_h_check(struct ieee80211_rx_data *rx) in ieee80211_rx_h_check() argument
1467 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; in ieee80211_rx_h_check()
1478 if (ieee80211_vif_is_mesh(&rx->sdata->vif)) in ieee80211_rx_h_check()
1479 return ieee80211_rx_mesh_check(rx); in ieee80211_rx_h_check()
1483 rx->sdata->vif.type != NL80211_IFTYPE_ADHOC && in ieee80211_rx_h_check()
1484 rx->sdata->vif.type != NL80211_IFTYPE_OCB && in ieee80211_rx_h_check()
1485 (!rx->sta || !test_sta_flag(rx->sta, WLAN_STA_ASSOC)))) { in ieee80211_rx_h_check()
1491 if (rx->sta && rx->sdata->vif.type == NL80211_IFTYPE_STATION && in ieee80211_rx_h_check()
1498 if (rx->skb->len < hdrlen + 8) in ieee80211_rx_h_check()
1501 skb_copy_bits(rx->skb, hdrlen + 6, &ethertype, 2); in ieee80211_rx_h_check()
1502 if (ethertype == rx->sdata->control_port_protocol) in ieee80211_rx_h_check()
1506 if (rx->sdata->vif.type == NL80211_IFTYPE_AP && in ieee80211_rx_h_check()
1507 cfg80211_rx_spurious_frame(rx->sdata->dev, in ieee80211_rx_h_check()
1520 ieee80211_rx_h_check_more_data(struct ieee80211_rx_data *rx) in ieee80211_rx_h_check_more_data() argument
1526 local = rx->local; in ieee80211_rx_h_check_more_data()
1527 skb = rx->skb; in ieee80211_rx_h_check_more_data()
1547 ieee80211_send_pspoll(local, rx->sdata); in ieee80211_rx_h_check_more_data()
1680 ieee80211_rx_h_uapsd_and_pspoll(struct ieee80211_rx_data *rx) in ieee80211_rx_h_uapsd_and_pspoll() argument
1682 struct ieee80211_sub_if_data *sdata = rx->sdata; in ieee80211_rx_h_uapsd_and_pspoll()
1683 struct ieee80211_hdr *hdr = (void *)rx->skb->data; in ieee80211_rx_h_uapsd_and_pspoll()
1684 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); in ieee80211_rx_h_uapsd_and_pspoll()
1686 if (!rx->sta) in ieee80211_rx_h_uapsd_and_pspoll()
1706 if (!test_sta_flag(rx->sta, WLAN_STA_PS_STA)) in ieee80211_rx_h_uapsd_and_pspoll()
1710 ieee80211_sta_pspoll(&rx->sta->sta); in ieee80211_rx_h_uapsd_and_pspoll()
1714 dev_kfree_skb(rx->skb); in ieee80211_rx_h_uapsd_and_pspoll()
1724 ieee80211_sta_uapsd_trigger(&rx->sta->sta, tid); in ieee80211_rx_h_uapsd_and_pspoll()
1731 ieee80211_rx_h_sta_process(struct ieee80211_rx_data *rx) in ieee80211_rx_h_sta_process() argument
1733 struct sta_info *sta = rx->sta; in ieee80211_rx_h_sta_process()
1734 struct link_sta_info *link_sta = rx->link_sta; in ieee80211_rx_h_sta_process()
1735 struct sk_buff *skb = rx->skb; in ieee80211_rx_h_sta_process()
1751 if (rx->sdata->vif.type == NL80211_IFTYPE_ADHOC) { in ieee80211_rx_h_sta_process()
1752 u8 *bssid = ieee80211_get_bssid(hdr, rx->skb->len, in ieee80211_rx_h_sta_process()
1754 if (ether_addr_equal(bssid, rx->sdata->u.ibss.bssid) && in ieee80211_rx_h_sta_process()
1762 } else if (rx->sdata->vif.type == NL80211_IFTYPE_OCB) { in ieee80211_rx_h_sta_process()
1778 link_sta->rx_stats.bytes += rx->skb->len; in ieee80211_rx_h_sta_process()
1815 (rx->sdata->vif.type == NL80211_IFTYPE_AP || in ieee80211_rx_h_sta_process()
1816 rx->sdata->vif.type == NL80211_IFTYPE_AP_VLAN)) { in ieee80211_rx_h_sta_process()
1827 if (ieee80211_vif_is_mesh(&rx->sdata->vif)) in ieee80211_rx_h_sta_process()
1835 I802_DEBUG_INC(rx->local->rx_handlers_drop_nullfunc); in ieee80211_rx_h_sta_process()
1844 (rx->sdata->vif.type == NL80211_IFTYPE_AP || in ieee80211_rx_h_sta_process()
1845 (rx->sdata->vif.type == NL80211_IFTYPE_AP_VLAN && in ieee80211_rx_h_sta_process()
1846 !rx->sdata->u.vlan.sta))) { in ieee80211_rx_h_sta_process()
1849 rx->sdata->dev, sta->sta.addr, in ieee80211_rx_h_sta_process()
1858 dev_kfree_skb(rx->skb); in ieee80211_rx_h_sta_process()
1866 ieee80211_rx_get_bigtk(struct ieee80211_rx_data *rx, int idx) in ieee80211_rx_get_bigtk() argument
1887 if (rx->link_sta) in ieee80211_rx_get_bigtk()
1888 key = rcu_dereference(rx->link_sta->gtk[idx]); in ieee80211_rx_get_bigtk()
1890 key = rcu_dereference(rx->link->gtk[idx]); in ieee80211_rx_get_bigtk()
1891 if (!key && rx->link_sta) in ieee80211_rx_get_bigtk()
1892 key = rcu_dereference(rx->link_sta->gtk[idx2]); in ieee80211_rx_get_bigtk()
1894 key = rcu_dereference(rx->link->gtk[idx2]); in ieee80211_rx_get_bigtk()
1900 ieee80211_rx_h_decrypt(struct ieee80211_rx_data *rx) in ieee80211_rx_h_decrypt() argument
1902 struct sk_buff *skb = rx->skb; in ieee80211_rx_h_decrypt()
1944 rx->key = NULL; in ieee80211_rx_h_decrypt()
1947 if (rx->sta) { in ieee80211_rx_h_decrypt()
1948 int keyid = rx->sta->ptk_idx; in ieee80211_rx_h_decrypt()
1949 sta_ptk = rcu_dereference(rx->sta->ptk[keyid]); in ieee80211_rx_h_decrypt()
1953 keyid = ieee80211_get_keyid(rx->skb); in ieee80211_rx_h_decrypt()
1958 ptk_idx = rcu_dereference(rx->sta->ptk[keyid]); in ieee80211_rx_h_decrypt()
1963 mmie_keyidx = ieee80211_get_mmie_keyidx(rx->skb); in ieee80211_rx_h_decrypt()
1966 rx->key = ptk_idx ? ptk_idx : sta_ptk; in ieee80211_rx_h_decrypt()
1982 if (rx->sdata->dev) in ieee80211_rx_h_decrypt()
1983 cfg80211_rx_unprot_mlme_mgmt(rx->sdata->dev, in ieee80211_rx_h_decrypt()
1989 rx->key = ieee80211_rx_get_bigtk(rx, mmie_keyidx); in ieee80211_rx_h_decrypt()
1990 if (!rx->key) in ieee80211_rx_h_decrypt()
2001 if (rx->link_sta) { in ieee80211_rx_h_decrypt()
2003 test_sta_flag(rx->sta, WLAN_STA_MFP)) in ieee80211_rx_h_decrypt()
2006 rx->key = rcu_dereference(rx->link_sta->gtk[mmie_keyidx]); in ieee80211_rx_h_decrypt()
2008 if (!rx->key) in ieee80211_rx_h_decrypt()
2009 rx->key = rcu_dereference(rx->link->gtk[mmie_keyidx]); in ieee80211_rx_h_decrypt()
2013 * need to set rx->key if there is a key that could have been in ieee80211_rx_h_decrypt()
2021 key = ieee80211_rx_get_bigtk(rx, -1); in ieee80211_rx_h_decrypt()
2024 key = rcu_dereference(rx->link->default_mgmt_key); in ieee80211_rx_h_decrypt()
2026 if (rx->link_sta) { in ieee80211_rx_h_decrypt()
2028 key = rcu_dereference(rx->link_sta->gtk[i]); in ieee80211_rx_h_decrypt()
2035 key = rcu_dereference(rx->link->gtk[i]); in ieee80211_rx_h_decrypt()
2042 rx->key = key; in ieee80211_rx_h_decrypt()
2058 keyidx = ieee80211_get_keyid(rx->skb); in ieee80211_rx_h_decrypt()
2064 if (is_multicast_ether_addr(hdr->addr1) && rx->link_sta) in ieee80211_rx_h_decrypt()
2065 rx->key = rcu_dereference(rx->link_sta->gtk[keyidx]); in ieee80211_rx_h_decrypt()
2068 if (!rx->key) { in ieee80211_rx_h_decrypt()
2070 rx->key = rcu_dereference(rx->link->gtk[keyidx]); in ieee80211_rx_h_decrypt()
2071 if (!rx->key) in ieee80211_rx_h_decrypt()
2072 rx->key = rcu_dereference(rx->sdata->keys[keyidx]); in ieee80211_rx_h_decrypt()
2079 if (rx->key && in ieee80211_rx_h_decrypt()
2080 rx->key->conf.cipher != WLAN_CIPHER_SUITE_WEP40 && in ieee80211_rx_h_decrypt()
2081 rx->key->conf.cipher != WLAN_CIPHER_SUITE_WEP104 && in ieee80211_rx_h_decrypt()
2083 rx->key = NULL; in ieee80211_rx_h_decrypt()
2087 if (rx->key) { in ieee80211_rx_h_decrypt()
2088 if (unlikely(rx->key->flags & KEY_FLAG_TAINTED)) in ieee80211_rx_h_decrypt()
2096 switch (rx->key->conf.cipher) { in ieee80211_rx_h_decrypt()
2099 result = ieee80211_crypto_wep_decrypt(rx); in ieee80211_rx_h_decrypt()
2102 result = ieee80211_crypto_tkip_decrypt(rx); in ieee80211_rx_h_decrypt()
2106 rx, IEEE80211_CCMP_MIC_LEN); in ieee80211_rx_h_decrypt()
2110 rx, IEEE80211_CCMP_256_MIC_LEN); in ieee80211_rx_h_decrypt()
2113 result = ieee80211_crypto_aes_cmac_decrypt(rx); in ieee80211_rx_h_decrypt()
2116 result = ieee80211_crypto_aes_cmac_256_decrypt(rx); in ieee80211_rx_h_decrypt()
2120 result = ieee80211_crypto_aes_gmac_decrypt(rx); in ieee80211_rx_h_decrypt()
2124 result = ieee80211_crypto_gcmp_decrypt(rx); in ieee80211_rx_h_decrypt()
2136 rx->sdata->dev)) in ieee80211_rx_h_decrypt()
2137 cfg80211_rx_unprot_mlme_mgmt(rx->sdata->dev, in ieee80211_rx_h_decrypt()
2229 static bool requires_sequential_pn(struct ieee80211_rx_data *rx, __le16 fc) in requires_sequential_pn() argument
2231 return rx->key && in requires_sequential_pn()
2232 (rx->key->conf.cipher == WLAN_CIPHER_SUITE_CCMP || in requires_sequential_pn()
2233 rx->key->conf.cipher == WLAN_CIPHER_SUITE_CCMP_256 || in requires_sequential_pn()
2234 rx->key->conf.cipher == WLAN_CIPHER_SUITE_GCMP || in requires_sequential_pn()
2235 rx->key->conf.cipher == WLAN_CIPHER_SUITE_GCMP_256) && in requires_sequential_pn()
2240 ieee80211_rx_h_defragment(struct ieee80211_rx_data *rx) in ieee80211_rx_h_defragment() argument
2242 struct ieee80211_fragment_cache *cache = &rx->sdata->frags; in ieee80211_rx_h_defragment()
2249 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); in ieee80211_rx_h_defragment()
2251 hdr = (struct ieee80211_hdr *)rx->skb->data; in ieee80211_rx_h_defragment()
2260 if (rx->sta) in ieee80211_rx_h_defragment()
2261 cache = &rx->sta->frags; in ieee80211_rx_h_defragment()
2269 I802_DEBUG_INC(rx->local->rx_handlers_fragments); in ieee80211_rx_h_defragment()
2271 if (skb_linearize(rx->skb)) in ieee80211_rx_h_defragment()
2279 hdr = (struct ieee80211_hdr *)rx->skb->data; in ieee80211_rx_h_defragment()
2285 rx->seqno_idx, &(rx->skb)); in ieee80211_rx_h_defragment()
2286 if (requires_sequential_pn(rx, fc)) { in ieee80211_rx_h_defragment()
2287 int queue = rx->security_idx; in ieee80211_rx_h_defragment()
2294 entry->key_color = rx->key->color; in ieee80211_rx_h_defragment()
2296 rx->key->u.ccmp.rx_pn[queue], in ieee80211_rx_h_defragment()
2302 BUILD_BUG_ON(sizeof(rx->key->u.ccmp.rx_pn[queue]) != in ieee80211_rx_h_defragment()
2303 sizeof(rx->key->u.gcmp.rx_pn[queue])); in ieee80211_rx_h_defragment()
2306 } else if (rx->key && in ieee80211_rx_h_defragment()
2310 entry->key_color = rx->key->color; in ieee80211_rx_h_defragment()
2319 rx->seqno_idx, hdr); in ieee80211_rx_h_defragment()
2321 I802_DEBUG_INC(rx->local->rx_handlers_drop_defrag); in ieee80211_rx_h_defragment()
2334 if (!requires_sequential_pn(rx, fc)) in ieee80211_rx_h_defragment()
2338 if (entry->key_color != rx->key->color) in ieee80211_rx_h_defragment()
2348 rpn = rx->ccm_gcm.pn; in ieee80211_rx_h_defragment()
2353 (!rx->key || in ieee80211_rx_h_defragment()
2356 rx->key->color != entry->key_color)) { in ieee80211_rx_h_defragment()
2362 } else if (entry->is_protected && rx->key && in ieee80211_rx_h_defragment()
2363 entry->key_color != rx->key->color && in ieee80211_rx_h_defragment()
2368 skb_pull(rx->skb, ieee80211_hdrlen(fc)); in ieee80211_rx_h_defragment()
2369 __skb_queue_tail(&entry->skb_list, rx->skb); in ieee80211_rx_h_defragment()
2371 entry->extra_len += rx->skb->len; in ieee80211_rx_h_defragment()
2373 rx->skb = NULL; in ieee80211_rx_h_defragment()
2377 rx->skb = __skb_dequeue(&entry->skb_list); in ieee80211_rx_h_defragment()
2378 if (skb_tailroom(rx->skb) < entry->extra_len) { in ieee80211_rx_h_defragment()
2379 I802_DEBUG_INC(rx->local->rx_expand_skb_head_defrag); in ieee80211_rx_h_defragment()
2380 if (unlikely(pskb_expand_head(rx->skb, 0, entry->extra_len, in ieee80211_rx_h_defragment()
2382 I802_DEBUG_INC(rx->local->rx_handlers_drop_defrag); in ieee80211_rx_h_defragment()
2388 skb_put_data(rx->skb, skb->data, skb->len); in ieee80211_rx_h_defragment()
2393 ieee80211_led_rx(rx->local); in ieee80211_rx_h_defragment()
2394 if (rx->sta) in ieee80211_rx_h_defragment()
2395 rx->link_sta->rx_stats.packets++; in ieee80211_rx_h_defragment()
2399 static int ieee80211_802_1x_port_control(struct ieee80211_rx_data *rx) in ieee80211_802_1x_port_control() argument
2401 if (unlikely(!rx->sta || !test_sta_flag(rx->sta, WLAN_STA_AUTHORIZED))) in ieee80211_802_1x_port_control()
2407 static int ieee80211_drop_unencrypted(struct ieee80211_rx_data *rx, __le16 fc) in ieee80211_drop_unencrypted() argument
2409 struct ieee80211_hdr *hdr = (void *)rx->skb->data; in ieee80211_drop_unencrypted()
2410 struct sk_buff *skb = rx->skb; in ieee80211_drop_unencrypted()
2421 if (unlikely(rx->sta && ieee80211_vif_is_mesh(&rx->sdata->vif) && in ieee80211_drop_unencrypted()
2428 if (!ether_addr_equal(hdr->addr1, rx->sdata->vif.addr)) in ieee80211_drop_unencrypted()
2432 if (!pskb_may_pull(rx->skb, hdr_len + 6)) in ieee80211_drop_unencrypted()
2439 if (skb_copy_bits(rx->skb, ethertype_offset, &ethertype, 2) == 0 && in ieee80211_drop_unencrypted()
2440 ethertype == rx->sdata->control_port_protocol) in ieee80211_drop_unencrypted()
2448 ieee80211_is_data(fc) && rx->key)) in ieee80211_drop_unencrypted()
2454 static int ieee80211_drop_unencrypted_mgmt(struct ieee80211_rx_data *rx) in ieee80211_drop_unencrypted_mgmt() argument
2456 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; in ieee80211_drop_unencrypted_mgmt()
2457 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); in ieee80211_drop_unencrypted_mgmt()
2467 if (rx->sta && test_sta_flag(rx->sta, WLAN_STA_MFP)) { in ieee80211_drop_unencrypted_mgmt()
2469 ieee80211_is_unicast_robust_mgmt_frame(rx->skb) && in ieee80211_drop_unencrypted_mgmt()
2470 rx->key)) { in ieee80211_drop_unencrypted_mgmt()
2473 cfg80211_rx_unprot_mlme_mgmt(rx->sdata->dev, in ieee80211_drop_unencrypted_mgmt()
2474 rx->skb->data, in ieee80211_drop_unencrypted_mgmt()
2475 rx->skb->len); in ieee80211_drop_unencrypted_mgmt()
2479 if (unlikely(ieee80211_is_multicast_robust_mgmt_frame(rx->skb) && in ieee80211_drop_unencrypted_mgmt()
2480 ieee80211_get_mmie_keyidx(rx->skb) < 0)) { in ieee80211_drop_unencrypted_mgmt()
2483 cfg80211_rx_unprot_mlme_mgmt(rx->sdata->dev, in ieee80211_drop_unencrypted_mgmt()
2484 rx->skb->data, in ieee80211_drop_unencrypted_mgmt()
2485 rx->skb->len); in ieee80211_drop_unencrypted_mgmt()
2488 if (unlikely(ieee80211_is_beacon(fc) && rx->key && in ieee80211_drop_unencrypted_mgmt()
2489 ieee80211_get_mmie_keyidx(rx->skb) < 0)) { in ieee80211_drop_unencrypted_mgmt()
2490 cfg80211_rx_unprot_mlme_mgmt(rx->sdata->dev, in ieee80211_drop_unencrypted_mgmt()
2491 rx->skb->data, in ieee80211_drop_unencrypted_mgmt()
2492 rx->skb->len); in ieee80211_drop_unencrypted_mgmt()
2499 if (unlikely(ieee80211_is_action(fc) && !rx->key && in ieee80211_drop_unencrypted_mgmt()
2500 ieee80211_is_robust_mgmt_frame(rx->skb))) in ieee80211_drop_unencrypted_mgmt()
2508 __ieee80211_data_to_8023(struct ieee80211_rx_data *rx, bool *port_control) in __ieee80211_data_to_8023() argument
2510 struct ieee80211_sub_if_data *sdata = rx->sdata; in __ieee80211_data_to_8023()
2511 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; in __ieee80211_data_to_8023()
2534 ret = ieee80211_data_to_8023(rx->skb, sdata->vif.addr, sdata->vif.type); in __ieee80211_data_to_8023()
2538 ehdr = (struct ethhdr *) rx->skb->data; in __ieee80211_data_to_8023()
2539 if (ehdr->h_proto == rx->sdata->control_port_protocol) in __ieee80211_data_to_8023()
2577 * requires that rx->skb is a frame with ethernet header
2579 static bool ieee80211_frame_allowed(struct ieee80211_rx_data *rx, __le16 fc) in ieee80211_frame_allowed() argument
2583 struct ethhdr *ehdr = (struct ethhdr *) rx->skb->data; in ieee80211_frame_allowed()
2590 if (unlikely(ehdr->h_proto == rx->sdata->control_port_protocol)) in ieee80211_frame_allowed()
2591 return ieee80211_is_our_addr(rx->sdata, ehdr->h_dest, NULL) || in ieee80211_frame_allowed()
2594 if (ieee80211_802_1x_port_control(rx) || in ieee80211_frame_allowed()
2595 ieee80211_drop_unencrypted(rx, fc)) in ieee80211_frame_allowed()
2602 struct ieee80211_rx_data *rx) in ieee80211_deliver_skb_to_local_stack() argument
2604 struct ieee80211_sub_if_data *sdata = rx->sdata; in ieee80211_deliver_skb_to_local_stack()
2641 if (rx->list) in ieee80211_deliver_skb_to_local_stack()
2642 list_add_tail(&skb->list, rx->list); in ieee80211_deliver_skb_to_local_stack()
2649 * requires that rx->skb is a frame with ethernet header
2652 ieee80211_deliver_skb(struct ieee80211_rx_data *rx) in ieee80211_deliver_skb() argument
2654 struct ieee80211_sub_if_data *sdata = rx->sdata; in ieee80211_deliver_skb()
2657 struct ethhdr *ehdr = (struct ethhdr *) rx->skb->data; in ieee80211_deliver_skb()
2660 skb = rx->skb; in ieee80211_deliver_skb()
2665 if (rx->sta) { in ieee80211_deliver_skb()
2671 u64_stats_update_begin(&rx->link_sta->rx_stats.syncp); in ieee80211_deliver_skb()
2672 rx->link_sta->rx_stats.msdu[rx->seqno_idx]++; in ieee80211_deliver_skb()
2673 u64_stats_update_end(&rx->link_sta->rx_stats.syncp); in ieee80211_deliver_skb()
2679 ehdr->h_proto != rx->sdata->control_port_protocol && in ieee80211_deliver_skb()
2735 ieee80211_deliver_skb_to_local_stack(skb, rx); in ieee80211_deliver_skb()
2753 __ieee80211_rx_h_amsdu(struct ieee80211_rx_data *rx, u8 data_offset) in __ieee80211_rx_h_amsdu() argument
2755 struct net_device *dev = rx->sdata->dev; in __ieee80211_rx_h_amsdu()
2756 struct sk_buff *skb = rx->skb; in __ieee80211_rx_h_amsdu()
2766 } else switch (rx->sdata->vif.type) { in __ieee80211_rx_h_amsdu()
2772 if (!rx->sta || in __ieee80211_rx_h_amsdu()
2773 !test_sta_flag(rx->sta, WLAN_STA_TDLS_PEER)) in __ieee80211_rx_h_amsdu()
2787 rx->sdata->vif.addr, in __ieee80211_rx_h_amsdu()
2788 rx->sdata->vif.type, in __ieee80211_rx_h_amsdu()
2793 rx->sdata->vif.type, in __ieee80211_rx_h_amsdu()
2794 rx->local->hw.extra_tx_headroom, in __ieee80211_rx_h_amsdu()
2798 rx->skb = __skb_dequeue(&frame_list); in __ieee80211_rx_h_amsdu()
2800 if (!ieee80211_frame_allowed(rx, fc)) { in __ieee80211_rx_h_amsdu()
2801 dev_kfree_skb(rx->skb); in __ieee80211_rx_h_amsdu()
2805 ieee80211_deliver_skb(rx); in __ieee80211_rx_h_amsdu()
2812 ieee80211_rx_h_amsdu(struct ieee80211_rx_data *rx) in ieee80211_rx_h_amsdu() argument
2814 struct sk_buff *skb = rx->skb; in ieee80211_rx_h_amsdu()
2829 switch (rx->sdata->vif.type) { in ieee80211_rx_h_amsdu()
2831 if (!rx->sdata->u.vlan.sta) in ieee80211_rx_h_amsdu()
2835 if (!rx->sdata->u.mgd.use_4addr) in ieee80211_rx_h_amsdu()
2846 if (rx->key) { in ieee80211_rx_h_amsdu()
2853 switch (rx->key->conf.cipher) { in ieee80211_rx_h_amsdu()
2863 return __ieee80211_rx_h_amsdu(rx, 0); in ieee80211_rx_h_amsdu()
2868 ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx) in ieee80211_rx_h_mesh_fwding() argument
2873 struct sk_buff *skb = rx->skb, *fwd_skb; in ieee80211_rx_h_mesh_fwding()
2874 struct ieee80211_local *local = rx->local; in ieee80211_rx_h_mesh_fwding()
2875 struct ieee80211_sub_if_data *sdata = rx->sdata; in ieee80211_rx_h_mesh_fwding()
2884 if (!pskb_may_pull(rx->skb, hdrlen + 6)) in ieee80211_rx_h_mesh_fwding()
2890 if (!pskb_may_pull(rx->skb, in ieee80211_rx_h_mesh_fwding()
2898 if (ieee80211_drop_unencrypted(rx, hdr->frame_control)) in ieee80211_rx_h_mesh_fwding()
2904 mesh_rmc_check(rx->sdata, hdr->addr3, mesh_hdr)) in ieee80211_rx_h_mesh_fwding()
2982 info->control.vif = &rx->sdata->vif; in ieee80211_rx_h_mesh_fwding()
3013 ieee80211_rx_h_data(struct ieee80211_rx_data *rx) in ieee80211_rx_h_data() argument
3015 struct ieee80211_sub_if_data *sdata = rx->sdata; in ieee80211_rx_h_data()
3016 struct ieee80211_local *local = rx->local; in ieee80211_rx_h_data()
3018 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)rx->skb->data; in ieee80211_rx_h_data()
3035 if (rx->sta && in ieee80211_rx_h_data()
3036 !test_and_set_sta_flag(rx->sta, WLAN_STA_4ADDR_EVENT)) in ieee80211_rx_h_data()
3038 rx->sdata->dev, rx->sta->sta.addr, GFP_ATOMIC); in ieee80211_rx_h_data()
3042 err = __ieee80211_data_to_8023(rx, &port_control); in ieee80211_rx_h_data()
3046 if (!ieee80211_frame_allowed(rx, fc)) in ieee80211_rx_h_data()
3050 if (unlikely(((struct ethhdr *)rx->skb->data)->h_proto == in ieee80211_rx_h_data()
3052 struct ieee80211_tdls_data *tf = (void *)rx->skb->data; in ieee80211_rx_h_data()
3054 if (pskb_may_pull(rx->skb, in ieee80211_rx_h_data()
3060 rx->skb->protocol = cpu_to_be16(ETH_P_TDLS); in ieee80211_rx_h_data()
3061 __ieee80211_queue_skb_to_iface(sdata, rx->link_id, in ieee80211_rx_h_data()
3062 rx->sta, rx->skb); in ieee80211_rx_h_data()
3067 if (rx->sdata->vif.type == NL80211_IFTYPE_AP_VLAN && in ieee80211_rx_h_data()
3072 rx->sdata = sdata; in ieee80211_rx_h_data()
3075 rx->skb->dev = dev; in ieee80211_rx_h_data()
3080 ((struct ethhdr *)rx->skb->data)->h_dest) && in ieee80211_rx_h_data()
3086 ieee80211_deliver_skb(rx); in ieee80211_rx_h_data()
3092 ieee80211_rx_h_ctrl(struct ieee80211_rx_data *rx, struct sk_buff_head *frames) in ieee80211_rx_h_ctrl() argument
3094 struct sk_buff *skb = rx->skb; in ieee80211_rx_h_ctrl()
3111 if (!rx->sta) in ieee80211_rx_h_ctrl()
3120 if (!test_bit(tid, rx->sta->ampdu_mlme.agg_session_valid) && in ieee80211_rx_h_ctrl()
3121 !test_and_set_bit(tid, rx->sta->ampdu_mlme.unexpected_agg)) in ieee80211_rx_h_ctrl()
3122 ieee80211_send_delba(rx->sdata, rx->sta->sta.addr, tid, in ieee80211_rx_h_ctrl()
3126 tid_agg_rx = rcu_dereference(rx->sta->ampdu_mlme.tid_rx[tid]); in ieee80211_rx_h_ctrl()
3133 event.u.ba.sta = &rx->sta->sta; in ieee80211_rx_h_ctrl()
3142 ieee80211_release_reorder_frames(rx->sdata, tid_agg_rx, in ieee80211_rx_h_ctrl()
3146 drv_event_callback(rx->local, rx->sdata, &event); in ieee80211_rx_h_ctrl()
3206 ieee80211_rx_check_bss_color_collision(struct ieee80211_rx_data *rx) in ieee80211_rx_check_bss_color_collision() argument
3208 struct ieee80211_mgmt *mgmt = (void *)rx->skb->data; in ieee80211_rx_check_bss_color_collision()
3212 if (!wiphy_ext_feature_isset(rx->local->hw.wiphy, in ieee80211_rx_check_bss_color_collision()
3216 if (ieee80211_hw_check(&rx->local->hw, DETECTS_COLOR_COLLISION)) in ieee80211_rx_check_bss_color_collision()
3219 if (rx->sdata->vif.bss_conf.csa_active) in ieee80211_rx_check_bss_color_collision()
3222 baselen = mgmt->u.beacon.variable - rx->skb->data; in ieee80211_rx_check_bss_color_collision()
3223 if (baselen > rx->skb->len) in ieee80211_rx_check_bss_color_collision()
3228 rx->skb->len - baselen); in ieee80211_rx_check_bss_color_collision()
3231 struct ieee80211_bss_conf *bss_conf = &rx->sdata->vif.bss_conf; in ieee80211_rx_check_bss_color_collision()
3243 ieeee80211_obss_color_collision_notify(&rx->sdata->vif, in ieee80211_rx_check_bss_color_collision()
3250 ieee80211_rx_h_mgmt_check(struct ieee80211_rx_data *rx) in ieee80211_rx_h_mgmt_check() argument
3252 struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *) rx->skb->data; in ieee80211_rx_h_mgmt_check()
3253 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); in ieee80211_rx_h_mgmt_check()
3263 if (rx->skb->len < 24) in ieee80211_rx_h_mgmt_check()
3269 if (rx->sdata->vif.type == NL80211_IFTYPE_AP && in ieee80211_rx_h_mgmt_check()
3271 !(rx->flags & IEEE80211_RX_BEACON_REPORTED)) { in ieee80211_rx_h_mgmt_check()
3275 ieee80211_rx_check_bss_color_collision(rx); in ieee80211_rx_h_mgmt_check()
3277 if (ieee80211_hw_check(&rx->local->hw, SIGNAL_DBM) && in ieee80211_rx_h_mgmt_check()
3281 cfg80211_report_obss_beacon_khz(rx->local->hw.wiphy, in ieee80211_rx_h_mgmt_check()
3282 rx->skb->data, rx->skb->len, in ieee80211_rx_h_mgmt_check()
3285 rx->flags |= IEEE80211_RX_BEACON_REPORTED; in ieee80211_rx_h_mgmt_check()
3288 if (ieee80211_drop_unencrypted_mgmt(rx)) in ieee80211_rx_h_mgmt_check()
3295 ieee80211_process_rx_twt_action(struct ieee80211_rx_data *rx) in ieee80211_process_rx_twt_action() argument
3297 struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *)rx->skb->data; in ieee80211_process_rx_twt_action()
3298 struct ieee80211_sub_if_data *sdata = rx->sdata; in ieee80211_process_rx_twt_action()
3304 if (!rx->local->ops->add_twt_setup) in ieee80211_process_rx_twt_action()
3310 if (!rx->sta) in ieee80211_process_rx_twt_action()
3317 if (rx->skb->len < IEEE80211_MIN_ACTION_SIZE + in ieee80211_process_rx_twt_action()
3327 if (rx->skb->len < IEEE80211_MIN_ACTION_SIZE + in ieee80211_process_rx_twt_action()
3335 if (rx->skb->len < IEEE80211_MIN_ACTION_SIZE + 2) in ieee80211_process_rx_twt_action()
3347 ieee80211_rx_h_action(struct ieee80211_rx_data *rx) in ieee80211_rx_h_action() argument
3349 struct ieee80211_local *local = rx->local; in ieee80211_rx_h_action()
3350 struct ieee80211_sub_if_data *sdata = rx->sdata; in ieee80211_rx_h_action()
3351 struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *) rx->skb->data; in ieee80211_rx_h_action()
3352 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); in ieee80211_rx_h_action()
3353 int len = rx->skb->len; in ieee80211_rx_h_action()
3362 if (!rx->sta && mgmt->u.action.category != WLAN_CATEGORY_PUBLIC && in ieee80211_rx_h_action()
3370 if (!rx->link_sta->pub->ht_cap.ht_supported) in ieee80211_rx_h_action()
3410 if (rx->link_sta->pub->smps_mode == smps_mode) in ieee80211_rx_h_action()
3412 rx->link_sta->pub->smps_mode = smps_mode; in ieee80211_rx_h_action()
3417 sband = rx->local->hw.wiphy->bands[status->band]; in ieee80211_rx_h_action()
3419 rate_control_rate_update(local, sband, rx->sta, 0, in ieee80211_rx_h_action()
3422 rx->sta->addr, in ieee80211_rx_h_action()
3434 if (!(rx->link_sta->pub->ht_cap.cap & in ieee80211_rx_h_action()
3441 max_bw = ieee80211_sta_cap_rx_bw(rx->link_sta); in ieee80211_rx_h_action()
3444 rx->link_sta->cur_max_bandwidth = max_bw; in ieee80211_rx_h_action()
3445 new_bw = ieee80211_sta_cur_vht_bw(rx->link_sta); in ieee80211_rx_h_action()
3447 if (rx->link_sta->pub->bandwidth == new_bw) in ieee80211_rx_h_action()
3450 rx->link_sta->pub->bandwidth = new_bw; in ieee80211_rx_h_action()
3451 sband = rx->local->hw.wiphy->bands[status->band]; in ieee80211_rx_h_action()
3453 ieee80211_sta_rx_bw_to_chan_width(rx->link_sta); in ieee80211_rx_h_action()
3456 rate_control_rate_update(local, sband, rx->sta, 0, in ieee80211_rx_h_action()
3459 rx->sta->addr, in ieee80211_rx_h_action()
3474 if (!rx->sta) in ieee80211_rx_h_action()
3629 if (ieee80211_process_rx_twt_action(rx)) in ieee80211_rx_h_action()
3646 if (rx->sta) in ieee80211_rx_h_action()
3647 rx->link_sta->rx_stats.packets++; in ieee80211_rx_h_action()
3648 dev_kfree_skb(rx->skb); in ieee80211_rx_h_action()
3652 ieee80211_queue_skb_to_iface(sdata, rx->link_id, rx->sta, rx->skb); in ieee80211_rx_h_action()
3657 ieee80211_rx_h_userspace_mgmt(struct ieee80211_rx_data *rx) in ieee80211_rx_h_userspace_mgmt() argument
3659 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); in ieee80211_rx_h_userspace_mgmt()
3662 .buf = rx->skb->data, in ieee80211_rx_h_userspace_mgmt()
3663 .len = rx->skb->len, in ieee80211_rx_h_userspace_mgmt()
3664 .link_id = rx->link_id, in ieee80211_rx_h_userspace_mgmt()
3665 .have_link_id = rx->link_id >= 0, in ieee80211_rx_h_userspace_mgmt()
3679 if (ieee80211_hw_check(&rx->local->hw, SIGNAL_DBM) && in ieee80211_rx_h_userspace_mgmt()
3683 if (ieee80211_is_timing_measurement(rx->skb) || in ieee80211_rx_h_userspace_mgmt()
3684 ieee80211_is_ftm(rx->skb)) { in ieee80211_rx_h_userspace_mgmt()
3685 info.rx_tstamp = ktime_to_ns(skb_hwtstamps(rx->skb)->hwtstamp); in ieee80211_rx_h_userspace_mgmt()
3689 if (cfg80211_rx_mgmt_ext(&rx->sdata->wdev, &info)) { in ieee80211_rx_h_userspace_mgmt()
3690 if (rx->sta) in ieee80211_rx_h_userspace_mgmt()
3691 rx->link_sta->rx_stats.packets++; in ieee80211_rx_h_userspace_mgmt()
3692 dev_kfree_skb(rx->skb); in ieee80211_rx_h_userspace_mgmt()
3700 ieee80211_rx_h_action_post_userspace(struct ieee80211_rx_data *rx) in ieee80211_rx_h_action_post_userspace() argument
3702 struct ieee80211_sub_if_data *sdata = rx->sdata; in ieee80211_rx_h_action_post_userspace()
3703 struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *) rx->skb->data; in ieee80211_rx_h_action_post_userspace()
3704 int len = rx->skb->len; in ieee80211_rx_h_action_post_userspace()
3728 if (rx->sta) in ieee80211_rx_h_action_post_userspace()
3729 rx->link_sta->rx_stats.packets++; in ieee80211_rx_h_action_post_userspace()
3730 dev_kfree_skb(rx->skb); in ieee80211_rx_h_action_post_userspace()
3735 ieee80211_rx_h_action_return(struct ieee80211_rx_data *rx) in ieee80211_rx_h_action_return() argument
3737 struct ieee80211_local *local = rx->local; in ieee80211_rx_h_action_return()
3738 struct ieee80211_mgmt *mgmt = (struct ieee80211_mgmt *) rx->skb->data; in ieee80211_rx_h_action_return()
3740 struct ieee80211_sub_if_data *sdata = rx->sdata; in ieee80211_rx_h_action_return()
3741 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); in ieee80211_rx_h_action_return()
3768 nskb = skb_copy_expand(rx->skb, local->hw.extra_tx_headroom, 0, in ieee80211_rx_h_action_return()
3775 memcpy(nmgmt->sa, rx->sdata->vif.addr, ETH_ALEN); in ieee80211_rx_h_action_return()
3779 if (rx->sdata->vif.type == NL80211_IFTYPE_P2P_DEVICE) { in ieee80211_rx_h_action_return()
3790 __ieee80211_tx_skb_tid_band(rx->sdata, nskb, 7, -1, in ieee80211_rx_h_action_return()
3793 dev_kfree_skb(rx->skb); in ieee80211_rx_h_action_return()
3798 ieee80211_rx_h_ext(struct ieee80211_rx_data *rx) in ieee80211_rx_h_ext() argument
3800 struct ieee80211_sub_if_data *sdata = rx->sdata; in ieee80211_rx_h_ext()
3801 struct ieee80211_hdr *hdr = (void *)rx->skb->data; in ieee80211_rx_h_ext()
3810 ieee80211_queue_skb_to_iface(sdata, rx->link_id, rx->sta, rx->skb); in ieee80211_rx_h_ext()
3816 ieee80211_rx_h_mgmt(struct ieee80211_rx_data *rx) in ieee80211_rx_h_mgmt() argument
3818 struct ieee80211_sub_if_data *sdata = rx->sdata; in ieee80211_rx_h_mgmt()
3819 struct ieee80211_mgmt *mgmt = (void *)rx->skb->data; in ieee80211_rx_h_mgmt()
3867 ieee80211_queue_skb_to_iface(sdata, rx->link_id, rx->sta, rx->skb); in ieee80211_rx_h_mgmt()
3872 static void ieee80211_rx_cooked_monitor(struct ieee80211_rx_data *rx, in ieee80211_rx_cooked_monitor() argument
3876 struct ieee80211_local *local = rx->local; in ieee80211_rx_cooked_monitor()
3877 struct sk_buff *skb = rx->skb, *skb2; in ieee80211_rx_cooked_monitor()
3886 if (rx->flags & IEEE80211_RX_CMNTR) in ieee80211_rx_cooked_monitor()
3888 rx->flags |= IEEE80211_RX_CMNTR; in ieee80211_rx_cooked_monitor()
3942 static void ieee80211_rx_handlers_result(struct ieee80211_rx_data *rx, in ieee80211_rx_handlers_result() argument
3947 I802_DEBUG_INC(rx->sdata->local->rx_handlers_drop); in ieee80211_rx_handlers_result()
3948 if (rx->sta) in ieee80211_rx_handlers_result()
3949 rx->link_sta->rx_stats.dropped++; in ieee80211_rx_handlers_result()
3956 status = IEEE80211_SKB_RXCB((rx->skb)); in ieee80211_rx_handlers_result()
3958 sband = rx->local->hw.wiphy->bands[status->band]; in ieee80211_rx_handlers_result()
3962 ieee80211_rx_cooked_monitor(rx, rate); in ieee80211_rx_handlers_result()
3966 I802_DEBUG_INC(rx->sdata->local->rx_handlers_drop); in ieee80211_rx_handlers_result()
3967 if (rx->sta) in ieee80211_rx_handlers_result()
3968 rx->link_sta->rx_stats.dropped++; in ieee80211_rx_handlers_result()
3969 dev_kfree_skb(rx->skb); in ieee80211_rx_handlers_result()
3972 I802_DEBUG_INC(rx->sdata->local->rx_handlers_queued); in ieee80211_rx_handlers_result()
3977 static void ieee80211_rx_handlers(struct ieee80211_rx_data *rx, in ieee80211_rx_handlers() argument
3985 res = rxh(rx); \ in ieee80211_rx_handlers()
3990 /* Lock here to avoid hitting all of the data used in the RX in ieee80211_rx_handlers()
3993 * from the timer, potentially concurrently with RX from the in ieee80211_rx_handlers()
3996 spin_lock_bh(&rx->local->rx_path_lock); in ieee80211_rx_handlers()
4004 rx->skb = skb; in ieee80211_rx_handlers()
4006 if (WARN_ON_ONCE(!rx->link)) in ieee80211_rx_handlers()
4017 if (ieee80211_vif_is_mesh(&rx->sdata->vif)) in ieee80211_rx_handlers()
4024 res = ieee80211_rx_h_ctrl(rx, frames); in ieee80211_rx_handlers()
4037 ieee80211_rx_handlers_result(rx, res); in ieee80211_rx_handlers()
4042 spin_unlock_bh(&rx->local->rx_path_lock); in ieee80211_rx_handlers()
4045 static void ieee80211_invoke_rx_handlers(struct ieee80211_rx_data *rx) in ieee80211_invoke_rx_handlers() argument
4054 res = rxh(rx); \ in ieee80211_invoke_rx_handlers()
4062 ieee80211_rx_reorder_ampdu(rx, &reorder_release); in ieee80211_invoke_rx_handlers()
4064 ieee80211_rx_handlers(rx, &reorder_release); in ieee80211_invoke_rx_handlers()
4068 ieee80211_rx_handlers_result(rx, res); in ieee80211_invoke_rx_handlers()
4074 * This function makes calls into the RX path, therefore
4080 struct ieee80211_rx_data rx = { in ieee80211_release_reorder_timeout() local
4108 drv_event_callback(rx.local, rx.sdata, &event); in ieee80211_release_reorder_timeout()
4112 rx.link = rcu_dereference(sta->sdata->link[link_id]); in ieee80211_release_reorder_timeout()
4113 rx.link_sta = rcu_dereference(sta->link[link_id]); in ieee80211_release_reorder_timeout()
4115 ieee80211_rx_handlers(&rx, &frames); in ieee80211_release_reorder_timeout()
4125 struct ieee80211_rx_data rx = { in ieee80211_mark_rx_ba_filtered_frames() local
4140 rx.sta = sta; in ieee80211_mark_rx_ba_filtered_frames()
4141 rx.sdata = sta->sdata; in ieee80211_mark_rx_ba_filtered_frames()
4142 rx.link = &rx.sdata->deflink; in ieee80211_mark_rx_ba_filtered_frames()
4143 rx.local = sta->local; in ieee80211_mark_rx_ba_filtered_frames()
4192 ieee80211_rx_handlers(&rx, &frames); in ieee80211_mark_rx_ba_filtered_frames()
4207 static bool ieee80211_accept_frame(struct ieee80211_rx_data *rx) in ieee80211_accept_frame() argument
4209 struct ieee80211_sub_if_data *sdata = rx->sdata; in ieee80211_accept_frame()
4210 struct sk_buff *skb = rx->skb; in ieee80211_accept_frame()
4221 if (ieee80211_is_robust_mgmt_frame(skb) && !rx->sta) in ieee80211_accept_frame()
4225 return ieee80211_is_our_addr(sdata, hdr->addr1, &rx->link_id); in ieee80211_accept_frame()
4240 if (!rx->sta) { in ieee80211_accept_frame()
4260 if (!rx->sta) { in ieee80211_accept_frame()
4280 &rx->link_id); in ieee80211_accept_frame()
4292 &rx->link_id)) in ieee80211_accept_frame()
4372 /* fast-rx doesn't do reordering */ in ieee80211_check_fast_rx()
4409 /* parallel-rx requires this, at least with calls to in ieee80211_check_fast_rx()
4446 /* we don't want to deal with MMIC in fast-rx */ in ieee80211_check_fast_rx()
4539 static void ieee80211_rx_8023(struct ieee80211_rx_data *rx, in ieee80211_rx_8023() argument
4544 struct ieee80211_rx_status *status = IEEE80211_SKB_RXCB(rx->skb); in ieee80211_rx_8023()
4545 struct sta_info *sta = rx->sta; in ieee80211_rx_8023()
4547 struct sk_buff *skb = rx->skb; in ieee80211_rx_8023()
4551 if (rx->link_id >= 0) { in ieee80211_rx_8023()
4552 link_sta = rcu_dereference(sta->link[rx->link_id]); in ieee80211_rx_8023()
4554 dev_kfree_skb(rx->skb); in ieee80211_rx_8023()
4607 stats->msdu[rx->seqno_idx]++; in ieee80211_rx_8023()
4616 sta_info_get(rx->sdata, da)) { in ieee80211_rx_8023()
4640 ieee80211_deliver_skb_to_local_stack(skb, rx); in ieee80211_rx_8023()
4643 static bool ieee80211_invoke_fast_rx(struct ieee80211_rx_data *rx, in ieee80211_invoke_fast_rx() argument
4646 struct sk_buff *skb = rx->skb; in ieee80211_invoke_fast_rx()
4649 struct sta_info *sta = rx->sta; in ieee80211_invoke_fast_rx()
4664 /* for parallel-rx, we need to have DUP_VALIDATED, otherwise we write in ieee80211_invoke_fast_rx()
4733 if (rx->key && !(status->flag & RX_FLAG_MIC_STRIPPED) && in ieee80211_invoke_fast_rx()
4737 if (rx->key && !ieee80211_has_protected(hdr->frame_control)) in ieee80211_invoke_fast_rx()
4741 if (__ieee80211_rx_h_amsdu(rx, snap_offs - hdrlen) != in ieee80211_invoke_fast_rx()
4758 ieee80211_rx_8023(rx, fast_rx, orig_len); in ieee80211_invoke_fast_rx()
4764 if (rx->link_id >= 0) { in ieee80211_invoke_fast_rx()
4765 link_sta = rcu_dereference(sta->link[rx->link_id]); in ieee80211_invoke_fast_rx()
4783 * was destined for RX processing or not, which,
4787 static bool ieee80211_prepare_and_rx_handle(struct ieee80211_rx_data *rx, in ieee80211_prepare_and_rx_handle() argument
4790 struct ieee80211_local *local = rx->local; in ieee80211_prepare_and_rx_handle()
4791 struct ieee80211_sub_if_data *sdata = rx->sdata; in ieee80211_prepare_and_rx_handle()
4796 rx->skb = skb; in ieee80211_prepare_and_rx_handle()
4798 /* See if we can do fast-rx; if we have to copy we already lost, in ieee80211_prepare_and_rx_handle()
4805 if (consume && rx->sta) { in ieee80211_prepare_and_rx_handle()
4808 fast_rx = rcu_dereference(rx->sta->fast_rx); in ieee80211_prepare_and_rx_handle()
4809 if (fast_rx && ieee80211_invoke_fast_rx(rx, fast_rx)) in ieee80211_prepare_and_rx_handle()
4813 if (!ieee80211_accept_frame(rx)) in ieee80211_prepare_and_rx_handle()
4816 if (rx->link_id >= 0) { in ieee80211_prepare_and_rx_handle()
4817 link = rcu_dereference(rx->sdata->link[rx->link_id]); in ieee80211_prepare_and_rx_handle()
4822 rx->link = link; in ieee80211_prepare_and_rx_handle()
4824 if (rx->sta) { in ieee80211_prepare_and_rx_handle()
4825 rx->link_sta = in ieee80211_prepare_and_rx_handle()
4826 rcu_dereference(rx->sta->link[rx->link_id]); in ieee80211_prepare_and_rx_handle()
4827 if (!rx->link_sta) in ieee80211_prepare_and_rx_handle()
4831 if (rx->sta) in ieee80211_prepare_and_rx_handle()
4832 rx->link_sta = &rx->sta->deflink; in ieee80211_prepare_and_rx_handle()
4834 rx->link = &sdata->deflink; in ieee80211_prepare_and_rx_handle()
4838 rx->link_id >= 0 && rx->sta && rx->sta->sta.mlo)) { in ieee80211_prepare_and_rx_handle()
4839 link_sta = rcu_dereference(rx->sta->link[rx->link_id]); in ieee80211_prepare_and_rx_handle()
4848 rx->skb = skb_copy(skb, GFP_ATOMIC); in ieee80211_prepare_and_rx_handle()
4849 if (!rx->skb) { in ieee80211_prepare_and_rx_handle()
4860 shwt = skb_hwtstamps(rx->skb); in ieee80211_prepare_and_rx_handle()
4867 ether_addr_copy(hdr->addr1, rx->sdata->vif.addr); in ieee80211_prepare_and_rx_handle()
4869 ether_addr_copy(hdr->addr2, rx->sta->addr); in ieee80211_prepare_and_rx_handle()
4874 ether_addr_copy(hdr->addr3, rx->sta->addr); in ieee80211_prepare_and_rx_handle()
4876 ether_addr_copy(hdr->addr3, rx->sdata->vif.addr); in ieee80211_prepare_and_rx_handle()
4881 ieee80211_invoke_rx_handlers(rx); in ieee80211_prepare_and_rx_handle()
4893 struct ieee80211_rx_data rx; in __ieee80211_rx_handle_8023() local
4895 memset(&rx, 0, sizeof(rx)); in __ieee80211_rx_handle_8023()
4896 rx.skb = skb; in __ieee80211_rx_handle_8023()
4897 rx.local = local; in __ieee80211_rx_handle_8023()
4898 rx.list = list; in __ieee80211_rx_handle_8023()
4899 rx.link_id = -1; in __ieee80211_rx_handle_8023()
4910 rx.sta = container_of(pubsta, struct sta_info, sta); in __ieee80211_rx_handle_8023()
4911 rx.sdata = rx.sta->sdata; in __ieee80211_rx_handle_8023()
4925 rx.link_id = status->link_id; in __ieee80211_rx_handle_8023()
4927 if (rx.link_id >= 0) { in __ieee80211_rx_handle_8023()
4930 link = rcu_dereference(rx.sdata->link[rx.link_id]); in __ieee80211_rx_handle_8023()
4933 rx.link = link; in __ieee80211_rx_handle_8023()
4935 rx.link = &rx.sdata->deflink; in __ieee80211_rx_handle_8023()
4938 fast_rx = rcu_dereference(rx.sta->fast_rx); in __ieee80211_rx_handle_8023()
4942 ieee80211_rx_8023(&rx, fast_rx, skb->len); in __ieee80211_rx_handle_8023()
4949 static bool ieee80211_rx_for_interface(struct ieee80211_rx_data *rx, in ieee80211_rx_for_interface() argument
4961 link_sta = link_sta_info_get_bss(rx->sdata, hdr->addr2); in ieee80211_rx_for_interface()
4963 rx->sta = link_sta->sta; in ieee80211_rx_for_interface()
4964 rx->link_id = link_sta->link_id; in ieee80211_rx_for_interface()
4968 rx->sta = sta_info_get_bss(rx->sdata, hdr->addr2); in ieee80211_rx_for_interface()
4969 if (rx->sta) { in ieee80211_rx_for_interface()
4971 !ieee80211_rx_is_valid_sta_link_id(&rx->sta->sta, in ieee80211_rx_for_interface()
4975 rx->link_id = status->link_valid ? status->link_id : -1; in ieee80211_rx_for_interface()
4977 rx->link_id = -1; in ieee80211_rx_for_interface()
4981 return ieee80211_prepare_and_rx_handle(rx, skb, consume); in ieee80211_rx_for_interface()
4985 * This is the actual Rx frames handler. as it belongs to Rx path it must
4998 struct ieee80211_rx_data rx; in __ieee80211_rx_handle_packet() local
5004 memset(&rx, 0, sizeof(rx)); in __ieee80211_rx_handle_packet()
5005 rx.skb = skb; in __ieee80211_rx_handle_packet()
5006 rx.local = local; in __ieee80211_rx_handle_packet()
5007 rx.list = list; in __ieee80211_rx_handle_packet()
5008 rx.link_id = -1; in __ieee80211_rx_handle_packet()
5029 ieee80211_parse_qos(&rx); in __ieee80211_rx_handle_packet()
5030 ieee80211_verify_alignment(&rx); in __ieee80211_rx_handle_packet()
5042 rx.sta = container_of(pubsta, struct sta_info, sta); in __ieee80211_rx_handle_packet()
5043 rx.sdata = rx.sta->sdata; in __ieee80211_rx_handle_packet()
5050 rx.link_id = status->link_id; in __ieee80211_rx_handle_packet()
5064 link_sta = link_sta_info_get_bss(rx.sdata, in __ieee80211_rx_handle_packet()
5069 rx.link_id = link_sta->link_id; in __ieee80211_rx_handle_packet()
5072 if (ieee80211_prepare_and_rx_handle(&rx, skb, true)) in __ieee80211_rx_handle_packet()
5091 rx.link_id = status->link_valid ? link_id : -1; in __ieee80211_rx_handle_packet()
5092 rx.sta = prev_sta; in __ieee80211_rx_handle_packet()
5093 rx.sdata = prev_sta->sdata; in __ieee80211_rx_handle_packet()
5094 ieee80211_prepare_and_rx_handle(&rx, skb, false); in __ieee80211_rx_handle_packet()
5106 rx.link_id = status->link_valid ? link_id : -1; in __ieee80211_rx_handle_packet()
5107 rx.sta = prev_sta; in __ieee80211_rx_handle_packet()
5108 rx.sdata = prev_sta->sdata; in __ieee80211_rx_handle_packet()
5110 if (ieee80211_prepare_and_rx_handle(&rx, skb, true)) in __ieee80211_rx_handle_packet()
5137 rx.sdata = prev; in __ieee80211_rx_handle_packet()
5138 ieee80211_rx_for_interface(&rx, skb, false); in __ieee80211_rx_handle_packet()
5144 rx.sdata = prev; in __ieee80211_rx_handle_packet()
5146 if (ieee80211_rx_for_interface(&rx, skb, true)) in __ieee80211_rx_handle_packet()
5186 /* We might be during a HW reconfig, prevent Rx for the same reason */ in ieee80211_rx_list()
5310 /* This is a version of the rx handler that can be called from hard irq