Difference between revisions of "How to setup Marvell 88w8686 SDIO wifi"

From IGEP - ISEE Wiki

Jump to: navigation, search
Line 1: Line 1:
== How to setup Marvell 88w8686 SDIO wifi ==
+
== How to setup Marvell 88w8686 SDIO wifi ==
  
=== Overview of How-To ===
+
=== 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 ===
+
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.  
At any point, if you see a mistake you can contribute to this How-To.
 
  
=== Setup basics ===
+
=== Feedback and Contributing  ===
  
*libertas: Marvell Libertas 8385/8686/8688 SDIO 802.11b/g card
+
At any point, if you see a mistake you can contribute to this How-To.
 +
 
 +
=== Setup basics  ===
 +
 
 +
*libertas: Marvell Libertas 8385/8686/8688 SDIO 802.11b/g card  
 
*firmware: 9.70.3p24 ( download from http://extranet.marvell.com/drivers/driverDisplay.do?driverId=203 )
 
*firmware: 9.70.3p24 ( download from http://extranet.marvell.com/drivers/driverDisplay.do?driverId=203 )
  
SDIO card should be showed after the image is downloaded to the board.
+
SDIO card should be showed after the image is downloaded to the board.  
 
+
<pre>mmc1: new SDIO card at address 0001
<pre>
+
</pre>  
mmc1: new SDIO card at address 0001
 
</pre>
 
 
The firmware binaries sd8686_helper.bin and sd8686.bin should be in /lib/firmware directory.  
 
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
+
To make the SDIO WIFI module work load the libertas_sdio module  
 
+
<pre># modprobe libertas_sdio
<pre>
 
# modprobe libertas_sdio
 
  
 
libertas_sdio: Libertas SDIO driver
 
libertas_sdio: Libertas SDIO driver
Line 33: Line 31:
 
libertas: PREP_CMD: command 0x00a3 failed: 2
 
libertas: PREP_CMD: command 0x00a3 failed: 2
 
libertas: eth1: Marvell WLAN 802.11 adapter
 
libertas: eth1: Marvell WLAN 802.11 adapter
</pre>
+
</pre>  
 
+
Now you can connect this wifi module to an AP. First of all, you'll check if your devices is detected.  
Now you can connect this wifi module to an AP. First of all, you'll check if your devices is detected.
+
<pre># iwconfig
 
 
<pre>
 
# iwconfig
 
  
 
eth1      IEEE 802.11b/g  ESSID:""   
 
eth1      IEEE 802.11b/g  ESSID:""   
Line 49: Line 44:
 
           Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
 
           Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
 
           Tx excessive retries:0  Invalid misc:0  Missed beacon:0
 
           Tx excessive retries:0  Invalid misc:0  Missed beacon:0
</pre>
+
</pre>  
Next, you will set up the interface
+
Next, you will set up the interface  
 
+
<pre># ifconfig eth1 up
<pre>
 
# ifconfig eth1 up
 
  
 
eth1      Link encap:Ethernet  HWaddr 00:13:E0:C3:0C:3C   
 
eth1      Link encap:Ethernet  HWaddr 00:13:E0:C3:0C:3C   
Line 61: Line 54:
 
           collisions:0 txqueuelen:1000  
 
           collisions:0 txqueuelen:1000  
 
           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
 
           RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
</pre>
+
</pre>  
and you can scan for an AP
+
and you can scan for an AP  
 
+
<pre># iwlist eth1 scan
<pre>
 
# iwlist eth1 scan
 
  
 
Cell 04 - Address: 00:18:84:81:46:E2
 
Cell 04 - Address: 00:18:84:81:46:E2
Line 76: Line 67:
 
                               11 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
 
                               11 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
 
                               48 Mb/s; 54 Mb/s
 
                               48 Mb/s; 54 Mb/s
</pre>
+
</pre>  
Now, is time to associate to your AP
+
Now, is time to associate to your AP  
 
+
<pre># iwconfig eth1 txpower auto essid MyPlace channel 4
<pre>
 
# iwconfig eth1 txpower auto essid MyPlace channel 4
 
  
 
eth1      IEEE 802.11b/g  ESSID:"MyPlace"   
 
eth1      IEEE 802.11b/g  ESSID:"MyPlace"   
Line 91: Line 80:
 
           Rx invalid nwid:0  Rx invalid crypt:3109  Rx invalid frag:0
 
           Rx invalid nwid:0  Rx invalid crypt:3109  Rx invalid frag:0
 
           Tx excessive retries:13  Invalid misc:3315  Missed beacon:0
 
           Tx excessive retries:13  Invalid misc:3315  Missed beacon:0
</pre>
+
</pre>  
and get and ip address
+
and get and ip address  
 
+
<pre># udhcpc -i eth1
<pre>
 
# udhcpc -i eth1
 
 
udhcpc (v1.9.1) started
 
udhcpc (v1.9.1) started
 
Sending discover...
 
Sending discover...
Line 101: Line 88:
 
Lease of 192.168.10.216 obtained, lease time 43200
 
Lease of 192.168.10.216 obtained, lease time 43200
 
adding dns 192.168.10.1
 
adding dns 192.168.10.1
</pre>
+
</pre>  
Last, you can test the network interface.
+
Last, you can test the network interface.  
 
+
<pre># ping -c 1 192.168.10.1
<pre>
 
# ping -c 1 192.168.10.1
 
  
 
PING 192.168.10.1 (192.168.10.1): 56 data bytes
 
PING 192.168.10.1 (192.168.10.1): 56 data bytes
Line 113: Line 98:
 
1 packets transmitted, 1 packets received, 0% packet loss
 
1 packets transmitted, 1 packets received, 0% packet loss
 
round-trip min/avg/max = 16.327/16.327/16.327 ms
 
round-trip min/avg/max = 16.327/16.327/16.327 ms
</pre>
+
</pre>  
 +
== How to debug the libertas driver  ==
  
== How to debug the libertas driver ==
+
From: http://wiki.laptop.org/go/Libertas_Debug
  
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:  
  
To enable debug on the wireless (libertas) driver you may write to the libertas_debug '/sys' file:
+
echo ''LBS_DEBUG_FLAGS'' &gt; /sys/module/libertas/parameters/libertas_debug
echo <i>LBS_DEBUG_FLAGS</i> > /sys/module/libertas/parameters/libertas_debug
 
  
You can calculate the value for <i>LBS_DEBUG_FLAGS</i> using the table bellow (just add up the values for the flags you want to activate).
+
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).  
  
<table border="1" cellpadding="2" cellspacing="2">
+
{| cellspacing="2" cellpadding="2" border="1"
<tr><th>Debug Flag Name</th><th>Flag Hex value</th><th>Description(*)</th></tr>
+
|-
<tr><td>LBS_DEB_ENTER</td><td>0x00000001<td>function entrance</td>
+
! Debug Flag Name
<tr><td>LBS_DEB_LEAVE</td><td>0x00000002<td>function exit</td></tr>
+
! Flag Hex value
<tr><td>LBS_DEB_MAIN</td><td>0x00000004<td>main libertas library code</td></tr>
+
! Description(*)
<tr><td>LBS_DEB_NET</td><td>0x00000008<td>interaction with network subsystem</td></tr>
+
|-
<tr><td>LBS_DEB_MESH</td><td>0x00000010<td>wireless mesh network</td></tr>
+
| LBS_DEB_ENTER
<tr><td>LBS_DEB_WEXT</td><td>0x00000020<td>interaction with wireless extensions</td></tr>
+
| 0x00000001
<tr><td>LBS_DEB_IOCTL</td><td>0x00000040<td>misc IOCTLs</td></tr>
+
| function entrance
<tr><td>LBS_DEB_SCAN</td><td>0x00000080<td>scanning for APs</td></tr>
+
|-
<tr><td>LBS_DEB_ASSOC</td><td>0x00000100<td>associating ton an AP</td></tr>
+
| LBS_DEB_LEAVE
<tr><td>LBS_DEB_JOIN</td><td>0x00000200<td>joining an IBSS?</td></tr>
+
| 0x00000002
<tr><td>LBS_DEB_11D</td><td>0x00000400<td>802.11d country settings</td></tr>
+
| function exit
<tr><td>LBS_DEB_DEBUGFS</td><td>0x00000800<td>interaction with the debugfs subsystem</td></tr>
+
|-
<tr><td>LBS_DEB_ETHTOOL</td><td>0x00001000<td>interaction with ethtool subsystem</td></tr>
+
| LBS_DEB_MAIN
<tr><td>LBS_DEB_HOST</td><td>0x00002000<td>communication between host and wlan chip</td></tr>
+
| 0x00000004
<tr><td>LBS_DEB_CMD</td><td>0x00004000<td>command and response processing</td></tr>
+
| main libertas library code
<tr><td>LBS_DEB_RX</td><td>0x00008000<td>packet reception</td></tr>
+
|-
<tr><td>LBS_DEB_TX</td><td>0x00010000<td>packet transmission</td></tr>
+
| LBS_DEB_NET
<tr><td>LBS_DEB_USB</td><td>0x00020000<td>interaction with USB subsystem</td></tr>
+
| 0x00000008
<tr><td>LBS_DEB_CS</td><td>0x00040000<td>interaction with card services subsystem</td></tr>
+
| interaction with network subsystem
<tr><td>LBS_DEB_FW</td><td>0x00080000<td>firmware downloading</td></tr>
+
|-
<tr><td>LBS_DEB_THREAD</td><td>0x00100000<td>main libertas worker thread</td></tr>
+
| LBS_DEB_MESH
<tr><td>LBS_DEB_HEX</td><td>0x00200000<td>turn on detailed hex dumps</td></tr>
+
| 0x00000010
<tr><td>LBS_DEB_SDIO</td><td>0x00400000<td>interaction with SDIO subsystem</td></tr>
+
| wireless mesh network
<tr><td colspan=3>(*) Description taken from [http://git.infradead.org/?p=users/schurig/libertas-tools.git;a=blob_plain;f=lbsdebug/lbsdebug.c;hb=master lbsdebug.c] (by Holger Schurig)</td></tr>
+
|-
</table>
+
| LBS_DEB_WEXT
 +
| 0x00000020
 +
| interaction with wireless extensions
 +
|-
 +
| LBS_DEB_IOCTL
 +
| 0x00000040
 +
| misc IOCTLs
 +
|-
 +
| LBS_DEB_SCAN
 +
| 0x00000080
 +
| scanning for APs
 +
|-
 +
| LBS_DEB_ASSOC
 +
| 0x00000100
 +
| associating ton an AP
 +
|-
 +
| LBS_DEB_JOIN
 +
| 0x00000200
 +
| joining an IBSS?
 +
|-
 +
| LBS_DEB_11D
 +
| 0x00000400
 +
| 802.11d country settings
 +
|-
 +
| LBS_DEB_DEBUGFS
 +
| 0x00000800
 +
| interaction with the debugfs subsystem
 +
|-
 +
| LBS_DEB_ETHTOOL
 +
| 0x00001000
 +
| interaction with ethtool subsystem
 +
|-
 +
| LBS_DEB_HOST
 +
| 0x00002000
 +
| communication between host and wlan chip
 +
|-
 +
| LBS_DEB_CMD
 +
| 0x00004000
 +
| command and response processing
 +
|-
 +
| LBS_DEB_RX
 +
| 0x00008000
 +
| packet reception
 +
|-
 +
| LBS_DEB_TX
 +
| 0x00010000
 +
| packet transmission
 +
|-
 +
| LBS_DEB_USB
 +
| 0x00020000
 +
| interaction with USB subsystem
 +
|-
 +
| LBS_DEB_CS
 +
| 0x00040000
 +
| interaction with card services subsystem
 +
|-
 +
| LBS_DEB_FW
 +
| 0x00080000
 +
| firmware downloading
 +
|-
 +
| LBS_DEB_THREAD
 +
| 0x00100000
 +
| main libertas worker thread
 +
|-
 +
| LBS_DEB_HEX
 +
| 0x00200000
 +
| turn on detailed hex dumps
 +
|-
 +
| LBS_DEB_SDIO
 +
| 0x00400000
 +
| interaction with SDIO subsystem
 +
|-
 +
| colspan="3" | (*) Description taken from [http://git.infradead.org/?p=users/schurig/libertas-tools.git;a=blob_plain;f=lbsdebug/lbsdebug.c;hb=master lbsdebug.c] (by Holger Schurig)
 +
|}
  
 +
<br> Example:<br> To activate scanning (LBS_DEB_SCAN), associating (LBS_DEB_ASSOC), command (LBS_DEB_CMD) and host (LBS_DEB_HOST):
  
Example:<br>
+
  echo 0x6180 &gt; /sys/module/libertas/parameters/libertas_debug
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:
  
The output will be post to the kernel ring buffer. You can display it with the dmesg command:
 
 
  dmesg
 
  dmesg
  
You can also use the lbsdebug tool, from Holger Shurig, git tree available [http://git.infradead.org/?p=users/schurig/libertas-tools.git;a=blob_plain;f=lbsdebug/lbsdebug.c;hb=master here].
+
You can also use the lbsdebug tool, from Holger Shurig, git tree available [http://git.infradead.org/?p=users/schurig/libertas-tools.git;a=blob_plain;f=lbsdebug/lbsdebug.c;hb=master here].  
 +
 
 +
== How to get WIFI active upon system start (using a WPA2 access-point)  ==
 +
 
 +
Tested configuration:
 +
*IGEP v3 board
 +
*Ubuntu Linux provided on the SD-card
 +
*WIFI access point with WPA-PSK encryption method.
 +
 
 +
 
 +
Basically you have to create/modify two files:
 +
 
 +
#create file /etc/wpa_supplicant.conf
 +
#modify /etc/network/interfaces
 +
 
 +
Here are the details.
 +
 
 +
 
 +
To create /etc/wpa_supplicant.conf do:
 +
 
 +
<pre>wpa_passphrase "your SSID" yourPassword &gt; /etc/wpa_supplicant.conf</pre>
 +
 
 +
Now add the following lines at the end of this file:
 +
 
 +
<pre>proto=WPA2
 +
key_mgmt=WPA-PSK
 +
pairwise=CCMP</pre>
 +
 
 +
Then modify /etc/network/interfaces
 +
 
 +
Change the line
 +
<pre>auto eth0
 +
into
 +
#auto eth0</pre>
 +
 
 +
Add the next lines (replace eth2 by your wifi interface):
 +
<pre>iface eth2 inet dhcp
 +
wpa-conf /etc/wpa_supplicant.conf</pre>
  
 +
To check if your /etc/wpa_supplicant.conf file is correct you can type
  
 +
<pre>wpa_supplicant -ieth2 -c/etc/wpa_supplicant.conf -d</pre>
  
[[Category:How to forge|Wireless]]
+
[[Category:How_to_forge|Wireless]]

Revision as of 18:13, 20 July 2010

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 Name Flag Hex value Description(*)
LBS_DEB_ENTER 0x00000001 function entrance
LBS_DEB_LEAVE 0x00000002 function exit
LBS_DEB_MAIN 0x00000004 main libertas library code
LBS_DEB_NET 0x00000008 interaction with network subsystem
LBS_DEB_MESH 0x00000010 wireless mesh network
LBS_DEB_WEXT 0x00000020 interaction with wireless extensions
LBS_DEB_IOCTL 0x00000040 misc IOCTLs
LBS_DEB_SCAN 0x00000080 scanning for APs
LBS_DEB_ASSOC 0x00000100 associating ton an AP
LBS_DEB_JOIN 0x00000200 joining an IBSS?
LBS_DEB_11D 0x00000400 802.11d country settings
LBS_DEB_DEBUGFS 0x00000800 interaction with the debugfs subsystem
LBS_DEB_ETHTOOL 0x00001000 interaction with ethtool subsystem
LBS_DEB_HOST 0x00002000 communication between host and wlan chip
LBS_DEB_CMD 0x00004000 command and response processing
LBS_DEB_RX 0x00008000 packet reception
LBS_DEB_TX 0x00010000 packet transmission
LBS_DEB_USB 0x00020000 interaction with USB subsystem
LBS_DEB_CS 0x00040000 interaction with card services subsystem
LBS_DEB_FW 0x00080000 firmware downloading
LBS_DEB_THREAD 0x00100000 main libertas worker thread
LBS_DEB_HEX 0x00200000 turn on detailed hex dumps
LBS_DEB_SDIO 0x00400000 interaction 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.

How to get WIFI active upon system start (using a WPA2 access-point)

Tested configuration:

  • IGEP v3 board
  • Ubuntu Linux provided on the SD-card
  • WIFI access point with WPA-PSK encryption method.


Basically you have to create/modify two files:

  1. create file /etc/wpa_supplicant.conf
  2. modify /etc/network/interfaces

Here are the details.


To create /etc/wpa_supplicant.conf do:

wpa_passphrase "your SSID" yourPassword > /etc/wpa_supplicant.conf

Now add the following lines at the end of this file:

proto=WPA2
key_mgmt=WPA-PSK
pairwise=CCMP

Then modify /etc/network/interfaces

Change the line

auto eth0 
into 
#auto eth0

Add the next lines (replace eth2 by your wifi interface):

iface eth2 inet dhcp
wpa-conf /etc/wpa_supplicant.conf

To check if your /etc/wpa_supplicant.conf file is correct you can type

wpa_supplicant -ieth2 -c/etc/wpa_supplicant.conf -d