aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafał Miłecki <rafal@milecki.pl>2018-07-31 09:44:19 +0200
committerRafał Miłecki <rafal@milecki.pl>2018-07-31 09:45:03 +0200
commitfecbd91c7c12b5b1cfe894c2901083cc42863aae (patch)
tree73678da11db3e27385c5e45c7f85918983167a2d
parent7dcdf162225ae0392a68488ab31a15fc2f20608d (diff)
downloadupstream-fecbd91c7c12b5b1cfe894c2901083cc42863aae.tar.gz
upstream-fecbd91c7c12b5b1cfe894c2901083cc42863aae.tar.bz2
upstream-fecbd91c7c12b5b1cfe894c2901083cc42863aae.zip
mac80211: brcmfmac: backport patch for per-firmware features
This allows driver to support features that can't be dynamically discovered. Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
-rw-r--r--package/kernel/mac80211/patches/341-v4.19-brcmfmac-specify-some-features-per-firmware-version.patch84
1 files changed, 84 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/341-v4.19-brcmfmac-specify-some-features-per-firmware-version.patch b/package/kernel/mac80211/patches/341-v4.19-brcmfmac-specify-some-features-per-firmware-version.patch
new file mode 100644
index 0000000000..6ebcdfdf29
--- /dev/null
+++ b/package/kernel/mac80211/patches/341-v4.19-brcmfmac-specify-some-features-per-firmware-version.patch
@@ -0,0 +1,84 @@
+From 1e591c56a65fbbcd5754a4210a0ef0402d5e5f33 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <rafal@milecki.pl>
+Date: Mon, 9 Jul 2018 06:55:43 +0200
+Subject: [PATCH] brcmfmac: specify some features per firmware version
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Some features supported by firmware aren't advertised and there is no
+way for a driver to query them. This includes e.g. monitor mode details.
+
+Most firmwares support monitor interface but only the latest ones
+/announce/ it with a "monitor" flag in the "cap" iovar. There isn't any
+reliable detection method for older firmwares (BRCMF_C_MONITOR was tried
+but "it only indicates the core part of the stack supports").
+
+Similarly support for tagging monitor frames and building radiotap
+headers can't be reliably detected for all firmwares.
+
+This commit adds table that allows mapping features to firmware version.
+It adds mappings for 43602a1 and 4366b1 firmwares from
+linux-firmware.git. Both were confirmed to be passing monitor frames.
+
+Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
+Reviewed-by: Arend van Spriel <arend.vanspriel@broadcom.com>
+Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
+---
+ .../wireless/broadcom/brcm80211/brcmfmac/feature.c | 38 ++++++++++++++++++++++
+ 1 file changed, 38 insertions(+)
+
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/feature.c
+@@ -93,6 +93,42 @@ static int brcmf_feat_debugfs_read(struc
+ }
+ #endif /* DEBUG */
+
++struct brcmf_feat_fwfeat {
++ const char * const fwid;
++ u32 feat_flags;
++};
++
++static const struct brcmf_feat_fwfeat brcmf_feat_fwfeat_map[] = {
++ /* brcmfmac43602-pcie.ap.bin from linux-firmware.git commit ea1178515b88 */
++ { "01-6cb8e269", BIT(BRCMF_FEAT_MONITOR) },
++ /* brcmfmac4366b-pcie.bin from linux-firmware.git commit 52442afee990 */
++ { "01-c47a91a4", BIT(BRCMF_FEAT_MONITOR) },
++};
++
++static void brcmf_feat_firmware_overrides(struct brcmf_pub *drv)
++{
++ const struct brcmf_feat_fwfeat *e;
++ u32 feat_flags = 0;
++ int i;
++
++ for (i = 0; i < ARRAY_SIZE(brcmf_feat_fwfeat_map); i++) {
++ e = &brcmf_feat_fwfeat_map[i];
++ if (!strcmp(e->fwid, drv->fwver)) {
++ feat_flags = e->feat_flags;
++ break;
++ }
++ }
++
++ if (!feat_flags)
++ return;
++
++ for (i = 0; i < BRCMF_FEAT_LAST; i++)
++ if (feat_flags & BIT(i))
++ brcmf_dbg(INFO, "enabling firmware feature: %s\n",
++ brcmf_feat_names[i]);
++ drv->feat_flags |= feat_flags;
++}
++
+ /**
+ * brcmf_feat_iovar_int_get() - determine feature through iovar query.
+ *
+@@ -253,6 +289,8 @@ void brcmf_feat_attach(struct brcmf_pub
+ }
+ brcmf_feat_iovar_int_get(ifp, BRCMF_FEAT_FWSUP, "sup_wpa");
+
++ brcmf_feat_firmware_overrides(drvr);
++
+ /* set chip related quirks */
+ switch (drvr->bus_if->chip) {
+ case BRCM_CC_43236_CHIP_ID: