2/17/2012

Wlan driver of Jorjin SiP modules

if your use wlan modules for Jorjin, can reference my integrated of wlan driver in github.

The wlan driver will be supported WG7210, WG73x, WG75 modules,it running on the Linux 2.6.30 upon and Android GB/ICS.

So if your are interested, let us go ahead !

#################################################################
#

#   NLCP Version        : R4_12
#   Operation system    : Linux / Android
#   Date                       : Jan 2012
#   Mantainer               : Dicky Chiang
#
#################################################################

NLCP(Native Linux Communication Package) is open source with integrated for TI.

The wlan driver will to support WG72, WG73x, WG75x series of Jorjin SiP modules.

Dirver download site:

$ git clone git://github.com/dickychiang/compat-wireless-r4-12.git

========================================================================
1. How to build the driver

You can refer the script file "m.sh" for setting environment. For example:

# Export parameter
$ export ARCH=arm
$ export CROSS_COMPILE=
$ export KERNEL_PATH=
$ export KLIB=${KERNEL_PATH}
$ export KLIB_BUILD=${KERNEL_PATH}

# Compile it
$ make modules

========================================================================
2. Install .ko files

If you are compiled is completed, need to copy file ".ko" to your filesystem. Or reference the script file "cp.sh".

For example:

$ export ROOTFS=
$ cp compat/compat.ko ${ROOTFS}/lib/modules/
$ cp net/mac80211/mac80211.ko ${ROOTFS}/lib/modules
$ cp net/wireless/cfg80211.ko ${ROOTFS}/lib/modules

* WG72x
$ cp drivers/net/wireless/wl1251/*.ko ${ROOTFS}/lib/modules

* WG73x/WG75x
$ cp drivers/net/wireless/wl12xx/*.ko ${ROOTFS}/lib/modules

========================================================================
3. Firmware

Select your type of Jorjin SiP modules then to copy in filesystem.

For example:

$ cp jorjin/wg73x_fw/*.bin ${ROOTFS}/lib/firmware/ti-connectivity

========================================================================
4. Insert module

If boot in system, according to as below for insert module.

$ insmod compat.ko
$ insmod cfg80211.ko
$ insmod mac80211.ko

For your type.
$ insmod wl1251.ko
$ insmod wl1251_sdio.ko

********************************************
* Wireless Configuration (For Linux system)*
********************************************
----------------------------------------------------------------------------------------------------
IW commands are Linux based commands that are used as configuration utility for wireless devices.
IW commands also provide connection to WLAN devices however it is not supported advance security modes (supports Non secured networks and WEP only) therefore we normaly use that option for debug mode only while working without WPA supplicant.

IW commands is use 'nl80211' interface, so we need to install 'libnl' first then to support it.
----------------------------------------------------------------------------------------------------

1. Install libnl-2.0

First to download it:

$ git clone git://github.com/dickychiang/libnl-2.0.git

And export environment or can reference to script 'm.sh'

$ export ROOTFS_PATH=
$ export PATH=:$PATH
$ export CROSS_COMPILE=
$ ./configure --prefix=${ROOTFS}  CC=${CROSS_COMPILE}gcc --host=arm-linux LD=${CROSS_COMPILE}ld
$ make
$ make install
========================================================================
2. Install IW tool for wireless configuration

Download source code :

$ git clone git://github.com/dickychiang/iw-linux.git

Export environment or reference script 'm.sh' for compile.

$ export PKG_CONFIG_PATH=${ROOTFS_PATH}/lib/pkgconfig:$PKG_CONFIG_PATH
$ export PKG_CONFIG_LIBDIR=${ROOTFS_PATH}/lib/:$PKG_CONFIG_LIBDIR
$ export NFSROOT=${ROOTFS_PATH}
$ make PREFIX=${NFSROOT} CC=${CROSS_COMPILE}gcc
$ make PREFIX=${NFSROOT} CC=${CROSS_COMPILE}gcc install
========================================================================
3. How to using the iw tool

Usually, the following is commonly commands.

$ iw wlan0 scan                     // Scan for Wifi network
$ iw wlan0 connect           // Connect to specifc Access point (by its SSID)
$ iw wlan0 disconnect               // Disconnect from the Access point that the Station is connected too  
$ iw wlan0 link                     // Verify Link Status

For example as following:

$ iw wlan0 scan
BSS 00:13:46:dd:e2:e9 (on wlan0)
TSF: 362449530606 usec (4d, 04:40:49)
freq: 2452
beacon interval: 100
capability: ESS Privacy ShortPreamble (0x0031)
    signal: -50.00 dBm
    last seen: 270 ms ago
    SSID: jjap
    Supported rates: 1.0* 2.0* 5.5* 11.0* 22.0
    DS Parameter set: channel 9
    ERP:
    Extended supported rates: 6.0 9.0 12.0 18.0 24.0 36.0 48.0 54.

$ iw wlan0 connect jjap keys 0:0397430202

$ iw wlan0 link
Connected to 00:13:46:dd:e2:e9 (on wlan10)
SSID: jjap
freq: 2452
RX: 9400 bytes (96 packets)
TX: 0 bytes (0 packets)
    signal: -48 dBm
    tx bitrate: 1.0 MBit/s

    bss flags:      short-preamble
    dtim period:    3
    beacon int:     100