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()
154 if (tx->sdata->vif.bss_conf.basic_rates & BIT(i)) in ieee80211_duration()
160 if (tx->sdata->flags & IEEE80211_SDATA_OPERATING_GMODE) in ieee80211_duration()
196 tx->sdata->vif.bss_conf.use_short_preamble, in ieee80211_duration()
206 tx->sdata->vif.bss_conf.use_short_preamble, in ieee80211_duration()
213 /* tx handlers */
215 ieee80211_tx_h_dynamic_ps(struct ieee80211_tx_data *tx) in ieee80211_tx_h_dynamic_ps() argument
217 struct ieee80211_local *local = tx->local; in ieee80211_tx_h_dynamic_ps()
219 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); in ieee80211_tx_h_dynamic_ps()
245 if (tx->sdata->vif.type != NL80211_IFTYPE_STATION) in ieee80211_tx_h_dynamic_ps()
251 ifmgd = &tx->sdata->u.mgd; in ieee80211_tx_h_dynamic_ps()
268 skb_get_queue_mapping(tx->skb) == IEEE80211_AC_VO) in ieee80211_tx_h_dynamic_ps()
292 ieee80211_tx_h_check_assoc(struct ieee80211_tx_data *tx) in ieee80211_tx_h_check_assoc() argument
295 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data; in ieee80211_tx_h_check_assoc()
296 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); in ieee80211_tx_h_check_assoc()
302 if (unlikely(test_bit(SCAN_SW_SCANNING, &tx->local->scanning)) && in ieee80211_tx_h_check_assoc()
303 test_bit(SDATA_STATE_OFFCHANNEL, &tx->sdata->state) && in ieee80211_tx_h_check_assoc()
319 if (tx->sdata->vif.type == NL80211_IFTYPE_OCB) in ieee80211_tx_h_check_assoc()
322 if (tx->sdata->vif.type == NL80211_IFTYPE_WDS) in ieee80211_tx_h_check_assoc()
325 if (tx->flags & IEEE80211_TX_PS_BUFFERED) in ieee80211_tx_h_check_assoc()
328 if (tx->sta) in ieee80211_tx_h_check_assoc()
329 assoc = test_sta_flag(tx->sta, WLAN_STA_ASSOC); in ieee80211_tx_h_check_assoc()
331 if (likely(tx->flags & IEEE80211_TX_UNICAST)) { in ieee80211_tx_h_check_assoc()
335 sdata_info(tx->sdata, in ieee80211_tx_h_check_assoc()
339 I802_DEBUG_INC(tx->local->tx_handlers_drop_not_assoc); in ieee80211_tx_h_check_assoc()
343 ieee80211_vif_get_num_mcast_if(tx->sdata) == 0)) { in ieee80211_tx_h_check_assoc()
406 ieee80211_tx_h_multicast_ps_buf(struct ieee80211_tx_data *tx) in ieee80211_tx_h_multicast_ps_buf() argument
408 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); in ieee80211_tx_h_multicast_ps_buf()
409 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data; in ieee80211_tx_h_multicast_ps_buf()
421 if (tx->sdata->vif.type == NL80211_IFTYPE_AP || in ieee80211_tx_h_multicast_ps_buf()
422 tx->sdata->vif.type == NL80211_IFTYPE_AP_VLAN) { in ieee80211_tx_h_multicast_ps_buf()
423 if (!tx->sdata->bss) in ieee80211_tx_h_multicast_ps_buf()
426 ps = &tx->sdata->bss->ps; in ieee80211_tx_h_multicast_ps_buf()
427 } else if (ieee80211_vif_is_mesh(&tx->sdata->vif)) { in ieee80211_tx_h_multicast_ps_buf()
428 ps = &tx->sdata->u.mesh.ps; in ieee80211_tx_h_multicast_ps_buf()
441 if (ieee80211_hw_check(&tx->local->hw, QUEUE_CONTROL)) in ieee80211_tx_h_multicast_ps_buf()
442 info->hw_queue = tx->sdata->vif.cab_queue; in ieee80211_tx_h_multicast_ps_buf()
451 if (!ieee80211_hw_check(&tx->local->hw, HOST_BROADCAST_PS_BUFFERING)) in ieee80211_tx_h_multicast_ps_buf()
455 if (tx->local->total_ps_buffered >= TOTAL_MAX_TX_BUFFER) in ieee80211_tx_h_multicast_ps_buf()
456 purge_old_ps_buffers(tx->local); in ieee80211_tx_h_multicast_ps_buf()
459 ps_dbg(tx->sdata, in ieee80211_tx_h_multicast_ps_buf()
460 "BC TX buffer full - dropping the oldest frame\n"); in ieee80211_tx_h_multicast_ps_buf()
461 ieee80211_free_txskb(&tx->local->hw, skb_dequeue(&ps->bc_buf)); in ieee80211_tx_h_multicast_ps_buf()
463 tx->local->total_ps_buffered++; in ieee80211_tx_h_multicast_ps_buf()
465 skb_queue_tail(&ps->bc_buf, tx->skb); in ieee80211_tx_h_multicast_ps_buf()
486 ieee80211_tx_h_unicast_ps_buf(struct ieee80211_tx_data *tx) in ieee80211_tx_h_unicast_ps_buf() argument
488 struct sta_info *sta = tx->sta; in ieee80211_tx_h_unicast_ps_buf()
489 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); in ieee80211_tx_h_unicast_ps_buf()
490 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data; in ieee80211_tx_h_unicast_ps_buf()
491 struct ieee80211_local *local = tx->local; in ieee80211_tx_h_unicast_ps_buf()
500 int ac = skb_get_queue_mapping(tx->skb); in ieee80211_tx_h_unicast_ps_buf()
510 if (tx->local->total_ps_buffered >= TOTAL_MAX_TX_BUFFER) in ieee80211_tx_h_unicast_ps_buf()
511 purge_old_ps_buffers(tx->local); in ieee80211_tx_h_unicast_ps_buf()
518 * ahead and Tx the packet. in ieee80211_tx_h_unicast_ps_buf()
529 ps_dbg(tx->sdata, in ieee80211_tx_h_unicast_ps_buf()
530 "STA %pM TX buffer for AC %d full - dropping oldest frame\n", in ieee80211_tx_h_unicast_ps_buf()
534 tx->local->total_ps_buffered++; in ieee80211_tx_h_unicast_ps_buf()
537 info->control.vif = &tx->sdata->vif; in ieee80211_tx_h_unicast_ps_buf()
540 skb_queue_tail(&sta->ps_tx_buf[ac], tx->skb); in ieee80211_tx_h_unicast_ps_buf()
556 ps_dbg(tx->sdata, in ieee80211_tx_h_unicast_ps_buf()
565 ieee80211_tx_h_ps_buf(struct ieee80211_tx_data *tx) in ieee80211_tx_h_ps_buf() argument
567 if (unlikely(tx->flags & IEEE80211_TX_PS_BUFFERED)) in ieee80211_tx_h_ps_buf()
570 if (tx->flags & IEEE80211_TX_UNICAST) in ieee80211_tx_h_ps_buf()
571 return ieee80211_tx_h_unicast_ps_buf(tx); in ieee80211_tx_h_ps_buf()
573 return ieee80211_tx_h_multicast_ps_buf(tx); in ieee80211_tx_h_ps_buf()
577 ieee80211_tx_h_check_control_port_protocol(struct ieee80211_tx_data *tx) in ieee80211_tx_h_check_control_port_protocol() argument
579 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); in ieee80211_tx_h_check_control_port_protocol()
581 if (unlikely(tx->sdata->control_port_protocol == tx->skb->protocol)) { in ieee80211_tx_h_check_control_port_protocol()
582 if (tx->sdata->control_port_no_encrypt) in ieee80211_tx_h_check_control_port_protocol()
592 ieee80211_tx_h_select_key(struct ieee80211_tx_data *tx) in ieee80211_tx_h_select_key() argument
595 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); in ieee80211_tx_h_select_key()
596 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data; in ieee80211_tx_h_select_key()
599 tx->key = NULL; in ieee80211_tx_h_select_key()
603 if (tx->sta && in ieee80211_tx_h_select_key()
604 (key = rcu_dereference(tx->sta->ptk[tx->sta->ptk_idx]))) in ieee80211_tx_h_select_key()
605 tx->key = key; in ieee80211_tx_h_select_key()
606 else if (ieee80211_is_group_privacy_action(tx->skb) && 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()
611 ieee80211_is_robust_mgmt_frame(tx->skb) && in ieee80211_tx_h_select_key()
612 (key = rcu_dereference(tx->sdata->default_mgmt_key))) in ieee80211_tx_h_select_key()
613 tx->key = key; in ieee80211_tx_h_select_key()
615 (key = rcu_dereference(tx->sdata->default_multicast_key))) in ieee80211_tx_h_select_key()
616 tx->key = key; in ieee80211_tx_h_select_key()
618 (key = rcu_dereference(tx->sdata->default_unicast_key))) in ieee80211_tx_h_select_key()
619 tx->key = key; in ieee80211_tx_h_select_key()
621 tx->key = NULL; in ieee80211_tx_h_select_key()
623 if (tx->key) { in ieee80211_tx_h_select_key()
628 switch (tx->key->conf.cipher) { in ieee80211_tx_h_select_key()
633 tx->key = NULL; in ieee80211_tx_h_select_key()
640 !ieee80211_use_mfp(hdr->frame_control, tx->sta, in ieee80211_tx_h_select_key()
641 tx->skb) && in ieee80211_tx_h_select_key()
642 !ieee80211_is_group_privacy_action(tx->skb)) in ieee80211_tx_h_select_key()
643 tx->key = NULL; in ieee80211_tx_h_select_key()
645 skip_hw = (tx->key->conf.flags & in ieee80211_tx_h_select_key()
654 tx->key = NULL; in ieee80211_tx_h_select_key()
658 if (unlikely(tx->key && tx->key->flags & KEY_FLAG_TAINTED && in ieee80211_tx_h_select_key()
662 if (!skip_hw && tx->key && in ieee80211_tx_h_select_key()
663 tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) in ieee80211_tx_h_select_key()
664 info->control.hw_key = &tx->key->conf; in ieee80211_tx_h_select_key()
665 } else if (!ieee80211_is_mgmt(hdr->frame_control) && tx->sta && in ieee80211_tx_h_select_key()
666 test_sta_flag(tx->sta, WLAN_STA_USES_ENCRYPTION)) { in ieee80211_tx_h_select_key()
674 ieee80211_tx_h_rate_ctrl(struct ieee80211_tx_data *tx) in ieee80211_tx_h_rate_ctrl() argument
676 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); in ieee80211_tx_h_rate_ctrl()
677 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()
691 /* set up the tx rate control struct we give the RC algo */ 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()
697 txrc.rate_idx_mask = tx->sdata->rc_rateidx_mask[info->band]; in ieee80211_tx_h_rate_ctrl()
699 if (tx->sdata->rc_has_mcs_mask[info->band]) in ieee80211_tx_h_rate_ctrl()
701 tx->sdata->rc_rateidx_mcs_mask[info->band]; in ieee80211_tx_h_rate_ctrl()
703 txrc.bss = (tx->sdata->vif.type == NL80211_IFTYPE_AP || in ieee80211_tx_h_rate_ctrl()
704 tx->sdata->vif.type == NL80211_IFTYPE_MESH_POINT || in ieee80211_tx_h_rate_ctrl()
705 tx->sdata->vif.type == NL80211_IFTYPE_ADHOC || in ieee80211_tx_h_rate_ctrl()
706 tx->sdata->vif.type == NL80211_IFTYPE_OCB); in ieee80211_tx_h_rate_ctrl()
709 if (len > tx->local->hw.wiphy->rts_threshold) { in ieee80211_tx_h_rate_ctrl()
714 info->control.use_cts_prot = tx->sdata->vif.bss_conf.use_cts_prot; in ieee80211_tx_h_rate_ctrl()
722 if (tx->sdata->vif.bss_conf.use_short_preamble && in ieee80211_tx_h_rate_ctrl()
724 (tx->sta && test_sta_flag(tx->sta, WLAN_STA_SHORT_PREAMBLE)))) in ieee80211_tx_h_rate_ctrl()
733 if (tx->sta) in ieee80211_tx_h_rate_ctrl()
734 assoc = test_sta_flag(tx->sta, WLAN_STA_ASSOC); in ieee80211_tx_h_rate_ctrl()
740 if (WARN(test_bit(SCAN_SW_SCANNING, &tx->local->scanning) && assoc && in ieee80211_tx_h_rate_ctrl()
741 !rate_usable_index_exists(sband, &tx->sta->sta), in ieee80211_tx_h_rate_ctrl()
745 tx->sdata->name, hdr->addr1, in ieee80211_tx_h_rate_ctrl()
753 rate_control_get_rate(tx->sdata, tx->sta, &txrc); in ieee80211_tx_h_rate_ctrl()
755 if (tx->sta && !info->control.skip_table) in ieee80211_tx_h_rate_ctrl()
756 ratetbl = rcu_dereference(tx->sta->sta.rates); in ieee80211_tx_h_rate_ctrl()
769 tx->rate = rate; in ieee80211_tx_h_rate_ctrl()
774 tx->rate = info->control.rates[0]; in ieee80211_tx_h_rate_ctrl()
778 txrc.reported_rate = tx->rate; in ieee80211_tx_h_rate_ctrl()
779 if (tx->sta && ieee80211_is_data(hdr->frame_control)) in ieee80211_tx_h_rate_ctrl()
780 tx->sta->tx_stats.last_rate = txrc.reported_rate; in ieee80211_tx_h_rate_ctrl()
781 } else if (tx->sta) in ieee80211_tx_h_rate_ctrl()
782 tx->sta->tx_stats.last_rate = txrc.reported_rate; in ieee80211_tx_h_rate_ctrl()
809 ieee80211_tx_h_sequence(struct ieee80211_tx_data *tx) in ieee80211_tx_h_sequence() argument
811 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); in ieee80211_tx_h_sequence()
812 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)tx->skb->data; in ieee80211_tx_h_sequence()
846 hdr->seq_ctrl = cpu_to_le16(tx->sdata->sequence_number); in ieee80211_tx_h_sequence()
847 tx->sdata->sequence_number += 0x10; in ieee80211_tx_h_sequence()
848 if (tx->sta) in ieee80211_tx_h_sequence()
849 tx->sta->tx_stats.msdu[IEEE80211_NUM_TIDS]++; in ieee80211_tx_h_sequence()
858 if (!tx->sta) in ieee80211_tx_h_sequence()
863 tx->sta->tx_stats.msdu[tid]++; in ieee80211_tx_h_sequence()
865 hdr->seq_ctrl = ieee80211_tx_next_seq(tx->sta, tid); in ieee80211_tx_h_sequence()
870 static int ieee80211_fragment(struct ieee80211_tx_data *tx, in ieee80211_fragment() argument
874 struct ieee80211_local *local = tx->local; in ieee80211_fragment()
894 tx->sdata->encrypt_headroom + in ieee80211_fragment()
899 __skb_queue_tail(&tx->skbs, tmp); in ieee80211_fragment()
902 local->tx_headroom + tx->sdata->encrypt_headroom); in ieee80211_fragment()
931 ieee80211_tx_h_fragment(struct ieee80211_tx_data *tx) in ieee80211_tx_h_fragment() argument
933 struct sk_buff *skb = tx->skb; in ieee80211_tx_h_fragment()
936 int frag_threshold = tx->local->hw.wiphy->frag_threshold; in ieee80211_tx_h_fragment()
940 /* no matter what happens, tx->skb moves to tx->skbs */ in ieee80211_tx_h_fragment()
941 __skb_queue_tail(&tx->skbs, skb); in ieee80211_tx_h_fragment()
942 tx->skb = NULL; in ieee80211_tx_h_fragment()
947 if (ieee80211_hw_check(&tx->local->hw, SUPPORTS_TX_FRAG)) in ieee80211_tx_h_fragment()
953 * caution taken here as fragmented ampdu may cause Tx stop. in ieee80211_tx_h_fragment()
972 if (ieee80211_fragment(tx, skb, hdrlen, frag_threshold)) in ieee80211_tx_h_fragment()
978 skb_queue_walk(&tx->skbs, skb) { in ieee80211_tx_h_fragment()
984 if (!skb_queue_is_last(&tx->skbs, skb)) { in ieee80211_tx_h_fragment()
1006 ieee80211_tx_h_stats(struct ieee80211_tx_data *tx) in ieee80211_tx_h_stats() argument
1011 if (!tx->sta) in ieee80211_tx_h_stats()
1014 skb_queue_walk(&tx->skbs, skb) { in ieee80211_tx_h_stats()
1016 tx->sta->tx_stats.bytes[ac] += skb->len; in ieee80211_tx_h_stats()
1019 tx->sta->tx_stats.packets[ac]++; in ieee80211_tx_h_stats()
1025 ieee80211_tx_h_encrypt(struct ieee80211_tx_data *tx) in ieee80211_tx_h_encrypt() argument
1027 if (!tx->key) in ieee80211_tx_h_encrypt()
1030 switch (tx->key->conf.cipher) { in ieee80211_tx_h_encrypt()
1033 return ieee80211_crypto_wep_encrypt(tx); in ieee80211_tx_h_encrypt()
1035 return ieee80211_crypto_tkip_encrypt(tx); in ieee80211_tx_h_encrypt()
1038 tx, IEEE80211_CCMP_MIC_LEN); in ieee80211_tx_h_encrypt()
1041 tx, IEEE80211_CCMP_256_MIC_LEN); in ieee80211_tx_h_encrypt()
1043 return ieee80211_crypto_aes_cmac_encrypt(tx); in ieee80211_tx_h_encrypt()
1045 return ieee80211_crypto_aes_cmac_256_encrypt(tx); in ieee80211_tx_h_encrypt()
1048 return ieee80211_crypto_aes_gmac_encrypt(tx); in ieee80211_tx_h_encrypt()
1051 return ieee80211_crypto_gcmp_encrypt(tx); in ieee80211_tx_h_encrypt()
1053 return ieee80211_crypto_hw_encrypt(tx); in ieee80211_tx_h_encrypt()
1060 ieee80211_tx_h_calculate_duration(struct ieee80211_tx_data *tx) in ieee80211_tx_h_calculate_duration() argument
1067 skb_queue_walk(&tx->skbs, skb) { in ieee80211_tx_h_calculate_duration()
1071 if (!skb_queue_is_last(&tx->skbs, skb)) { in ieee80211_tx_h_calculate_duration()
1072 struct sk_buff *next = skb_queue_next(&tx->skbs, skb); in ieee80211_tx_h_calculate_duration()
1079 ieee80211_duration(tx, skb, group_addr, next_len); in ieee80211_tx_h_calculate_duration()
1087 static bool ieee80211_tx_prep_agg(struct ieee80211_tx_data *tx, in ieee80211_tx_prep_agg() argument
1105 } else if (!tx->sta->sta.txq[tid]) { in ieee80211_tx_prep_agg()
1106 spin_lock(&tx->sta->lock); in ieee80211_tx_prep_agg()
1125 tid_tx = rcu_dereference_protected_tid_tx(tx->sta, tid); in ieee80211_tx_prep_agg()
1135 clear_sta_flag(tx->sta, WLAN_STA_SP); in ieee80211_tx_prep_agg()
1136 ps_dbg(tx->sta->sdata, in ieee80211_tx_prep_agg()
1138 tx->sta->sta.addr, tx->sta->sta.aid); in ieee80211_tx_prep_agg()
1140 info->control.vif = &tx->sdata->vif; in ieee80211_tx_prep_agg()
1147 spin_unlock(&tx->sta->lock); in ieee80211_tx_prep_agg()
1150 ieee80211_free_txskb(&tx->local->hw, purge_skb); in ieee80211_tx_prep_agg()
1161 * initialises @tx
1167 struct ieee80211_tx_data *tx, in ieee80211_tx_prepare() argument
1175 memset(tx, 0, sizeof(*tx)); in ieee80211_tx_prepare()
1176 tx->skb = skb; in ieee80211_tx_prepare()
1177 tx->local = local; in ieee80211_tx_prepare()
1178 tx->sdata = sdata; in ieee80211_tx_prepare()
1179 __skb_queue_head_init(&tx->skbs); in ieee80211_tx_prepare()
1192 tx->sta = sta; in ieee80211_tx_prepare()
1195 tx->sta = rcu_dereference(sdata->u.vlan.sta); in ieee80211_tx_prepare()
1196 if (!tx->sta && sdata->wdev.use_4addr) in ieee80211_tx_prepare()
1200 tx->sdata->control_port_protocol == tx->skb->protocol) { in ieee80211_tx_prepare()
1201 tx->sta = sta_info_get_bss(sdata, hdr->addr1); in ieee80211_tx_prepare()
1203 if (!tx->sta && !is_multicast_ether_addr(hdr->addr1)) in ieee80211_tx_prepare()
1204 tx->sta = sta_info_get(sdata, hdr->addr1); in ieee80211_tx_prepare()
1207 if (tx->sta && ieee80211_is_data_qos(hdr->frame_control) && in ieee80211_tx_prepare()
1215 tid_tx = rcu_dereference(tx->sta->ampdu_mlme.tid_tx[tid]); in ieee80211_tx_prepare()
1219 queued = ieee80211_tx_prep_agg(tx, skb, info, in ieee80211_tx_prepare()
1228 tx->flags &= ~IEEE80211_TX_UNICAST; in ieee80211_tx_prepare()
1231 tx->flags |= IEEE80211_TX_UNICAST; in ieee80211_tx_prepare()
1234 if (!(tx->flags & IEEE80211_TX_UNICAST) || in ieee80211_tx_prepare()
1240 if (!tx->sta) in ieee80211_tx_prepare()
1242 else if (test_and_clear_sta_flag(tx->sta, WLAN_STA_CLEAR_PS_FILT)) { in ieee80211_tx_prepare()
1244 ieee80211_check_fast_xmit(tx->sta); in ieee80211_tx_prepare()
1677 * later transmission from the tx-pending in ieee80211_tx_frags()
1764 * Invoke TX handlers, return 0 on success and non-zero if the
1771 static int invoke_tx_handlers_early(struct ieee80211_tx_data *tx) in invoke_tx_handlers_early() argument
1777 res = txh(tx); \ in invoke_tx_handlers_early()
1787 if (!ieee80211_hw_check(&tx->local->hw, HAS_RATE_CONTROL)) in invoke_tx_handlers_early()
1792 I802_DEBUG_INC(tx->local->tx_handlers_drop); in invoke_tx_handlers_early()
1793 if (tx->skb) in invoke_tx_handlers_early()
1794 ieee80211_free_txskb(&tx->local->hw, tx->skb); in invoke_tx_handlers_early()
1796 ieee80211_purge_tx_queue(&tx->local->hw, &tx->skbs); in invoke_tx_handlers_early()
1799 I802_DEBUG_INC(tx->local->tx_handlers_queued); in invoke_tx_handlers_early()
1810 static int invoke_tx_handlers_late(struct ieee80211_tx_data *tx) in invoke_tx_handlers_late() argument
1812 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(tx->skb); in invoke_tx_handlers_late()
1816 __skb_queue_tail(&tx->skbs, tx->skb); in invoke_tx_handlers_late()
1817 tx->skb = NULL; in invoke_tx_handlers_late()
1824 /* handlers after fragment must be aware of tx info fragmentation! */ in invoke_tx_handlers_late()
1827 if (!ieee80211_hw_check(&tx->local->hw, HAS_RATE_CONTROL)) in invoke_tx_handlers_late()
1833 I802_DEBUG_INC(tx->local->tx_handlers_drop); in invoke_tx_handlers_late()
1834 if (tx->skb) in invoke_tx_handlers_late()
1835 ieee80211_free_txskb(&tx->local->hw, tx->skb); in invoke_tx_handlers_late()
1837 ieee80211_purge_tx_queue(&tx->local->hw, &tx->skbs); in invoke_tx_handlers_late()
1840 I802_DEBUG_INC(tx->local->tx_handlers_queued); in invoke_tx_handlers_late()
1847 static int invoke_tx_handlers(struct ieee80211_tx_data *tx) in invoke_tx_handlers() argument
1849 int r = invoke_tx_handlers_early(tx); in invoke_tx_handlers()
1853 return invoke_tx_handlers_late(tx); in invoke_tx_handlers()
1862 struct ieee80211_tx_data tx; in ieee80211_tx_prepare_skb() local
1865 if (ieee80211_tx_prepare(sdata, &tx, NULL, skb) == TX_DROP) in ieee80211_tx_prepare_skb()
1872 if (invoke_tx_handlers(&tx)) in ieee80211_tx_prepare_skb()
1876 if (tx.sta) in ieee80211_tx_prepare_skb()
1877 *sta = &tx.sta->sta; in ieee80211_tx_prepare_skb()
1883 skb2 = __skb_dequeue(&tx.skbs); in ieee80211_tx_prepare_skb()
1884 if (WARN_ON(skb2 != skb || !skb_queue_empty(&tx.skbs))) { in ieee80211_tx_prepare_skb()
1886 ieee80211_purge_tx_queue(hw, &tx.skbs); in ieee80211_tx_prepare_skb()
1902 struct ieee80211_tx_data tx; in ieee80211_tx() local
1913 /* initialises tx */ in ieee80211_tx()
1915 res_prepare = ieee80211_tx_prepare(sdata, &tx, sta, skb); in ieee80211_tx()
1930 if (invoke_tx_handlers_early(&tx)) in ieee80211_tx()
1933 if (ieee80211_queue_skb(local, sdata, tx.sta, tx.skb)) in ieee80211_tx()
1936 if (!invoke_tx_handlers_late(&tx)) in ieee80211_tx()
1937 result = __ieee80211_tx(local, &tx.skbs, led_len, in ieee80211_tx()
1938 tx.sta, txpending); in ieee80211_tx()
1981 "failed to reallocate TX buffer\n"); in ieee80211_skb_resize()
2302 * don't use nl80211-based management TX/RX. in ieee80211_monitor_start_xmit()
2340 * NO TX unless the channel is explicitly allowed in which case in ieee80211_monitor_start_xmit()
2344 * Since AP mode uses monitor interfaces to inject/TX management in ieee80211_monitor_start_xmit()
2499 * Note that this function also takes care of the TX status request and
2904 * maintained if any of the TX path checks change.
2927 * key and the fast-tx assignment are done atomically, so the CPU that in ieee80211_check_fast_xmit()
3184 "failed to reallocate TX buffer\n"); in ieee80211_amsdu_realloc_pad()
3465 struct ieee80211_tx_data tx; in ieee80211_xmit_fast() local
3478 /* don't handle TX status request here either */ in ieee80211_xmit_fast()
3546 __skb_queue_head_init(&tx.skbs); in ieee80211_xmit_fast()
3548 tx.flags = IEEE80211_TX_UNICAST; in ieee80211_xmit_fast()
3549 tx.local = local; in ieee80211_xmit_fast()
3550 tx.sdata = sdata; in ieee80211_xmit_fast()
3551 tx.sta = sta; in ieee80211_xmit_fast()
3552 tx.key = fast_tx->key; in ieee80211_xmit_fast()
3555 tx.skb = skb; in ieee80211_xmit_fast()
3556 r = ieee80211_tx_h_rate_ctrl(&tx); in ieee80211_xmit_fast()
3557 skb = tx.skb; in ieee80211_xmit_fast()
3558 tx.skb = NULL; in ieee80211_xmit_fast()
3577 __skb_queue_tail(&tx.skbs, skb); in ieee80211_xmit_fast()
3578 ieee80211_tx_frags(local, &sdata->vif, sta, &tx.skbs, false); in ieee80211_xmit_fast()
3592 struct ieee80211_tx_data tx; in ieee80211_tx_dequeue() local
3627 memset(&tx, 0, sizeof(tx)); in ieee80211_tx_dequeue()
3628 __skb_queue_head_init(&tx.skbs); in ieee80211_tx_dequeue()
3629 tx.local = local; in ieee80211_tx_dequeue()
3630 tx.skb = skb; in ieee80211_tx_dequeue()
3631 tx.sdata = vif_to_sdata(info->control.vif); in ieee80211_tx_dequeue()
3634 tx.sta = container_of(txq->sta, struct sta_info, sta); in ieee80211_tx_dequeue()
3641 !ieee80211_vif_is_mesh(&tx.sdata->vif) && in ieee80211_tx_dequeue()
3642 tx.sdata->vif.type != NL80211_IFTYPE_OCB && in ieee80211_tx_dequeue()
3644 !test_sta_flag(tx.sta, WLAN_STA_AUTHORIZED) && in ieee80211_tx_dequeue()
3647 !ether_addr_equal(tx.sdata->vif.addr, in ieee80211_tx_dequeue()
3659 r = ieee80211_tx_h_select_key(&tx); in ieee80211_tx_dequeue()
3678 if (tx.key && in ieee80211_tx_dequeue()
3679 (tx.key->conf.flags & IEEE80211_KEY_FLAG_GENERATE_IV)) in ieee80211_tx_dequeue()
3683 tx.key, skb); in ieee80211_tx_dequeue()
3685 if (invoke_tx_handlers_late(&tx)) in ieee80211_tx_dequeue()
3688 skb = __skb_dequeue(&tx.skbs); in ieee80211_tx_dequeue()
3690 if (!skb_queue_empty(&tx.skbs)) { in ieee80211_tx_dequeue()
3692 skb_queue_splice_tail(&tx.skbs, &txqi->frags); in ieee80211_tx_dequeue()
3705 switch (tx.sdata->vif.type) { in ieee80211_tx_dequeue()
3707 if (tx.sdata->u.mntr.flags & MONITOR_FLAG_ACTIVE) { in ieee80211_tx_dequeue()
3708 vif = &tx.sdata->vif; in ieee80211_tx_dequeue()
3711 tx.sdata = rcu_dereference(local->monitor_sdata); in ieee80211_tx_dequeue()
3712 if (tx.sdata) { in ieee80211_tx_dequeue()
3713 vif = &tx.sdata->vif; in ieee80211_tx_dequeue()
3724 tx.sdata = container_of(tx.sdata->bss, in ieee80211_tx_dequeue()
3728 vif = &tx.sdata->vif; in ieee80211_tx_dequeue()
3744 ieee80211_sta_update_pending_airtime(local, tx.sta, in ieee80211_tx_dequeue()
4320 struct ieee80211_tx_data tx = { in ieee80211_build_data_template() local
4339 tx.sta = sta_info_get(sdata, hdr->addr1); in ieee80211_build_data_template()
4340 tx.skb = skb; in ieee80211_build_data_template()
4342 if (ieee80211_tx_h_select_key(&tx) != TX_CONTINUE) { in ieee80211_build_data_template()
4729 struct ieee80211_tx_data tx; in ieee80211_beacon_protect() local
4732 memset(&tx, 0, sizeof(tx)); in ieee80211_beacon_protect()
4733 tx.key = rcu_dereference(sdata->default_beacon_key); in ieee80211_beacon_protect()
4734 if (!tx.key) in ieee80211_beacon_protect()
4736 tx.local = local; in ieee80211_beacon_protect()
4737 tx.sdata = sdata; in ieee80211_beacon_protect()
4738 __skb_queue_head_init(&tx.skbs); in ieee80211_beacon_protect()
4739 __skb_queue_tail(&tx.skbs, skb); in ieee80211_beacon_protect()
4740 res = ieee80211_tx_h_encrypt(&tx); in ieee80211_beacon_protect()
4741 check_skb = __skb_dequeue(&tx.skbs); in ieee80211_beacon_protect()
5248 struct ieee80211_tx_data tx; in ieee80211_get_buffered_bc() local
5297 if (!ieee80211_tx_prepare(sdata, &tx, NULL, skb)) in ieee80211_get_buffered_bc()
5304 tx.flags |= IEEE80211_TX_PS_BUFFERED; in ieee80211_get_buffered_bc()
5307 if (invoke_tx_handlers(&tx)) in ieee80211_get_buffered_bc()
5422 * requirements are that we do not come into tx with bhs on. in __ieee80211_tx_skb_tid_band()