Skip to content

Commit 0ea90f3

Browse files
committed
Merge tag 'wireless-2023-01-12' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless
Johannes Berg says: ==================== Some fixes, stack only for now: * iTXQ conversion fixes, various bugs reported * properly reset multiple BSSID settings * fix for a link_sta crash * fix for AP VLAN checks * fix for MLO address translation * tag 'wireless-2023-01-12' of git://git.kernel.org/pub/scm/linux/kernel/git/wireless/wireless: wifi: mac80211: fix MLO + AP_VLAN check mac80211: Fix MLO address translation for multiple bss case wifi: mac80211: reset multiple BSSID options in stop_ap() wifi: mac80211: Fix iTXQ AMPDU fragmentation handling wifi: mac80211: sdata can be NULL during AMPDU start wifi: mac80211: Proper mark iTXQs for resumption wifi: mac80211: fix initialization of rx->link and rx->link_sta ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents d9fc151 + f216033 commit 0ea90f3

File tree

12 files changed

+176
-191
lines changed

12 files changed

+176
-191
lines changed

include/net/mac80211.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1832,8 +1832,6 @@ struct ieee80211_vif_cfg {
18321832
* @drv_priv: data area for driver use, will always be aligned to
18331833
* sizeof(void \*).
18341834
* @txq: the multicast data TX queue
1835-
* @txqs_stopped: per AC flag to indicate that intermediate TXQs are stopped,
1836-
* protected by fq->lock.
18371835
* @offload_flags: 802.3 -> 802.11 enapsulation offload flags, see
18381836
* &enum ieee80211_offload_flags.
18391837
* @mbssid_tx_vif: Pointer to the transmitting interface if MBSSID is enabled.
@@ -1863,8 +1861,6 @@ struct ieee80211_vif {
18631861
bool probe_req_reg;
18641862
bool rx_mcast_action_reg;
18651863

1866-
bool txqs_stopped[IEEE80211_NUM_ACS];
1867-
18681864
struct ieee80211_vif *mbssid_tx_vif;
18691865

18701866
/* must be last */

net/mac80211/agg-tx.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,7 @@ void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid)
491491
{
492492
struct tid_ampdu_tx *tid_tx;
493493
struct ieee80211_local *local = sta->local;
494-
struct ieee80211_sub_if_data *sdata = sta->sdata;
494+
struct ieee80211_sub_if_data *sdata;
495495
struct ieee80211_ampdu_params params = {
496496
.sta = &sta->sta,
497497
.action = IEEE80211_AMPDU_TX_START,
@@ -511,8 +511,6 @@ void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid)
511511
*/
512512
clear_bit(HT_AGG_STATE_WANT_START, &tid_tx->state);
513513

514-
ieee80211_agg_stop_txq(sta, tid);
515-
516514
/*
517515
* Make sure no packets are being processed. This ensures that
518516
* we have a valid starting sequence number and that in-flight
@@ -521,6 +519,7 @@ void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid)
521519
*/
522520
synchronize_net();
523521

522+
sdata = sta->sdata;
524523
params.ssn = sta->tid_seq[tid] >> 4;
525524
ret = drv_ampdu_action(local, sdata, &params);
526525
tid_tx->ssn = params.ssn;
@@ -534,6 +533,9 @@ void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid)
534533
*/
535534
set_bit(HT_AGG_STATE_DRV_READY, &tid_tx->state);
536535
} else if (ret) {
536+
if (!sdata)
537+
return;
538+
537539
ht_dbg(sdata,
538540
"BA request denied - HW unavailable for %pM tid %d\n",
539541
sta->sta.addr, tid);

net/mac80211/cfg.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ static int ieee80211_set_ap_mbssid_options(struct ieee80211_sub_if_data *sdata,
147147
link_conf->bssid_index = 0;
148148
link_conf->nontransmitted = false;
149149
link_conf->ema_ap = false;
150+
link_conf->bssid_indicator = 0;
150151

151152
if (sdata->vif.type != NL80211_IFTYPE_AP || !params.tx_wdev)
152153
return -EINVAL;
@@ -1511,6 +1512,12 @@ static int ieee80211_stop_ap(struct wiphy *wiphy, struct net_device *dev,
15111512
kfree(link_conf->ftmr_params);
15121513
link_conf->ftmr_params = NULL;
15131514

1515+
sdata->vif.mbssid_tx_vif = NULL;
1516+
link_conf->bssid_index = 0;
1517+
link_conf->nontransmitted = false;
1518+
link_conf->ema_ap = false;
1519+
link_conf->bssid_indicator = 0;
1520+
15141521
__sta_info_flush(sdata, true);
15151522
ieee80211_free_keys(sdata, true);
15161523

net/mac80211/debugfs_sta.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ static ssize_t sta_aqm_read(struct file *file, char __user *userbuf,
167167
continue;
168168
txqi = to_txq_info(sta->sta.txq[i]);
169169
p += scnprintf(p, bufsz + buf - p,
170-
"%d %d %u %u %u %u %u %u %u %u %u 0x%lx(%s%s%s)\n",
170+
"%d %d %u %u %u %u %u %u %u %u %u 0x%lx(%s%s%s%s)\n",
171171
txqi->txq.tid,
172172
txqi->txq.ac,
173173
txqi->tin.backlog_bytes,
@@ -182,7 +182,8 @@ static ssize_t sta_aqm_read(struct file *file, char __user *userbuf,
182182
txqi->flags,
183183
test_bit(IEEE80211_TXQ_STOP, &txqi->flags) ? "STOP" : "RUN",
184184
test_bit(IEEE80211_TXQ_AMPDU, &txqi->flags) ? " AMPDU" : "",
185-
test_bit(IEEE80211_TXQ_NO_AMSDU, &txqi->flags) ? " NO-AMSDU" : "");
185+
test_bit(IEEE80211_TXQ_NO_AMSDU, &txqi->flags) ? " NO-AMSDU" : "",
186+
test_bit(IEEE80211_TXQ_DIRTY, &txqi->flags) ? " DIRTY" : "");
186187
}
187188

188189
rcu_read_unlock();

net/mac80211/driver-ops.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,9 @@ int drv_ampdu_action(struct ieee80211_local *local,
392392

393393
might_sleep();
394394

395+
if (!sdata)
396+
return -EIO;
397+
395398
sdata = get_bss_sdata(sdata);
396399
if (!check_sdata_in_driver(sdata))
397400
return -EIO;

net/mac80211/driver-ops.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1199,7 +1199,7 @@ static inline void drv_wake_tx_queue(struct ieee80211_local *local,
11991199

12001200
/* In reconfig don't transmit now, but mark for waking later */
12011201
if (local->in_reconfig) {
1202-
set_bit(IEEE80211_TXQ_STOP_NETIF_TX, &txq->flags);
1202+
set_bit(IEEE80211_TXQ_DIRTY, &txq->flags);
12031203
return;
12041204
}
12051205

net/mac80211/ht.c

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -391,6 +391,37 @@ void ieee80211_ba_session_work(struct work_struct *work)
391391

392392
tid_tx = sta->ampdu_mlme.tid_start_tx[tid];
393393
if (!blocked && tid_tx) {
394+
struct txq_info *txqi = to_txq_info(sta->sta.txq[tid]);
395+
struct ieee80211_sub_if_data *sdata =
396+
vif_to_sdata(txqi->txq.vif);
397+
struct fq *fq = &sdata->local->fq;
398+
399+
spin_lock_bh(&fq->lock);
400+
401+
/* Allow only frags to be dequeued */
402+
set_bit(IEEE80211_TXQ_STOP, &txqi->flags);
403+
404+
if (!skb_queue_empty(&txqi->frags)) {
405+
/* Fragmented Tx is ongoing, wait for it to
406+
* finish. Reschedule worker to retry later.
407+
*/
408+
409+
spin_unlock_bh(&fq->lock);
410+
spin_unlock_bh(&sta->lock);
411+
412+
/* Give the task working on the txq a chance
413+
* to send out the queued frags
414+
*/
415+
synchronize_net();
416+
417+
mutex_unlock(&sta->ampdu_mlme.mtx);
418+
419+
ieee80211_queue_work(&sdata->local->hw, work);
420+
return;
421+
}
422+
423+
spin_unlock_bh(&fq->lock);
424+
394425
/*
395426
* Assign it over to the normal tid_tx array
396427
* where it "goes live".

net/mac80211/ieee80211_i.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ enum txq_info_flags {
838838
IEEE80211_TXQ_STOP,
839839
IEEE80211_TXQ_AMPDU,
840840
IEEE80211_TXQ_NO_AMSDU,
841-
IEEE80211_TXQ_STOP_NETIF_TX,
841+
IEEE80211_TXQ_DIRTY,
842842
};
843843

844844
/**

net/mac80211/iface.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,9 @@ static int ieee80211_check_concurrent_iface(struct ieee80211_sub_if_data *sdata,
364364

365365
/* No support for VLAN with MLO yet */
366366
if (iftype == NL80211_IFTYPE_AP_VLAN &&
367-
nsdata->wdev.use_4addr)
367+
sdata->wdev.use_4addr &&
368+
nsdata->vif.type == NL80211_IFTYPE_AP &&
369+
nsdata->vif.valid_links)
368370
return -EOPNOTSUPP;
369371

370372
/*

0 commit comments

Comments
 (0)