How to setup Marvell 88w8686 SDIO wifi

From IGEP - ISEE Wiki

Revision as of 14:11, 17 June 2010 by Eballetbo (talk | contribs)

Jump to: navigation, search

How to setup Marvell 88w8686 SDIO wifi

Overview of How-To

This How-To is meant to be a starting point for people to learn setup the wifi on IGEP v2 devices as quickly and easily as possible.

Feedback and Contributing

At any point, if you see a mistake you can contribute to this How-To.

Setup basics

SDIO card should be showed after the image is downloaded to the board.

mmc1: new SDIO card at address 0001

The firmware binaries sd8686_helper.bin and sd8686.bin should be in /lib/firmware directory.

To make the SDIO WIFI module work load the libertas_sdio module

# modprobe libertas_sdio

libertas_sdio: Libertas SDIO driver
libertas_sdio: Copyright Pierre Ossman
libertas_sdio mmc1:0001:1: firmware: requesting sd8686_helper.bin
libertas_sdio mmc1:0001:1: firmware: requesting sd8686.bin
libertas: 00:13:e0:c3:0c:3c, 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

Now you can connect this wifi module to an AP. First of all, you'll check if your devices is detected.

# iwconfig

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

Next, you will set up the interface

# ifconfig eth1 up

eth1      Link encap:Ethernet  HWaddr 00:13:E0:C3:0C:3C  
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

and you can scan for an AP

# iwlist eth1 scan

Cell 04 - Address: 00:18:84:81:46:E2
                    ESSID:"MyPlace"
                    Mode:Managed
                    Frequency:2.427 GHz (Channel 4)
                    Quality=100/100  Signal level=-39 dBm  Noise level=-96 dBm
                    Encryption key:off
                    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

Now, is time to associate to your AP

# iwconfig eth1 txpower auto essid MyPlace channel 4

eth1      IEEE 802.11b/g  ESSID:"MyPlace"  
          Mode:Managed  Frequency:2.427 GHz  Access Point: 00:18:84:81:46:E2   
          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=97/100  Signal level=-43 dBm  Noise level=-94 dBm
          Rx invalid nwid:0  Rx invalid crypt:3109  Rx invalid frag:0
          Tx excessive retries:13  Invalid misc:3315   Missed beacon:0

and get and ip address

# udhcpc -i eth1
udhcpc (v1.9.1) started
Sending discover...
Sending select for 192.168.10.216...
Lease of 192.168.10.216 obtained, lease time 43200
adding dns 192.168.10.1

Last, you can test the network interface.

# ping -c 1 192.168.10.1

PING 192.168.10.1 (192.168.10.1): 56 data bytes
64 bytes from 192.168.10.1: seq=0 ttl=64 time=16.327 ms

--- 192.168.10.1 ping statistics ---
1 packets transmitted, 1 packets received, 0% packet loss
round-trip min/avg/max = 16.327/16.327/16.327 ms

How to debug the libertas driver

From: http://wiki.laptop.org/go/Libertas_Debug

To enable debug on the wireless (libertas) driver you may write to the libertas_debug '/sys' file:

echo LBS_DEBUG_FLAGS > /sys/module/libertas/parameters/libertas_debug

You can calculate the value for LBS_DEBUG_FLAGS using the table bellow (just add up the values for the flags you want to activate).

Debug Flag NameFlag Hex valueDescription(*)
LBS_DEB_ENTER0x00000001function entrance
LBS_DEB_LEAVE0x00000002function exit
LBS_DEB_MAIN0x00000004main libertas library code
LBS_DEB_NET0x00000008interaction with network subsystem
LBS_DEB_MESH0x00000010wireless mesh network
LBS_DEB_WEXT0x00000020interaction with wireless extensions
LBS_DEB_IOCTL0x00000040misc IOCTLs
LBS_DEB_SCAN0x00000080scanning for APs
LBS_DEB_ASSOC0x00000100associating ton an AP
LBS_DEB_JOIN0x00000200joining an IBSS?
LBS_DEB_11D0x00000400802.11d country settings
LBS_DEB_DEBUGFS0x00000800interaction with the debugfs subsystem
LBS_DEB_ETHTOOL0x00001000interaction with ethtool subsystem
LBS_DEB_HOST0x00002000communication between host and wlan chip
LBS_DEB_CMD0x00004000command and response processing
LBS_DEB_RX0x00008000packet reception
LBS_DEB_TX0x00010000packet transmission
LBS_DEB_USB0x00020000interaction with USB subsystem
LBS_DEB_CS0x00040000interaction with card services subsystem
LBS_DEB_FW0x00080000firmware downloading
LBS_DEB_THREAD0x00100000main libertas worker thread
LBS_DEB_HEX0x00200000turn on detailed hex dumps
LBS_DEB_SDIO0x00400000interaction with SDIO subsystem
(*) Description taken from lbsdebug.c (by Holger Schurig)


Example:
To activate scanning (LBS_DEB_SCAN), associating (LBS_DEB_ASSOC), command (LBS_DEB_CMD) and host (LBS_DEB_HOST):

echo 0x6180 > /sys/module/libertas/parameters/libertas_debug

The output will be post to the kernel ring buffer. You can display it with the dmesg command:

dmesg

You can also use the lbsdebug tool, from Holger Shurig, git tree available here.