Tobias Diedrich wrote:
> > Like I said. This makes no sense at all. Core switching is different on
> > ssb based systems. It (used to?) work(s) with the appropriate bcm64309
> > config symbol defined. However, mb and nbd are working on porting the
> > whole system code to ssb which will be much nicer anyway. Until then, I
> > suggest you either explicitly state that you want to help with it, or
> > just wait :)
> 
> Ok, thanks for the info.
> I guess for now I'll look into getting 2.6.18 to boot on this thing
> instead.

Ok, now that 2.6.18 boots, I had a look at bcm43xx-d80211 again.
I applied patch_2.6.18_to_wireless-dev on top of 2.6.18.2
and with the following additional changes (patch attached) it sort
of basically works.

I ported the BCM947XX-ifdefs to the bcm43xx-d80211 driver.

At first I got an oops in the d80211 stack when I compiled it into
the kernel instead of as module (fixed by the changes from module_init
to subsys_initcall).

Then "ifconfig wlan0 up" worked fine, but after "iwlist wlan0 scan"
I got an oops, which is a null dereference in
bcm43xx_dma_handle_txstatus.  For some reason meta->skb seems to be
NULL sometimes.  After changing the unconditional "unmap_descbuffer"
to "if (meta-skb) unmap_descbuffer" the "iwlist wlan0 scan" actually
works and find my network.
Even better: wpa_supplicant associates fine and I can ping my
router.

Output from debugging printks:
|slot=87 meta->dmaaddr=009e2c00
|About to unmap_descbuffer...
|meta=80ffd9d4, meta->skb=8083e160
|unmapped descbuffer
|slot=88 meta->dmaaddr=00801c30
|About to unmap_descbuffer...
|meta=80ffda20, meta->skb=00000000
|unmapped descbuffer
|slot=89 meta->dmaaddr=009e2800
|About to unmap_descbuffer...
|meta=80ffda6c, meta->skb=808690e0
|unmapped descbuffer
|slot=90 meta->dmaaddr=00801cd4
|About to unmap_descbuffer...
|meta=80ffdab8, meta->skb=00000000
|unmapped descbuffer

However I get a new Oops when I terminate wpa_supplicant (In
bcm43xx_dmacontroller_tx_reset AFAICS).

Anyway, promising results for today, patch attached. :)

-- 
Tobias                                          PGP: http://9ac7e0bc.uguu.de
このメールは十割再利用されたビットで作られています。
Index: linux-2.6.18/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c
===================================================================
--- linux-2.6.18.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c        
2006-11-05 22:42:36.000000000 +0100
+++ linux-2.6.18/drivers/net/wireless/d80211/bcm43xx/bcm43xx_main.c     
2006-11-10 23:41:17.000000000 +0100
@@ -141,6 +141,10 @@
        { PCI_VENDOR_ID_BROADCOM, 0x4324, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
        /* Broadcom 43XG 802.11b/g */
        { PCI_VENDOR_ID_BROADCOM, 0x4325, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+#ifdef CONFIG_BCM947XX
+       /* SB bus on BCM947xx */
+       { PCI_VENDOR_ID_BROADCOM, 0x0800, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+#endif
        { 0 },
 };
 MODULE_DEVICE_TABLE(pci, bcm43xx_pci_tbl);
@@ -1929,11 +1933,33 @@
        return err;
 }
 
+#ifdef CONFIG_BCM947XX
+static struct pci_device_id bcm43xx_47xx_ids[] = {
+       { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4324) },
+       { PCI_DEVICE(PCI_VENDOR_ID_BROADCOM, 0x4311) },
+       { 0 }
+};
+#endif
+
 static int bcm43xx_initialize_irq(struct bcm43xx_private *bcm)
 {
        int err;
 
        bcm->irq = bcm->ssb.pci_dev->irq;
+#ifdef CONFIG_BCM947XX
+       if (bcm->ssb.pci_dev->bus->number == 0) {
+               struct pci_dev *d;
+               struct pci_device_id *id;
+               for (id = bcm43xx_47xx_ids; id->vendor; id++) {
+                       d = pci_get_device(id->vendor, id->device, NULL);
+                       if (d != NULL) {
+                               bcm->irq = d->irq;
+                               pci_dev_put(d);
+                               break;
+                       }
+               }
+       }
+#endif
        err = request_irq(bcm->irq, bcm43xx_interrupt_handler,
                          IRQF_SHARED, KBUILD_MODNAME, bcm);
        if (err)
@@ -2277,8 +2303,11 @@
        u32 sbimconfiglow;
        u8 limit;
 
+#ifndef CONFIG_BCM947XX
        assert(bcm->pcicore);
-       if (bcm->pcicore->cc == SSB_CC_PCI &&
+#endif
+       if (bcm->pcicore &&
+           bcm->pcicore->cc == SSB_CC_PCI &&
            bcm->pcicore->rev <= 5) {
                sbimconfiglow = bcm43xx_read32(bcm->wlcore, SSB_IMCFGLO);
                sbimconfiglow &= ~SSB_IMCFGLO_REQTO;
@@ -2656,6 +2685,11 @@
                { .chip_id_key = 0x4710, .nr_cores_value = 9, },
                { .chip_id_key = 0x4610, .nr_cores_value = 9, },
                { .chip_id_key = 0x4704, .nr_cores_value = 9, },
+#if 0
+#ifdef CONFIG_BCM947XX
+               { .chip_id_key = 0x4309, .nr_cores_value = 7, }
+#endif
+#endif
        };
 
        switch (bcm->ssb.pci_dev->device) {
@@ -3321,6 +3355,7 @@
 
        printk(KERN_INFO PFX "Broadcom %04X WLAN found\n", bcm->ssb.chip_id);
 
+#ifndef CONFIG_BCM947XX
        /* Attach all IO cores to the backplane. */
        coremask = 0;
        for (i = 0; i < bcm->nr_80211_available; i++)
@@ -3330,6 +3365,7 @@
                printk(KERN_ERR PFX "Could not connect cores\n");
                goto err_chipset_detach;
        }
+#endif
 
        err = bcm43xx_sprom_extract(bcm);
        if (err)
@@ -3828,6 +3864,11 @@
        struct ieee80211_hw *ieee;
        int err = -ENOMEM;
 
+#ifdef CONFIG_BCM947XX
+       if ((pdev->bus->number == 0) && (pdev->device != 0x0800))
+               return -ENODEV;
+#endif
+
 #ifdef DEBUG_SINGLE_DEVICE_ONLY
        if (strcmp(pci_name(pdev), DEBUG_SINGLE_DEVICE_ONLY))
                return -ENODEV;
Index: linux-2.6.18/drivers/misc/ssb.c
===================================================================
--- linux-2.6.18.orig/drivers/misc/ssb.c        2006-11-05 22:42:36.000000000 
+0100
+++ linux-2.6.18/drivers/misc/ssb.c     2006-11-10 22:59:57.000000000 +0100
@@ -532,10 +532,14 @@
 
        memset(ssb, 0, sizeof(*ssb));
        ssb->pci_dev = pci_dev;
+#ifdef CONFIG_BCM947XX
+       ssb->bus = SSB_BUS_SSB;
+#else
        if (pci_dev)
                ssb->bus = SSB_BUS_PCI;
        else
                ssb->bus = SSB_BUS_SSB;
+#endif
        ssb->mmio = mmio;
        ssb->device_suspend = device_suspend;
        ssb->device_resume = device_resume;
Index: linux-2.6.18/net/d80211/ieee80211.c
===================================================================
--- linux-2.6.18.orig/net/d80211/ieee80211.c    2006-11-10 23:46:16.000000000 
+0100
+++ linux-2.6.18/net/d80211/ieee80211.c 2006-11-10 23:47:08.000000000 +0100
@@ -4810,7 +4811,7 @@
 }
 
 
-module_init(ieee80211_init);
+subsys_initcall(ieee80211_init);
 module_exit(ieee80211_exit);
 
 MODULE_DESCRIPTION("IEEE 802.11 subsystem");
Index: linux-2.6.18/net/d80211/rate_control.c
===================================================================
--- linux-2.6.18.orig/net/d80211/rate_control.c 2006-11-10 23:52:18.000000000 
+0100
+++ linux-2.6.18/net/d80211/rate_control.c      2006-11-10 23:52:28.000000000 
+0100
@@ -387,7 +387,7 @@
 }
 
 
-module_init(rate_control_simple_init);
+subsys_initcall(rate_control_simple_init);
 module_exit(rate_control_simple_exit);
 
 MODULE_DESCRIPTION("Simple rate control algorithm for ieee80211");
Index: linux-2.6.18/drivers/net/wireless/d80211/bcm43xx/bcm43xx_dma.c
===================================================================
--- linux-2.6.18.orig/drivers/net/wireless/d80211/bcm43xx/bcm43xx_dma.c 
2006-11-05 23:10:12.000000000 +0100
+++ linux-2.6.18/drivers/net/wireless/d80211/bcm43xx/bcm43xx_dma.c      
2006-11-11 00:41:47.000000000 +0100
@@ -1115,8 +1115,14 @@
        while (1) {
                assert(slot >= 0 && slot < ring->nr_slots);
                desc = ops->idx2desc(ring, slot, &meta);
+               printk(KERN_ERR "slot=%d meta->dmaaddr=%08x\n",
+                               slot, meta->dmaaddr);
 
-               unmap_descbuffer(ring, meta->dmaaddr, meta->skb->len, 1);
+               printk(KERN_ERR "About to unmap_descbuffer...\n");
+               printk(KERN_ERR "meta=%p, meta->skb=%p\n", meta, meta->skb);
+               if (meta->skb)
+                       unmap_descbuffer(ring, meta->dmaaddr, meta->skb->len, 
1);
+               printk(KERN_ERR "unmapped descbuffer\n");
                if (meta->is_last_fragment) {
                        /* Call back to inform the ieee80211 subsystem about the
                         * status of the transmission.
_______________________________________________
Bcm43xx-dev mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/bcm43xx-dev

Reply via email to