Lines Matching refs:tx

43 static __le16 ieee80211_duration(struct ieee80211_tx_data *tx,  in ieee80211_duration()  argument
49 struct ieee80211_local *local = tx->local; in ieee80211_duration()
55 if (tx->rate.flags & (IEEE80211_TX_RC_MCS | IEEE80211_TX_RC_VHT_MCS)) in ieee80211_duration()
59 if (WARN_ON_ONCE(tx->rate.idx < 0)) in ieee80211_duration()
63 txrate = &sband->bitrates[tx->rate.idx]; in ieee80211_duration()
134 if (tx->sdata->vif.bss_conf.basic_rates & BIT(i)) in ieee80211_duration()
140 if (tx->sdata->deflink.operating_11g_mode) in ieee80211_duration()
173 tx->sdata->vif.bss_conf.use_short_preamble); in ieee80211_duration()
182 tx->sdata->vif.bss_conf.use_short_preamble); in ieee80211_duration()
190 ieee80211_tx_h_dynamic_ps(struct ieee80211_tx_data *tx) in ieee80211_tx_h_dynamic_ps() argument
192 struct ieee80211_local *local = tx->local; in ieee80211_tx_h_dynamic_ps()
194 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); in ieee80211_tx_h_dynamic_ps()
220 if (tx->sdata->vif.type != NL80211_IFTYPE_STATION) in ieee80211_tx_h_dynamic_ps()
226 ifmgd = &tx->sdata->u.mgd; in ieee80211_tx_h_dynamic_ps()
243 skb_get_queue_mapping(tx->skb) == IEEE80211_AC_VO) in ieee80211_tx_h_dynamic_ps()
267 ieee80211_tx_h_check_assoc(struct ieee80211_tx_data *tx) in ieee80211_tx_h_check_assoc() argument
270 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data; in ieee80211_tx_h_check_assoc()
271 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); in ieee80211_tx_h_check_assoc()
277 if (unlikely(test_bit(SCAN_SW_SCANNING, &tx->local->scanning)) && in ieee80211_tx_h_check_assoc()
278 test_bit(SDATA_STATE_OFFCHANNEL, &tx->sdata->state) && in ieee80211_tx_h_check_assoc()
294 if (tx->sdata->vif.type == NL80211_IFTYPE_OCB) in ieee80211_tx_h_check_assoc()
297 if (tx->flags & IEEE80211_TX_PS_BUFFERED) in ieee80211_tx_h_check_assoc()
300 if (tx->sta) in ieee80211_tx_h_check_assoc()
301 assoc = test_sta_flag(tx->sta, WLAN_STA_ASSOC); in ieee80211_tx_h_check_assoc()
303 if (likely(tx->flags & IEEE80211_TX_UNICAST)) { in ieee80211_tx_h_check_assoc()
307 sdata_info(tx->sdata, in ieee80211_tx_h_check_assoc()
311 I802_DEBUG_INC(tx->local->tx_handlers_drop_not_assoc); in ieee80211_tx_h_check_assoc()
315 ieee80211_vif_get_num_mcast_if(tx->sdata) == 0)) { in ieee80211_tx_h_check_assoc()
378 ieee80211_tx_h_multicast_ps_buf(struct ieee80211_tx_data *tx) in ieee80211_tx_h_multicast_ps_buf() argument
380 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); in ieee80211_tx_h_multicast_ps_buf()
381 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data; in ieee80211_tx_h_multicast_ps_buf()
393 if (tx->sdata->vif.type == NL80211_IFTYPE_AP || in ieee80211_tx_h_multicast_ps_buf()
394 tx->sdata->vif.type == NL80211_IFTYPE_AP_VLAN) { in ieee80211_tx_h_multicast_ps_buf()
395 if (!tx->sdata->bss) in ieee80211_tx_h_multicast_ps_buf()
398 ps = &tx->sdata->bss->ps; in ieee80211_tx_h_multicast_ps_buf()
399 } else if (ieee80211_vif_is_mesh(&tx->sdata->vif)) { in ieee80211_tx_h_multicast_ps_buf()
400 ps = &tx->sdata->u.mesh.ps; in ieee80211_tx_h_multicast_ps_buf()
413 if (ieee80211_hw_check(&tx->local->hw, QUEUE_CONTROL)) in ieee80211_tx_h_multicast_ps_buf()
414 info->hw_queue = tx->sdata->vif.cab_queue; in ieee80211_tx_h_multicast_ps_buf()
423 if (!ieee80211_hw_check(&tx->local->hw, HOST_BROADCAST_PS_BUFFERING)) in ieee80211_tx_h_multicast_ps_buf()
427 if (tx->local->total_ps_buffered >= TOTAL_MAX_TX_BUFFER) in ieee80211_tx_h_multicast_ps_buf()
428 purge_old_ps_buffers(tx->local); in ieee80211_tx_h_multicast_ps_buf()
431 ps_dbg(tx->sdata, in ieee80211_tx_h_multicast_ps_buf()
433 ieee80211_free_txskb(&tx->local->hw, skb_dequeue(&ps->bc_buf)); in ieee80211_tx_h_multicast_ps_buf()
435 tx->local->total_ps_buffered++; in ieee80211_tx_h_multicast_ps_buf()
437 skb_queue_tail(&ps->bc_buf, tx->skb); in ieee80211_tx_h_multicast_ps_buf()
458 ieee80211_tx_h_unicast_ps_buf(struct ieee80211_tx_data *tx) in ieee80211_tx_h_unicast_ps_buf() argument
460 struct sta_info *sta = tx->sta; in ieee80211_tx_h_unicast_ps_buf()
461 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); in ieee80211_tx_h_unicast_ps_buf()
462 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data; in ieee80211_tx_h_unicast_ps_buf()
463 struct ieee80211_local *local = tx->local; in ieee80211_tx_h_unicast_ps_buf()
472 int ac = skb_get_queue_mapping(tx->skb); in ieee80211_tx_h_unicast_ps_buf()
475 !ieee80211_is_bufferable_mmpdu(tx->skb)) { in ieee80211_tx_h_unicast_ps_buf()
482 if (tx->local->total_ps_buffered >= TOTAL_MAX_TX_BUFFER) in ieee80211_tx_h_unicast_ps_buf()
483 purge_old_ps_buffers(tx->local); in ieee80211_tx_h_unicast_ps_buf()
501 ps_dbg(tx->sdata, in ieee80211_tx_h_unicast_ps_buf()
506 tx->local->total_ps_buffered++; in ieee80211_tx_h_unicast_ps_buf()
509 info->control.vif = &tx->sdata->vif; in ieee80211_tx_h_unicast_ps_buf()
512 skb_queue_tail(&sta->ps_tx_buf[ac], tx->skb); in ieee80211_tx_h_unicast_ps_buf()
528 ps_dbg(tx->sdata, in ieee80211_tx_h_unicast_ps_buf()
537 ieee80211_tx_h_ps_buf(struct ieee80211_tx_data *tx) in ieee80211_tx_h_ps_buf() argument
539 if (unlikely(tx->flags & IEEE80211_TX_PS_BUFFERED)) in ieee80211_tx_h_ps_buf()
542 if (tx->flags & IEEE80211_TX_UNICAST) in ieee80211_tx_h_ps_buf()
543 return ieee80211_tx_h_unicast_ps_buf(tx); in ieee80211_tx_h_ps_buf()
545 return ieee80211_tx_h_multicast_ps_buf(tx); in ieee80211_tx_h_ps_buf()
549 ieee80211_tx_h_check_control_port_protocol(struct ieee80211_tx_data *tx) in ieee80211_tx_h_check_control_port_protocol() argument
551 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); in ieee80211_tx_h_check_control_port_protocol()
553 if (unlikely(tx->sdata->control_port_protocol == tx->skb->protocol)) { in ieee80211_tx_h_check_control_port_protocol()
554 if (tx->sdata->control_port_no_encrypt) in ieee80211_tx_h_check_control_port_protocol()
564 ieee80211_select_link_key(struct ieee80211_tx_data *tx) in ieee80211_select_link_key() argument
566 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data; in ieee80211_select_link_key()
567 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); in ieee80211_select_link_key()
573 link = &tx->sdata->deflink; in ieee80211_select_link_key()
575 link = rcu_dereference(tx->sdata->link[link_id]); in ieee80211_select_link_key()
580 if (ieee80211_is_group_privacy_action(tx->skb)) in ieee80211_select_link_key()
584 ieee80211_is_robust_mgmt_frame(tx->skb)) in ieee80211_select_link_key()
593 ieee80211_tx_h_select_key(struct ieee80211_tx_data *tx) in ieee80211_tx_h_select_key() argument
596 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); in ieee80211_tx_h_select_key()
597 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data; in ieee80211_tx_h_select_key()
600 tx->key = NULL; in ieee80211_tx_h_select_key()
604 if (tx->sta && in ieee80211_tx_h_select_key()
605 (key = rcu_dereference(tx->sta->ptk[tx->sta->ptk_idx]))) in ieee80211_tx_h_select_key()
606 tx->key = key; in ieee80211_tx_h_select_key()
607 else if ((key = ieee80211_select_link_key(tx))) in ieee80211_tx_h_select_key()
608 tx->key = key; in ieee80211_tx_h_select_key()
610 (key = rcu_dereference(tx->sdata->default_unicast_key))) in ieee80211_tx_h_select_key()
611 tx->key = key; in ieee80211_tx_h_select_key()
613 tx->key = NULL; in ieee80211_tx_h_select_key()
616 if (tx->key && tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) in ieee80211_tx_h_select_key()
617 info->control.hw_key = &tx->key->conf; in ieee80211_tx_h_select_key()
621 if (tx->key) { in ieee80211_tx_h_select_key()
626 switch (tx->key->conf.cipher) { in ieee80211_tx_h_select_key()
631 tx->key = NULL; in ieee80211_tx_h_select_key()
638 !ieee80211_use_mfp(hdr->frame_control, tx->sta, in ieee80211_tx_h_select_key()
639 tx->skb) && in ieee80211_tx_h_select_key()
640 !ieee80211_is_group_privacy_action(tx->skb)) in ieee80211_tx_h_select_key()
641 tx->key = NULL; in ieee80211_tx_h_select_key()
643 skip_hw = (tx->key->conf.flags & in ieee80211_tx_h_select_key()
652 tx->key = NULL; in ieee80211_tx_h_select_key()
656 if (unlikely(tx->key && tx->key->flags & KEY_FLAG_TAINTED && in ieee80211_tx_h_select_key()
658 tx->skb->protocol != tx->sdata->control_port_protocol) in ieee80211_tx_h_select_key()
661 if (!skip_hw && tx->key && in ieee80211_tx_h_select_key()
662 tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) in ieee80211_tx_h_select_key()
663 info->control.hw_key = &tx->key->conf; in ieee80211_tx_h_select_key()
664 } else if (ieee80211_is_data_present(hdr->frame_control) && tx->sta && in ieee80211_tx_h_select_key()
665 test_sta_flag(tx->sta, WLAN_STA_USES_ENCRYPTION)) { in ieee80211_tx_h_select_key()
673 ieee80211_tx_h_rate_ctrl(struct ieee80211_tx_data *tx) in ieee80211_tx_h_rate_ctrl() argument
675 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); in ieee80211_tx_h_rate_ctrl()
676 struct ieee80211_hdr *hdr = (void *)tx->skb->data; in ieee80211_tx_h_rate_ctrl()
686 sband = tx->local->hw.wiphy->bands[info->band]; in ieee80211_tx_h_rate_ctrl()
688 len = min_t(u32, tx->skb->len + FCS_LEN, in ieee80211_tx_h_rate_ctrl()
689 tx->local->hw.wiphy->frag_threshold); in ieee80211_tx_h_rate_ctrl()
692 txrc.hw = &tx->local->hw; in ieee80211_tx_h_rate_ctrl()
694 txrc.bss_conf = &tx->sdata->vif.bss_conf; in ieee80211_tx_h_rate_ctrl()
695 txrc.skb = tx->skb; in ieee80211_tx_h_rate_ctrl()
701 txrc.rate_idx_mask = tx->sdata->rc_rateidx_mask[info->band]; in ieee80211_tx_h_rate_ctrl()
703 if (tx->sdata->rc_has_mcs_mask[info->band]) in ieee80211_tx_h_rate_ctrl()
705 tx->sdata->rc_rateidx_mcs_mask[info->band]; in ieee80211_tx_h_rate_ctrl()
708 txrc.bss = (tx->sdata->vif.type == NL80211_IFTYPE_AP || in ieee80211_tx_h_rate_ctrl()
709 tx->sdata->vif.type == NL80211_IFTYPE_MESH_POINT || in ieee80211_tx_h_rate_ctrl()
710 tx->sdata->vif.type == NL80211_IFTYPE_ADHOC || in ieee80211_tx_h_rate_ctrl()
711 tx->sdata->vif.type == NL80211_IFTYPE_OCB); in ieee80211_tx_h_rate_ctrl()
714 if (len > tx->local->hw.wiphy->rts_threshold) { in ieee80211_tx_h_rate_ctrl()
719 info->control.use_cts_prot = tx->sdata->vif.bss_conf.use_cts_prot; in ieee80211_tx_h_rate_ctrl()
727 if (tx->sdata->vif.bss_conf.use_short_preamble && in ieee80211_tx_h_rate_ctrl()
728 (ieee80211_is_tx_data(tx->skb) || in ieee80211_tx_h_rate_ctrl()
729 (tx->sta && test_sta_flag(tx->sta, WLAN_STA_SHORT_PREAMBLE)))) in ieee80211_tx_h_rate_ctrl()
738 if (tx->sta) in ieee80211_tx_h_rate_ctrl()
739 assoc = test_sta_flag(tx->sta, WLAN_STA_ASSOC); in ieee80211_tx_h_rate_ctrl()
745 if (WARN(test_bit(SCAN_SW_SCANNING, &tx->local->scanning) && assoc && in ieee80211_tx_h_rate_ctrl()
746 !rate_usable_index_exists(sband, &tx->sta->sta), in ieee80211_tx_h_rate_ctrl()
750 tx->sdata->name, in ieee80211_tx_h_rate_ctrl()
759 rate_control_get_rate(tx->sdata, tx->sta, &txrc); in ieee80211_tx_h_rate_ctrl()
761 if (tx->sta && !info->control.skip_table) in ieee80211_tx_h_rate_ctrl()
762 ratetbl = rcu_dereference(tx->sta->sta.rates); in ieee80211_tx_h_rate_ctrl()
775 tx->rate = rate; in ieee80211_tx_h_rate_ctrl()
780 tx->rate = info->control.rates[0]; in ieee80211_tx_h_rate_ctrl()
784 txrc.reported_rate = tx->rate; in ieee80211_tx_h_rate_ctrl()
785 if (tx->sta && ieee80211_is_tx_data(tx->skb)) in ieee80211_tx_h_rate_ctrl()
786 tx->sta->deflink.tx_stats.last_rate = txrc.reported_rate; in ieee80211_tx_h_rate_ctrl()
787 } else if (tx->sta) in ieee80211_tx_h_rate_ctrl()
788 tx->sta->deflink.tx_stats.last_rate = txrc.reported_rate; in ieee80211_tx_h_rate_ctrl()
815 ieee80211_tx_h_sequence(struct ieee80211_tx_data *tx) in ieee80211_tx_h_sequence() argument
817 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); in ieee80211_tx_h_sequence()
818 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data; in ieee80211_tx_h_sequence()
846 tx->sdata->mld_mcast_seq += 0x10; in ieee80211_tx_h_sequence()
847 hdr->seq_ctrl = cpu_to_le16(tx->sdata->mld_mcast_seq); in ieee80211_tx_h_sequence()
862 hdr->seq_ctrl = cpu_to_le16(tx->sdata->sequence_number); in ieee80211_tx_h_sequence()
863 tx->sdata->sequence_number += 0x10; in ieee80211_tx_h_sequence()
864 if (tx->sta) in ieee80211_tx_h_sequence()
865 tx->sta->deflink.tx_stats.msdu[IEEE80211_NUM_TIDS]++; in ieee80211_tx_h_sequence()
874 if (!tx->sta) in ieee80211_tx_h_sequence()
879 tx->sta->deflink.tx_stats.msdu[tid]++; in ieee80211_tx_h_sequence()
881 hdr->seq_ctrl = ieee80211_tx_next_seq(tx->sta, tid); in ieee80211_tx_h_sequence()
886 static int ieee80211_fragment(struct ieee80211_tx_data *tx, in ieee80211_fragment() argument
890 struct ieee80211_local *local = tx->local; in ieee80211_fragment()
915 __skb_queue_tail(&tx->skbs, tmp); in ieee80211_fragment()
947 ieee80211_tx_h_fragment(struct ieee80211_tx_data *tx) in ieee80211_tx_h_fragment() argument
949 struct sk_buff *skb = tx->skb; in ieee80211_tx_h_fragment()
952 int frag_threshold = tx->local->hw.wiphy->frag_threshold; in ieee80211_tx_h_fragment()
957 __skb_queue_tail(&tx->skbs, skb); in ieee80211_tx_h_fragment()
958 tx->skb = NULL; in ieee80211_tx_h_fragment()
963 if (ieee80211_hw_check(&tx->local->hw, SUPPORTS_TX_FRAG)) in ieee80211_tx_h_fragment()
988 if (ieee80211_fragment(tx, skb, hdrlen, frag_threshold)) in ieee80211_tx_h_fragment()
994 skb_queue_walk(&tx->skbs, skb) { in ieee80211_tx_h_fragment()
1000 if (!skb_queue_is_last(&tx->skbs, skb)) { in ieee80211_tx_h_fragment()
1022 ieee80211_tx_h_stats(struct ieee80211_tx_data *tx) in ieee80211_tx_h_stats() argument
1027 if (!tx->sta) in ieee80211_tx_h_stats()
1030 skb_queue_walk(&tx->skbs, skb) { in ieee80211_tx_h_stats()
1032 tx->sta->deflink.tx_stats.bytes[ac] += skb->len; in ieee80211_tx_h_stats()
1035 tx->sta->deflink.tx_stats.packets[ac]++; in ieee80211_tx_h_stats()
1041 ieee80211_tx_h_encrypt(struct ieee80211_tx_data *tx) in ieee80211_tx_h_encrypt() argument
1043 if (!tx->key) in ieee80211_tx_h_encrypt()
1046 switch (tx->key->conf.cipher) { in ieee80211_tx_h_encrypt()
1049 return ieee80211_crypto_wep_encrypt(tx); in ieee80211_tx_h_encrypt()
1051 return ieee80211_crypto_tkip_encrypt(tx); in ieee80211_tx_h_encrypt()
1054 tx, IEEE80211_CCMP_MIC_LEN); in ieee80211_tx_h_encrypt()
1057 tx, IEEE80211_CCMP_256_MIC_LEN); in ieee80211_tx_h_encrypt()
1059 return ieee80211_crypto_aes_cmac_encrypt(tx); in ieee80211_tx_h_encrypt()
1061 return ieee80211_crypto_aes_cmac_256_encrypt(tx); in ieee80211_tx_h_encrypt()
1064 return ieee80211_crypto_aes_gmac_encrypt(tx); in ieee80211_tx_h_encrypt()
1067 return ieee80211_crypto_gcmp_encrypt(tx); in ieee80211_tx_h_encrypt()
1074 ieee80211_tx_h_calculate_duration(struct ieee80211_tx_data *tx) in ieee80211_tx_h_calculate_duration() argument
1081 skb_queue_walk(&tx->skbs, skb) { in ieee80211_tx_h_calculate_duration()
1085 if (!skb_queue_is_last(&tx->skbs, skb)) { in ieee80211_tx_h_calculate_duration()
1086 struct sk_buff *next = skb_queue_next(&tx->skbs, skb); in ieee80211_tx_h_calculate_duration()
1093 ieee80211_duration(tx, skb, group_addr, next_len); in ieee80211_tx_h_calculate_duration()
1101 static bool ieee80211_tx_prep_agg(struct ieee80211_tx_data *tx, in ieee80211_tx_prep_agg() argument
1118 } else if (!tx->sta->sta.txq[tid]) { in ieee80211_tx_prep_agg()
1119 spin_lock(&tx->sta->lock); in ieee80211_tx_prep_agg()
1138 tid_tx = rcu_dereference_protected_tid_tx(tx->sta, tid); in ieee80211_tx_prep_agg()
1147 clear_sta_flag(tx->sta, WLAN_STA_SP); in ieee80211_tx_prep_agg()
1148 ps_dbg(tx->sta->sdata, in ieee80211_tx_prep_agg()
1150 tx->sta->sta.addr, tx->sta->sta.aid); in ieee80211_tx_prep_agg()
1152 info->control.vif = &tx->sdata->vif; in ieee80211_tx_prep_agg()
1159 spin_unlock(&tx->sta->lock); in ieee80211_tx_prep_agg()
1162 ieee80211_free_txskb(&tx->local->hw, purge_skb); in ieee80211_tx_prep_agg()
1202 struct ieee80211_tx_data *tx, in ieee80211_tx_prepare() argument
1211 memset(tx, 0, sizeof(*tx)); in ieee80211_tx_prepare()
1212 tx->skb = skb; in ieee80211_tx_prepare()
1213 tx->local = local; in ieee80211_tx_prepare()
1214 tx->sdata = sdata; in ieee80211_tx_prepare()
1215 __skb_queue_head_init(&tx->skbs); in ieee80211_tx_prepare()
1228 tx->sta = sta; in ieee80211_tx_prepare()
1231 tx->sta = rcu_dereference(sdata->u.vlan.sta); in ieee80211_tx_prepare()
1232 if (!tx->sta && sdata->wdev.use_4addr) in ieee80211_tx_prepare()
1234 } else if (tx->sdata->control_port_protocol == tx->skb->protocol) { in ieee80211_tx_prepare()
1235 tx->sta = sta_info_get_bss(sdata, hdr->addr1); in ieee80211_tx_prepare()
1237 if (!tx->sta && !is_multicast_ether_addr(hdr->addr1)) { in ieee80211_tx_prepare()
1238 tx->sta = sta_info_get(sdata, hdr->addr1); in ieee80211_tx_prepare()
1243 if (tx->sta && ieee80211_is_data_qos(hdr->frame_control) && in ieee80211_tx_prepare()
1250 tid_tx = rcu_dereference(tx->sta->ampdu_mlme.tid_tx[tid]); in ieee80211_tx_prepare()
1252 ieee80211_aggr_check(sdata, tx->sta, skb); in ieee80211_tx_prepare()
1253 tid_tx = rcu_dereference(tx->sta->ampdu_mlme.tid_tx[tid]); in ieee80211_tx_prepare()
1259 queued = ieee80211_tx_prep_agg(tx, skb, info, in ieee80211_tx_prepare()
1268 tx->flags &= ~IEEE80211_TX_UNICAST; in ieee80211_tx_prepare()
1271 tx->flags |= IEEE80211_TX_UNICAST; in ieee80211_tx_prepare()
1274 if (!(tx->flags & IEEE80211_TX_UNICAST) || in ieee80211_tx_prepare()
1280 if (!tx->sta) in ieee80211_tx_prepare()
1282 else if (test_and_clear_sta_flag(tx->sta, WLAN_STA_CLEAR_PS_FILT)) { in ieee80211_tx_prepare()
1284 ieee80211_check_fast_xmit(tx->sta); in ieee80211_tx_prepare()
1798 static int invoke_tx_handlers_early(struct ieee80211_tx_data *tx) in invoke_tx_handlers_early() argument
1804 res = txh(tx); \ in invoke_tx_handlers_early()
1817 I802_DEBUG_INC(tx->local->tx_handlers_drop); in invoke_tx_handlers_early()
1818 if (tx->skb) in invoke_tx_handlers_early()
1819 ieee80211_free_txskb(&tx->local->hw, tx->skb); in invoke_tx_handlers_early()
1821 ieee80211_purge_tx_queue(&tx->local->hw, &tx->skbs); in invoke_tx_handlers_early()
1824 I802_DEBUG_INC(tx->local->tx_handlers_queued); in invoke_tx_handlers_early()
1835 static int invoke_tx_handlers_late(struct ieee80211_tx_data *tx) in invoke_tx_handlers_late() argument
1837 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); in invoke_tx_handlers_late()
1840 if (!ieee80211_hw_check(&tx->local->hw, HAS_RATE_CONTROL)) in invoke_tx_handlers_late()
1844 __skb_queue_tail(&tx->skbs, tx->skb); in invoke_tx_handlers_late()
1845 tx->skb = NULL; in invoke_tx_handlers_late()
1855 if (!ieee80211_hw_check(&tx->local->hw, HAS_RATE_CONTROL)) in invoke_tx_handlers_late()
1861 I802_DEBUG_INC(tx->local->tx_handlers_drop); in invoke_tx_handlers_late()
1862 if (tx->skb) in invoke_tx_handlers_late()
1863 ieee80211_free_txskb(&tx->local->hw, tx->skb); in invoke_tx_handlers_late()
1865 ieee80211_purge_tx_queue(&tx->local->hw, &tx->skbs); in invoke_tx_handlers_late()
1868 I802_DEBUG_INC(tx->local->tx_handlers_queued); in invoke_tx_handlers_late()
1875 static int invoke_tx_handlers(struct ieee80211_tx_data *tx) in invoke_tx_handlers() argument
1877 int r = invoke_tx_handlers_early(tx); in invoke_tx_handlers()
1881 return invoke_tx_handlers_late(tx); in invoke_tx_handlers()
1890 struct ieee80211_tx_data tx; in ieee80211_tx_prepare_skb() local
1893 if (ieee80211_tx_prepare(sdata, &tx, NULL, skb) == TX_DROP) in ieee80211_tx_prepare_skb()
1900 if (invoke_tx_handlers(&tx)) in ieee80211_tx_prepare_skb()
1904 if (tx.sta) in ieee80211_tx_prepare_skb()
1905 *sta = &tx.sta->sta; in ieee80211_tx_prepare_skb()
1911 skb2 = __skb_dequeue(&tx.skbs); in ieee80211_tx_prepare_skb()
1912 if (WARN_ON(skb2 != skb || !skb_queue_empty(&tx.skbs))) { in ieee80211_tx_prepare_skb()
1914 ieee80211_purge_tx_queue(hw, &tx.skbs); in ieee80211_tx_prepare_skb()
1930 struct ieee80211_tx_data tx; in ieee80211_tx() local
1941 res_prepare = ieee80211_tx_prepare(sdata, &tx, sta, skb); in ieee80211_tx()
1956 if (invoke_tx_handlers_early(&tx)) in ieee80211_tx()
1959 if (ieee80211_queue_skb(local, sdata, tx.sta, tx.skb)) in ieee80211_tx()
1962 if (!invoke_tx_handlers_late(&tx)) in ieee80211_tx()
1963 result = __ieee80211_tx(local, &tx.skbs, tx.sta, txpending); in ieee80211_tx()
3543 struct ieee80211_tx_data *tx) in ieee80211_xmit_fast_finish() argument
3545 struct sk_buff *skb = tx->skb; in ieee80211_xmit_fast_finish()
3550 if (!ieee80211_hw_check(&tx->local->hw, HAS_RATE_CONTROL) && in ieee80211_xmit_fast_finish()
3551 ieee80211_tx_h_rate_ctrl(tx) != TX_CONTINUE) in ieee80211_xmit_fast_finish()
3667 struct ieee80211_tx_data tx; in __ieee80211_xmit_fast() local
3716 __skb_queue_head_init(&tx.skbs); in __ieee80211_xmit_fast()
3718 tx.flags = IEEE80211_TX_UNICAST; in __ieee80211_xmit_fast()
3719 tx.local = local; in __ieee80211_xmit_fast()
3720 tx.sdata = sdata; in __ieee80211_xmit_fast()
3721 tx.sta = sta; in __ieee80211_xmit_fast()
3722 tx.key = fast_tx->key; in __ieee80211_xmit_fast()
3727 tx.skb = skb; in __ieee80211_xmit_fast()
3729 fast_tx->key, &tx); in __ieee80211_xmit_fast()
3730 tx.skb = NULL; in __ieee80211_xmit_fast()
3738 __skb_queue_tail(&tx.skbs, skb); in __ieee80211_xmit_fast()
3739 ieee80211_tx_frags(local, &sdata->vif, sta, &tx.skbs, false); in __ieee80211_xmit_fast()
3807 struct ieee80211_tx_data tx; in ieee80211_tx_dequeue() local
3855 memset(&tx, 0, sizeof(tx)); in ieee80211_tx_dequeue()
3856 __skb_queue_head_init(&tx.skbs); in ieee80211_tx_dequeue()
3857 tx.local = local; in ieee80211_tx_dequeue()
3858 tx.skb = skb; in ieee80211_tx_dequeue()
3859 tx.sdata = vif_to_sdata(info->control.vif); in ieee80211_tx_dequeue()
3862 tx.sta = container_of(txq->sta, struct sta_info, sta); in ieee80211_tx_dequeue()
3869 !ieee80211_vif_is_mesh(&tx.sdata->vif) && in ieee80211_tx_dequeue()
3870 tx.sdata->vif.type != NL80211_IFTYPE_OCB && in ieee80211_tx_dequeue()
3872 !test_sta_flag(tx.sta, WLAN_STA_AUTHORIZED) && in ieee80211_tx_dequeue()
3875 !ieee80211_is_our_addr(tx.sdata, hdr->addr2, in ieee80211_tx_dequeue()
3888 r = ieee80211_tx_h_select_key(&tx); in ieee80211_tx_dequeue()
3900 r = ieee80211_tx_h_rate_ctrl(&tx); in ieee80211_tx_dequeue()
3914 if (tx.key && in ieee80211_tx_dequeue()
3915 (tx.key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV)) in ieee80211_tx_dequeue()
3919 tx.key, &tx); in ieee80211_tx_dequeue()
3925 if (invoke_tx_handlers_late(&tx)) in ieee80211_tx_dequeue()
3928 skb = __skb_dequeue(&tx.skbs); in ieee80211_tx_dequeue()
3931 if (!skb_queue_empty(&tx.skbs)) { in ieee80211_tx_dequeue()
3933 skb_queue_splice_tail(&tx.skbs, &txqi->frags); in ieee80211_tx_dequeue()
3946 switch (tx.sdata->vif.type) { in ieee80211_tx_dequeue()
3948 if ((tx.sdata->u.mntr.flags & MONITOR_FLAG_ACTIVE) || in ieee80211_tx_dequeue()
3950 vif = &tx.sdata->vif; in ieee80211_tx_dequeue()
3953 tx.sdata = rcu_dereference(local->monitor_sdata); in ieee80211_tx_dequeue()
3954 if (tx.sdata && in ieee80211_tx_dequeue()
3956 vif = &tx.sdata->vif; in ieee80211_tx_dequeue()
3968 tx.sdata = container_of(tx.sdata->bss, in ieee80211_tx_dequeue()
3972 vif = &tx.sdata->vif; in ieee80211_tx_dequeue()
3979 if (tx.sta && in ieee80211_tx_dequeue()
3988 ieee80211_sta_update_pending_airtime(local, tx.sta, in ieee80211_tx_dequeue()
4733 struct ieee80211_tx_data tx = { in ieee80211_build_data_template() local
4753 tx.sta = sta_info_get(sdata, hdr->addr1); in ieee80211_build_data_template()
4754 tx.skb = skb; in ieee80211_build_data_template()
4756 if (ieee80211_tx_h_select_key(&tx) != TX_CONTINUE) { in ieee80211_build_data_template()
5185 struct ieee80211_tx_data tx; in ieee80211_beacon_protect() local
5188 memset(&tx, 0, sizeof(tx)); in ieee80211_beacon_protect()
5189 tx.key = rcu_dereference(link->default_beacon_key); in ieee80211_beacon_protect()
5190 if (!tx.key) in ieee80211_beacon_protect()
5193 if (unlikely(tx.key->flags & KEY_FLAG_TAINTED)) { in ieee80211_beacon_protect()
5194 tx.key = NULL; in ieee80211_beacon_protect()
5198 if (!(tx.key->conf.flags & IEEE80211_KEY_FLAG_SW_MGMT_TX) && in ieee80211_beacon_protect()
5199 tx.key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) in ieee80211_beacon_protect()
5200 IEEE80211_SKB_CB(skb)->control.hw_key = &tx.key->conf; in ieee80211_beacon_protect()
5202 tx.local = local; in ieee80211_beacon_protect()
5203 tx.sdata = sdata; in ieee80211_beacon_protect()
5204 __skb_queue_head_init(&tx.skbs); in ieee80211_beacon_protect()
5205 __skb_queue_tail(&tx.skbs, skb); in ieee80211_beacon_protect()
5206 res = ieee80211_tx_h_encrypt(&tx); in ieee80211_beacon_protect()
5207 check_skb = __skb_dequeue(&tx.skbs); in ieee80211_beacon_protect()
5975 struct ieee80211_tx_data tx; in ieee80211_get_buffered_bc() local
6024 if (!ieee80211_tx_prepare(sdata, &tx, NULL, skb)) in ieee80211_get_buffered_bc()
6031 tx.flags |= IEEE80211_TX_PS_BUFFERED; in ieee80211_get_buffered_bc()
6034 if (invoke_tx_handlers(&tx)) in ieee80211_get_buffered_bc()