Skip to content

Commit cc20ff2

Browse files
nbd168jmberg-intel
authored andcommitted
mac80211: swap NEED_TXPROCESSING and HW_80211_ENCAP tx flags
In order to unify the tx status path, the hw 802.11 encapsulation flag needs to survive the trip to the tx status call. Since we don't have any free bits in info->flags, we need to move one. IEEE80211_TX_INTFL_NEED_TXPROCESSING is only used internally in mac80211, and only before the call into the driver. Signed-off-by: Felix Fietkau <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Johannes Berg <[email protected]>
1 parent c74114d commit cc20ff2

File tree

8 files changed

+25
-25
lines changed

8 files changed

+25
-25
lines changed

drivers/net/wireless/ath/ath11k/dp_tx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ ath11k_dp_tx_get_encap_type(struct ath11k_vif *arvif, struct sk_buff *skb)
1818
if (test_bit(ATH11K_FLAG_RAW_MODE, &ab->dev_flags))
1919
return HAL_TCL_ENCAP_TYPE_RAW;
2020

21-
if (tx_info->control.flags & IEEE80211_TX_CTRL_HW_80211_ENCAP)
21+
if (tx_info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP)
2222
return HAL_TCL_ENCAP_TYPE_ETHERNET;
2323

2424
return HAL_TCL_ENCAP_TYPE_NATIVE_WIFI;
@@ -98,7 +98,7 @@ int ath11k_dp_tx(struct ath11k *ar, struct ath11k_vif *arvif,
9898
if (test_bit(ATH11K_FLAG_CRASH_FLUSH, &ar->ab->dev_flags))
9999
return -ESHUTDOWN;
100100

101-
if (!(info->control.flags & IEEE80211_TX_CTRL_HW_80211_ENCAP) &&
101+
if (!(info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) &&
102102
!ieee80211_is_data(hdr->frame_control))
103103
return -ENOTSUPP;
104104

drivers/net/wireless/ath/ath11k/mac.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3936,7 +3936,7 @@ static int ath11k_mac_mgmt_tx_wmi(struct ath11k *ar, struct ath11k_vif *arvif,
39363936
return -ENOSPC;
39373937

39383938
info = IEEE80211_SKB_CB(skb);
3939-
if (!(info->control.flags & IEEE80211_TX_CTRL_HW_80211_ENCAP)) {
3939+
if (!(info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP)) {
39403940
if ((ieee80211_is_action(hdr->frame_control) ||
39413941
ieee80211_is_deauth(hdr->frame_control) ||
39423942
ieee80211_is_disassoc(hdr->frame_control)) &&
@@ -4063,7 +4063,7 @@ static void ath11k_mac_op_tx(struct ieee80211_hw *hw,
40634063
bool is_prb_rsp;
40644064
int ret;
40654065

4066-
if (info->control.flags & IEEE80211_TX_CTRL_HW_80211_ENCAP) {
4066+
if (info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) {
40674067
skb_cb->flags |= ATH11K_SKB_HW_80211_ENCAP;
40684068
} else if (ieee80211_is_mgmt(hdr->frame_control)) {
40694069
is_prb_rsp = ieee80211_is_probe_resp(hdr->frame_control);

include/net/mac80211.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -720,9 +720,8 @@ struct ieee80211_bss_conf {
720720
* @IEEE80211_TX_INTFL_OFFCHAN_TX_OK: Internal to mac80211. Used to indicate
721721
* that a frame can be transmitted while the queues are stopped for
722722
* off-channel operation.
723-
* @IEEE80211_TX_INTFL_NEED_TXPROCESSING: completely internal to mac80211,
724-
* used to indicate that a pending frame requires TX processing before
725-
* it can be sent out.
723+
* @IEEE80211_TX_CTL_HW_80211_ENCAP: This frame uses hardware encapsulation
724+
* (header conversion)
726725
* @IEEE80211_TX_INTFL_RETRIED: completely internal to mac80211,
727726
* used to indicate that a frame was already retried due to PS
728727
* @IEEE80211_TX_INTFL_DONT_ENCRYPT: completely internal to mac80211,
@@ -791,7 +790,7 @@ enum mac80211_tx_info_flags {
791790
IEEE80211_TX_STAT_AMPDU_NO_BACK = BIT(11),
792791
IEEE80211_TX_CTL_RATE_CTRL_PROBE = BIT(12),
793792
IEEE80211_TX_INTFL_OFFCHAN_TX_OK = BIT(13),
794-
IEEE80211_TX_INTFL_NEED_TXPROCESSING = BIT(14),
793+
IEEE80211_TX_CTL_HW_80211_ENCAP = BIT(14),
795794
IEEE80211_TX_INTFL_RETRIED = BIT(15),
796795
IEEE80211_TX_INTFL_DONT_ENCRYPT = BIT(16),
797796
IEEE80211_TX_CTL_NO_PS_BUFFER = BIT(17),
@@ -823,8 +822,9 @@ enum mac80211_tx_info_flags {
823822
* @IEEE80211_TX_CTRL_AMSDU: This frame is an A-MSDU frame
824823
* @IEEE80211_TX_CTRL_FAST_XMIT: This frame is going through the fast_xmit path
825824
* @IEEE80211_TX_CTRL_SKIP_MPATH_LOOKUP: This frame skips mesh path lookup
826-
* @IEEE80211_TX_CTRL_HW_80211_ENCAP: This frame uses hardware encapsulation
827-
* (header conversion)
825+
* @IEEE80211_TX_INTCFL_NEED_TXPROCESSING: completely internal to mac80211,
826+
* used to indicate that a pending frame requires TX processing before
827+
* it can be sent out.
828828
* @IEEE80211_TX_CTRL_NO_SEQNO: Do not overwrite the sequence number that
829829
* has already been assigned to this frame.
830830
*
@@ -837,7 +837,7 @@ enum mac80211_tx_control_flags {
837837
IEEE80211_TX_CTRL_AMSDU = BIT(3),
838838
IEEE80211_TX_CTRL_FAST_XMIT = BIT(4),
839839
IEEE80211_TX_CTRL_SKIP_MPATH_LOOKUP = BIT(5),
840-
IEEE80211_TX_CTRL_HW_80211_ENCAP = BIT(6),
840+
IEEE80211_TX_INTCFL_NEED_TXPROCESSING = BIT(6),
841841
IEEE80211_TX_CTRL_NO_SEQNO = BIT(7),
842842
};
843843

net/mac80211/mesh_hwmp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ static void prepare_frame_for_deferred_tx(struct ieee80211_sub_if_data *sdata,
212212
skb->priority = 7;
213213

214214
info->control.vif = &sdata->vif;
215-
info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING;
215+
info->control.flags |= IEEE80211_TX_INTCFL_NEED_TXPROCESSING;
216216
ieee80211_set_qos_hdr(sdata, skb);
217217
ieee80211_mps_set_frame_flags(sdata, NULL, hdr);
218218
}
@@ -1163,7 +1163,7 @@ int mesh_nexthop_resolve(struct ieee80211_sub_if_data *sdata,
11631163
if (skb_queue_len(&mpath->frame_queue) >= MESH_FRAME_QUEUE_LEN)
11641164
skb_to_free = skb_dequeue(&mpath->frame_queue);
11651165

1166-
info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING;
1166+
info->control.flags |= IEEE80211_TX_INTCFL_NEED_TXPROCESSING;
11671167
ieee80211_set_qos_hdr(sdata, skb);
11681168
skb_queue_tail(&mpath->frame_queue, skb);
11691169
if (skb_to_free)

net/mac80211/mesh_ps.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ static void mpsp_qos_null_append(struct sta_info *sta,
432432

433433
info = IEEE80211_SKB_CB(new_skb);
434434
info->control.vif = &sdata->vif;
435-
info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING;
435+
info->control.flags |= IEEE80211_TX_INTCFL_NEED_TXPROCESSING;
436436

437437
__skb_queue_tail(frames, new_skb);
438438
}

net/mac80211/rx.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2899,7 +2899,7 @@ ieee80211_rx_h_mesh_fwding(struct ieee80211_rx_data *rx)
28992899
fwd_hdr->frame_control &= ~cpu_to_le16(IEEE80211_FCTL_RETRY);
29002900
info = IEEE80211_SKB_CB(fwd_skb);
29012901
memset(info, 0, sizeof(*info));
2902-
info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING;
2902+
info->control.flags |= IEEE80211_TX_INTCFL_NEED_TXPROCESSING;
29032903
info->control.vif = &rx->sdata->vif;
29042904
info->control.jiffies = jiffies;
29052905
if (is_multicast_ether_addr(fwd_hdr->addr1)) {

net/mac80211/status.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ static void ieee80211_handle_filtered_frame(struct ieee80211_local *local,
6666

6767
info->control.jiffies = jiffies;
6868
info->control.vif = &sta->sdata->vif;
69-
info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING |
70-
IEEE80211_TX_INTFL_RETRANSMISSION;
69+
info->control.flags |= IEEE80211_TX_INTCFL_NEED_TXPROCESSING;
70+
info->flags |= IEEE80211_TX_INTFL_RETRANSMISSION;
7171
info->flags &= ~IEEE80211_TX_TEMPORARY_FLAGS;
7272

7373
sta->status_stats.filtered++;

net/mac80211/tx.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ ieee80211_tx_h_unicast_ps_buf(struct ieee80211_tx_data *tx)
531531

532532
info->control.jiffies = jiffies;
533533
info->control.vif = &tx->sdata->vif;
534-
info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING;
534+
info->control.flags |= IEEE80211_TX_INTCFL_NEED_TXPROCESSING;
535535
info->flags &= ~IEEE80211_TX_TEMPORARY_FLAGS;
536536
skb_queue_tail(&sta->ps_tx_buf[ac], tx->skb);
537537
spin_unlock(&sta->ps_lock);
@@ -1134,7 +1134,7 @@ static bool ieee80211_tx_prep_agg(struct ieee80211_tx_data *tx,
11341134
tx->sta->sta.addr, tx->sta->sta.aid);
11351135
}
11361136
info->control.vif = &tx->sdata->vif;
1137-
info->flags |= IEEE80211_TX_INTFL_NEED_TXPROCESSING;
1137+
info->control.flags |= IEEE80211_TX_INTCFL_NEED_TXPROCESSING;
11381138
info->flags &= ~IEEE80211_TX_TEMPORARY_FLAGS;
11391139
__skb_queue_tail(&tid_tx->pending, skb);
11401140
if (skb_queue_len(&tid_tx->pending) > STA_MAX_TX_BUFFER)
@@ -1179,7 +1179,7 @@ ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata,
11791179
* we are doing the needed processing, so remove the flag
11801180
* now.
11811181
*/
1182-
info->flags &= ~IEEE80211_TX_INTFL_NEED_TXPROCESSING;
1182+
info->control.flags &= ~IEEE80211_TX_INTCFL_NEED_TXPROCESSING;
11831183

11841184
hdr = (struct ieee80211_hdr *) skb->data;
11851185

@@ -1258,7 +1258,7 @@ static struct txq_info *ieee80211_get_txq(struct ieee80211_local *local,
12581258
(info->control.flags & IEEE80211_TX_CTRL_PS_RESPONSE))
12591259
return NULL;
12601260

1261-
if (!(info->control.flags & IEEE80211_TX_CTRL_HW_80211_ENCAP) &&
1261+
if (!(info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) &&
12621262
unlikely(!ieee80211_is_data_present(hdr->frame_control))) {
12631263
if ((!ieee80211_is_mgmt(hdr->frame_control) ||
12641264
ieee80211_is_bufferable_mmpdu(hdr->frame_control) ||
@@ -3649,7 +3649,7 @@ struct sk_buff *ieee80211_tx_dequeue(struct ieee80211_hw *hw,
36493649
else
36503650
info->flags &= ~IEEE80211_TX_CTL_AMPDU;
36513651

3652-
if (info->control.flags & IEEE80211_TX_CTRL_HW_80211_ENCAP)
3652+
if (info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP)
36533653
goto encap_out;
36543654

36553655
if (info->control.flags & IEEE80211_TX_CTRL_FAST_XMIT) {
@@ -4239,7 +4239,7 @@ static void ieee80211_8023_xmit(struct ieee80211_sub_if_data *sdata,
42394239
sdata = container_of(sdata->bss,
42404240
struct ieee80211_sub_if_data, u.ap);
42414241

4242-
info->control.flags |= IEEE80211_TX_CTRL_HW_80211_ENCAP;
4242+
info->flags |= IEEE80211_TX_CTL_HW_80211_ENCAP;
42434243
info->control.vif = &sdata->vif;
42444244

42454245
if (key)
@@ -4364,15 +4364,15 @@ static bool ieee80211_tx_pending_skb(struct ieee80211_local *local,
43644364

43654365
sdata = vif_to_sdata(info->control.vif);
43664366

4367-
if (info->flags & IEEE80211_TX_INTFL_NEED_TXPROCESSING) {
4367+
if (info->control.flags & IEEE80211_TX_INTCFL_NEED_TXPROCESSING) {
43684368
chanctx_conf = rcu_dereference(sdata->vif.chanctx_conf);
43694369
if (unlikely(!chanctx_conf)) {
43704370
dev_kfree_skb(skb);
43714371
return true;
43724372
}
43734373
info->band = chanctx_conf->def.chan->band;
43744374
result = ieee80211_tx(sdata, NULL, skb, true);
4375-
} else if (info->control.flags & IEEE80211_TX_CTRL_HW_80211_ENCAP) {
4375+
} else if (info->flags & IEEE80211_TX_CTL_HW_80211_ENCAP) {
43764376
if (ieee80211_lookup_ra_sta(sdata, skb, &sta)) {
43774377
dev_kfree_skb(skb);
43784378
return true;

0 commit comments

Comments
 (0)