801-ssb_export_fallback_sprom.patch 988 B

12345678910111213141516171819202122232425262728293031
  1. --- a/arch/mips/bcm63xx/sprom.c
  2. +++ b/arch/mips/bcm63xx/sprom.c
  3. @@ -8,6 +8,7 @@
  4. */
  5. #include <linux/init.h>
  6. +#include <linux/export.h>
  7. #include <linux/kernel.h>
  8. #include <linux/string.h>
  9. #include <linux/platform_device.h>
  10. @@ -387,7 +388,19 @@ struct fallback_sprom_match {
  11. struct ssb_sprom sprom;
  12. };
  13. -static struct fallback_sprom_match fallback_sprom;
  14. +struct fallback_sprom_match fallback_sprom;
  15. +
  16. +int bcm63xx_get_fallback_sprom(uint pci_bus, uint pci_slot, struct ssb_sprom *out)
  17. +{
  18. + if (pci_bus != fallback_sprom.pci_bus ||
  19. + pci_slot != fallback_sprom.pci_dev)
  20. + pr_warn("fallback_sprom: pci bus/device num mismatch: expected %i/%i, but got %i/%i\n",
  21. + fallback_sprom.pci_bus, fallback_sprom.pci_dev,
  22. + pci_bus, pci_slot);
  23. + memcpy(out, &fallback_sprom.sprom, sizeof(struct ssb_sprom));
  24. + return 0;
  25. +}
  26. +EXPORT_SYMBOL(bcm63xx_get_fallback_sprom);
  27. #if defined(CONFIG_SSB_PCIHOST)
  28. int bcm63xx_get_fallback_ssb_sprom(struct ssb_bus *bus, struct ssb_sprom *out)