现在的位置: 首页 > 综合 > 正文

Wifi over SDIO

2014年02月19日 ⁄ 综合 ⁄ 共 11324字 ⁄ 字号 评论关闭

Wifi over SDIO

In this page, we tested a SDIO extend card with Marvell 8686 WIFI module, via BF548-EZKIT SD Host controller. We use 2009R1 uclinux-dist.

Kernel Configure

  1. wireless network stack:

    Networking  --->
      [*] Networking support
          Wireless  --->
            <*> Improved wireless configuration API
            [*]   nl80211 new netlink interface support
            [*]   Old wireless static regulatory definitions
            -*- Wireless extensions
            [*] Wireless extensions sysfs files
            <*> Generic IEEE 802.11 Networking Stack (mac80211)
    
  2. Blackfin SD Host driver:

    Device Drivers  --->
      <*> MMC/SD card support  --->
          *** MMC/SD Host Controller Drivers ***
          <*>   Blackfin Secure Digital Host support
          [*]     Blackfin EZkit Missing SDH_CMD Pull Up Resistor Workaround
          [*]     Enable sdio irq for sdio device
    
  3. libertas driver: For details about libertas, see linux wireless

    Device Drivers  --->
      [*] Network device support  --->
          Wireless LAN  --->
            [*] Wireless LAN (IEEE 802.11)
            <M>   Marvell 8xxx Libertas WLAN driver support
            <M>     Marvell Libertas 8385 and 8686 SDIO 802.11b/g cards
            [*]       Support transferring block with size of power-of-2 only
            [*]     Enable full debugging output in the Libertas module.
    
  4. Disable Nand flash controller support, because the Nand flash controller use the same DMA channel as SDH

    Device Drivers  --->
      <*> Memory Technology Device (MTD) support  --->
          <*>   NAND Device Support  --->
                < >   Blackfin on-chip NAND Flash Controller driver
    

Setup Wifi

  1. Build wireless network tools:

    Network Applications  --->
      --- Wireless-tools
      [*] wireless_tools support
      [*]   iwconfig
      [*]   iwgetid
      [*]   iwlist
      [*]   iwpriv
      [*]   iwspy
    
  2. Add libertas firmware to rootfs: For details of the non-free firmware, see linux wireless - libertas driver

    $ cd uclinux-dist
    $ mkdir romfs/lib/firmware
    $ cp …/sd8686.bin …/sd8686_helper.bin romfs/lib/firmware
    

Kernel Testing

Build the kernel image. Download to BF548-EZkit and boot.

- If the SDH driver found the card, there would be a message like:

mmc0: new SDIO card at address 0001  
  1. Load libertas driver:

    root:/> modprobe libertas
    root:/> modprobe libertas_sdio helper_name=sd8686_helper.bin fw_name=sd8686.bin
    libertas_sdio: Libertas SDIO driver
    libertas_sdio: Copyright Pierre Ossman
    firmware: requesting sd8686_helper.bin
    firmware: requesting sd8686.bin
    libertas: 00:13:e0:a1:69:92, fw 9.70.3p24, cap 0x00000303
    libertas: unidentified region code; using the default (USA)
    libertas: PREP_CMD: command 0x00a3 failed: 2
    libertas: PREP_CMD: command 0x00a3 failed: 2
    libertas: eth1: Marvell WLAN 802.11 adapter
    

Connect to an Access Point (Managed Mode)

  1. Check eth1

    root:/> iwconfig eth1
    eth1      IEEE 802.11b/g  ESSID:""
              Mode:Managed  Frequency:2.412 GHz  Access Point: Not-Associated
              Bit Rate:0 kb/s   Tx-Power=18 dBm
              Retry short limit:8   RTS thr=2347 B   Fragment thr=2346 B
              Encryption key:off
              Power Management: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
    
  2. scan for available APs :

    root:/> ifconfig eth1 up
    root:/> iwlist eth1 scan
    eth1      Scan completed :
              Cell 01 - Address: 00:1C:F9:C0:73:00
                        ESSID:"ADIWLAN"
                        Mode:Managed
                        Frequency:2.412 GHz (Channel 1)
                        Quality=99/100  Signal level=-47 dBm  Noise level=-96 dBm
                        Encryption key:on
                        Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 6 Mb/s; 9 Mb/s
                                  11 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
                                  48 Mb/s; 54 Mb/s
                        IE: WPA Version 1
                            Group Cipher : TKIP
                            Pairwise Ciphers (1) : TKIP
                            Authentication Suites (1) : 802.1x
              Cell 02 - Address: 00:1C:F9:C0:73:01
                        ESSID:"ADICHINA"
                        Mode:Managed
                        Frequency:2.412 GHz (Channel 1)
                        Quality=99/100  Signal level=-48 dBm  Noise level=-96 dBm
                        Encryption key:on
                        Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 6 Mb/s; 9 Mb/s
                                  11 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
                                  48 Mb/s; 54 Mb/s
                        IE: WPA Version 1
                            Group Cipher : TKIP
                            Pairwise Ciphers (1) : TKIP
                            Authentication Suites (1) : 802.1x
    [snip]
    
  3. Connect to AP:

    root:/> iwconfig eth1 essid linksys
    root:/> ifconfig eth1 192.168.1.101 up
    root:/> iwconfig eth1
    eth1      IEEE 802.11b/g  ESSID:"linksys"
              Mode:Managed  Frequency:2.437 GHz  Access Point: 00:1A:70:D4:94:C7
              Bit Rate:0 kb/s   Tx-Power=13 dBm
              Retry short limit:8   RTS thr=2347 B   Fragment thr=2346 B
              Encryption key:off
              Power Management:off
              Link Quality=95/100  Signal level=-39 dBm  Noise level=-93 dBm
              Rx invalid nwid:0  Rx invalid crypt:2499  Rx invalid frag:0
              Tx excessive retries:24  Invalid misc:6120   Missed beacon:0
    root:/> route add default gw 192.168.1.1
    root:/> ping 192.168.1.1
    PING 192.168.1.1 (192.168.1.1): 56 data bytes
    64 bytes from 192.168.1.1: seq=0 ttl=64 time=24.000 ms
    64 bytes from 192.168.1.1: seq=1 ttl=64 time=12.000 ms
    64 bytes from 192.168.1.1: seq=2 ttl=64 time=12.000 ms
    64 bytes from 192.168.1.1: seq=3 ttl=64 time=16.000 ms
    64 bytes from 192.168.1.1: seq=4 ttl=64 time=12.000 ms
    64 bytes from 192.168.1.1: seq=5 ttl=64 time=12.000 ms
    

Adhoc Mode

On both nodes. (One is 192.168.0.10, the other is 192.168.0.11), do bellow setup:

root:/> iwconfig eth1 mode ad-hoc
root:/> iwconfig eth1 essid my_network
root:/> iwconfig eth1 channel 1
root:/> ifconfig eth1 up
root:/> ifconfig eth1 192.168.1.11
root:/> iwconfig
eth1      IEEE 802.11b/g  ESSID:"my_network"  
          Mode:Ad-Hoc  Frequency:2.437 GHz  Cell: 02:24:D4:0D:78:9D   
          Bit Rate:54 Mb/s   Tx-Power=13 dBm   
          Retry short limit:8   RTS thr=2347 B   Fragment thr=2346 B   
          Encryption key:off
          Power Management:off
          Link Quality=95/100  Signal level=-30 dBm  Noise level=-92 dBm
          Rx invalid nwid:0  Rx invalid crypt:2664  Rx invalid frag:0
          Tx excessive retries:23  Invalid misc:5865   Missed beacon:0
root:/> ping 192.168.1.10
PING 192.168.1.10 (192.168.1.10): 56 data bytes
64 bytes from 192.168.1.10: seq=0 ttl=64 time=40.000 ms
64 bytes from 192.168.1.10: seq=1 ttl=64 time=12.000 ms
64 bytes from 192.168.1.10: seq=2 ttl=64 time=12.000 ms
64 bytes from 192.168.1.10: seq=3 ttl=64 time=16.000 ms
64 bytes from 192.168.1.10: seq=4 ttl=64 time=16.000 ms
^C
--- 192.168.1.10 ping statistics ---
5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max = 12.000/19.200/40.000 ms

 

Performance

BF548-Ezkit

  • System Setting
Board Version CCLK SCLK Kernel Version Toolchain Version
BF548-EZKIT-1.4 - Rev 0.2 525MHz 131MHz 2.6.28.9-ADI-2009R1-pre-svn6259 gcc 4.1.2 (svn-3305)

iperf

Managed Mode
  • AP: Linksys WRH54G
  • Server side (a Linux PC with Intel WiFi link 5100)

    linux-pc:/$ iwconfig
    wlan0     IEEE 802.11abgn  ESSID:"linksys"  
              Mode:Managed  Frequency:2.437 GHz  Access Point: 00:1A:70:D4:94:C7   
              Bit Rate=1 Mb/s   Tx-Power=15 dBm   
              Retry min limit:7   RTS thr:off   Fragment thr=2352 B   
              Power Management:off
              Link Quality=100/100  Signal level:-22 dBm  Noise level=-83 dBm
              Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
              Tx excessive retries:0  Invalid misc:0   Missed beacon:0
    
    linux-pc:/$ ./iperf -s
    ------------------------------------------------------------
    Server listening on TCP port 5001
    TCP window size: 85.3 KByte (default)
    ------------------------------------------------------------
    
  • Client side

    root:/> iwconfig eth1
    eth1      IEEE 802.11b/g  ESSID:"linksys"  
              Mode:Managed  Frequency:2.437 GHz  Access Point: 00:1A:70:D4:94:C7   
              Bit Rate:1 Mb/s   Tx-Power=13 dBm   
              Retry short limit:8   RTS thr=2347 B   Fragment thr=2346 B   
              Encryption key:off
              Power Management:off
              Link Quality=100/100  Signal level=-23 dBm  Noise level=-91 dBm
              Rx invalid nwid:0  Rx invalid crypt:2495  Rx invalid frag:0
              Tx excessive retries:11276  Invalid misc:2789127   Missed beacon:0
    
    root:/> iperf -v
    iperf version 2.0.4 (7 Apr 2008) pthreads
    
    root:/> iperf -c 192.168.1.100 -i 1
    ------------------------------------------------------------
    Client connecting to 192.168.1.100, TCP port 5001
    TCP window size: 16.0 KByte (default)
    ------------------------------------------------------------
    [  5] local 192.168.1.101 port 35970 connected with 192.168.1.100 port 5001
    [ ID] Interval       Transfer     Bandwidth
    [  5]  0.0- 1.0 sec    264 KBytes  2.16 Mbits/sec
    [ ID] Interval       Transfer     Bandwidth
    [  5]  1.0- 2.0 sec    216 KBytes  1.77 Mbits/sec
    [ ID] Interval       Transfer     Bandwidth
    [  5]  2.0- 3.0 sec    240 KBytes  1.97 Mbits/sec
    [ ID] Interval       Transfer     Bandwidth
    [  5]  3.0- 4.0 sec    224 KBytes  1.84 Mbits/sec
    [ ID] Interval       Transfer     Bandwidth
    [  5]  4.0- 5.0 sec    224 KBytes  1.84 Mbits/sec
    [ ID] Interval       Transfer     Bandwidth
    [  5]  5.0- 6.0 sec    232 KBytes  1.90 Mbits/sec
    [ ID] Interval       Transfer     Bandwidth
    [  5]  6.0- 7.0 sec    224 KBytes  1.84 Mbits/sec
    [ ID] Interval       Transfer     Bandwidth
    [  5]  7.0- 8.0 sec    224 KBytes  1.84 Mbits/sec
    [ ID] Interval       Transfer     Bandwidth
    [  5]  8.0- 9.0 sec    248 KBytes  2.03 Mbits/sec
    [ ID] Interval       Transfer     Bandwidth
    [  5]  9.0-10.0 sec    232 KBytes  1.90 Mbits/sec
    [ ID] Interval       Transfer     Bandwidth
    [  5]  0.0-10.0 sec  2.27 MBytes  1.91 Mbits/sec
    
Adhoc Mode
  • Server side (a Linux PC with Intel WiFi link 5100)

    linux-pc:/$ ./iperf -s
    ------------------------------------------------------------
    Server listening on TCP port 5001
    TCP window size: 85.3 KByte (default)
    ------------------------------------------------------------
    
  • Client side

    root:/> iwconfig
    eth1      IEEE 802.11b/g  ESSID:"my_network"  
              Mode:Ad-Hoc  Frequency:2.437 GHz  Cell: 02:24:D4:0D:78:9D   
              Bit Rate:54 Mb/s   Tx-Power=13 dBm   
              Retry short limit:8   RTS thr=2347 B   Fragment thr=2346 B   
              Encryption key:off
              Power Management:off
              Link Quality=95/100  Signal level=-30 dBm  Noise level=-92 dBm
              Rx invalid nwid:0  Rx invalid crypt:2664  Rx invalid frag:0
              Tx excessive retries:23  Invalid misc:5865   Missed beacon:0
    
    root:/> iperf -c 192.168.1.10 -i 1
    ------------------------------------------------------------
    Client connecting to 192.168.1.10, TCP port 5001
    TCP window size: 16.0 KByte (default)
    ------------------------------------------------------------
    [  5] local 192.168.1.11 port 38997 connected with 192.168.1.10 port 5001
    [ ID] Interval       Transfer     Bandwidth
    [  5]  0.0- 1.0 sec    248 KBytes  2.03 Mbits/sec
    [ ID] Interval       Transfer     Bandwidth
    [  5]  1.0- 2.0 sec    232 KBytes  1.90 Mbits/sec
    [ ID] Interval       Transfer     Bandwidth
    [  5]  2.0- 3.0 sec    224 KBytes  1.84 Mbits/sec
    [ ID] Interval       Transfer     Bandwidth
    [  5]  3.0- 4.0 sec    224 KBytes  1.84 Mbits/sec
    [ ID] Interval       Transfer     Bandwidth
    [  5]  4.0- 5.0 sec    232 KBytes  1.90 Mbits/sec
    [ ID] Interval       Transfer     Bandwidth
    [  5]  5.0- 6.0 sec    224 KBytes  1.84 Mbits/sec
    [ ID] Interval       Transfer     Bandwidth
    [  5]  6.0- 7.0 sec    224 KBytes  1.84 Mbits/sec
    [ ID] Interval       Transfer     Bandwidth
    [  5]  7.0- 8.0 sec    232 KBytes  1.90 Mbits/sec
    [ ID] Interval       Transfer     Bandwidth
    [  5]  8.0- 9.0 sec    240 KBytes  1.97 Mbits/sec
    [ ID] Interval       Transfer     Bandwidth
    [  5]  9.0-10.0 sec    232 KBytes  1.90 Mbits/sec
    [ ID] Interval       Transfer     Bandwidth
    [  5]  0.0-10.0 sec  2.26 MBytes  1.90 Mbits/sec
    

BF518F-Ezkit

  • System Setting
Board Version CCLK SCLK Kernel Version Toolchain Version
BF518F-ezkit-0.1 - Rev 0.0 400MHz 100MHz 2.6.28.9-ADI-2009R1-pre-svn6277 gcc 4.1.2 (09r1-rc5)

iperf

  • Client side

    root:/> iperf -c 192.168.1.2 -i 1
    ------------------------------------------------------------
    Client connecting to 192.168.1.2, TCP port 5001
    TCP window size: 16.0 KByte (default)
    ------------------------------------------------------------
    [  5] local 192.168.1.101 port 33900 connected with 192.168.1.2 port 5001
    [  5]  0.0- 1.0 sec    256 KBytes  2.10 Mbits/sec
    [  5]  1.0- 2.0 sec    224 KBytes  1.84 Mbits/sec
    [  5]  2.0- 3.0 sec    232 KBytes  1.90 Mbits/sec
    [  5]  3.0- 4.0 sec    224 KBytes  1.84 Mbits/sec
    [  5]  4.0- 5.0 sec    232 KBytes  1.90 Mbits/sec
    [  5]  5.0- 6.0 sec    224 KBytes  1.84 Mbits/sec
    [  5]  6.0- 7.0 sec    232 KBytes  1.90 Mbits/sec
    [  5]  7.0- 8.0 sec    200 KBytes  1.64 Mbits/sec
    [  5]  8.0- 9.0 sec    232 KBytes  1.90 Mbits/sec
    [  5]  9.0-10.0 sec    232 KBytes  1.90 Mbits/sec
    [  5]  0.0-10.1 sec  2.24 MBytes  1.86 Mbits/sec
    

【上篇】
【下篇】

抱歉!评论已关闭.