Skip to contentSkip to conversation

[3.3.8]: backport bcma_core_pci_up/down from 3.12

wireless Tijs Van Buggenhout 2 participants 2 messages Mar 14, 2014 – Apr 2, 2014

lore
Share & tools
lore
#0 lore raw

commit 6273720de27b0dbd278f823d9c99d40122f41d63

Author: Tijs Van Buggenhout <[email protected]>
Date:   Fri Mar 14 20:42:21 2014 +0100

Backport bcma_core_pci_up/down from 3.12

Compiling module b43 from compat-wireless-2014-01-23.1 for 3.3.8 kernel results in build errors like so:

...

  CC [M]  /compat-wireless-2014-01-23.1/compat/backport-3.13.o
  CC [M]  /compat-wireless-2014-01-23.1/compat/dma-shared-helpers.o
  LD [M]  /compat-wireless-2014-01-23.1/compat/compat.o
  CC [M]  /compat-wireless-2014-01-23.1/drivers/net/wireless/b43/main.o

/compat-wireless-2014-01-23.1/drivers/net/wireless/b43/main.c: In function 'b43_wireless_core_exit':
/compat-wireless-2014-01-23.1/drivers/net/wireless/b43/main.c:4680:3: error:
implicit declaration of function 'bcma_core_pci_down' [-Werror=implicit- function-declaration] /compat-wireless-2014-01-23.1/drivers/net/wireless/b43/main.c: In function 'b43_wireless_core_init':
/compat-wireless-2014-01-23.1/drivers/net/wireless/b43/main.c:4729:3: error:
implicit declaration of function 'bcma_core_pci_up' [-Werror=implicit- function-declaration]
cc1: some warnings being treated as errors

make[9]: *** [/compat-wireless-2014-01-23.1/drivers/net/wireless/b43/main.o] Error 1
make[8]: *** [/compat-wireless-2014-01-23.1/drivers/net/wireless/b43] Error 2 make[7]: *** [/compat-wireless-2014-01-23.1/drivers/net/wireless] Error 2 make[6]: *** [_module_/compat-wireless-2014-01-23.1] Error 2 make[5]: *** [modules] Error 2
make[4]: *** [modules] Error 2
make[3]: *** [modules] Error 2
make[3]: Leaving directory `/compat-wireless-2014-01-23.1' make[2]: *** [/compat-wireless-2014-01-23.1/.built] Error 2

bcma_core_pci_up and bcma_core_pci_down are used in b43/main.c and brcmsmac/main.c, but are only introduced in kernel 3.12.0. The following patch adds a backport of these functions for earlier kernel versions. Tested patch on b43 and ath9k driver.

--

backport/backport-include/linux/bcma/bcma_driver_pci.h new file +14 -0
new file mode 100644
index 0000000..5e52f04
@@ -0,0 +1,14 @@
+#ifndef __BACKPORT_BCMA_DRIVER_PCI_H
+#define __BACKPORT_BCMA_DRIVER_PCI_H
+#include_next <linux/bcma/bcma_driver_pci.h>
+#include <linux/version.h>
+
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3,12,0)
+struct bcma_bus;
+#define bcma_core_pci_up LINUX_BACKPORT(bcma_core_pci_up)
+extern void bcma_core_pci_up(struct bcma_bus *bus);
+#define bcma_core_pci_down LINUX_BACKPORT(bcma_core_pci_down)
+extern void bcma_core_pci_down(struct bcma_bus *bus);
+#endif
+
+#endif /* __BACKPORT_BCMA_DRIVER_PCI_H */
backport/compat/backport-3.12.c +30 -0
index 7e3dc58..5f0edb2 100644
@@ -27,3 +27,33 @@ u8 *hid_alloc_report_buf(struct hid_report *report, gfp_t flags)
 	return kmalloc(len, flags);
 }
 EXPORT_SYMBOL_GPL(hid_alloc_report_buf);
+
+#if defined(CONFIG_BCMA) || defined(CONFIG_BCMA_MODULE)
+#include <linux/bcma/bcma.h>
+
+void bcma_core_pci_up(struct bcma_bus *bus)
+{
+	struct bcma_drv_pci *pc;
+
+	if (bus->hosttype != BCMA_HOSTTYPE_PCI)
+		return;
+
+	pc = &bus->drv_pci[0];
+
+	bcma_core_pci_extend_L1timer(pc, true);
+}
+EXPORT_SYMBOL_GPL(bcma_core_pci_up);
+
+void bcma_core_pci_down(struct bcma_bus *bus)
+{
+	struct bcma_drv_pci *pc;
+
+	if (bus->hosttype != BCMA_HOSTTYPE_PCI)
+		return;
+
+	pc = &bus->drv_pci[0];
+
+	bcma_core_pci_extend_L1timer(pc, false);
+}
+EXPORT_SYMBOL_GPL(bcma_core_pci_down);
+#endif
#1 lore raw
Quoted 2 lines · Tijs Van Buggenhout

+ bcma_core_pci_extend_L1timer(pc, true);

This is is a static routine defined elsewhere in the kernel and will break compilation. This patch breaks compilation, please try reading drivers/bcma/driver_pci.c and look for a better way to backport this. Also please try to test patches with 'ckmake --allyesconfig' for patches like this after first having used backports-update-manager to update your system.

Luis