openwrt/target/linux/brcm63xx/patches-3.18/801-ssb_export_fallback_sprom.patch
Jonas Gorski 387fd3ca26 brcm63xx: add kernel 3.18 support
Add 3.18 support based on 3.18-rc6. Only netboot tested.

Signed-off-by: Jonas Gorski <jogo@openwrt.org>

SVN-Revision: 43461
2014-12-01 13:27:26 +00:00

32 lines
988 B
Diff

--- a/arch/mips/bcm63xx/sprom.c
+++ b/arch/mips/bcm63xx/sprom.c
@@ -8,6 +8,7 @@
*/
#include <linux/init.h>
+#include <linux/export.h>
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/platform_device.h>
@@ -387,7 +388,19 @@ struct fallback_sprom_match {
struct ssb_sprom sprom;
};
-static struct fallback_sprom_match fallback_sprom;
+struct fallback_sprom_match fallback_sprom;
+
+int bcm63xx_get_fallback_sprom(uint pci_bus, uint pci_slot, struct ssb_sprom *out)
+{
+ if (pci_bus != fallback_sprom.pci_bus ||
+ pci_slot != fallback_sprom.pci_dev)
+ pr_warn("fallback_sprom: pci bus/device num mismatch: expected %i/%i, but got %i/%i\n",
+ fallback_sprom.pci_bus, fallback_sprom.pci_dev,
+ pci_bus, pci_slot);
+ memcpy(out, &fallback_sprom.sprom, sizeof(struct ssb_sprom));
+ return 0;
+}
+EXPORT_SYMBOL(bcm63xx_get_fallback_sprom);
#if defined(CONFIG_SSB_PCIHOST)
int bcm63xx_get_fallback_ssb_sprom(struct ssb_bus *bus, struct ssb_sprom *out)