Skip to content

Commit d9c52fd

Browse files
nbd168Kalle Valo
authored and
Kalle Valo
committed
ath9k: fix tx99 with monitor mode interface
Tx99 is typically configured via a monitor mode interface, which does not get added to the driver as a vif. Since the code currently expects a configured virtual interface for tx99, enabling tx99 via debugfs fails. Since the vif is not needed anyway, remove all checks for it. Signed-off-by: Felix Fietkau <[email protected]> [[email protected]: s/CPTCFG/CONFIG/] Signed-off-by: Kalle Valo <[email protected]>
1 parent a2f73a1 commit d9c52fd

File tree

4 files changed

+4
-20
lines changed

4 files changed

+4
-20
lines changed

drivers/net/wireless/ath/ath9k/ath9k.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1074,7 +1074,6 @@ struct ath_softc {
10741074

10751075
struct ath_spec_scan_priv spec_priv;
10761076

1077-
struct ieee80211_vif *tx99_vif;
10781077
struct sk_buff *tx99_skb;
10791078
bool tx99_state;
10801079
s16 tx99_power;

drivers/net/wireless/ath/ath9k/main.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,15 +1251,10 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
12511251
struct ath_vif *avp = (void *)vif->drv_priv;
12521252
struct ath_node *an = &avp->mcast_node;
12531253

1254-
mutex_lock(&sc->mutex);
1254+
if (IS_ENABLED(CONFIG_ATH9K_TX99))
1255+
return -EOPNOTSUPP;
12551256

1256-
if (IS_ENABLED(CONFIG_ATH9K_TX99)) {
1257-
if (sc->cur_chan->nvifs >= 1) {
1258-
mutex_unlock(&sc->mutex);
1259-
return -EOPNOTSUPP;
1260-
}
1261-
sc->tx99_vif = vif;
1262-
}
1257+
mutex_lock(&sc->mutex);
12631258

12641259
ath_dbg(common, CONFIG, "Attach a VIF of type: %d\n", vif->type);
12651260
sc->cur_chan->nvifs++;
@@ -1342,7 +1337,6 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw,
13421337
ath9k_p2p_remove_vif(sc, vif);
13431338

13441339
sc->cur_chan->nvifs--;
1345-
sc->tx99_vif = NULL;
13461340
if (!ath9k_is_chanctx_enabled())
13471341
list_del(&avp->list);
13481342

drivers/net/wireless/ath/ath9k/tx99.c

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,12 +54,6 @@ static struct sk_buff *ath9k_build_tx99_skb(struct ath_softc *sc)
5454
struct ieee80211_hdr *hdr;
5555
struct ieee80211_tx_info *tx_info;
5656
struct sk_buff *skb;
57-
struct ath_vif *avp;
58-
59-
if (!sc->tx99_vif)
60-
return NULL;
61-
62-
avp = (struct ath_vif *)sc->tx99_vif->drv_priv;
6357

6458
skb = alloc_skb(len, GFP_KERNEL);
6559
if (!skb)
@@ -77,14 +71,11 @@ static struct sk_buff *ath9k_build_tx99_skb(struct ath_softc *sc)
7771
memcpy(hdr->addr2, hw->wiphy->perm_addr, ETH_ALEN);
7872
memcpy(hdr->addr3, hw->wiphy->perm_addr, ETH_ALEN);
7973

80-
hdr->seq_ctrl |= cpu_to_le16(avp->seq_no);
81-
8274
tx_info = IEEE80211_SKB_CB(skb);
8375
memset(tx_info, 0, sizeof(*tx_info));
8476
rate = &tx_info->control.rates[0];
8577
tx_info->band = sc->cur_chan->chandef.chan->band;
8678
tx_info->flags = IEEE80211_TX_CTL_NO_ACK;
87-
tx_info->control.vif = sc->tx99_vif;
8879
rate->count = 1;
8980
if (ah->curchan && IS_CHAN_HT(ah->curchan)) {
9081
rate->flags |= IEEE80211_TX_RC_MCS;

drivers/net/wireless/ath/ath9k/xmit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2973,7 +2973,7 @@ int ath9k_tx99_send(struct ath_softc *sc, struct sk_buff *skb,
29732973
return -EINVAL;
29742974
}
29752975

2976-
ath_set_rates(sc->tx99_vif, NULL, bf);
2976+
ath_set_rates(NULL, NULL, bf);
29772977

29782978
ath9k_hw_set_desc_link(sc->sc_ah, bf->bf_desc, bf->bf_daddr);
29792979
ath9k_hw_tx99_start(sc->sc_ah, txctl->txq->axq_qnum);

0 commit comments

Comments
 (0)