1 From: Christian Lamparter <chunkeey@gmail.com>
2 Date: Sat, 16 Nov 2019 19:25:24 +0100
3 Subject: [PATCH] owl_loader: compatibility patch
5 This patch includes OpenWrt specific changes that are
6 not included in the upstream owl-loader.
8 This includes a platform data handling changes for ar71xx.
10 Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
12 --- a/drivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.c
13 +++ b/drivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.c
16 struct pci_dev *pdev = (struct pci_dev *)context;
17 struct owl_ctx *ctx = (struct owl_ctx *)pci_get_drvdata(pdev);
18 + struct ath9k_platform_data *pdata = dev_get_platdata(&pdev->dev);
21 complete(&ctx->eeprom_load);
27 + memcpy(pdata->eeprom_data, fw->data, fw->size);
30 + * eeprom has been successfully loaded - pass the data to ath9k
31 + * but remove the eeprom_name, so it doesn't try to load it too.
33 + pdata->eeprom_name = NULL;
36 if (ath9k_pci_fixup(pdev, (const u16 *)fw->data, fw->size))
40 static const char *owl_get_eeprom_name(struct pci_dev *pdev)
42 struct device *dev = &pdev->dev;
43 + struct ath9k_platform_data *pdata;
46 + /* try the existing platform data first */
47 + pdata = dev_get_platdata(dev);
48 + if (pdata && pdata->eeprom_name)
49 + return pdata->eeprom_name;
51 dev_dbg(dev, "using auto-generated eeprom filename\n");
53 eeprom_name = devm_kzalloc(dev, EEPROM_FILENAME_LEN, GFP_KERNEL);