Lines Matching full:tx
51 static __le16 ieee80211_duration(struct ieee80211_tx_data *tx, in ieee80211_duration() argument
57 struct ieee80211_local *local = tx->local; in ieee80211_duration()
65 if (tx->rate.flags & (IEEE80211_TX_RC_MCS | IEEE80211_TX_RC_VHT_MCS)) in ieee80211_duration()
69 chanctx_conf = rcu_dereference(tx->sdata->vif.chanctx_conf); in ieee80211_duration()
77 if (WARN_ON_ONCE(tx->rate.idx < 0)) in ieee80211_duration()
81 txrate = &sband->bitrates[tx->rate.idx]; in ieee80211_duration()
150 if (tx->sdata->vif.bss_conf.basic_rates & BIT(i)) in ieee80211_duration()
156 if (tx->sdata->flags & IEEE80211_SDATA_OPERATING_GMODE) in ieee80211_duration()
191 tx->sdata->vif.bss_conf.use_short_preamble, in ieee80211_duration()
201 tx->sdata->vif.bss_conf.use_short_preamble, in ieee80211_duration()
208 /* tx handlers */
210 ieee80211_tx_h_dynamic_ps(struct ieee80211_tx_data *tx) in ieee80211_tx_h_dynamic_ps() argument
212 struct ieee80211_local *local = tx->local; in ieee80211_tx_h_dynamic_ps()
214 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); in ieee80211_tx_h_dynamic_ps()
240 if (tx->sdata->vif.type != NL80211_IFTYPE_STATION) in ieee80211_tx_h_dynamic_ps()
246 ifmgd = &tx->sdata->u.mgd; in ieee80211_tx_h_dynamic_ps()
263 skb_get_queue_mapping(tx->skb) == IEEE80211_AC_VO) in ieee80211_tx_h_dynamic_ps()
287 ieee80211_tx_h_check_assoc(struct ieee80211_tx_data *tx) in ieee80211_tx_h_check_assoc() argument
290 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data; in ieee80211_tx_h_check_assoc()
291 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); in ieee80211_tx_h_check_assoc()
297 if (unlikely(test_bit(SCAN_SW_SCANNING, &tx->local->scanning)) && in ieee80211_tx_h_check_assoc()
298 test_bit(SDATA_STATE_OFFCHANNEL, &tx->sdata->state) && in ieee80211_tx_h_check_assoc()
314 if (tx->sdata->vif.type == NL80211_IFTYPE_OCB) in ieee80211_tx_h_check_assoc()
317 if (tx->sdata->vif.type == NL80211_IFTYPE_WDS) in ieee80211_tx_h_check_assoc()
320 if (tx->flags & IEEE80211_TX_PS_BUFFERED) in ieee80211_tx_h_check_assoc()
323 if (tx->sta) in ieee80211_tx_h_check_assoc()
324 assoc = test_sta_flag(tx->sta, WLAN_STA_ASSOC); in ieee80211_tx_h_check_assoc()
326 if (likely(tx->flags & IEEE80211_TX_UNICAST)) { in ieee80211_tx_h_check_assoc()
330 sdata_info(tx->sdata, in ieee80211_tx_h_check_assoc()
334 I802_DEBUG_INC(tx->local->tx_handlers_drop_not_assoc); in ieee80211_tx_h_check_assoc()
338 ieee80211_vif_get_num_mcast_if(tx->sdata) == 0)) { in ieee80211_tx_h_check_assoc()
401 ieee80211_tx_h_multicast_ps_buf(struct ieee80211_tx_data *tx) in ieee80211_tx_h_multicast_ps_buf() argument
403 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); in ieee80211_tx_h_multicast_ps_buf()
404 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data; in ieee80211_tx_h_multicast_ps_buf()
416 if (tx->sdata->vif.type == NL80211_IFTYPE_AP || in ieee80211_tx_h_multicast_ps_buf()
417 tx->sdata->vif.type == NL80211_IFTYPE_AP_VLAN) { in ieee80211_tx_h_multicast_ps_buf()
418 if (!tx->sdata->bss) in ieee80211_tx_h_multicast_ps_buf()
421 ps = &tx->sdata->bss->ps; in ieee80211_tx_h_multicast_ps_buf()
422 } else if (ieee80211_vif_is_mesh(&tx->sdata->vif)) { in ieee80211_tx_h_multicast_ps_buf()
423 ps = &tx->sdata->u.mesh.ps; in ieee80211_tx_h_multicast_ps_buf()
436 if (ieee80211_hw_check(&tx->local->hw, QUEUE_CONTROL)) in ieee80211_tx_h_multicast_ps_buf()
437 info->hw_queue = tx->sdata->vif.cab_queue; in ieee80211_tx_h_multicast_ps_buf()
446 if (!ieee80211_hw_check(&tx->local->hw, HOST_BROADCAST_PS_BUFFERING)) in ieee80211_tx_h_multicast_ps_buf()
450 if (tx->local->total_ps_buffered >= TOTAL_MAX_TX_BUFFER) in ieee80211_tx_h_multicast_ps_buf()
451 purge_old_ps_buffers(tx->local); in ieee80211_tx_h_multicast_ps_buf()
454 ps_dbg(tx->sdata, in ieee80211_tx_h_multicast_ps_buf()
455 "BC TX buffer full - dropping the oldest frame\n"); in ieee80211_tx_h_multicast_ps_buf()
456 ieee80211_free_txskb(&tx->local->hw, skb_dequeue(&ps->bc_buf)); in ieee80211_tx_h_multicast_ps_buf()
458 tx->local->total_ps_buffered++; in ieee80211_tx_h_multicast_ps_buf()
460 skb_queue_tail(&ps->bc_buf, tx->skb); in ieee80211_tx_h_multicast_ps_buf()
481 ieee80211_tx_h_unicast_ps_buf(struct ieee80211_tx_data *tx) in ieee80211_tx_h_unicast_ps_buf() argument
483 struct sta_info *sta = tx->sta; in ieee80211_tx_h_unicast_ps_buf()
484 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); in ieee80211_tx_h_unicast_ps_buf()
485 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data; in ieee80211_tx_h_unicast_ps_buf()
486 struct ieee80211_local *local = tx->local; in ieee80211_tx_h_unicast_ps_buf()
495 int ac = skb_get_queue_mapping(tx->skb); in ieee80211_tx_h_unicast_ps_buf()
505 if (tx->local->total_ps_buffered >= TOTAL_MAX_TX_BUFFER) in ieee80211_tx_h_unicast_ps_buf()
506 purge_old_ps_buffers(tx->local); in ieee80211_tx_h_unicast_ps_buf()
513 * ahead and Tx the packet. in ieee80211_tx_h_unicast_ps_buf()
524 ps_dbg(tx->sdata, in ieee80211_tx_h_unicast_ps_buf()
525 "STA %pM TX buffer for AC %d full - dropping oldest frame\n", in ieee80211_tx_h_unicast_ps_buf()
529 tx->local->total_ps_buffered++; in ieee80211_tx_h_unicast_ps_buf()
532 info->control.vif = &tx->sdata->vif; in ieee80211_tx_h_unicast_ps_buf()
535 skb_queue_tail(&sta->ps_tx_buf[ac], tx->skb); in ieee80211_tx_h_unicast_ps_buf()
551 ps_dbg(tx->sdata, in ieee80211_tx_h_unicast_ps_buf()
560 ieee80211_tx_h_ps_buf(struct ieee80211_tx_data *tx) in ieee80211_tx_h_ps_buf() argument
562 if (unlikely(tx->flags & IEEE80211_TX_PS_BUFFERED)) in ieee80211_tx_h_ps_buf()
565 if (tx->flags & IEEE80211_TX_UNICAST) in ieee80211_tx_h_ps_buf()
566 return ieee80211_tx_h_unicast_ps_buf(tx); in ieee80211_tx_h_ps_buf()
568 return ieee80211_tx_h_multicast_ps_buf(tx); in ieee80211_tx_h_ps_buf()
572 ieee80211_tx_h_check_control_port_protocol(struct ieee80211_tx_data *tx) in ieee80211_tx_h_check_control_port_protocol() argument
574 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); in ieee80211_tx_h_check_control_port_protocol()
576 if (unlikely(tx->sdata->control_port_protocol == tx->skb->protocol)) { in ieee80211_tx_h_check_control_port_protocol()
577 if (tx->sdata->control_port_no_encrypt) in ieee80211_tx_h_check_control_port_protocol()
587 ieee80211_tx_h_select_key(struct ieee80211_tx_data *tx) in ieee80211_tx_h_select_key() argument
590 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); in ieee80211_tx_h_select_key()
591 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data; in ieee80211_tx_h_select_key()
594 tx->key = NULL; in ieee80211_tx_h_select_key()
595 else if (tx->sta && in ieee80211_tx_h_select_key()
596 (key = rcu_dereference(tx->sta->ptk[tx->sta->ptk_idx]))) in ieee80211_tx_h_select_key()
597 tx->key = key; in ieee80211_tx_h_select_key()
598 else if (ieee80211_is_group_privacy_action(tx->skb) && in ieee80211_tx_h_select_key()
599 (key = rcu_dereference(tx->sdata->default_multicast_key))) in ieee80211_tx_h_select_key()
600 tx->key = key; in ieee80211_tx_h_select_key()
603 ieee80211_is_robust_mgmt_frame(tx->skb) && in ieee80211_tx_h_select_key()
604 (key = rcu_dereference(tx->sdata->default_mgmt_key))) in ieee80211_tx_h_select_key()
605 tx->key = key; in ieee80211_tx_h_select_key()
607 (key = rcu_dereference(tx->sdata->default_multicast_key))) 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()
615 if (tx->key) { in ieee80211_tx_h_select_key()
620 switch (tx->key->conf.cipher) { in ieee80211_tx_h_select_key()
625 tx->key = NULL; in ieee80211_tx_h_select_key()
632 !ieee80211_use_mfp(hdr->frame_control, tx->sta, in ieee80211_tx_h_select_key()
633 tx->skb) && in ieee80211_tx_h_select_key()
634 !ieee80211_is_group_privacy_action(tx->skb)) in ieee80211_tx_h_select_key()
635 tx->key = NULL; in ieee80211_tx_h_select_key()
637 skip_hw = (tx->key->conf.flags & in ieee80211_tx_h_select_key()
646 tx->key = NULL; in ieee80211_tx_h_select_key()
650 if (unlikely(tx->key && tx->key->flags & KEY_FLAG_TAINTED && in ieee80211_tx_h_select_key()
654 if (!skip_hw && tx->key && in ieee80211_tx_h_select_key()
655 tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) in ieee80211_tx_h_select_key()
656 info->control.hw_key = &tx->key->conf; in ieee80211_tx_h_select_key()
663 ieee80211_tx_h_rate_ctrl(struct ieee80211_tx_data *tx) in ieee80211_tx_h_rate_ctrl() argument
665 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); in ieee80211_tx_h_rate_ctrl()
666 struct ieee80211_hdr *hdr = (void *)tx->skb->data; in ieee80211_tx_h_rate_ctrl()
675 sband = tx->local->hw.wiphy->bands[info->band]; in ieee80211_tx_h_rate_ctrl()
677 len = min_t(u32, tx->skb->len + FCS_LEN, in ieee80211_tx_h_rate_ctrl()
678 tx->local->hw.wiphy->frag_threshold); in ieee80211_tx_h_rate_ctrl()
680 /* set up the tx rate control struct we give the RC algo */ in ieee80211_tx_h_rate_ctrl()
681 txrc.hw = &tx->local->hw; in ieee80211_tx_h_rate_ctrl()
683 txrc.bss_conf = &tx->sdata->vif.bss_conf; in ieee80211_tx_h_rate_ctrl()
684 txrc.skb = tx->skb; in ieee80211_tx_h_rate_ctrl()
686 txrc.rate_idx_mask = tx->sdata->rc_rateidx_mask[info->band]; in ieee80211_tx_h_rate_ctrl()
688 if (tx->sdata->rc_has_mcs_mask[info->band]) in ieee80211_tx_h_rate_ctrl()
690 tx->sdata->rc_rateidx_mcs_mask[info->band]; in ieee80211_tx_h_rate_ctrl()
692 txrc.bss = (tx->sdata->vif.type == NL80211_IFTYPE_AP || in ieee80211_tx_h_rate_ctrl()
693 tx->sdata->vif.type == NL80211_IFTYPE_MESH_POINT || in ieee80211_tx_h_rate_ctrl()
694 tx->sdata->vif.type == NL80211_IFTYPE_ADHOC || in ieee80211_tx_h_rate_ctrl()
695 tx->sdata->vif.type == NL80211_IFTYPE_OCB); in ieee80211_tx_h_rate_ctrl()
698 if (len > tx->local->hw.wiphy->rts_threshold) { in ieee80211_tx_h_rate_ctrl()
703 info->control.use_cts_prot = tx->sdata->vif.bss_conf.use_cts_prot; in ieee80211_tx_h_rate_ctrl()
711 if (tx->sdata->vif.bss_conf.use_short_preamble && in ieee80211_tx_h_rate_ctrl()
713 (tx->sta && test_sta_flag(tx->sta, WLAN_STA_SHORT_PREAMBLE)))) in ieee80211_tx_h_rate_ctrl()
722 if (tx->sta) in ieee80211_tx_h_rate_ctrl()
723 assoc = test_sta_flag(tx->sta, WLAN_STA_ASSOC); in ieee80211_tx_h_rate_ctrl()
729 if (WARN(test_bit(SCAN_SW_SCANNING, &tx->local->scanning) && assoc && in ieee80211_tx_h_rate_ctrl()
730 !rate_usable_index_exists(sband, &tx->sta->sta), in ieee80211_tx_h_rate_ctrl()
734 tx->sdata->name, hdr->addr1, in ieee80211_tx_h_rate_ctrl()
742 rate_control_get_rate(tx->sdata, tx->sta, &txrc); in ieee80211_tx_h_rate_ctrl()
744 if (tx->sta && !info->control.skip_table) in ieee80211_tx_h_rate_ctrl()
745 ratetbl = rcu_dereference(tx->sta->sta.rates); in ieee80211_tx_h_rate_ctrl()
758 tx->rate = rate; in ieee80211_tx_h_rate_ctrl()
763 tx->rate = info->control.rates[0]; in ieee80211_tx_h_rate_ctrl()
767 txrc.reported_rate = tx->rate; in ieee80211_tx_h_rate_ctrl()
768 if (tx->sta && ieee80211_is_data(hdr->frame_control)) in ieee80211_tx_h_rate_ctrl()
769 tx->sta->tx_stats.last_rate = txrc.reported_rate; in ieee80211_tx_h_rate_ctrl()
770 } else if (tx->sta) in ieee80211_tx_h_rate_ctrl()
771 tx->sta->tx_stats.last_rate = txrc.reported_rate; in ieee80211_tx_h_rate_ctrl()
798 ieee80211_tx_h_sequence(struct ieee80211_tx_data *tx) in ieee80211_tx_h_sequence() argument
800 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); in ieee80211_tx_h_sequence()
801 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data; in ieee80211_tx_h_sequence()
829 if (tx->flags & IEEE80211_TX_NO_SEQNO) in ieee80211_tx_h_sequence()
834 hdr->seq_ctrl = cpu_to_le16(tx->sdata->sequence_number); in ieee80211_tx_h_sequence()
835 tx->sdata->sequence_number += 0x10; in ieee80211_tx_h_sequence()
836 if (tx->sta) in ieee80211_tx_h_sequence()
837 tx->sta->tx_stats.msdu[IEEE80211_NUM_TIDS]++; in ieee80211_tx_h_sequence()
846 if (!tx->sta) in ieee80211_tx_h_sequence()
851 tx->sta->tx_stats.msdu[tid]++; in ieee80211_tx_h_sequence()
853 hdr->seq_ctrl = ieee80211_tx_next_seq(tx->sta, tid); in ieee80211_tx_h_sequence()
858 static int ieee80211_fragment(struct ieee80211_tx_data *tx, in ieee80211_fragment() argument
862 struct ieee80211_local *local = tx->local; in ieee80211_fragment()
882 tx->sdata->encrypt_headroom + in ieee80211_fragment()
887 __skb_queue_tail(&tx->skbs, tmp); in ieee80211_fragment()
890 local->tx_headroom + tx->sdata->encrypt_headroom); in ieee80211_fragment()
919 ieee80211_tx_h_fragment(struct ieee80211_tx_data *tx) in ieee80211_tx_h_fragment() argument
921 struct sk_buff *skb = tx->skb; in ieee80211_tx_h_fragment()
924 int frag_threshold = tx->local->hw.wiphy->frag_threshold; in ieee80211_tx_h_fragment()
928 /* no matter what happens, tx->skb moves to tx->skbs */ in ieee80211_tx_h_fragment()
929 __skb_queue_tail(&tx->skbs, skb); in ieee80211_tx_h_fragment()
930 tx->skb = NULL; in ieee80211_tx_h_fragment()
935 if (ieee80211_hw_check(&tx->local->hw, SUPPORTS_TX_FRAG)) in ieee80211_tx_h_fragment()
941 * caution taken here as fragmented ampdu may cause Tx stop. in ieee80211_tx_h_fragment()
960 if (ieee80211_fragment(tx, skb, hdrlen, frag_threshold)) in ieee80211_tx_h_fragment()
966 skb_queue_walk(&tx->skbs, skb) { in ieee80211_tx_h_fragment()
972 if (!skb_queue_is_last(&tx->skbs, skb)) { in ieee80211_tx_h_fragment()
994 ieee80211_tx_h_stats(struct ieee80211_tx_data *tx) in ieee80211_tx_h_stats() argument
999 if (!tx->sta) in ieee80211_tx_h_stats()
1002 skb_queue_walk(&tx->skbs, skb) { in ieee80211_tx_h_stats()
1004 tx->sta->tx_stats.bytes[ac] += skb->len; in ieee80211_tx_h_stats()
1007 tx->sta->tx_stats.packets[ac]++; in ieee80211_tx_h_stats()
1013 ieee80211_tx_h_encrypt(struct ieee80211_tx_data *tx) in ieee80211_tx_h_encrypt() argument
1015 if (!tx->key) in ieee80211_tx_h_encrypt()
1018 switch (tx->key->conf.cipher) { in ieee80211_tx_h_encrypt()
1021 return ieee80211_crypto_wep_encrypt(tx); in ieee80211_tx_h_encrypt()
1023 return ieee80211_crypto_tkip_encrypt(tx); in ieee80211_tx_h_encrypt()
1026 tx, IEEE80211_CCMP_MIC_LEN); in ieee80211_tx_h_encrypt()
1029 tx, IEEE80211_CCMP_256_MIC_LEN); in ieee80211_tx_h_encrypt()
1031 return ieee80211_crypto_aes_cmac_encrypt(tx); in ieee80211_tx_h_encrypt()
1033 return ieee80211_crypto_aes_cmac_256_encrypt(tx); in ieee80211_tx_h_encrypt()
1036 return ieee80211_crypto_aes_gmac_encrypt(tx); in ieee80211_tx_h_encrypt()
1039 return ieee80211_crypto_gcmp_encrypt(tx); in ieee80211_tx_h_encrypt()
1041 return ieee80211_crypto_hw_encrypt(tx); in ieee80211_tx_h_encrypt()
1048 ieee80211_tx_h_calculate_duration(struct ieee80211_tx_data *tx) in ieee80211_tx_h_calculate_duration() argument
1055 skb_queue_walk(&tx->skbs, skb) { in ieee80211_tx_h_calculate_duration()
1059 if (!skb_queue_is_last(&tx->skbs, skb)) { in ieee80211_tx_h_calculate_duration()
1060 struct sk_buff *next = skb_queue_next(&tx->skbs, skb); in ieee80211_tx_h_calculate_duration()
1067 ieee80211_duration(tx, skb, group_addr, next_len); in ieee80211_tx_h_calculate_duration()
1075 static bool ieee80211_tx_prep_agg(struct ieee80211_tx_data *tx, in ieee80211_tx_prep_agg() argument
1093 } else if (!tx->sta->sta.txq[tid]) { in ieee80211_tx_prep_agg()
1094 spin_lock(&tx->sta->lock); in ieee80211_tx_prep_agg()
1113 tid_tx = rcu_dereference_protected_tid_tx(tx->sta, tid); in ieee80211_tx_prep_agg()
1123 clear_sta_flag(tx->sta, WLAN_STA_SP); in ieee80211_tx_prep_agg()
1124 ps_dbg(tx->sta->sdata, in ieee80211_tx_prep_agg()
1126 tx->sta->sta.addr, tx->sta->sta.aid); in ieee80211_tx_prep_agg()
1128 info->control.vif = &tx->sdata->vif; in ieee80211_tx_prep_agg()
1135 spin_unlock(&tx->sta->lock); in ieee80211_tx_prep_agg()
1138 ieee80211_free_txskb(&tx->local->hw, purge_skb); in ieee80211_tx_prep_agg()
1149 * initialises @tx
1155 struct ieee80211_tx_data *tx, in ieee80211_tx_prepare() argument
1163 memset(tx, 0, sizeof(*tx)); in ieee80211_tx_prepare()
1164 tx->skb = skb; in ieee80211_tx_prepare()
1165 tx->local = local; in ieee80211_tx_prepare()
1166 tx->sdata = sdata; in ieee80211_tx_prepare()
1167 __skb_queue_head_init(&tx->skbs); in ieee80211_tx_prepare()
1180 tx->sta = sta; in ieee80211_tx_prepare()
1183 tx->sta = rcu_dereference(sdata->u.vlan.sta); in ieee80211_tx_prepare()
1184 if (!tx->sta && sdata->wdev.use_4addr) in ieee80211_tx_prepare()
1188 tx->sdata->control_port_protocol == tx->skb->protocol) { in ieee80211_tx_prepare()
1189 tx->sta = sta_info_get_bss(sdata, hdr->addr1); in ieee80211_tx_prepare()
1191 if (!tx->sta && !is_multicast_ether_addr(hdr->addr1)) in ieee80211_tx_prepare()
1192 tx->sta = sta_info_get(sdata, hdr->addr1); in ieee80211_tx_prepare()
1195 if (tx->sta && ieee80211_is_data_qos(hdr->frame_control) && in ieee80211_tx_prepare()
1203 tid_tx = rcu_dereference(tx->sta->ampdu_mlme.tid_tx[tid]); in ieee80211_tx_prepare()
1207 queued = ieee80211_tx_prep_agg(tx, skb, info, in ieee80211_tx_prepare()
1216 tx->flags &= ~IEEE80211_TX_UNICAST; in ieee80211_tx_prepare()
1219 tx->flags |= IEEE80211_TX_UNICAST; in ieee80211_tx_prepare()
1222 if (!(tx->flags & IEEE80211_TX_UNICAST) || in ieee80211_tx_prepare()
1228 if (!tx->sta) in ieee80211_tx_prepare()
1230 else if (test_and_clear_sta_flag(tx->sta, WLAN_STA_CLEAR_PS_FILT)) { in ieee80211_tx_prepare()
1232 ieee80211_check_fast_xmit(tx->sta); in ieee80211_tx_prepare()
1664 * later transmission from the tx-pending in ieee80211_tx_frags()
1758 * Invoke TX handlers, return 0 on success and non-zero if the
1765 static int invoke_tx_handlers_early(struct ieee80211_tx_data *tx) in invoke_tx_handlers_early() argument
1771 res = txh(tx); \ in invoke_tx_handlers_early()
1781 if (!ieee80211_hw_check(&tx->local->hw, HAS_RATE_CONTROL)) in invoke_tx_handlers_early()
1786 I802_DEBUG_INC(tx->local->tx_handlers_drop); in invoke_tx_handlers_early()
1787 if (tx->skb) in invoke_tx_handlers_early()
1788 ieee80211_free_txskb(&tx->local->hw, tx->skb); in invoke_tx_handlers_early()
1790 ieee80211_purge_tx_queue(&tx->local->hw, &tx->skbs); in invoke_tx_handlers_early()
1793 I802_DEBUG_INC(tx->local->tx_handlers_queued); in invoke_tx_handlers_early()
1804 static int invoke_tx_handlers_late(struct ieee80211_tx_data *tx) in invoke_tx_handlers_late() argument
1806 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); in invoke_tx_handlers_late()
1810 __skb_queue_tail(&tx->skbs, tx->skb); in invoke_tx_handlers_late()
1811 tx->skb = NULL; in invoke_tx_handlers_late()
1818 /* handlers after fragment must be aware of tx info fragmentation! */ in invoke_tx_handlers_late()
1821 if (!ieee80211_hw_check(&tx->local->hw, HAS_RATE_CONTROL)) in invoke_tx_handlers_late()
1827 I802_DEBUG_INC(tx->local->tx_handlers_drop); in invoke_tx_handlers_late()
1828 if (tx->skb) in invoke_tx_handlers_late()
1829 ieee80211_free_txskb(&tx->local->hw, tx->skb); in invoke_tx_handlers_late()
1831 ieee80211_purge_tx_queue(&tx->local->hw, &tx->skbs); in invoke_tx_handlers_late()
1834 I802_DEBUG_INC(tx->local->tx_handlers_queued); in invoke_tx_handlers_late()
1841 static int invoke_tx_handlers(struct ieee80211_tx_data *tx) in invoke_tx_handlers() argument
1843 int r = invoke_tx_handlers_early(tx); in invoke_tx_handlers()
1847 return invoke_tx_handlers_late(tx); in invoke_tx_handlers()
1856 struct ieee80211_tx_data tx; in ieee80211_tx_prepare_skb() local
1859 if (ieee80211_tx_prepare(sdata, &tx, NULL, skb) == TX_DROP) in ieee80211_tx_prepare_skb()
1866 if (invoke_tx_handlers(&tx)) in ieee80211_tx_prepare_skb()
1870 if (tx.sta) in ieee80211_tx_prepare_skb()
1871 *sta = &tx.sta->sta; in ieee80211_tx_prepare_skb()
1877 skb2 = __skb_dequeue(&tx.skbs); in ieee80211_tx_prepare_skb()
1878 if (WARN_ON(skb2 != skb || !skb_queue_empty(&tx.skbs))) { in ieee80211_tx_prepare_skb()
1880 ieee80211_purge_tx_queue(hw, &tx.skbs); in ieee80211_tx_prepare_skb()
1896 struct ieee80211_tx_data tx; in ieee80211_tx() local
1907 /* initialises tx */ in ieee80211_tx()
1909 res_prepare = ieee80211_tx_prepare(sdata, &tx, sta, skb); in ieee80211_tx()
1911 tx.flags |= txdata_flags; in ieee80211_tx()
1926 if (invoke_tx_handlers_early(&tx)) in ieee80211_tx()
1929 if (ieee80211_queue_skb(local, sdata, tx.sta, tx.skb)) in ieee80211_tx()
1932 if (!invoke_tx_handlers_late(&tx)) in ieee80211_tx()
1933 result = __ieee80211_tx(local, &tx.skbs, led_len, in ieee80211_tx()
1934 tx.sta, txpending); in ieee80211_tx()
1972 "failed to reallocate TX buffer\n"); in ieee80211_skb_resize()
2317 * NO TX unless the channel is explicitly allowed in which case in ieee80211_monitor_start_xmit()
2321 * Since AP mode uses monitor interfaces to inject/TX management in ieee80211_monitor_start_xmit()
2438 * Note that this function also takes care of the TX status request and
2858 * maintained if any of the TX path checks change.
2881 * key and the fast-tx assignment are done atomically, so the CPU that in ieee80211_check_fast_xmit()
3138 "failed to reallocate TX buffer\n"); in ieee80211_amsdu_realloc_pad()
3419 struct ieee80211_tx_data tx; in ieee80211_xmit_fast() local
3432 /* don't handle TX status request here either */ in ieee80211_xmit_fast()
3500 __skb_queue_head_init(&tx.skbs); in ieee80211_xmit_fast()
3502 tx.flags = IEEE80211_TX_UNICAST; in ieee80211_xmit_fast()
3503 tx.local = local; in ieee80211_xmit_fast()
3504 tx.sdata = sdata; in ieee80211_xmit_fast()
3505 tx.sta = sta; in ieee80211_xmit_fast()
3506 tx.key = fast_tx->key; in ieee80211_xmit_fast()
3509 tx.skb = skb; in ieee80211_xmit_fast()
3510 r = ieee80211_tx_h_rate_ctrl(&tx); in ieee80211_xmit_fast()
3511 skb = tx.skb; in ieee80211_xmit_fast()
3512 tx.skb = NULL; in ieee80211_xmit_fast()
3531 __skb_queue_tail(&tx.skbs, skb); in ieee80211_xmit_fast()
3532 ieee80211_tx_frags(local, &sdata->vif, &sta->sta, &tx.skbs, false); in ieee80211_xmit_fast()
3546 struct ieee80211_tx_data tx; in ieee80211_tx_dequeue() local
3578 memset(&tx, 0, sizeof(tx)); in ieee80211_tx_dequeue()
3579 __skb_queue_head_init(&tx.skbs); in ieee80211_tx_dequeue()
3580 tx.local = local; in ieee80211_tx_dequeue()
3581 tx.skb = skb; in ieee80211_tx_dequeue()
3582 tx.sdata = vif_to_sdata(info->control.vif); in ieee80211_tx_dequeue()
3585 tx.sta = container_of(txq->sta, struct sta_info, sta); in ieee80211_tx_dequeue()
3591 r = ieee80211_tx_h_select_key(&tx); in ieee80211_tx_dequeue()
3607 if (tx.key && in ieee80211_tx_dequeue()
3608 (tx.key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV)) in ieee80211_tx_dequeue()
3612 tx.key, skb); in ieee80211_tx_dequeue()
3614 if (invoke_tx_handlers_late(&tx)) in ieee80211_tx_dequeue()
3617 skb = __skb_dequeue(&tx.skbs); in ieee80211_tx_dequeue()
3619 if (!skb_queue_empty(&tx.skbs)) { in ieee80211_tx_dequeue()
3621 skb_queue_splice_tail(&tx.skbs, &txqi->frags); in ieee80211_tx_dequeue()
3634 switch (tx.sdata->vif.type) { in ieee80211_tx_dequeue()
3636 if (tx.sdata->u.mntr.flags & MONITOR_FLAG_ACTIVE) { in ieee80211_tx_dequeue()
3637 vif = &tx.sdata->vif; in ieee80211_tx_dequeue()
3640 tx.sdata = rcu_dereference(local->monitor_sdata); in ieee80211_tx_dequeue()
3641 if (tx.sdata) { in ieee80211_tx_dequeue()
3642 vif = &tx.sdata->vif; in ieee80211_tx_dequeue()
3653 tx.sdata = container_of(tx.sdata->bss, in ieee80211_tx_dequeue()
3657 vif = &tx.sdata->vif; in ieee80211_tx_dequeue()
4037 struct ieee80211_tx_data tx = { in ieee80211_build_data_template() local
4056 tx.sta = sta_info_get(sdata, hdr->addr1); in ieee80211_build_data_template()
4057 tx.skb = skb; in ieee80211_build_data_template()
4059 if (ieee80211_tx_h_select_key(&tx) != TX_CONTINUE) { in ieee80211_build_data_template()
4865 struct ieee80211_tx_data tx; in ieee80211_get_buffered_bc() local
4914 if (!ieee80211_tx_prepare(sdata, &tx, NULL, skb)) in ieee80211_get_buffered_bc()
4921 tx.flags |= IEEE80211_TX_PS_BUFFERED; in ieee80211_get_buffered_bc()
4924 if (invoke_tx_handlers(&tx)) in ieee80211_get_buffered_bc()
5039 * requirements are that we do not come into tx with bhs on. in __ieee80211_tx_skb_tid_band()