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,9 @@ wl_module_init(void)
115 - ssb_driver_unregister(&wl_ssb_driver);
116 +#if defined(CONFIG_SSB) || defined(CONFIG_BCMA)
117 + wl_glue_unregister();
118 +#endif /* defined(CONFIG_SSB) || defined(CONFIG_BCMA) */
122 @@ -1099,9 +1072,9 @@ wl_module_exit(void)
124 pci_unregister_driver(&wl_pci_driver);
125 #endif /* CONFIG_PCI */
127 - ssb_driver_unregister(&wl_ssb_driver);
128 -#endif /* CONFIG_SSB */
129 +#if defined(CONFIG_SSB) || defined(CONFIG_BCMA)
130 + wl_glue_unregister();
131 +#endif /* defined(CONFIG_SSB) || defined(CONFIG_BCMA) */
134 module_init(wl_module_init);
135 --- a/driver/linux_osl.c
136 +++ b/driver/linux_osl.c
138 #include <asm/paccess.h>
142 -#include <linux/ssb/ssb.h>
144 +#if defined(CONFIG_SSB) || defined(CONFIG_BCMA)
145 +#include <wl_glue.h>
146 +#endif /* defined(CONFIG_SSB) || defined(CONFIG_BCMA) */
148 #define PCI_CFG_RETRY 10
150 @@ -370,15 +370,17 @@ osl_dma_consistent_align(void)
151 static struct device *
152 osl_get_dmadev(osl_t *osh)
155 +#if defined(CONFIG_SSB) || defined(CONFIG_BCMA)
156 if (osh->bustype == SI_BUS) {
157 - /* This can be SiliconBackplane emulated as pci with Broadcom or
158 - * ssb device. Less harmful is to check for pci_bus_type and if
159 - * no match then assume we got ssb */
160 + /* This can be SiliconBackplane emulated as pci with Broadcom,
161 + * ssb or bcma device. Less harmful is to check for pci_bus_type and if
162 + * no match then assume we got either ssb or bcma */
163 if (((struct pci_dev *)osh->pdev)->dev.bus != &pci_bus_type)
164 - return ((struct ssb_device *)osh->pdev)->dma_dev;
166 + return wl_glue_get_dmadev(osh->pdev);
170 +#endif /* defined(CONFIG_SSB) || defined(CONFIG_BCMA) */
171 return &((struct pci_dev *)osh->pdev)->dev;
174 --- a/driver/Makefile
175 +++ b/driver/Makefile
178 include $(src)/$(BUILD_TYPE)/buildflags.mk
180 -EXTRA_CFLAGS += -I$(src)/include -I$(src) -DBCMDRIVER $(WLFLAGS)
181 +EXTRA_CFLAGS += -I$(src)/include -I$(src) -I$(realpath $(src)/../glue) -DBCMDRIVER $(WLFLAGS)
183 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