All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ath9k: fix tx99 with monitor mode interface
@ 2018-08-20  9:37 Felix Fietkau
  2018-08-20 12:05 ` Kalle Valo
  2018-08-28 13:46 ` Kalle Valo
  0 siblings, 2 replies; 4+ messages in thread
From: Felix Fietkau @ 2018-08-20  9:37 UTC (permalink / raw)
  To: linux-wireless; +Cc: kvalo

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 <nbd@nbd.name>
---
 drivers/net/wireless/ath/ath9k/ath9k.h |  1 -
 drivers/net/wireless/ath/ath9k/main.c  | 12 +++---------
 drivers/net/wireless/ath/ath9k/tx99.c  |  9 ---------
 drivers/net/wireless/ath/ath9k/xmit.c  |  2 +-
 4 files changed, 4 insertions(+), 20 deletions(-)

diff --git a/drivers/net/wireless/ath/ath9k/ath9k.h b/drivers/net/wireless/ath/ath9k/ath9k.h
index 21ba20981a80..003e9fb456ac 100644
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
@@ -1074,7 +1074,6 @@ struct ath_softc {
 
 	struct ath_spec_scan_priv spec_priv;
 
-	struct ieee80211_vif *tx99_vif;
 	struct sk_buff *tx99_skb;
 	bool tx99_state;
 	s16 tx99_power;
diff --git a/drivers/net/wireless/ath/ath9k/main.c b/drivers/net/wireless/ath/ath9k/main.c
index 1049773378f2..fea1f17500aa 100644
--- a/drivers/net/wireless/ath/ath9k/main.c
+++ b/drivers/net/wireless/ath/ath9k/main.c
@@ -1251,15 +1251,10 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
 	struct ath_vif *avp = (void *)vif->drv_priv;
 	struct ath_node *an = &avp->mcast_node;
 
-	mutex_lock(&sc->mutex);
+	if (IS_ENABLED(CPTCFG_ATH9K_TX99))
+		return -EOPNOTSUPP;
 
-	if (IS_ENABLED(CONFIG_ATH9K_TX99)) {
-		if (sc->cur_chan->nvifs >= 1) {
-			mutex_unlock(&sc->mutex);
-			return -EOPNOTSUPP;
-		}
-		sc->tx99_vif = vif;
-	}
+	mutex_lock(&sc->mutex);
 
 	ath_dbg(common, CONFIG, "Attach a VIF of type: %d\n", vif->type);
 	sc->cur_chan->nvifs++;
@@ -1342,7 +1337,6 @@ static void ath9k_remove_interface(struct ieee80211_hw *hw,
 	ath9k_p2p_remove_vif(sc, vif);
 
 	sc->cur_chan->nvifs--;
-	sc->tx99_vif = NULL;
 	if (!ath9k_is_chanctx_enabled())
 		list_del(&avp->list);
 
diff --git a/drivers/net/wireless/ath/ath9k/tx99.c b/drivers/net/wireless/ath/ath9k/tx99.c
index ce50d8f5835e..9b05ffb68c34 100644
--- a/drivers/net/wireless/ath/ath9k/tx99.c
+++ b/drivers/net/wireless/ath/ath9k/tx99.c
@@ -54,12 +54,6 @@ static struct sk_buff *ath9k_build_tx99_skb(struct ath_softc *sc)
 	struct ieee80211_hdr *hdr;
 	struct ieee80211_tx_info *tx_info;
 	struct sk_buff *skb;
-	struct ath_vif *avp;
-
-	if (!sc->tx99_vif)
-		return NULL;
-
-	avp = (struct ath_vif *)sc->tx99_vif->drv_priv;
 
 	skb = alloc_skb(len, GFP_KERNEL);
 	if (!skb)
@@ -77,14 +71,11 @@ static struct sk_buff *ath9k_build_tx99_skb(struct ath_softc *sc)
 	memcpy(hdr->addr2, hw->wiphy->perm_addr, ETH_ALEN);
 	memcpy(hdr->addr3, hw->wiphy->perm_addr, ETH_ALEN);
 
-	hdr->seq_ctrl |= cpu_to_le16(avp->seq_no);
-
 	tx_info = IEEE80211_SKB_CB(skb);
 	memset(tx_info, 0, sizeof(*tx_info));
 	rate = &tx_info->control.rates[0];
 	tx_info->band = sc->cur_chan->chandef.chan->band;
 	tx_info->flags = IEEE80211_TX_CTL_NO_ACK;
-	tx_info->control.vif = sc->tx99_vif;
 	rate->count = 1;
 	if (ah->curchan && IS_CHAN_HT(ah->curchan)) {
 		rate->flags |= IEEE80211_TX_RC_MCS;
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c
index 43b6c8508e49..66b6a8872c06 100644
--- a/drivers/net/wireless/ath/ath9k/xmit.c
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
@@ -2973,7 +2973,7 @@ int ath9k_tx99_send(struct ath_softc *sc, struct sk_buff *skb,
 		return -EINVAL;
 	}
 
-	ath_set_rates(sc->tx99_vif, NULL, bf);
+	ath_set_rates(NULL, NULL, bf);
 
 	ath9k_hw_set_desc_link(sc->sc_ah, bf->bf_desc, bf->bf_daddr);
 	ath9k_hw_tx99_start(sc->sc_ah, txctl->txq->axq_qnum);
-- 
2.17.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] ath9k: fix tx99 with monitor mode interface
  2018-08-20  9:37 [PATCH] ath9k: fix tx99 with monitor mode interface Felix Fietkau
@ 2018-08-20 12:05 ` Kalle Valo
  2018-08-20 12:07   ` Felix Fietkau
  2018-08-28 13:46 ` Kalle Valo
  1 sibling, 1 reply; 4+ messages in thread
From: Kalle Valo @ 2018-08-20 12:05 UTC (permalink / raw)
  To: Felix Fietkau; +Cc: linux-wireless

Felix Fietkau <nbd@nbd.name> writes:

> 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 <nbd@nbd.name>

[...]

> --- a/drivers/net/wireless/ath/ath9k/main.c
> +++ b/drivers/net/wireless/ath/ath9k/main.c
> @@ -1251,15 +1251,10 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
>  	struct ath_vif *avp = (void *)vif->drv_priv;
>  	struct ath_node *an = &avp->mcast_node;
>  
> -	mutex_lock(&sc->mutex);
> +	if (IS_ENABLED(CPTCFG_ATH9K_TX99))
> +		return -EOPNOTSUPP;

Obviously this should be CONFIG_ATH9K_TX99, I'll fix that in the pending
branch.

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ath9k: fix tx99 with monitor mode interface
  2018-08-20 12:05 ` Kalle Valo
@ 2018-08-20 12:07   ` Felix Fietkau
  0 siblings, 0 replies; 4+ messages in thread
From: Felix Fietkau @ 2018-08-20 12:07 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-wireless

On 2018-08-20 14:05, Kalle Valo wrote:
> Felix Fietkau <nbd@nbd.name> writes:
> 
>> 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 <nbd@nbd.name>
> 
> [...]
> 
>> --- a/drivers/net/wireless/ath/ath9k/main.c
>> +++ b/drivers/net/wireless/ath/ath9k/main.c
>> @@ -1251,15 +1251,10 @@ static int ath9k_add_interface(struct ieee80211_hw *hw,
>>  	struct ath_vif *avp = (void *)vif->drv_priv;
>>  	struct ath_node *an = &avp->mcast_node;
>>  
>> -	mutex_lock(&sc->mutex);
>> +	if (IS_ENABLED(CPTCFG_ATH9K_TX99))
>> +		return -EOPNOTSUPP;
> 
> Obviously this should be CONFIG_ATH9K_TX99, I'll fix that in the pending
> branch.
Sorry about that, I'll be more careful next time.

Thanks,

- Felix

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] ath9k: fix tx99 with monitor mode interface
  2018-08-20  9:37 [PATCH] ath9k: fix tx99 with monitor mode interface Felix Fietkau
  2018-08-20 12:05 ` Kalle Valo
@ 2018-08-28 13:46 ` Kalle Valo
  1 sibling, 0 replies; 4+ messages in thread
From: Kalle Valo @ 2018-08-28 13:46 UTC (permalink / raw)
  To: Felix Fietkau; +Cc: linux-wireless

Felix Fietkau <nbd@nbd.name> wrote:

> 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 <nbd@nbd.name>
> [kvalo@codeaurora.org: s/CPTCFG/CONFIG/]
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

Patch applied to ath-next branch of ath.git, thanks.

d9c52fd17cb4 ath9k: fix tx99 with monitor mode interface

-- 
https://patchwork.kernel.org/patch/10570041/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-08-28 17:37 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-20  9:37 [PATCH] ath9k: fix tx99 with monitor mode interface Felix Fietkau
2018-08-20 12:05 ` Kalle Valo
2018-08-20 12:07   ` Felix Fietkau
2018-08-28 13:46 ` Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.