aboutsummaryrefslogtreecommitdiffstats
path: root/package/kernel/mac80211/patches/ath/120-owl-loader-compat.patch
diff options
context:
space:
mode:
authorChristian Lamparter <chunkeey@gmail.com>2019-11-16 17:08:07 +0100
committerChristian Lamparter <chunkeey@gmail.com>2019-11-30 13:21:20 +0100
commit82a741c774dc1aa1e2c2e4b2e445bf79158de1a1 (patch)
tree04f0e6391a0c5967854abd0e2163397786546e23 /package/kernel/mac80211/patches/ath/120-owl-loader-compat.patch
parentf1410902e6c089a53935ab44e83207e877445bc5 (diff)
downloadupstream-82a741c774dc1aa1e2c2e4b2e445bf79158de1a1.tar.gz
upstream-82a741c774dc1aa1e2c2e4b2e445bf79158de1a1.tar.bz2
upstream-82a741c774dc1aa1e2c2e4b2e445bf79158de1a1.zip
mac80211: switch to upstream owl-loader driver
The Owl Loader (named after the codename that Atheros gave these devices back in the day) has been accepted upstream. This patch removes the "misc" driver OpenWrt had and adds the remaining differences against the version that ships with 5.4-rc1 into a separate "120-owl-loader-compat.patch" file that can be cut down once AR71XX is being dealt with. Note: I decided to keep the existing (kmod-)owl-loader package name around for now. The kernel module file in the kmod package will be called ath9k_pci_owl_loader.ko though. Acked-by: Hauke Mehrtens <hauke@hauke-m.de> Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
Diffstat (limited to 'package/kernel/mac80211/patches/ath/120-owl-loader-compat.patch')
-rw-r--r--package/kernel/mac80211/patches/ath/120-owl-loader-compat.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/package/kernel/mac80211/patches/ath/120-owl-loader-compat.patch b/package/kernel/mac80211/patches/ath/120-owl-loader-compat.patch
new file mode 100644
index 0000000000..afd5e3eef0
--- /dev/null
+++ b/package/kernel/mac80211/patches/ath/120-owl-loader-compat.patch
@@ -0,0 +1,53 @@
+From: Christian Lamparter <chunkeey@gmail.com>
+Date: Sat, 16 Nov 2019 19:25:24 +0100
+Subject: [PATCH] owl_loader: compatibility patch
+
+This patch includes OpenWrt specific changes that are
+not included in the upstream owl-loader.
+
+This includes a platform data handling changes for ar71xx.
+
+Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
+
+--- a/drivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.c
++++ b/drivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.c
+@@ -104,6 +104,7 @@
+ {
+ struct pci_dev *pdev = (struct pci_dev *)context;
+ struct owl_ctx *ctx = (struct owl_ctx *)pci_get_drvdata(pdev);
++ struct ath9k_platform_data *pdata = dev_get_platdata(&pdev->dev);
+ struct pci_bus *bus;
+
+ complete(&ctx->eeprom_load);
+@@ -121,6 +122,16 @@
+ goto release;
+ }
+
++ if (pdata) {
++ memcpy(pdata->eeprom_data, fw->data, fw->size);
++
++ /*
++ * eeprom has been successfully loaded - pass the data to ath9k
++ * but remove the eeprom_name, so it doesn't try to load it too.
++ */
++ pdata->eeprom_name = NULL;
++ }
++
+ if (ath9k_pci_fixup(pdev, (const u16 *)fw->data, fw->size))
+ goto release;
+
+@@ -138,8 +149,14 @@
+ static const char *owl_get_eeprom_name(struct pci_dev *pdev)
+ {
+ struct device *dev = &pdev->dev;
++ struct ath9k_platform_data *pdata;
+ char *eeprom_name;
+
++ /* try the existing platform data first */
++ pdata = dev_get_platdata(dev);
++ if (pdata && pdata->eeprom_name)
++ return pdata->eeprom_name;
++
+ dev_dbg(dev, "using auto-generated eeprom filename\n");
+
+ eeprom_name = devm_kzalloc(dev, EEPROM_FILENAME_LEN, GFP_KERNEL);