Tests:SDIO-KS7010

This document describes how to test the SDIO functionality with a Spectec SDW-823 WIFI card. Note: Later Spectec SDW-821 (FCC: S2Y-WLAN-11G-K) will probably work, too, but this needs verification.

Ensure the driver is activated in the kernel config
Symbol: KS7010 [=y] Prompt: KeyStream KS7010 SDIO support Location: -> Device Drivers -> Staging drivers (STAGING [=y]) Depends on: STAGING [=y] && MMC [=y] && WIRELESS [=y]

The driver appeared upstream in Linux v4.8-rc1. The topic branch is here: 

Prepare the root filesystem for your target
Get the firmware from http://downloads.qi-hardware.com/software/ks7010-firmware-20100217.tar.bz2 and copy the .rom file to /lib/firmware to the root filesystem.

The root filesystem should also have wireless-tools (v3.0-pre9 used in this example) and wpa-supplicant (version 2.5 used in this example).

Boot the kernel
You should see this on successful probe: mmc1: card has broken SDIO 1.1 CIS, forcing SDIO 1.0 mmc1: new SDIO card at address 0001 ks_wlan: MAC ADDRESS = xxx ks_wlan: firmware ver. = 7010-SDIO-0.2f [Jun 04 2009 15:41:36]

In this example, the KS7010 was assigned "eth1". Replace all "eth1" if this differs for your system.

Verify SD card speed and bus width
We want 50MHz at 4 bit width:

clock:         49999998 Hz vdd:            21 (3.3 ~ 3.4 V) bus mode:       2 (push-pull) chip select:   0 (don't care) power mode:    2 (on) bus width:     2 (4 bits) timing spec:   0 (legacy) signal voltage: 0 (3.30 V) driver type:   0 (driver type B)
 * 1) cat /sys/kernel/debug/mmc0/ios

Now scan for networks
eth1     Scan completed : Cell 01 - Address: xxx ESSID:"xxx" Mode:Managed Frequency:2.437 GHz (Channel 6) Quality:100/100 Signal level=-59 dBm  Noise level=0 dBm Encryption key:on Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s 9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s 48 Mb/s; 54 Mb/s
 * 1) iwlist eth1 scan

Create /etc/wpa_supplicant.conf for your network
Here is a template: ctrl_interface=/var/run/wpa_supplicant network={ ssid=" " scan_ssid=1 key_mgmt=WPA-PSK psk=" " }

Start wpa_supplicant to connect to the network
Successfully initialized wpa_supplicant rfkill: Cannot open RFKILL control device eth1: Trying to associate with xxx eth1: Associated with xxx eth1: WPA: Key negotiation completed with xxx [PTK=CCMP GTK=CCMP] eth1: CTRL-EVENT-CONNECTED - Connection to xxx completed [id=0 id_str=]
 * 1) wpa_supplicant -Dwext -ieth1 -c /etc/wpa_supplicant.conf &

Get an address and say hello to someone :)
udhcpc (v1.24.2) started Sending discover... Sending select for 192.168.223.100... Lease of 192.168.223.100 obtained, lease time 86400 PING 192.168.223.1 (192.168.223.1): 56 data bytes 64 bytes from 192.168.223.1: seq=0 ttl=255 time=4.179 ms 64 bytes from 192.168.223.1: seq=1 ttl=255 time=1.617 ms 64 bytes from 192.168.223.1: seq=2 ttl=255 time=1.344 ms 64 bytes from 192.168.223.1: seq=3 ttl=255 time=1.305 ms ...
 * 1) udhcpc -i eth1; ping 192.168.223.1