Hi,

  I have a linksys WRT54G on which I install OpenWRT (the development
version, ie Kamikaze). This linux system comes with a 2.6.17 kernel
(not the linus kernel but one patched to support some of the WRT54G
hardware).
  When building this system (with a cross compiler : WRT54G is mips),
we can choose to compile the bcm43xx module (the SoftMac one). The
sources for this module are not patched (ie they are the same as the
ones in 2.6.17 official linux kernel). However, I want to use my WRT54G
as an AP, so I need hostapd, so I need the dscape bcm43xx...

  I try to follow the advices from
http://openfacts.berlios.de/index-en.phtml?title=Broadcom_43xx_Linux_Driver/Debian_Unstable_with_Devicescape_802.11_stack
With some more patches, I succeed in cross-compiling a dscape bcm43xx.
For those who are interested, I add a package/dscape-ieee80211 directory
whose contents can be see here:
http://dept-info.labri.fr/~danjean/dscape-ieee80211/
In two words, I use the rt2x00 dscape stack with the bcm43xx dscape
driver (and ssb.c) from the wireless-dev linux tree.

However, when loading the module, no core were detected. Looking at the
sources and comparing with the softmac bcm43xx (that detect my device),
I found that dscape bcm43xx does not change the mmio when switching the
core.
  I added the following patch to my sources :
http://dept-info.labri.fr/~danjean/dscape-ieee80211/patches/200-ssb-bugfix.patch
Index: dscape-ieee80211/src/wireless-dev/ssb/ssb.c
===================================================================
--- dscape-ieee80211.orig/src/wireless-dev/ssb/ssb.c    2006-11-13 
02:00:02.000000000 +0100
+++ dscape-ieee80211/src/wireless-dev/ssb/ssb.c 2006-11-13 01:58:55.000000000 
+0100
@@ -590,6 +590,7 @@
        int err;
        int attempts = 0;
        u32 cur_core;
+       static int last_core = 1;

        while (1) {
                err = ssb_pci_write_config32(ssb, SSB_BAR0_WIN,
@@ -610,6 +611,10 @@
                        goto error;
                udelay(10);
        }
+       char* mmio=(char*)((coreidx-last_core)*SSB_CORE_SIZE + 
(char*)ssb->mmio);
+       ssb->mmio=mmio;
+       last_core=coreidx;
+       printk(KERN_DEBUG PFX "switched to core %i, mmio set to %p\n", coreidx, 
ssb->mmio);
        return 0;
 error:
        printk(KERN_ERR PFX "Failed to switch to core %u\n", coreidx);


  I know that this is a quirck and dirty patch, but it seems to work.
At least, when loading the bcm, I get this :
Nov 13 22:19:04 (none) user.warn kernel: PCI: Enabling device 0000:00:01.0 
(0000 -> 0002)
Nov 13 22:19:04 (none) user.debug kernel: PCI: Setting latency timer of device 
0000:00:01.0 to 64
Nov 13 22:19:04 (none) user.debug kernel: ssb: switched to core 0, mmio set to 
b8000000
Nov 13 22:19:04 (none) user.debug kernel: ssb: switched to core 0, mmio set to 
b8000000
Nov 13 22:19:04 (none) user.debug kernel: ssb: Core 0 found: cc 0800, rev 09, 
vendor 4243
Nov 13 22:19:04 (none) user.debug kernel: ssb: switched to core 1, mmio set to 
b8001000
Nov 13 22:19:04 (none) user.debug kernel: ssb: Core 1 found: cc 0812, rev 07, 
vendor 4243
Nov 13 22:19:04 (none) user.debug kernel: ssb: switched to core 2, mmio set to 
b8002000
Nov 13 22:19:04 (none) user.debug kernel: ssb: Core 2 found: cc 0806, rev 07, 
vendor 4243
Nov 13 22:19:04 (none) user.debug kernel: ssb: switched to core 3, mmio set to 
b8003000
Nov 13 22:19:04 (none) user.debug kernel: ssb: Core 3 found: cc 0818, rev 01, 
vendor 4243
Nov 13 22:19:04 (none) user.debug kernel: ssb: switched to core 4, mmio set to 
b8004000
Nov 13 22:19:04 (none) user.debug kernel: ssb: Core 4 found: cc 0817, rev 01, 
vendor 4243
Nov 13 22:19:04 (none) user.debug kernel: ssb: switched to core 5, mmio set to 
b8005000
Nov 13 22:19:04 (none) user.debug kernel: ssb: Core 5 found: cc 0816, rev 01, 
vendor 4243
Nov 13 22:19:04 (none) user.debug kernel: ssb: switched to core 6, mmio set to 
b8006000
Nov 13 22:19:04 (none) user.debug kernel: ssb: Core 6 found: cc 080F, rev 01, 
vendor 4243
Nov 13 22:19:04 (none) user.debug kernel: ssb: switched to core 7, mmio set to 
b8007000
Nov 13 22:19:04 (none) user.debug kernel: ssb: Core 7 found: cc 0804, rev 0A, 
vendor 4243
Nov 13 22:19:04 (none) user.info kernel: bcm43xx_d80211: Broadcom 4712 WLAN 
found
Nov 13 22:19:04 (none) user.debug kernel: ssb: switched to core 7, mmio set to 
b8007000
Nov 13 22:19:04 (none) user.debug kernel: ssb: switched to core 1, mmio set to 
b8001000
Nov 13 22:19:04 (none) user.info kernel: bcm43xx_d80211: PHY connected
Nov 13 22:19:04 (none) user.info kernel: bcm43xx_d80211: Detected PHY: Version: 
2, Type 2, Revision 2
Nov 13 22:19:04 (none) user.info kernel: bcm43xx_d80211: Detected Radio: ID: 
2205017f (Manuf: 17f Ver: 2050 Rev: 2)
Nov 13 22:19:04 (none) user.info kernel: bcm43xx_d80211: Radio turned off
Nov 13 22:19:04 (none) user.info kernel: bcm43xx_d80211: Radio turned off
Nov 13 22:19:04 (none) user.debug kernel: ssb: switched to core 0, mmio set to 
b8000000
Nov 13 22:19:04 (none) user.debug kernel: wmaster0: Selected rate control 
algorithm 'simple'

And iwconfig show my card :
[EMAIL PROTECTED]:~# iwconfig
[...]
wmaster0  IEEE 802.11g  Frequency:2.412 GHz
          RTS thr:off   Fragment thr=2346 B

wlan0     IEEE 802.11g  ESSID:""
          Mode:Managed  Frequency:2.412 GHz  Access Point: Not-Associated
          RTS thr:off   Fragment thr=2346 B
          Encryption key:off
          Link Quality:0  Signal level:0  Noise level:0
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

But then, I do not succeed in setting up my device.
When I do 'ifconfig wlan0 up', I got (in syslog):
Nov 13 22:23:37 (none) user.info kernel: bcm43xx_d80211: Virtual interface 
added (type: 0x00000002, ID: 7, MAC: 00:14:bf:bf:e7:5e)
Nov 13 22:23:37 (none) user.debug kernel: ssb: switched to core 1, mmio set to 
b8001000
Nov 13 22:23:37 (none) user.info kernel: bcm43xx_d80211: PHY connected
Nov 13 22:23:38 (none) user.debug kernel: bcm43xx_d80211: firmware revision 
127, patchlevel E, date 2005-04-18 02:36:27
Nov 13 22:23:38 (none) user.debug kernel: ssb: switched to core 0, mmio set to 
b8000000
Nov 13 22:23:38 (none) user.debug kernel: ssb: switched to core 1, mmio set to 
b8001000
Nov 13 22:23:38 (none) user.info kernel: bcm43xx_d80211: Radio turned on
Nov 13 22:23:38 (none) user.debug kernel: ssb: switched to core 0, mmio set to 
b8000000
Nov 13 22:23:38 (none) user.debug kernel: ssb: switched to core 1, mmio set to 
b8001000
Nov 13 22:23:38 (none) user.info kernel: bcm43xx_d80211: Chip initialized
Nov 13 22:23:38 (none) user.info kernel: bcm43xx_d80211: 30-bit DMA initialized
Nov 13 22:23:38 (none) user.debug kernel: ssb: switched to core 0, mmio set to 
b8000000
Nov 13 22:23:38 (none) user.debug kernel: ssb: switched to core 1, mmio set to 
b8001000
Nov 13 22:23:38 (none) user.info kernel: bcm43xx_d80211: Keys cleared
Nov 13 22:23:38 (none) user.err kernel: bcm43xx_d80211: FATAL ERROR: Fatal DMA 
error: 0x00000400, 0x00000000, 0x00000000, 0x00000000, 0x00000000, 0x00000000
Nov 13 22:23:38 (none) user.err kernel: bcm43xx_d80211: Controller RESET (DMA 
error) ...
Nov 13 22:23:38 (none) user.info kernel: bcm43xx_d80211: Selected 802.11 core 
(phytype 2)
Nov 13 22:23:38 (none) user.debug kernel: wmaster0: Does not support passive 
scan, disabled

And then I cannot do any operation on the device:
"iwlist wlan0 scan" stalls
"hostapd conffile.conf" reports "ioctl[SIOCSIWMODE]:
Device or resource busy" and blocks in D state

I think the problem comes from the DMA error.
I tried to load the module with "pio=1", but then, the
"ifconfig wlan0 up" makes my hardware to reboot (and I does not have
a serial line to see what happens yet)

So my questions :
* what do you think about my quick and dirty fix that makes the
  bcm43xx_d80211 module using the same io address as the softmac one
  (and so my device is correctly detected and initialized) ?
  What is the correct fix ?
* Do you thing that the DMA problem can come from bad io addresses ?
* What can I do to help you to improve this driver for this device ?
* Is it possible to make hostapd working with softmac bcm43xx ?

In fact, all I want is to be able to make linksys WRT64G working as an
AP (even with no WPA and no WEP: I will use VPN in this case)

  Best regards,
    Vincent


_______________________________________________
Bcm43xx-dev mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/bcm43xx-dev

Reply via email to