Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de> Tested-by: Koen Vandeputte <koen.vandeputte@ncentric.com>master
parent
b1ef0e4437
commit
e30ca0d90a
@ -1,92 +0,0 @@ |
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Mon, 20 Aug 2018 11:35:05 +0200
|
||||
Subject: [PATCH] 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 <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- 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;
|
||||
--- 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 ie
|
||||
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(CPTCFG_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(struc
|
||||
ath9k_p2p_remove_vif(sc, vif);
|
||||
|
||||
sc->cur_chan->nvifs--;
|
||||
- sc->tx99_vif = NULL;
|
||||
if (!ath9k_is_chanctx_enabled())
|
||||
list_del(&avp->list);
|
||||
|
||||
--- 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_
|
||||
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_
|
||||
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;
|
||||
--- a/drivers/net/wireless/ath/ath9k/xmit.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
|
||||
@@ -2974,7 +2974,7 @@ int ath9k_tx99_send(struct ath_softc *sc
|
||||
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);
|
@ -1,96 +0,0 @@ |
||||
From: Felix Fietkau <nbd@nbd.name>
|
||||
Date: Sat, 22 Sep 2018 15:20:50 +0200
|
||||
Subject: [PATCH] ath9k: add back support for using active monitor interfaces
|
||||
for tx99
|
||||
|
||||
Various documented examples on how to set up tx99 with ath9k rely
|
||||
on setting up a regular monitor interface for setting the channel.
|
||||
My previous patch "ath9k: fix tx99 with monitor mode interface" made
|
||||
it possible to set it up this way again. However, it was removing support
|
||||
for using an active monitor interface, which is required for controlling
|
||||
the bitrate as well, since the bitrate is not passed down with a regular
|
||||
monitor interface.
|
||||
|
||||
This patch partially reverts the previous one, but keeps support for using
|
||||
a regular monitor interface to keep documented steps working in cases
|
||||
where the bitrate does not matter
|
||||
|
||||
Fixes: d9c52fd17cb48 ("ath9k: fix tx99 with monitor mode interface")
|
||||
Signed-off-by: Felix Fietkau <nbd@nbd.name>
|
||||
---
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath9k/ath9k.h
|
||||
+++ b/drivers/net/wireless/ath/ath9k/ath9k.h
|
||||
@@ -1074,6 +1074,7 @@ 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;
|
||||
--- a/drivers/net/wireless/ath/ath9k/main.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/main.c
|
||||
@@ -1251,8 +1251,13 @@ static int ath9k_add_interface(struct ie
|
||||
struct ath_vif *avp = (void *)vif->drv_priv;
|
||||
struct ath_node *an = &avp->mcast_node;
|
||||
|
||||
- if (IS_ENABLED(CPTCFG_ATH9K_TX99))
|
||||
- return -EOPNOTSUPP;
|
||||
+ if (IS_ENABLED(CPTCFG_ATH9K_TX99)) {
|
||||
+ if (sc->cur_chan->nvifs >= 1) {
|
||||
+ mutex_unlock(&sc->mutex);
|
||||
+ return -EOPNOTSUPP;
|
||||
+ }
|
||||
+ sc->tx99_vif = vif;
|
||||
+ }
|
||||
|
||||
mutex_lock(&sc->mutex);
|
||||
|
||||
@@ -1337,6 +1342,7 @@ static void ath9k_remove_interface(struc
|
||||
ath9k_p2p_remove_vif(sc, vif);
|
||||
|
||||
sc->cur_chan->nvifs--;
|
||||
+ sc->tx99_vif = NULL;
|
||||
if (!ath9k_is_chanctx_enabled())
|
||||
list_del(&avp->list);
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath9k/tx99.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/tx99.c
|
||||
@@ -54,6 +54,7 @@ static struct sk_buff *ath9k_build_tx99_
|
||||
struct ieee80211_hdr *hdr;
|
||||
struct ieee80211_tx_info *tx_info;
|
||||
struct sk_buff *skb;
|
||||
+ struct ath_vif *avp;
|
||||
|
||||
skb = alloc_skb(len, GFP_KERNEL);
|
||||
if (!skb)
|
||||
@@ -71,11 +72,17 @@ static struct sk_buff *ath9k_build_tx99_
|
||||
memcpy(hdr->addr2, hw->wiphy->perm_addr, ETH_ALEN);
|
||||
memcpy(hdr->addr3, hw->wiphy->perm_addr, ETH_ALEN);
|
||||
|
||||
+ if (sc->tx99_vif) {
|
||||
+ avp = (struct ath_vif *) sc->tx99_vif->drv_priv;
|
||||
+ 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;
|
||||
--- a/drivers/net/wireless/ath/ath9k/xmit.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/xmit.c
|
||||
@@ -2974,7 +2974,7 @@ int ath9k_tx99_send(struct ath_softc *sc
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
- ath_set_rates(NULL, NULL, bf);
|
||||
+ ath_set_rates(sc->tx99_vif, 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);
|
@ -1,39 +0,0 @@ |
||||
From bbf0a8af2261bc7ae39b227ff6a1e9f45a008c27 Mon Sep 17 00:00:00 2001
|
||||
From: Sven Eckelmann <sven.eckelmann@openmesh.com>
|
||||
Date: Mon, 30 Jul 2018 17:31:41 +0200
|
||||
Subject: [PATCH] ath10k: Limit available channels via DT ieee80211-freq-limit
|
||||
|
||||
Tri-band devices (1x 2.4GHz + 2x 5GHz) often incorporate special filters in
|
||||
the RX and TX path. These filtered channel can in theory still be used by
|
||||
the hardware but the signal strength is reduced so much that it makes no
|
||||
sense.
|
||||
|
||||
There is already a DT property to limit the available channels but ath10k
|
||||
has to manually call this functionality to limit the currrently set wiphy
|
||||
channels further.
|
||||
|
||||
Signed-off-by: Sven Eckelmann <sven.eckelmann@openmesh.com>
|
||||
|
||||
Forwarded: https://patchwork.kernel.org/patch/10549245/
|
||||
---
|
||||
drivers/net/wireless/ath/ath10k/mac.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
--- a/drivers/net/wireless/ath/ath10k/mac.c
|
||||
+++ b/drivers/net/wireless/ath/ath10k/mac.c
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
#include "mac.h"
|
||||
|
||||
+#include <net/cfg80211.h>
|
||||
#include <net/mac80211.h>
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/acpi.h>
|
||||
@@ -8394,6 +8395,7 @@ int ath10k_mac_register(struct ath10k *a
|
||||
ar->hw->wiphy->bands[NL80211_BAND_5GHZ] = band;
|
||||
}
|
||||
|
||||
+ wiphy_read_of_freq_limits(ar->hw->wiphy);
|
||||
ath10k_mac_setup_ht_vht_cap(ar);
|
||||
|
||||
ar->hw->wiphy->interface_modes =
|
@ -1,38 +0,0 @@ |
||||
From cb18e2e9ec71d42409a51b83546686c609780dde Mon Sep 17 00:00:00 2001
|
||||
From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
|
||||
Date: Wed, 22 Aug 2018 15:22:15 +0200
|
||||
Subject: [PATCH] brcmfmac: fix wrong strnchr usage
|
||||
|
||||
strnchr takes arguments in the order of its name: string, max bytes to
|
||||
read, character to search for. Here we're passing '\n' aka 10 as the
|
||||
buffer size, and searching for sizeof(buf) aka BRCMF_DCMD_SMLEN aka
|
||||
256 (aka '\0', since it's implicitly converted to char) within those 10
|
||||
bytes.
|
||||
|
||||
Just interchanging the last two arguments would still leave a bug,
|
||||
because if we've been successful once, there are not sizeof(buf)
|
||||
characters left after the new value of p.
|
||||
|
||||
Since clmver is immediately afterwards passed as a %s argument, I assume
|
||||
that it is actually a properly nul-terminated string. For that case, we
|
||||
have strreplace().
|
||||
|
||||
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
|
||||
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
|
||||
---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c | 4 +---
|
||||
1 file changed, 1 insertion(+), 3 deletions(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/common.c
|
||||
@@ -296,9 +296,7 @@ int brcmf_c_preinit_dcmds(struct brcmf_i
|
||||
/* Replace all newline/linefeed characters with space
|
||||
* character
|
||||
*/
|
||||
- ptr = clmver;
|
||||
- while ((ptr = strnchr(ptr, '\n', sizeof(buf))) != NULL)
|
||||
- *ptr = ' ';
|
||||
+ strreplace(clmver, '\n', ' ');
|
||||
|
||||
brcmf_dbg(INFO, "CLM version = %s\n", clmver);
|
||||
}
|
@ -1,28 +0,0 @@ |
||||
From: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
Date: Wed, 5 Sep 2018 09:48:59 +0200
|
||||
Subject: [PATCH] brcmfmac: increase buffer for obtaining firmware capabilities
|
||||
|
||||
When obtaining the firmware capability a buffer is provided of 512
|
||||
bytes. However, if all features in firmware are supported the buffer
|
||||
needs to be 565 bytes as otherwise truncated information is retrieved
|
||||
from firmware. Increasing the buffer to 768 bytes on stack.
|
||||
|
||||
Reviewed-by: Hante Meuleman <hante.meuleman@broadcom.com>
|
||||
Reviewed-by: Pieter-Paul Giesberts <pieter-paul.giesberts@broadcom.com>
|
||||
Reviewed-by: Franky Lin <franky.lin@broadcom.com>
|
||||
Signed-off-by: Arend van Spriel <arend.vanspriel@broadcom.com>
|
||||
---
|
||||
drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c
|
||||
+++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c
|
||||
@@ -178,7 +178,7 @@ static void brcmf_feat_iovar_data_set(st
|
||||
ifp->fwil_fwerr = false;
|
||||
}
|
||||
|
||||
-#define MAX_CAPS_BUFFER_SIZE 512
|
||||
+#define MAX_CAPS_BUFFER_SIZE 768
|
||||
static void brcmf_feat_firmware_capabilities(struct brcmf_if *ifp)
|
||||
{
|
||||
char caps[MAX_CAPS_BUFFER_SIZE];
|
@ -1,68 +0,0 @@ |
||||
From e3c57dd949835419cee8d3b45db38de58bf6ebd5 Mon Sep 17 00:00:00 2001
|
||||
From: Hauke Mehrtens <hauke@hauke-m.de>
|
||||
Date: Mon, 18 Nov 2019 01:13:37 +0100
|
||||
Subject: [PATCH] backports: Adapt to changes to skb_get_hash_perturb()
|
||||
|
||||
The skb_get_hash_perturb() function now takes a siphash_key_t instead of
|
||||
an u32. This was changed in commit 55667441c84f ("net/flow_dissector:
|
||||
switch to siphash"). Use the correct type in the fq header file
|
||||
depending on the kernel version.
|
||||
|
||||
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
|
||||
---
|
||||
include/net/fq.h | 8 ++++++++
|
||||
include/net/fq_impl.h | 8 ++++++++
|
||||
2 files changed, 16 insertions(+)
|
||||
|
||||
--- a/include/net/fq.h
|
||||
+++ b/include/net/fq.h
|
||||
@@ -70,7 +70,15 @@ struct fq {
|
||||
struct list_head backlogs;
|
||||
spinlock_t lock;
|
||||
u32 flows_cnt;
|
||||
+#if LINUX_VERSION_IS_GEQ(5,3,10) || \
|
||||
+ LINUX_VERSION_IN_RANGE(4,19,83, 4,20,0) || \
|
||||
+ LINUX_VERSION_IN_RANGE(4,14,153, 4,15,0) || \
|
||||
+ LINUX_VERSION_IN_RANGE(4,9,200, 4,10,0) || \
|
||||
+ LINUX_VERSION_IN_RANGE(4,4,200, 4,5,0)
|
||||
+ siphash_key_t perturbation;
|
||||
+#else
|
||||
u32 perturbation;
|
||||
+#endif
|
||||
u32 limit;
|
||||
u32 memory_limit;
|
||||
u32 memory_usage;
|
||||
--- a/include/net/fq_impl.h
|
||||
+++ b/include/net/fq_impl.h
|
||||
@@ -109,7 +109,15 @@ begin:
|
||||
|
||||
static u32 fq_flow_idx(struct fq *fq, struct sk_buff *skb)
|
||||
{
|
||||
+#if LINUX_VERSION_IS_GEQ(5,3,10) || \
|
||||
+ LINUX_VERSION_IN_RANGE(4,19,83, 4,20,0) || \
|
||||
+ LINUX_VERSION_IN_RANGE(4,14,153, 4,15,0) || \
|
||||
+ LINUX_VERSION_IN_RANGE(4,9,200, 4,10,0) || \
|
||||
+ LINUX_VERSION_IN_RANGE(4,4,200, 4,5,0)
|
||||
+ u32 hash = skb_get_hash_perturb(skb, &fq->perturbation);
|
||||
+#else
|
||||
u32 hash = skb_get_hash_perturb(skb, fq->perturbation);
|
||||
+#endif
|
||||
|
||||
return reciprocal_scale(hash, fq->flows_cnt);
|
||||
}
|
||||
@@ -309,7 +317,15 @@ static int fq_init(struct fq *fq, int fl
|
||||
INIT_LIST_HEAD(&fq->backlogs);
|
||||
spin_lock_init(&fq->lock);
|
||||
fq->flows_cnt = max_t(u32, flows_cnt, 1);
|
||||
+#if LINUX_VERSION_IS_GEQ(5,3,10) || \
|
||||
+ LINUX_VERSION_IN_RANGE(4,19,83, 4,20,0) || \
|
||||
+ LINUX_VERSION_IN_RANGE(4,14,153, 4,15,0) || \
|
||||
+ LINUX_VERSION_IN_RANGE(4,9,200, 4,10,0) || \
|
||||
+ LINUX_VERSION_IN_RANGE(4,4,200, 4,5,0)
|
||||
+ get_random_bytes(&fq->perturbation, sizeof(fq->perturbation));
|
||||
+#else
|
||||
fq->perturbation = prandom_u32();
|
||||
+#endif
|
||||
fq->quantum = 300;
|
||||
fq->limit = 8192;
|
||||
fq->memory_limit = 16 << 20; /* 16 MBytes */
|
Loading…
Reference in new issue