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()
651 if (!skip_hw && tx->key && in ieee80211_tx_h_select_key()
652 tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) in ieee80211_tx_h_select_key()
653 info->control.hw_key = &tx->key->conf; in ieee80211_tx_h_select_key()
654 } else if (ieee80211_is_data_present(hdr->frame_control) && tx->sta && in ieee80211_tx_h_select_key()
655 test_sta_flag(tx->sta, WLAN_STA_USES_ENCRYPTION)) { 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()
676 sband = tx->local->hw.wiphy->bands[info->band]; in ieee80211_tx_h_rate_ctrl()
678 len = min_t(u32, tx->skb->len + FCS_LEN, in ieee80211_tx_h_rate_ctrl()
679 tx->local->hw.wiphy->frag_threshold); in ieee80211_tx_h_rate_ctrl()
682 txrc.hw = &tx->local->hw; in ieee80211_tx_h_rate_ctrl()
684 txrc.bss_conf = &tx->sdata->vif.bss_conf; in ieee80211_tx_h_rate_ctrl()
685 txrc.skb = tx->skb; in ieee80211_tx_h_rate_ctrl()
687 txrc.rate_idx_mask = tx->sdata->rc_rateidx_mask[info->band]; in ieee80211_tx_h_rate_ctrl()
689 if (tx->sdata->rc_has_mcs_mask[info->band]) in ieee80211_tx_h_rate_ctrl()
691 tx->sdata->rc_rateidx_mcs_mask[info->band]; in ieee80211_tx_h_rate_ctrl()
693 txrc.bss = (tx->sdata->vif.type == NL80211_IFTYPE_AP || in ieee80211_tx_h_rate_ctrl()
694 tx->sdata->vif.type == NL80211_IFTYPE_MESH_POINT || in ieee80211_tx_h_rate_ctrl()
695 tx->sdata->vif.type == NL80211_IFTYPE_ADHOC || in ieee80211_tx_h_rate_ctrl()
696 tx->sdata->vif.type == NL80211_IFTYPE_OCB); in ieee80211_tx_h_rate_ctrl()
699 if (len > tx->local->hw.wiphy->rts_threshold) { in ieee80211_tx_h_rate_ctrl()
704 info->control.use_cts_prot = tx->sdata->vif.bss_conf.use_cts_prot; in ieee80211_tx_h_rate_ctrl()
712 if (tx->sdata->vif.bss_conf.use_short_preamble && in ieee80211_tx_h_rate_ctrl()
713 (ieee80211_is_tx_data(tx->skb) || in ieee80211_tx_h_rate_ctrl()
714 (tx->sta && test_sta_flag(tx->sta, WLAN_STA_SHORT_PREAMBLE)))) in ieee80211_tx_h_rate_ctrl()
723 if (tx->sta) in ieee80211_tx_h_rate_ctrl()
724 assoc = test_sta_flag(tx->sta, WLAN_STA_ASSOC); in ieee80211_tx_h_rate_ctrl()
730 if (WARN(test_bit(SCAN_SW_SCANNING, &tx->local->scanning) && assoc && in ieee80211_tx_h_rate_ctrl()
731 !rate_usable_index_exists(sband, &tx->sta->sta), in ieee80211_tx_h_rate_ctrl()
735 tx->sdata->name, in ieee80211_tx_h_rate_ctrl()
744 rate_control_get_rate(tx->sdata, tx->sta, &txrc); in ieee80211_tx_h_rate_ctrl()
746 if (tx->sta && !info->control.skip_table) in ieee80211_tx_h_rate_ctrl()
747 ratetbl = rcu_dereference(tx->sta->sta.rates); in ieee80211_tx_h_rate_ctrl()
760 tx->rate = rate; in ieee80211_tx_h_rate_ctrl()
765 tx->rate = info->control.rates[0]; in ieee80211_tx_h_rate_ctrl()
769 txrc.reported_rate = tx->rate; in ieee80211_tx_h_rate_ctrl()
770 if (tx->sta && ieee80211_is_tx_data(tx->skb)) in ieee80211_tx_h_rate_ctrl()
771 tx->sta->tx_stats.last_rate = txrc.reported_rate; in ieee80211_tx_h_rate_ctrl()
772 } else if (tx->sta) in ieee80211_tx_h_rate_ctrl()
773 tx->sta->tx_stats.last_rate = txrc.reported_rate; in ieee80211_tx_h_rate_ctrl()
800 ieee80211_tx_h_sequence(struct ieee80211_tx_data *tx) in ieee80211_tx_h_sequence() argument
802 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); in ieee80211_tx_h_sequence()
803 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data; in ieee80211_tx_h_sequence()
837 hdr->seq_ctrl = cpu_to_le16(tx->sdata->sequence_number); in ieee80211_tx_h_sequence()
838 tx->sdata->sequence_number += 0x10; in ieee80211_tx_h_sequence()
839 if (tx->sta) in ieee80211_tx_h_sequence()
840 tx->sta->tx_stats.msdu[IEEE80211_NUM_TIDS]++; in ieee80211_tx_h_sequence()
849 if (!tx->sta) in ieee80211_tx_h_sequence()
854 tx->sta->tx_stats.msdu[tid]++; in ieee80211_tx_h_sequence()
856 hdr->seq_ctrl = ieee80211_tx_next_seq(tx->sta, tid); in ieee80211_tx_h_sequence()
861 static int ieee80211_fragment(struct ieee80211_tx_data *tx, in ieee80211_fragment() argument
865 struct ieee80211_local *local = tx->local; in ieee80211_fragment()
885 tx->sdata->encrypt_headroom + in ieee80211_fragment()
890 __skb_queue_tail(&tx->skbs, tmp); in ieee80211_fragment()
893 local->tx_headroom + tx->sdata->encrypt_headroom); in ieee80211_fragment()
922 ieee80211_tx_h_fragment(struct ieee80211_tx_data *tx) in ieee80211_tx_h_fragment() argument
924 struct sk_buff *skb = tx->skb; in ieee80211_tx_h_fragment()
927 int frag_threshold = tx->local->hw.wiphy->frag_threshold; in ieee80211_tx_h_fragment()
932 __skb_queue_tail(&tx->skbs, skb); in ieee80211_tx_h_fragment()
933 tx->skb = NULL; in ieee80211_tx_h_fragment()
938 if (ieee80211_hw_check(&tx->local->hw, SUPPORTS_TX_FRAG)) in ieee80211_tx_h_fragment()
963 if (ieee80211_fragment(tx, skb, hdrlen, frag_threshold)) in ieee80211_tx_h_fragment()
969 skb_queue_walk(&tx->skbs, skb) { in ieee80211_tx_h_fragment()
975 if (!skb_queue_is_last(&tx->skbs, skb)) { in ieee80211_tx_h_fragment()
997 ieee80211_tx_h_stats(struct ieee80211_tx_data *tx) in ieee80211_tx_h_stats() argument
1002 if (!tx->sta) in ieee80211_tx_h_stats()
1005 skb_queue_walk(&tx->skbs, skb) { in ieee80211_tx_h_stats()
1007 tx->sta->tx_stats.bytes[ac] += skb->len; in ieee80211_tx_h_stats()
1010 tx->sta->tx_stats.packets[ac]++; in ieee80211_tx_h_stats()
1016 ieee80211_tx_h_encrypt(struct ieee80211_tx_data *tx) in ieee80211_tx_h_encrypt() argument
1018 if (!tx->key) in ieee80211_tx_h_encrypt()
1021 switch (tx->key->conf.cipher) { in ieee80211_tx_h_encrypt()
1024 return ieee80211_crypto_wep_encrypt(tx); in ieee80211_tx_h_encrypt()
1026 return ieee80211_crypto_tkip_encrypt(tx); in ieee80211_tx_h_encrypt()
1029 tx, IEEE80211_CCMP_MIC_LEN); in ieee80211_tx_h_encrypt()
1032 tx, IEEE80211_CCMP_256_MIC_LEN); in ieee80211_tx_h_encrypt()
1034 return ieee80211_crypto_aes_cmac_encrypt(tx); in ieee80211_tx_h_encrypt()
1036 return ieee80211_crypto_aes_cmac_256_encrypt(tx); in ieee80211_tx_h_encrypt()
1039 return ieee80211_crypto_aes_gmac_encrypt(tx); in ieee80211_tx_h_encrypt()
1042 return ieee80211_crypto_gcmp_encrypt(tx); in ieee80211_tx_h_encrypt()
1044 return ieee80211_crypto_hw_encrypt(tx); in ieee80211_tx_h_encrypt()
1051 ieee80211_tx_h_calculate_duration(struct ieee80211_tx_data *tx) in ieee80211_tx_h_calculate_duration() argument
1058 skb_queue_walk(&tx->skbs, skb) { in ieee80211_tx_h_calculate_duration()
1062 if (!skb_queue_is_last(&tx->skbs, skb)) { in ieee80211_tx_h_calculate_duration()
1063 struct sk_buff *next = skb_queue_next(&tx->skbs, skb); in ieee80211_tx_h_calculate_duration()
1070 ieee80211_duration(tx, skb, group_addr, next_len); in ieee80211_tx_h_calculate_duration()
1078 static bool ieee80211_tx_prep_agg(struct ieee80211_tx_data *tx, in ieee80211_tx_prep_agg() argument
1096 } else if (!tx->sta->sta.txq[tid]) { in ieee80211_tx_prep_agg()
1097 spin_lock(&tx->sta->lock); in ieee80211_tx_prep_agg()
1116 tid_tx = rcu_dereference_protected_tid_tx(tx->sta, tid); in ieee80211_tx_prep_agg()
1126 clear_sta_flag(tx->sta, WLAN_STA_SP); in ieee80211_tx_prep_agg()
1127 ps_dbg(tx->sta->sdata, in ieee80211_tx_prep_agg()
1129 tx->sta->sta.addr, tx->sta->sta.aid); in ieee80211_tx_prep_agg()
1131 info->control.vif = &tx->sdata->vif; in ieee80211_tx_prep_agg()
1138 spin_unlock(&tx->sta->lock); in ieee80211_tx_prep_agg()
1141 ieee80211_free_txskb(&tx->local->hw, purge_skb); in ieee80211_tx_prep_agg()
1181 struct ieee80211_tx_data *tx, in ieee80211_tx_prepare() argument
1190 memset(tx, 0, sizeof(*tx)); in ieee80211_tx_prepare()
1191 tx->skb = skb; in ieee80211_tx_prepare()
1192 tx->local = local; in ieee80211_tx_prepare()
1193 tx->sdata = sdata; in ieee80211_tx_prepare()
1194 __skb_queue_head_init(&tx->skbs); in ieee80211_tx_prepare()
1207 tx->sta = sta; in ieee80211_tx_prepare()
1210 tx->sta = rcu_dereference(sdata->u.vlan.sta); in ieee80211_tx_prepare()
1211 if (!tx->sta && sdata->wdev.use_4addr) in ieee80211_tx_prepare()
1213 } else if (tx->sdata->control_port_protocol == tx->skb->protocol) { in ieee80211_tx_prepare()
1214 tx->sta = sta_info_get_bss(sdata, hdr->addr1); in ieee80211_tx_prepare()
1216 if (!tx->sta && !is_multicast_ether_addr(hdr->addr1)) { in ieee80211_tx_prepare()
1217 tx->sta = sta_info_get(sdata, hdr->addr1); in ieee80211_tx_prepare()
1222 if (tx->sta && ieee80211_is_data_qos(hdr->frame_control) && in ieee80211_tx_prepare()
1229 tid_tx = rcu_dereference(tx->sta->ampdu_mlme.tid_tx[tid]); in ieee80211_tx_prepare()
1231 ieee80211_aggr_check(sdata, tx->sta, skb); in ieee80211_tx_prepare()
1232 tid_tx = rcu_dereference(tx->sta->ampdu_mlme.tid_tx[tid]); in ieee80211_tx_prepare()
1238 queued = ieee80211_tx_prep_agg(tx, skb, info, in ieee80211_tx_prepare()
1247 tx->flags &= ~IEEE80211_TX_UNICAST; in ieee80211_tx_prepare()
1250 tx->flags |= IEEE80211_TX_UNICAST; in ieee80211_tx_prepare()
1253 if (!(tx->flags & IEEE80211_TX_UNICAST) || in ieee80211_tx_prepare()
1259 if (!tx->sta) in ieee80211_tx_prepare()
1261 else if (test_and_clear_sta_flag(tx->sta, WLAN_STA_CLEAR_PS_FILT)) { in ieee80211_tx_prepare()
1263 ieee80211_check_fast_xmit(tx->sta); in ieee80211_tx_prepare()
1783 static int invoke_tx_handlers_early(struct ieee80211_tx_data *tx) in invoke_tx_handlers_early() argument
1789 res = txh(tx); \ in invoke_tx_handlers_early()
1802 I802_DEBUG_INC(tx->local->tx_handlers_drop); in invoke_tx_handlers_early()
1803 if (tx->skb) in invoke_tx_handlers_early()
1804 ieee80211_free_txskb(&tx->local->hw, tx->skb); in invoke_tx_handlers_early()
1806 ieee80211_purge_tx_queue(&tx->local->hw, &tx->skbs); in invoke_tx_handlers_early()
1809 I802_DEBUG_INC(tx->local->tx_handlers_queued); in invoke_tx_handlers_early()
1820 static int invoke_tx_handlers_late(struct ieee80211_tx_data *tx) in invoke_tx_handlers_late() argument
1822 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); in invoke_tx_handlers_late()
1825 if (!ieee80211_hw_check(&tx->local->hw, HAS_RATE_CONTROL)) in invoke_tx_handlers_late()
1829 __skb_queue_tail(&tx->skbs, tx->skb); in invoke_tx_handlers_late()
1830 tx->skb = NULL; in invoke_tx_handlers_late()
1840 if (!ieee80211_hw_check(&tx->local->hw, HAS_RATE_CONTROL)) in invoke_tx_handlers_late()
1846 I802_DEBUG_INC(tx->local->tx_handlers_drop); in invoke_tx_handlers_late()
1847 if (tx->skb) in invoke_tx_handlers_late()
1848 ieee80211_free_txskb(&tx->local->hw, tx->skb); in invoke_tx_handlers_late()
1850 ieee80211_purge_tx_queue(&tx->local->hw, &tx->skbs); in invoke_tx_handlers_late()
1853 I802_DEBUG_INC(tx->local->tx_handlers_queued); in invoke_tx_handlers_late()
1860 static int invoke_tx_handlers(struct ieee80211_tx_data *tx) in invoke_tx_handlers() argument
1862 int r = invoke_tx_handlers_early(tx); in invoke_tx_handlers()
1866 return invoke_tx_handlers_late(tx); in invoke_tx_handlers()
1875 struct ieee80211_tx_data tx; in ieee80211_tx_prepare_skb() local
1878 if (ieee80211_tx_prepare(sdata, &tx, NULL, skb) == TX_DROP) in ieee80211_tx_prepare_skb()
1885 if (invoke_tx_handlers(&tx)) in ieee80211_tx_prepare_skb()
1889 if (tx.sta) in ieee80211_tx_prepare_skb()
1890 *sta = &tx.sta->sta; in ieee80211_tx_prepare_skb()
1896 skb2 = __skb_dequeue(&tx.skbs); in ieee80211_tx_prepare_skb()
1897 if (WARN_ON(skb2 != skb || !skb_queue_empty(&tx.skbs))) { in ieee80211_tx_prepare_skb()
1899 ieee80211_purge_tx_queue(hw, &tx.skbs); in ieee80211_tx_prepare_skb()
1915 struct ieee80211_tx_data tx; in ieee80211_tx() local
1926 res_prepare = ieee80211_tx_prepare(sdata, &tx, sta, skb); in ieee80211_tx()
1941 if (invoke_tx_handlers_early(&tx)) in ieee80211_tx()
1944 if (ieee80211_queue_skb(local, sdata, tx.sta, tx.skb)) in ieee80211_tx()
1947 if (!invoke_tx_handlers_late(&tx)) in ieee80211_tx()
1948 result = __ieee80211_tx(local, &tx.skbs, tx.sta, txpending); in ieee80211_tx()
3439 struct ieee80211_tx_data *tx) in ieee80211_xmit_fast_finish() argument
3441 struct sk_buff *skb = tx->skb; in ieee80211_xmit_fast_finish()
3446 if (!ieee80211_hw_check(&tx->local->hw, HAS_RATE_CONTROL) && in ieee80211_xmit_fast_finish()
3447 ieee80211_tx_h_rate_ctrl(tx) != TX_CONTINUE) in ieee80211_xmit_fast_finish()
3514 struct ieee80211_tx_data tx; in ieee80211_xmit_fast() local
3595 __skb_queue_head_init(&tx.skbs); in ieee80211_xmit_fast()
3597 tx.flags = IEEE80211_TX_UNICAST; in ieee80211_xmit_fast()
3598 tx.local = local; in ieee80211_xmit_fast()
3599 tx.sdata = sdata; in ieee80211_xmit_fast()
3600 tx.sta = sta; in ieee80211_xmit_fast()
3601 tx.key = fast_tx->key; in ieee80211_xmit_fast()
3606 tx.skb = skb; in ieee80211_xmit_fast()
3608 fast_tx->key, &tx); in ieee80211_xmit_fast()
3609 tx.skb = NULL; in ieee80211_xmit_fast()
3619 __skb_queue_tail(&tx.skbs, skb); in ieee80211_xmit_fast()
3620 ieee80211_tx_frags(local, &sdata->vif, sta, &tx.skbs, false); in ieee80211_xmit_fast()
3634 struct ieee80211_tx_data tx; in ieee80211_tx_dequeue() local
3675 memset(&tx, 0, sizeof(tx)); in ieee80211_tx_dequeue()
3676 __skb_queue_head_init(&tx.skbs); in ieee80211_tx_dequeue()
3677 tx.local = local; in ieee80211_tx_dequeue()
3678 tx.skb = skb; in ieee80211_tx_dequeue()
3679 tx.sdata = vif_to_sdata(info->control.vif); in ieee80211_tx_dequeue()
3682 tx.sta = container_of(txq->sta, struct sta_info, sta); in ieee80211_tx_dequeue()
3689 !ieee80211_vif_is_mesh(&tx.sdata->vif) && in ieee80211_tx_dequeue()
3690 tx.sdata->vif.type != NL80211_IFTYPE_OCB && in ieee80211_tx_dequeue()
3692 !test_sta_flag(tx.sta, WLAN_STA_AUTHORIZED) && in ieee80211_tx_dequeue()
3695 !ether_addr_equal(tx.sdata->vif.addr, in ieee80211_tx_dequeue()
3707 r = ieee80211_tx_h_select_key(&tx); in ieee80211_tx_dequeue()
3720 r = ieee80211_tx_h_rate_ctrl(&tx); in ieee80211_tx_dequeue()
3734 if (tx.key && in ieee80211_tx_dequeue()
3735 (tx.key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV)) in ieee80211_tx_dequeue()
3739 tx.key, &tx); in ieee80211_tx_dequeue()
3745 if (invoke_tx_handlers_late(&tx)) in ieee80211_tx_dequeue()
3748 skb = __skb_dequeue(&tx.skbs); in ieee80211_tx_dequeue()
3750 if (!skb_queue_empty(&tx.skbs)) { in ieee80211_tx_dequeue()
3752 skb_queue_splice_tail(&tx.skbs, &txqi->frags); in ieee80211_tx_dequeue()
3765 switch (tx.sdata->vif.type) { in ieee80211_tx_dequeue()
3767 if (tx.sdata->u.mntr.flags & MONITOR_FLAG_ACTIVE) { in ieee80211_tx_dequeue()
3768 vif = &tx.sdata->vif; in ieee80211_tx_dequeue()
3771 tx.sdata = rcu_dereference(local->monitor_sdata); in ieee80211_tx_dequeue()
3772 if (tx.sdata) { in ieee80211_tx_dequeue()
3773 vif = &tx.sdata->vif; in ieee80211_tx_dequeue()
3784 tx.sdata = container_of(tx.sdata->bss, in ieee80211_tx_dequeue()
3788 vif = &tx.sdata->vif; in ieee80211_tx_dequeue()
3804 ieee80211_sta_update_pending_airtime(local, tx.sta, in ieee80211_tx_dequeue()
4554 struct ieee80211_tx_data tx = { in ieee80211_build_data_template() local
4573 tx.sta = sta_info_get(sdata, hdr->addr1); in ieee80211_build_data_template()
4574 tx.skb = skb; in ieee80211_build_data_template()
4576 if (ieee80211_tx_h_select_key(&tx) != TX_CONTINUE) { in ieee80211_build_data_template()
4970 struct ieee80211_tx_data tx; in ieee80211_beacon_protect() local
4973 memset(&tx, 0, sizeof(tx)); in ieee80211_beacon_protect()
4974 tx.key = rcu_dereference(sdata->default_beacon_key); in ieee80211_beacon_protect()
4975 if (!tx.key) in ieee80211_beacon_protect()
4977 tx.local = local; in ieee80211_beacon_protect()
4978 tx.sdata = sdata; in ieee80211_beacon_protect()
4979 __skb_queue_head_init(&tx.skbs); in ieee80211_beacon_protect()
4980 __skb_queue_tail(&tx.skbs, skb); in ieee80211_beacon_protect()
4981 res = ieee80211_tx_h_encrypt(&tx); in ieee80211_beacon_protect()
4982 check_skb = __skb_dequeue(&tx.skbs); in ieee80211_beacon_protect()
5523 struct ieee80211_tx_data tx; in ieee80211_get_buffered_bc() local
5572 if (!ieee80211_tx_prepare(sdata, &tx, NULL, skb)) in ieee80211_get_buffered_bc()
5579 tx.flags |= IEEE80211_TX_PS_BUFFERED; in ieee80211_get_buffered_bc()
5582 if (invoke_tx_handlers(&tx)) in ieee80211_get_buffered_bc()