diff options
Diffstat (limited to 'package/broadcom-wl/patches')
-rw-r--r-- | package/broadcom-wl/patches/005-fix-mem-leak-on-unload.patch (renamed from package/broadcom-wl/patches/006-fix-mem-leak-on-unload.patch) | 0 | ||||
-rw-r--r-- | package/broadcom-wl/patches/006-generic-dma-api.patch | 4 | ||||
-rw-r--r-- | package/broadcom-wl/patches/007-add-bcma-support.patch | 184 | ||||
-rw-r--r-- | package/broadcom-wl/patches/910-fallback-sprom.patch | 2 |
4 files changed, 187 insertions, 3 deletions
diff --git a/package/broadcom-wl/patches/006-fix-mem-leak-on-unload.patch b/package/broadcom-wl/patches/005-fix-mem-leak-on-unload.patch index 41c246f..41c246f 100644 --- a/package/broadcom-wl/patches/006-fix-mem-leak-on-unload.patch +++ b/package/broadcom-wl/patches/005-fix-mem-leak-on-unload.patch diff --git a/package/broadcom-wl/patches/006-generic-dma-api.patch b/package/broadcom-wl/patches/006-generic-dma-api.patch index a4ac1d8..a90bbe1 100644 --- a/package/broadcom-wl/patches/006-generic-dma-api.patch +++ b/package/broadcom-wl/patches/006-generic-dma-api.patch @@ -11,8 +11,8 @@ Signed-off-by: George Kashperko <george@znau.edu.ua> --- driver/linux_osl.c | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) ---- broadcom-wl-5.10.56.27.3.orig/driver/linux_osl.c 2011-05-17 23:40:00.000000000 +0300 -+++ broadcom-wl-5.10.56.27.3/driver/linux_osl.c 2011-05-17 23:46:01.000000000 +0300 +--- a/driver/linux_osl.c ++++ b/driver/linux_osl.c @@ -25,6 +25,9 @@ #include <asm/paccess.h> #endif /* mips */ diff --git a/package/broadcom-wl/patches/007-add-bcma-support.patch b/package/broadcom-wl/patches/007-add-bcma-support.patch new file mode 100644 index 0000000..2639abc --- /dev/null +++ b/package/broadcom-wl/patches/007-add-bcma-support.patch @@ -0,0 +1,184 @@ +--- a/driver/wl_linux.c ++++ b/driver/wl_linux.c +@@ -85,10 +85,9 @@ typedef void wlc_hw_info_t; + #include <bcmjtag.h> + #endif /* BCMJTAG */ + +- +-#ifdef CONFIG_SSB +-#include <linux/ssb/ssb.h> +-#endif ++#if defined(CONFIG_SSB) || defined(CONFIG_BCMA) ++#include <wl_glue.h> ++#endif /* defined(CONFIG_SSB) || defined(CONFIG_BCMA) */ + + /* Linux wireless extension support */ + #ifdef CONFIG_WIRELESS_EXT +@@ -997,62 +996,32 @@ static struct pci_driver wl_pci_driver = + #endif /* CONFIG_PCI */ + #endif + ++#ifdef BCMJTAG ++static bcmjtag_driver_t wl_jtag_driver = { ++ wl_jtag_probe, ++ wl_jtag_detach, ++ wl_jtag_poll, ++ }; ++#endif /* BCMJTAG */ + +-static int wl_ssb_probe(struct ssb_device *dev, const struct ssb_device_id *id) ++#if defined(CONFIG_SSB) || defined(CONFIG_BCMA) ++static void * glue_attach_cb(u16 vendor, u16 device, ++ ulong mmio, void *dev, u32 irq) + { +- wl_info_t *wl; +- void *mmio; +- +- if (dev->bus->bustype != SSB_BUSTYPE_SSB) { +- printk("Attaching to SSB behind PCI is not supported. Please remove the b43 ssb bridge\n"); +- return -EINVAL; +- } +- +- mmio = (void *) 0x18000000 + dev->core_index * 0x1000; +- wl = wl_attach(id->vendor, id->coreid, (ulong) mmio, SI_BUS, dev, dev->irq); +- if (!wl) { +- printk("wl_attach failed\n"); +- return -ENODEV; +- } +- +- ssb_set_drvdata(dev, wl); +- +- return 0; ++ return wl_attach(vendor, device, mmio, SI_BUS, dev, irq); + } + +-static void wl_ssb_remove(struct ssb_device *dev) ++static void glue_remove_cb(void *wldev) + { +- wl_info_t *wl = (wl_info_t *) ssb_get_drvdata(dev); ++ wl_info_t *wl = (wl_info_t *)wldev; + + WL_LOCK(wl); + WL_APSTA_UPDN(("wl%d (%s): wl_remove() -> wl_down()\n", wl->pub->unit, wl->dev->name)); + wl_down(wl); + WL_UNLOCK(wl); + wl_free(wl); +- ssb_set_drvdata(dev, NULL); + } +- +-static const struct ssb_device_id wl_ssb_tbl[] = { +- SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, SSB_ANY_REV), +- SSB_DEVTABLE_END +-}; +- +-#ifdef CONFIG_SSB +-static struct ssb_driver wl_ssb_driver = { +- .name = KBUILD_MODNAME, +- .id_table = wl_ssb_tbl, +- .probe = wl_ssb_probe, +- .remove = wl_ssb_remove, +-}; +-#endif +- +-#ifdef BCMJTAG +-static bcmjtag_driver_t wl_jtag_driver = { +- wl_jtag_probe, +- wl_jtag_detach, +- wl_jtag_poll, +- }; +-#endif /* BCMJTAG */ ++#endif/* defined(CONFIG_SSB) || defined(CONFIG_BCMA) */ + + + /** +@@ -1067,11 +1036,13 @@ wl_module_init(void) + { + int error = -ENODEV; + +-#ifdef CONFIG_SSB +- error = ssb_driver_register(&wl_ssb_driver); ++#if defined(CONFIG_SSB) || defined(CONFIG_BCMA) ++ wl_glue_set_attach_callback(&glue_attach_cb); ++ wl_glue_set_remove_callback(&glue_remove_cb); ++ error = wl_glue_register(); + if (error) + return error; +-#endif /* CONFIG_SSB */ ++#endif /* defined(CONFIG_SSB) || defined(CONFIG_BCMA) */ + + #ifdef CONFIG_PCI + error = pci_register_driver(&wl_pci_driver); +@@ -1082,7 +1053,9 @@ wl_module_init(void) + return 0; + + error_pci: +- ssb_driver_unregister(&wl_ssb_driver); ++#if defined(CONFIG_SSB) || defined(CONFIG_BCMA) ++ wl_glue_unregister(); ++#endif /* defined(CONFIG_SSB) || defined(CONFIG_BCMA) */ + return error; + } + +@@ -1099,9 +1072,9 @@ wl_module_exit(void) + #ifdef CONFIG_PCI + pci_unregister_driver(&wl_pci_driver); + #endif /* CONFIG_PCI */ +-#ifdef CONFIG_SSB +- ssb_driver_unregister(&wl_ssb_driver); +-#endif /* CONFIG_SSB */ ++#if defined(CONFIG_SSB) || defined(CONFIG_BCMA) ++ wl_glue_unregister(); ++#endif /* defined(CONFIG_SSB) || defined(CONFIG_BCMA) */ + } + + module_init(wl_module_init); +--- a/driver/linux_osl.c ++++ b/driver/linux_osl.c +@@ -25,9 +25,9 @@ + #include <asm/paccess.h> + #endif /* mips */ + #include <pcicfg.h> +-#ifdef CONFIG_SSB +-#include <linux/ssb/ssb.h> +-#endif ++#if defined(CONFIG_SSB) || defined(CONFIG_BCMA) ++#include <wl_glue.h> ++#endif /* defined(CONFIG_SSB) || defined(CONFIG_BCMA) */ + + #define PCI_CFG_RETRY 10 + +@@ -370,15 +370,17 @@ osl_dma_consistent_align(void) + static struct device * + osl_get_dmadev(osl_t *osh) + { +-#ifdef CONFIG_SSB ++#if defined(CONFIG_SSB) || defined(CONFIG_BCMA) + if (osh->bustype == SI_BUS) { +- /* This can be SiliconBackplane emulated as pci with Broadcom or +- * ssb device. Less harmful is to check for pci_bus_type and if +- * no match then assume we got ssb */ ++ /* This can be SiliconBackplane emulated as pci with Broadcom, ++ * ssb or bcma device. Less harmful is to check for pci_bus_type and if ++ * no match then assume we got either ssb or bcma */ + if (((struct pci_dev *)osh->pdev)->dev.bus != &pci_bus_type) +- return ((struct ssb_device *)osh->pdev)->dma_dev; ++ { ++ return wl_glue_get_dmadev(osh->pdev); ++ } + } +-#endif ++#endif /* defined(CONFIG_SSB) || defined(CONFIG_BCMA) */ + return &((struct pci_dev *)osh->pdev)->dev; + } + +--- a/driver/Makefile ++++ b/driver/Makefile +@@ -1,7 +1,7 @@ + BUILD_TYPE=wl_apsta + include $(src)/$(BUILD_TYPE)/buildflags.mk + +-EXTRA_CFLAGS += -I$(src)/include -I$(src) -DBCMDRIVER $(WLFLAGS) ++EXTRA_CFLAGS += -I$(src)/include -I$(src) -I$(realpath $(src)/../glue) -DBCMDRIVER $(WLFLAGS) + + wl-objs := $(BUILD_TYPE)/wl_prebuilt.o wl_iw.o wl_linux.o linux_osl.o siutils.o aiutils.o hndpmu.o bcmutils.o sbutils.o nicpci.o hnddma.o bcmsrom.o nvram_stub.o + diff --git a/package/broadcom-wl/patches/910-fallback-sprom.patch b/package/broadcom-wl/patches/910-fallback-sprom.patch index 407ec5a..749ecbf 100644 --- a/package/broadcom-wl/patches/910-fallback-sprom.patch +++ b/package/broadcom-wl/patches/910-fallback-sprom.patch @@ -23,7 +23,7 @@ /* * Apply CRC over SROM content regardless SROM is present or not, * and use variable <devpath>sromrev's existance in flash to decide -@@ -2120,6 +2130,58 @@ BCMATTACHFN(initvars_srom_pci)(si_t *sih +@@ -2120,6 +2129,58 @@ BCMATTACHFN(initvars_srom_pci)(si_t *sih goto varscont; } |