1 --- a/driver/wl_linux.c
2 +++ b/driver/wl_linux.c
3 @@ -85,10 +85,9 @@ typedef void wlc_hw_info_t;
9 -#include <linux/ssb/ssb.h>
11 +#if defined(CONFIG_SSB) || defined(CONFIG_BCMA)
13 +#endif /* defined(CONFIG_SSB) || defined(CONFIG_BCMA) */
15 /* Linux wireless extension support */
16 #ifdef CONFIG_WIRELESS_EXT
17 @@ -997,62 +996,32 @@ static struct pci_driver wl_pci_driver =
18 #endif /* CONFIG_PCI */
22 +static bcmjtag_driver_t wl_jtag_driver = {
29 -static int wl_ssb_probe(struct ssb_device *dev, const struct ssb_device_id *id)
30 +#if defined(CONFIG_SSB) || defined(CONFIG_BCMA)
31 +static void * glue_attach_cb(u16 vendor, u16 device,
32 + ulong mmio, void *dev, u32 irq)
37 - if (dev->bus->bustype != SSB_BUSTYPE_SSB) {
38 - printk("Attaching to SSB behind PCI is not supported. Please remove the b43 ssb bridge\n");
42 - mmio = (void *) 0x18000000 + dev->core_index * 0x1000;
43 - wl = wl_attach(id->vendor, id->coreid, (ulong) mmio, SI_BUS, dev, dev->irq);
45 - printk("wl_attach failed\n");
49 - ssb_set_drvdata(dev, wl);
52 + return wl_attach(vendor, device, mmio, SI_BUS, dev, irq);
55 -static void wl_ssb_remove(struct ssb_device *dev)
56 +static void glue_remove_cb(void *wldev)
58 - wl_info_t *wl = (wl_info_t *) ssb_get_drvdata(dev);
59 + wl_info_t *wl = (wl_info_t *)wldev;
62 WL_APSTA_UPDN(("wl%d (%s): wl_remove() -> wl_down()\n", wl->pub->unit, wl->dev->name));
66 - ssb_set_drvdata(dev, NULL);
69 -static const struct ssb_device_id wl_ssb_tbl[] = {
70 - SSB_DEVICE(SSB_VENDOR_BROADCOM, SSB_DEV_80211, SSB_ANY_REV),
75 -static struct ssb_driver wl_ssb_driver = {
76 - .name = KBUILD_MODNAME,
77 - .id_table = wl_ssb_tbl,
78 - .probe = wl_ssb_probe,
79 - .remove = wl_ssb_remove,
84 -static bcmjtag_driver_t wl_jtag_driver = {
90 +#endif/* defined(CONFIG_SSB) || defined(CONFIG_BCMA) */
94 @@ -1067,11 +1036,13 @@ wl_module_init(void)
99 - error = ssb_driver_register(&wl_ssb_driver);
100 +#if defined(CONFIG_SSB) || defined(CONFIG_BCMA)
101 + wl_glue_set_attach_callback(&glue_attach_cb);
102 + wl_glue_set_remove_callback(&glue_remove_cb);
103 + error = wl_glue_register();
106 -#endif /* CONFIG_SSB */
107 +#endif /* defined(CONFIG_SSB) || defined(CONFIG_BCMA) */
110 error = pci_register_driver(&wl_pci_driver);
111 @@ -1082,7 +1053,11 @@ wl_module_init(void)
115 - ssb_driver_unregister(&wl_ssb_driver);
116 +#if defined(CONFIG_SSB) || defined(CONFIG_BCMA)
117 + wl_glue_unregister();
118 + wl_glue_set_attach_callback(NULL);
119 + wl_glue_set_remove_callback(NULL);
120 +#endif /* defined(CONFIG_SSB) || defined(CONFIG_BCMA) */
124 @@ -1099,9 +1074,11 @@ wl_module_exit(void)
126 pci_unregister_driver(&wl_pci_driver);
127 #endif /* CONFIG_PCI */
129 - ssb_driver_unregister(&wl_ssb_driver);
130 -#endif /* CONFIG_SSB */
131 +#if defined(CONFIG_SSB) || defined(CONFIG_BCMA)
132 + wl_glue_unregister();
133 + wl_glue_set_attach_callback(NULL);
134 + wl_glue_set_remove_callback(NULL);
135 +#endif /* defined(CONFIG_SSB) || defined(CONFIG_BCMA) */
138 module_init(wl_module_init);
139 --- a/driver/linux_osl.c
140 +++ b/driver/linux_osl.c
142 #include <asm/paccess.h>
146 -#include <linux/ssb/ssb.h>
148 +#if defined(CONFIG_SSB) || defined(CONFIG_BCMA)
149 +#include <wl_glue.h>
150 +#endif /* defined(CONFIG_SSB) || defined(CONFIG_BCMA) */
152 #define PCI_CFG_RETRY 10
154 @@ -370,15 +370,17 @@ osl_dma_consistent_align(void)
155 static struct device *
156 osl_get_dmadev(osl_t *osh)
159 +#if defined(CONFIG_SSB) || defined(CONFIG_BCMA)
160 if (osh->bustype == SI_BUS) {
161 - /* This can be SiliconBackplane emulated as pci with Broadcom or
162 - * ssb device. Less harmful is to check for pci_bus_type and if
163 - * no match then assume we got ssb */
164 + /* This can be SiliconBackplane emulated as pci with Broadcom,
165 + * ssb or bcma device. Less harmful is to check for pci_bus_type and if
166 + * no match then assume we got either ssb or bcma */
167 if (((struct pci_dev *)osh->pdev)->dev.bus != &pci_bus_type)
168 - return ((struct ssb_device *)osh->pdev)->dma_dev;
170 + return wl_glue_get_dmadev(osh->pdev);
174 +#endif /* defined(CONFIG_SSB) || defined(CONFIG_BCMA) */
175 return &((struct pci_dev *)osh->pdev)->dev;
178 --- a/driver/Makefile
179 +++ b/driver/Makefile
182 include $(src)/$(BUILD_TYPE)/buildflags.mk
184 -EXTRA_CFLAGS += -I$(src)/include -I$(src) -DBCMDRIVER $(WLFLAGS)
185 +EXTRA_CFLAGS += -I$(src)/include -I$(src) -I$(realpath $(src)/../glue) -DBCMDRIVER $(WLFLAGS)
187 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