Lines Matching refs:tx
42 static __le16 ieee80211_duration(struct ieee80211_tx_data *tx, in ieee80211_duration() argument
48 struct ieee80211_local *local = tx->local; in ieee80211_duration()
56 if (tx->rate.flags & (IEEE80211_TX_RC_MCS | IEEE80211_TX_RC_VHT_MCS)) in ieee80211_duration()
60 chanctx_conf = rcu_dereference(tx->sdata->vif.chanctx_conf); in ieee80211_duration()
68 if (WARN_ON_ONCE(tx->rate.idx < 0)) in ieee80211_duration()
72 txrate = &sband->bitrates[tx->rate.idx]; in ieee80211_duration()
145 if (tx->sdata->vif.bss_conf.basic_rates & BIT(i)) in ieee80211_duration()
152 if (tx->sdata->flags & IEEE80211_SDATA_OPERATING_GMODE) in ieee80211_duration()
188 tx->sdata->vif.bss_conf.use_short_preamble, in ieee80211_duration()
198 tx->sdata->vif.bss_conf.use_short_preamble, in ieee80211_duration()
207 ieee80211_tx_h_dynamic_ps(struct ieee80211_tx_data *tx) in ieee80211_tx_h_dynamic_ps() argument
209 struct ieee80211_local *local = tx->local; in ieee80211_tx_h_dynamic_ps()
211 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); in ieee80211_tx_h_dynamic_ps()
237 if (tx->sdata->vif.type != NL80211_IFTYPE_STATION) in ieee80211_tx_h_dynamic_ps()
243 ifmgd = &tx->sdata->u.mgd; in ieee80211_tx_h_dynamic_ps()
260 skb_get_queue_mapping(tx->skb) == IEEE80211_AC_VO) in ieee80211_tx_h_dynamic_ps()
284 ieee80211_tx_h_check_assoc(struct ieee80211_tx_data *tx) in ieee80211_tx_h_check_assoc() argument
287 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data; in ieee80211_tx_h_check_assoc()
288 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); in ieee80211_tx_h_check_assoc()
294 if (unlikely(test_bit(SCAN_SW_SCANNING, &tx->local->scanning)) && in ieee80211_tx_h_check_assoc()
295 test_bit(SDATA_STATE_OFFCHANNEL, &tx->sdata->state) && in ieee80211_tx_h_check_assoc()
311 if (tx->sdata->vif.type == NL80211_IFTYPE_OCB) in ieee80211_tx_h_check_assoc()
314 if (tx->flags & IEEE80211_TX_PS_BUFFERED) in ieee80211_tx_h_check_assoc()
317 if (tx->sta) in ieee80211_tx_h_check_assoc()
318 assoc = test_sta_flag(tx->sta, WLAN_STA_ASSOC); in ieee80211_tx_h_check_assoc()
320 if (likely(tx->flags & IEEE80211_TX_UNICAST)) { in ieee80211_tx_h_check_assoc()
324 sdata_info(tx->sdata, in ieee80211_tx_h_check_assoc()
328 I802_DEBUG_INC(tx->local->tx_handlers_drop_not_assoc); in ieee80211_tx_h_check_assoc()
332 ieee80211_vif_get_num_mcast_if(tx->sdata) == 0)) { in ieee80211_tx_h_check_assoc()
395 ieee80211_tx_h_multicast_ps_buf(struct ieee80211_tx_data *tx) in ieee80211_tx_h_multicast_ps_buf() argument
397 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); in ieee80211_tx_h_multicast_ps_buf()
398 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data; in ieee80211_tx_h_multicast_ps_buf()
410 if (tx->sdata->vif.type == NL80211_IFTYPE_AP || in ieee80211_tx_h_multicast_ps_buf()
411 tx->sdata->vif.type == NL80211_IFTYPE_AP_VLAN) { in ieee80211_tx_h_multicast_ps_buf()
412 if (!tx->sdata->bss) in ieee80211_tx_h_multicast_ps_buf()
415 ps = &tx->sdata->bss->ps; in ieee80211_tx_h_multicast_ps_buf()
416 } else if (ieee80211_vif_is_mesh(&tx->sdata->vif)) { in ieee80211_tx_h_multicast_ps_buf()
417 ps = &tx->sdata->u.mesh.ps; in ieee80211_tx_h_multicast_ps_buf()
430 if (ieee80211_hw_check(&tx->local->hw, QUEUE_CONTROL)) in ieee80211_tx_h_multicast_ps_buf()
431 info->hw_queue = tx->sdata->vif.cab_queue; in ieee80211_tx_h_multicast_ps_buf()
440 if (!ieee80211_hw_check(&tx->local->hw, HOST_BROADCAST_PS_BUFFERING)) in ieee80211_tx_h_multicast_ps_buf()
444 if (tx->local->total_ps_buffered >= TOTAL_MAX_TX_BUFFER) in ieee80211_tx_h_multicast_ps_buf()
445 purge_old_ps_buffers(tx->local); in ieee80211_tx_h_multicast_ps_buf()
448 ps_dbg(tx->sdata, in ieee80211_tx_h_multicast_ps_buf()
450 ieee80211_free_txskb(&tx->local->hw, skb_dequeue(&ps->bc_buf)); in ieee80211_tx_h_multicast_ps_buf()
452 tx->local->total_ps_buffered++; in ieee80211_tx_h_multicast_ps_buf()
454 skb_queue_tail(&ps->bc_buf, tx->skb); in ieee80211_tx_h_multicast_ps_buf()
475 ieee80211_tx_h_unicast_ps_buf(struct ieee80211_tx_data *tx) in ieee80211_tx_h_unicast_ps_buf() argument
477 struct sta_info *sta = tx->sta; in ieee80211_tx_h_unicast_ps_buf()
478 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); in ieee80211_tx_h_unicast_ps_buf()
479 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data; in ieee80211_tx_h_unicast_ps_buf()
480 struct ieee80211_local *local = tx->local; in ieee80211_tx_h_unicast_ps_buf()
489 int ac = skb_get_queue_mapping(tx->skb); in ieee80211_tx_h_unicast_ps_buf()
499 if (tx->local->total_ps_buffered >= TOTAL_MAX_TX_BUFFER) in ieee80211_tx_h_unicast_ps_buf()
500 purge_old_ps_buffers(tx->local); in ieee80211_tx_h_unicast_ps_buf()
518 ps_dbg(tx->sdata, in ieee80211_tx_h_unicast_ps_buf()
523 tx->local->total_ps_buffered++; in ieee80211_tx_h_unicast_ps_buf()
526 info->control.vif = &tx->sdata->vif; in ieee80211_tx_h_unicast_ps_buf()
529 skb_queue_tail(&sta->ps_tx_buf[ac], tx->skb); in ieee80211_tx_h_unicast_ps_buf()
545 ps_dbg(tx->sdata, in ieee80211_tx_h_unicast_ps_buf()
554 ieee80211_tx_h_ps_buf(struct ieee80211_tx_data *tx) in ieee80211_tx_h_ps_buf() argument
556 if (unlikely(tx->flags & IEEE80211_TX_PS_BUFFERED)) in ieee80211_tx_h_ps_buf()
559 if (tx->flags & IEEE80211_TX_UNICAST) in ieee80211_tx_h_ps_buf()
560 return ieee80211_tx_h_unicast_ps_buf(tx); in ieee80211_tx_h_ps_buf()
562 return ieee80211_tx_h_multicast_ps_buf(tx); in ieee80211_tx_h_ps_buf()
566 ieee80211_tx_h_check_control_port_protocol(struct ieee80211_tx_data *tx) in ieee80211_tx_h_check_control_port_protocol() argument
568 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); in ieee80211_tx_h_check_control_port_protocol()
570 if (unlikely(tx->sdata->control_port_protocol == tx->skb->protocol)) { in ieee80211_tx_h_check_control_port_protocol()
571 if (tx->sdata->control_port_no_encrypt) in ieee80211_tx_h_check_control_port_protocol()
581 ieee80211_tx_h_select_key(struct ieee80211_tx_data *tx) in ieee80211_tx_h_select_key() argument
584 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); in ieee80211_tx_h_select_key()
585 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data; in ieee80211_tx_h_select_key()
588 tx->key = NULL; in ieee80211_tx_h_select_key()
592 if (tx->sta && in ieee80211_tx_h_select_key()
593 (key = rcu_dereference(tx->sta->ptk[tx->sta->ptk_idx]))) in ieee80211_tx_h_select_key()
594 tx->key = key; in ieee80211_tx_h_select_key()
595 else if (ieee80211_is_group_privacy_action(tx->skb) && in ieee80211_tx_h_select_key()
596 (key = rcu_dereference(tx->sdata->default_multicast_key))) in ieee80211_tx_h_select_key()
597 tx->key = key; in ieee80211_tx_h_select_key()
600 ieee80211_is_robust_mgmt_frame(tx->skb) && in ieee80211_tx_h_select_key()
601 (key = rcu_dereference(tx->sdata->default_mgmt_key))) in ieee80211_tx_h_select_key()
602 tx->key = key; in ieee80211_tx_h_select_key()
604 (key = rcu_dereference(tx->sdata->default_multicast_key))) in ieee80211_tx_h_select_key()
605 tx->key = key; in ieee80211_tx_h_select_key()
607 (key = rcu_dereference(tx->sdata->default_unicast_key))) in ieee80211_tx_h_select_key()
608 tx->key = key; in ieee80211_tx_h_select_key()
610 tx->key = NULL; in ieee80211_tx_h_select_key()
612 if (tx->key) { in ieee80211_tx_h_select_key()
617 switch (tx->key->conf.cipher) { in ieee80211_tx_h_select_key()
622 tx->key = NULL; in ieee80211_tx_h_select_key()
629 !ieee80211_use_mfp(hdr->frame_control, tx->sta, in ieee80211_tx_h_select_key()
630 tx->skb) && in ieee80211_tx_h_select_key()
631 !ieee80211_is_group_privacy_action(tx->skb)) in ieee80211_tx_h_select_key()
632 tx->key = NULL; in ieee80211_tx_h_select_key()
634 skip_hw = (tx->key->conf.flags & in ieee80211_tx_h_select_key()
643 tx->key = NULL; in ieee80211_tx_h_select_key()
647 if (unlikely(tx->key && tx->key->flags & KEY_FLAG_TAINTED && in ieee80211_tx_h_select_key()
649 tx->skb->protocol != tx->sdata->control_port_protocol) in ieee80211_tx_h_select_key()
652 if (!skip_hw && tx->key && in ieee80211_tx_h_select_key()
653 tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) in ieee80211_tx_h_select_key()
654 info->control.hw_key = &tx->key->conf; in ieee80211_tx_h_select_key()
655 } else if (ieee80211_is_data_present(hdr->frame_control) && tx->sta && in ieee80211_tx_h_select_key()
656 test_sta_flag(tx->sta, WLAN_STA_USES_ENCRYPTION)) { in ieee80211_tx_h_select_key()
664 ieee80211_tx_h_rate_ctrl(struct ieee80211_tx_data *tx) in ieee80211_tx_h_rate_ctrl() argument
666 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); in ieee80211_tx_h_rate_ctrl()
667 struct ieee80211_hdr *hdr = (void *)tx->skb->data; in ieee80211_tx_h_rate_ctrl()
677 sband = tx->local->hw.wiphy->bands[info->band]; in ieee80211_tx_h_rate_ctrl()
679 len = min_t(u32, tx->skb->len + FCS_LEN, in ieee80211_tx_h_rate_ctrl()
680 tx->local->hw.wiphy->frag_threshold); in ieee80211_tx_h_rate_ctrl()
683 txrc.hw = &tx->local->hw; in ieee80211_tx_h_rate_ctrl()
685 txrc.bss_conf = &tx->sdata->vif.bss_conf; in ieee80211_tx_h_rate_ctrl()
686 txrc.skb = tx->skb; in ieee80211_tx_h_rate_ctrl()
688 txrc.rate_idx_mask = tx->sdata->rc_rateidx_mask[info->band]; in ieee80211_tx_h_rate_ctrl()
690 if (tx->sdata->rc_has_mcs_mask[info->band]) in ieee80211_tx_h_rate_ctrl()
692 tx->sdata->rc_rateidx_mcs_mask[info->band]; in ieee80211_tx_h_rate_ctrl()
694 txrc.bss = (tx->sdata->vif.type == NL80211_IFTYPE_AP || in ieee80211_tx_h_rate_ctrl()
695 tx->sdata->vif.type == NL80211_IFTYPE_MESH_POINT || in ieee80211_tx_h_rate_ctrl()
696 tx->sdata->vif.type == NL80211_IFTYPE_ADHOC || in ieee80211_tx_h_rate_ctrl()
697 tx->sdata->vif.type == NL80211_IFTYPE_OCB); in ieee80211_tx_h_rate_ctrl()
700 if (len > tx->local->hw.wiphy->rts_threshold) { in ieee80211_tx_h_rate_ctrl()
705 info->control.use_cts_prot = tx->sdata->vif.bss_conf.use_cts_prot; in ieee80211_tx_h_rate_ctrl()
713 if (tx->sdata->vif.bss_conf.use_short_preamble && in ieee80211_tx_h_rate_ctrl()
714 (ieee80211_is_tx_data(tx->skb) || in ieee80211_tx_h_rate_ctrl()
715 (tx->sta && test_sta_flag(tx->sta, WLAN_STA_SHORT_PREAMBLE)))) in ieee80211_tx_h_rate_ctrl()
724 if (tx->sta) in ieee80211_tx_h_rate_ctrl()
725 assoc = test_sta_flag(tx->sta, WLAN_STA_ASSOC); in ieee80211_tx_h_rate_ctrl()
731 if (WARN(test_bit(SCAN_SW_SCANNING, &tx->local->scanning) && assoc && in ieee80211_tx_h_rate_ctrl()
732 !rate_usable_index_exists(sband, &tx->sta->sta), in ieee80211_tx_h_rate_ctrl()
736 tx->sdata->name, in ieee80211_tx_h_rate_ctrl()
745 rate_control_get_rate(tx->sdata, tx->sta, &txrc); in ieee80211_tx_h_rate_ctrl()
747 if (tx->sta && !info->control.skip_table) in ieee80211_tx_h_rate_ctrl()
748 ratetbl = rcu_dereference(tx->sta->sta.rates); in ieee80211_tx_h_rate_ctrl()
761 tx->rate = rate; in ieee80211_tx_h_rate_ctrl()
766 tx->rate = info->control.rates[0]; in ieee80211_tx_h_rate_ctrl()
770 txrc.reported_rate = tx->rate; in ieee80211_tx_h_rate_ctrl()
771 if (tx->sta && ieee80211_is_tx_data(tx->skb)) in ieee80211_tx_h_rate_ctrl()
772 tx->sta->tx_stats.last_rate = txrc.reported_rate; in ieee80211_tx_h_rate_ctrl()
773 } else if (tx->sta) in ieee80211_tx_h_rate_ctrl()
774 tx->sta->tx_stats.last_rate = txrc.reported_rate; in ieee80211_tx_h_rate_ctrl()
801 ieee80211_tx_h_sequence(struct ieee80211_tx_data *tx) in ieee80211_tx_h_sequence() argument
803 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); in ieee80211_tx_h_sequence()
804 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data; in ieee80211_tx_h_sequence()
838 hdr->seq_ctrl = cpu_to_le16(tx->sdata->sequence_number); in ieee80211_tx_h_sequence()
839 tx->sdata->sequence_number += 0x10; in ieee80211_tx_h_sequence()
840 if (tx->sta) in ieee80211_tx_h_sequence()
841 tx->sta->tx_stats.msdu[IEEE80211_NUM_TIDS]++; in ieee80211_tx_h_sequence()
850 if (!tx->sta) in ieee80211_tx_h_sequence()
855 tx->sta->tx_stats.msdu[tid]++; in ieee80211_tx_h_sequence()
857 hdr->seq_ctrl = ieee80211_tx_next_seq(tx->sta, tid); in ieee80211_tx_h_sequence()
862 static int ieee80211_fragment(struct ieee80211_tx_data *tx, in ieee80211_fragment() argument
866 struct ieee80211_local *local = tx->local; in ieee80211_fragment()
886 tx->sdata->encrypt_headroom + in ieee80211_fragment()
891 __skb_queue_tail(&tx->skbs, tmp); in ieee80211_fragment()
894 local->tx_headroom + tx->sdata->encrypt_headroom); in ieee80211_fragment()
923 ieee80211_tx_h_fragment(struct ieee80211_tx_data *tx) in ieee80211_tx_h_fragment() argument
925 struct sk_buff *skb = tx->skb; in ieee80211_tx_h_fragment()
928 int frag_threshold = tx->local->hw.wiphy->frag_threshold; in ieee80211_tx_h_fragment()
933 __skb_queue_tail(&tx->skbs, skb); in ieee80211_tx_h_fragment()
934 tx->skb = NULL; in ieee80211_tx_h_fragment()
939 if (ieee80211_hw_check(&tx->local->hw, SUPPORTS_TX_FRAG)) in ieee80211_tx_h_fragment()
964 if (ieee80211_fragment(tx, skb, hdrlen, frag_threshold)) in ieee80211_tx_h_fragment()
970 skb_queue_walk(&tx->skbs, skb) { in ieee80211_tx_h_fragment()
976 if (!skb_queue_is_last(&tx->skbs, skb)) { in ieee80211_tx_h_fragment()
998 ieee80211_tx_h_stats(struct ieee80211_tx_data *tx) in ieee80211_tx_h_stats() argument
1003 if (!tx->sta) in ieee80211_tx_h_stats()
1006 skb_queue_walk(&tx->skbs, skb) { in ieee80211_tx_h_stats()
1008 tx->sta->tx_stats.bytes[ac] += skb->len; in ieee80211_tx_h_stats()
1011 tx->sta->tx_stats.packets[ac]++; in ieee80211_tx_h_stats()
1017 ieee80211_tx_h_encrypt(struct ieee80211_tx_data *tx) in ieee80211_tx_h_encrypt() argument
1019 if (!tx->key) in ieee80211_tx_h_encrypt()
1022 switch (tx->key->conf.cipher) { in ieee80211_tx_h_encrypt()
1025 return ieee80211_crypto_wep_encrypt(tx); in ieee80211_tx_h_encrypt()
1027 return ieee80211_crypto_tkip_encrypt(tx); in ieee80211_tx_h_encrypt()
1030 tx, IEEE80211_CCMP_MIC_LEN); in ieee80211_tx_h_encrypt()
1033 tx, IEEE80211_CCMP_256_MIC_LEN); in ieee80211_tx_h_encrypt()
1035 return ieee80211_crypto_aes_cmac_encrypt(tx); in ieee80211_tx_h_encrypt()
1037 return ieee80211_crypto_aes_cmac_256_encrypt(tx); in ieee80211_tx_h_encrypt()
1040 return ieee80211_crypto_aes_gmac_encrypt(tx); in ieee80211_tx_h_encrypt()
1043 return ieee80211_crypto_gcmp_encrypt(tx); in ieee80211_tx_h_encrypt()
1045 return ieee80211_crypto_hw_encrypt(tx); in ieee80211_tx_h_encrypt()
1052 ieee80211_tx_h_calculate_duration(struct ieee80211_tx_data *tx) in ieee80211_tx_h_calculate_duration() argument
1059 skb_queue_walk(&tx->skbs, skb) { in ieee80211_tx_h_calculate_duration()
1063 if (!skb_queue_is_last(&tx->skbs, skb)) { in ieee80211_tx_h_calculate_duration()
1064 struct sk_buff *next = skb_queue_next(&tx->skbs, skb); in ieee80211_tx_h_calculate_duration()
1071 ieee80211_duration(tx, skb, group_addr, next_len); in ieee80211_tx_h_calculate_duration()
1079 static bool ieee80211_tx_prep_agg(struct ieee80211_tx_data *tx, in ieee80211_tx_prep_agg() argument
1097 } else if (!tx->sta->sta.txq[tid]) { in ieee80211_tx_prep_agg()
1098 spin_lock(&tx->sta->lock); in ieee80211_tx_prep_agg()
1117 tid_tx = rcu_dereference_protected_tid_tx(tx->sta, tid); in ieee80211_tx_prep_agg()
1127 clear_sta_flag(tx->sta, WLAN_STA_SP); in ieee80211_tx_prep_agg()
1128 ps_dbg(tx->sta->sdata, in ieee80211_tx_prep_agg()
1130 tx->sta->sta.addr, tx->sta->sta.aid); in ieee80211_tx_prep_agg()
1132 info->control.vif = &tx->sdata->vif; in ieee80211_tx_prep_agg()
1139 spin_unlock(&tx->sta->lock); in ieee80211_tx_prep_agg()
1142 ieee80211_free_txskb(&tx->local->hw, purge_skb); in ieee80211_tx_prep_agg()
1182 struct ieee80211_tx_data *tx, in ieee80211_tx_prepare() argument
1191 memset(tx, 0, sizeof(*tx)); in ieee80211_tx_prepare()
1192 tx->skb = skb; in ieee80211_tx_prepare()
1193 tx->local = local; in ieee80211_tx_prepare()
1194 tx->sdata = sdata; in ieee80211_tx_prepare()
1195 __skb_queue_head_init(&tx->skbs); in ieee80211_tx_prepare()
1208 tx->sta = sta; in ieee80211_tx_prepare()
1211 tx->sta = rcu_dereference(sdata->u.vlan.sta); in ieee80211_tx_prepare()
1212 if (!tx->sta && sdata->wdev.use_4addr) in ieee80211_tx_prepare()
1214 } else if (tx->sdata->control_port_protocol == tx->skb->protocol) { in ieee80211_tx_prepare()
1215 tx->sta = sta_info_get_bss(sdata, hdr->addr1); in ieee80211_tx_prepare()
1217 if (!tx->sta && !is_multicast_ether_addr(hdr->addr1)) { in ieee80211_tx_prepare()
1218 tx->sta = sta_info_get(sdata, hdr->addr1); in ieee80211_tx_prepare()
1223 if (tx->sta && ieee80211_is_data_qos(hdr->frame_control) && in ieee80211_tx_prepare()
1230 tid_tx = rcu_dereference(tx->sta->ampdu_mlme.tid_tx[tid]); in ieee80211_tx_prepare()
1232 ieee80211_aggr_check(sdata, tx->sta, skb); in ieee80211_tx_prepare()
1233 tid_tx = rcu_dereference(tx->sta->ampdu_mlme.tid_tx[tid]); in ieee80211_tx_prepare()
1239 queued = ieee80211_tx_prep_agg(tx, skb, info, in ieee80211_tx_prepare()
1248 tx->flags &= ~IEEE80211_TX_UNICAST; in ieee80211_tx_prepare()
1251 tx->flags |= IEEE80211_TX_UNICAST; in ieee80211_tx_prepare()
1254 if (!(tx->flags & IEEE80211_TX_UNICAST) || in ieee80211_tx_prepare()
1260 if (!tx->sta) in ieee80211_tx_prepare()
1262 else if (test_and_clear_sta_flag(tx->sta, WLAN_STA_CLEAR_PS_FILT)) { in ieee80211_tx_prepare()
1264 ieee80211_check_fast_xmit(tx->sta); in ieee80211_tx_prepare()
1784 static int invoke_tx_handlers_early(struct ieee80211_tx_data *tx) in invoke_tx_handlers_early() argument
1790 res = txh(tx); \ in invoke_tx_handlers_early()
1803 I802_DEBUG_INC(tx->local->tx_handlers_drop); in invoke_tx_handlers_early()
1804 if (tx->skb) in invoke_tx_handlers_early()
1805 ieee80211_free_txskb(&tx->local->hw, tx->skb); in invoke_tx_handlers_early()
1807 ieee80211_purge_tx_queue(&tx->local->hw, &tx->skbs); in invoke_tx_handlers_early()
1810 I802_DEBUG_INC(tx->local->tx_handlers_queued); in invoke_tx_handlers_early()
1821 static int invoke_tx_handlers_late(struct ieee80211_tx_data *tx) in invoke_tx_handlers_late() argument
1823 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); in invoke_tx_handlers_late()
1826 if (!ieee80211_hw_check(&tx->local->hw, HAS_RATE_CONTROL)) in invoke_tx_handlers_late()
1830 __skb_queue_tail(&tx->skbs, tx->skb); in invoke_tx_handlers_late()
1831 tx->skb = NULL; in invoke_tx_handlers_late()
1841 if (!ieee80211_hw_check(&tx->local->hw, HAS_RATE_CONTROL)) in invoke_tx_handlers_late()
1847 I802_DEBUG_INC(tx->local->tx_handlers_drop); in invoke_tx_handlers_late()
1848 if (tx->skb) in invoke_tx_handlers_late()
1849 ieee80211_free_txskb(&tx->local->hw, tx->skb); in invoke_tx_handlers_late()
1851 ieee80211_purge_tx_queue(&tx->local->hw, &tx->skbs); in invoke_tx_handlers_late()
1854 I802_DEBUG_INC(tx->local->tx_handlers_queued); in invoke_tx_handlers_late()
1861 static int invoke_tx_handlers(struct ieee80211_tx_data *tx) in invoke_tx_handlers() argument
1863 int r = invoke_tx_handlers_early(tx); in invoke_tx_handlers()
1867 return invoke_tx_handlers_late(tx); in invoke_tx_handlers()
1876 struct ieee80211_tx_data tx; in ieee80211_tx_prepare_skb() local
1879 if (ieee80211_tx_prepare(sdata, &tx, NULL, skb) == TX_DROP) in ieee80211_tx_prepare_skb()
1886 if (invoke_tx_handlers(&tx)) in ieee80211_tx_prepare_skb()
1890 if (tx.sta) in ieee80211_tx_prepare_skb()
1891 *sta = &tx.sta->sta; in ieee80211_tx_prepare_skb()
1897 skb2 = __skb_dequeue(&tx.skbs); in ieee80211_tx_prepare_skb()
1898 if (WARN_ON(skb2 != skb || !skb_queue_empty(&tx.skbs))) { in ieee80211_tx_prepare_skb()
1900 ieee80211_purge_tx_queue(hw, &tx.skbs); in ieee80211_tx_prepare_skb()
1916 struct ieee80211_tx_data tx; in ieee80211_tx() local
1927 res_prepare = ieee80211_tx_prepare(sdata, &tx, sta, skb); in ieee80211_tx()
1942 if (invoke_tx_handlers_early(&tx)) in ieee80211_tx()
1945 if (ieee80211_queue_skb(local, sdata, tx.sta, tx.skb)) in ieee80211_tx()
1948 if (!invoke_tx_handlers_late(&tx)) in ieee80211_tx()
1949 result = __ieee80211_tx(local, &tx.skbs, tx.sta, txpending); in ieee80211_tx()
3440 struct ieee80211_tx_data *tx) in ieee80211_xmit_fast_finish() argument
3442 struct sk_buff *skb = tx->skb; in ieee80211_xmit_fast_finish()
3447 if (!ieee80211_hw_check(&tx->local->hw, HAS_RATE_CONTROL) && in ieee80211_xmit_fast_finish()
3448 ieee80211_tx_h_rate_ctrl(tx) != TX_CONTINUE) in ieee80211_xmit_fast_finish()
3515 struct ieee80211_tx_data tx; in ieee80211_xmit_fast() local
3596 __skb_queue_head_init(&tx.skbs); in ieee80211_xmit_fast()
3598 tx.flags = IEEE80211_TX_UNICAST; in ieee80211_xmit_fast()
3599 tx.local = local; in ieee80211_xmit_fast()
3600 tx.sdata = sdata; in ieee80211_xmit_fast()
3601 tx.sta = sta; in ieee80211_xmit_fast()
3602 tx.key = fast_tx->key; in ieee80211_xmit_fast()
3607 tx.skb = skb; in ieee80211_xmit_fast()
3609 fast_tx->key, &tx); in ieee80211_xmit_fast()
3610 tx.skb = NULL; in ieee80211_xmit_fast()
3620 __skb_queue_tail(&tx.skbs, skb); in ieee80211_xmit_fast()
3621 ieee80211_tx_frags(local, &sdata->vif, sta, &tx.skbs, false); in ieee80211_xmit_fast()
3635 struct ieee80211_tx_data tx; in ieee80211_tx_dequeue() local
3676 memset(&tx, 0, sizeof(tx)); in ieee80211_tx_dequeue()
3677 __skb_queue_head_init(&tx.skbs); in ieee80211_tx_dequeue()
3678 tx.local = local; in ieee80211_tx_dequeue()
3679 tx.skb = skb; in ieee80211_tx_dequeue()
3680 tx.sdata = vif_to_sdata(info->control.vif); in ieee80211_tx_dequeue()
3683 tx.sta = container_of(txq->sta, struct sta_info, sta); in ieee80211_tx_dequeue()
3690 !ieee80211_vif_is_mesh(&tx.sdata->vif) && in ieee80211_tx_dequeue()
3691 tx.sdata->vif.type != NL80211_IFTYPE_OCB && in ieee80211_tx_dequeue()
3693 !test_sta_flag(tx.sta, WLAN_STA_AUTHORIZED) && in ieee80211_tx_dequeue()
3696 !ether_addr_equal(tx.sdata->vif.addr, in ieee80211_tx_dequeue()
3708 r = ieee80211_tx_h_select_key(&tx); in ieee80211_tx_dequeue()
3721 r = ieee80211_tx_h_rate_ctrl(&tx); in ieee80211_tx_dequeue()
3735 if (tx.key && in ieee80211_tx_dequeue()
3736 (tx.key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV)) in ieee80211_tx_dequeue()
3740 tx.key, &tx); in ieee80211_tx_dequeue()
3746 if (invoke_tx_handlers_late(&tx)) in ieee80211_tx_dequeue()
3749 skb = __skb_dequeue(&tx.skbs); in ieee80211_tx_dequeue()
3752 if (!skb_queue_empty(&tx.skbs)) { in ieee80211_tx_dequeue()
3754 skb_queue_splice_tail(&tx.skbs, &txqi->frags); in ieee80211_tx_dequeue()
3767 switch (tx.sdata->vif.type) { in ieee80211_tx_dequeue()
3769 if (tx.sdata->u.mntr.flags & MONITOR_FLAG_ACTIVE) { in ieee80211_tx_dequeue()
3770 vif = &tx.sdata->vif; in ieee80211_tx_dequeue()
3773 tx.sdata = rcu_dereference(local->monitor_sdata); in ieee80211_tx_dequeue()
3774 if (tx.sdata) { in ieee80211_tx_dequeue()
3775 vif = &tx.sdata->vif; in ieee80211_tx_dequeue()
3786 tx.sdata = container_of(tx.sdata->bss, in ieee80211_tx_dequeue()
3790 vif = &tx.sdata->vif; in ieee80211_tx_dequeue()
3806 ieee80211_sta_update_pending_airtime(local, tx.sta, in ieee80211_tx_dequeue()
4556 struct ieee80211_tx_data tx = { in ieee80211_build_data_template() local
4575 tx.sta = sta_info_get(sdata, hdr->addr1); in ieee80211_build_data_template()
4576 tx.skb = skb; in ieee80211_build_data_template()
4578 if (ieee80211_tx_h_select_key(&tx) != TX_CONTINUE) { in ieee80211_build_data_template()
4972 struct ieee80211_tx_data tx; in ieee80211_beacon_protect() local
4975 memset(&tx, 0, sizeof(tx)); in ieee80211_beacon_protect()
4976 tx.key = rcu_dereference(sdata->default_beacon_key); in ieee80211_beacon_protect()
4977 if (!tx.key) in ieee80211_beacon_protect()
4979 tx.local = local; in ieee80211_beacon_protect()
4980 tx.sdata = sdata; in ieee80211_beacon_protect()
4981 __skb_queue_head_init(&tx.skbs); in ieee80211_beacon_protect()
4982 __skb_queue_tail(&tx.skbs, skb); in ieee80211_beacon_protect()
4983 res = ieee80211_tx_h_encrypt(&tx); in ieee80211_beacon_protect()
4984 check_skb = __skb_dequeue(&tx.skbs); in ieee80211_beacon_protect()
5492 struct ieee80211_tx_data tx; in ieee80211_get_buffered_bc() local
5541 if (!ieee80211_tx_prepare(sdata, &tx, NULL, skb)) in ieee80211_get_buffered_bc()
5548 tx.flags |= IEEE80211_TX_PS_BUFFERED; in ieee80211_get_buffered_bc()
5551 if (invoke_tx_handlers(&tx)) in ieee80211_get_buffered_bc()