移植wifi,显然必须了解wifi的基础结构,尤其在Android下的结构。
1 wifi的系统结构:
2 SDIO/wifi驱动分析
1.1 Android 下的wifi配置设置
在GOOGLE的网站上有一个wifi的大致介绍 -》
1.2 WL18xx Platform Integration Guide
http://processors./index.php/WL18xx_Platform_Integration_Guide
Software Porting
WLAN SW Blocks
The host communicates via SDIO to the WLAN device. On the device side, the WLAN MAC is responsiblefor the 802.11 MAC functions, and conveys WLAN packets from/to the external host to/from the FW.The MAC is responsible for the timing and the time critical decisions only. The PHY performs the 802.11PHY functions of encoding/decoding and modulation/demodulation, and is responsible for the RF functionsof up/down modulation to carrier frequency, filtering and amplification.
Board Initialization file
For each platform there is a board file inside the PSP where the initial board related software bringup is doneThe board file is located inside the linux kernel source tree under “arch/arm/mach-(omap2/davinci)/board-xxxx.cNote:This presentation is mostly based on board_am335x-evm.c located under “arch/arm/mach-omap2”, but similar initilization is needed for every new platform which is connecting to the same type of WiLink module.【实践】x210系统下的板子的设置如下:
hanson@hanson-desktop:~/x210_ics_rtm_v13/kernel/arch/arm/mach-s5pv210$ vim mach-x210.c
Initialization sequence
Inside the am335x-evm board file there is an initialization function called am335x_evm_setup(). This function is called when the Linux kernel boots.For the standard am335x-evm this function is calling setup_general_purpose_evm() function which sets up all the peripherals that are in use.This function initiates calls to all the initialization functions which are located inside the gen_purp_evm_dev_cfg[] device configuration structure.The functions which are related to the connectivity parts are mmc2_wl12xx_init, uart1_wl12xx_init and wl12xx_init. These functions are descibed below.
MMC initialization
The WLAN subsystem is usually connected using a second MMC port of the host processor. The first MMC is normally used for SD card.
On the Aam335x-evm MMC3 is being used and an init function is provided for initializing this MMC structure data.Before we can use the SDIO pins they need to be muxed in the kernel for SDIO mode.
The SDIO related pin muxes are set in the structure below:
/* Module pin mux for wlan and bluetooth */static struct pinmux_config mmc2_wl12xx_pin_mux[] = {{"gpmc_a1.mmc2_dat0",OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP},<br>{"gpmc_a2.mmc2_dat1",OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP},{"gpmc_a3.mmc2_dat2",OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP},{"gpmc_ben1.mmc2_dat3",OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP},{"gpmc_csn3.mmc2_cmd",OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP},{"gpmc_clk.mmc2_clk",OMAP_MUX_MODE3 | AM33XX_PIN_INPUT_PULLUP},{NULL, 0},};
The below function is used for setting up this MMC interface. In this function the pin mux structure is being intialized and then the inteface is initilized as a non-removeable card working in 4-Bit mode.
static void mmc2_wl12xx_init(int evm_id, int profile){setup_pin_mux(mmc2_wl12xx_pin_mux);am335x_mmc[1].mmc =3;am335x_mmc[1].name ="wl1271";am335x_mmc[1].caps =MMC_CAP_4_BIT_DATA | MMC_CAP_POWER_OFF_CARD;am335x_mmc[1].nonremovable =true;am335x_mmc[1].gpio_cd =-EINVAL;am335x_mmc[1].gpio_wp =-EINVAL;am335x_mmc[1].ocr_mask =MMC_VDD_32_33 | MMC_VDD_33_34; /* 3V3 *//* mmc will be initialized when mmc0_init is called */return;}
Themmc2_wl12xx_init()function is placed inside the board configuration structure seen below and when it is called during board startup a second mmc interface is created in the kernel (mmc1) which is used for communicating with the WLAN sub-system.
/* General Purpose EVM */static struct evm_dev_cfg gen_purp_evm_dev_cfg[] = {{enable_ecap0,DEV_ON_DGHTR_BRD, (PROFILE_0 | PROFILE_1 | PROFILE_2 | PROFILE_7) },{lcdc_init,DEV_ON_DGHTR_BRD, (PROFILE_0 | PROFILE_1 | PROFILE_2 | PROFILE_7) },......{mmc1_init,DEV_ON_DGHTR_BRD, PROFILE_2},{mmc2_wl12xx_init,DEV_ON_BASEBOARD, (PROFILE_0 | PROFILE_3 | PROFILE_5)},{mmc0_init,DEV_ON_BASEBOARD, (PROFILE_ALL & ~PROFILE_5)},{mmc0_no_cd_init,DEV_ON_BASEBOARD, PROFILE_5},{spi0_init,DEV_ON_DGHTR_BRD, PROFILE_2},{uart1_wl12xx_init,DEV_ON_BASEBOARD, (PROFILE_0 | PROFILE_3 | PROFILE_5)},{wl12xx_init,DEV_ON_BASEBOARD, (PROFILE_0 | PROFILE_3 | PROFILE_5)},......{haptics_init,DEV_ON_DGHTR_BRD, (PROFILE_4)},{NULL, 0, 0},};
GPIO Pins Configuration
In addition to the MMC, UART intefcaes, the WiLink module needs three additional GPIO lines: WLAN Enable (GPIO1_16): Set as an output pinWLAN Irq (GPIO3_17): Set as a GPIO input pinBT/GPS Enable (GPIO3_21): Set as a GPIO output pin with pull-up enabled. The pullup is needed for keeping the chip enabled when system is suspending so we would not need to releoad the firmware after each suspend/resume cycle.
The strucure below is used for setting the muxing of these pins:
static struct pinmux_config wl12xx_pin_mux[] = {{"gpmc_a0.gpio1_16", OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT},{"mcasp0_ahclkr.gpio3_17", OMAP_MUX_MODE7 | AM33XX_PIN_INPUT},{"mcasp0_ahclkx.gpio3_21", OMAP_MUX_MODE7 | AM33XX_PIN_OUTPUT_PULLUP},{NULL, 0},};
Important Build guid:(Suggest from TI emproee)
0 BSP build guide
http://processors./index.php?title=WL18xx_AMxxx_platform_integration_guide
1
http://processors./index.php/WL18xx_WiFi_Build_Process
2
/wiki/4AJ.2.3_OMAP4_Jelly_Bean_Release_Notes#Building_WLAN_driver
Ref : Basic:
1 Android WIFI框架分析(1)
/wh_19910525/article/details/7384480
/menuconfig/article/details/7306931
2 Android_Wifi_HAL层
/c0611/article/details/16804035
3 android WIFI学习总结
/ldinvicible/article/details/11909411
4 Android开发--WIFi基本结构
/liuhui_8989/article/details/23045499
5 Android平台开发-WIFI 驱动移植 -- 详细
/wh_19910525/article/details/7392199
6 WIFI INSTANT by blog
/wh_19910525/article/category/1107726
7 Android WIFI guide
/online-pdk/guide/wifi.html
8 SDIO/wifi驱动分析BASIC
/wh_19910525/article/details/7392518
ref:Porting
1 Atheros AR6003 SDIO WiFi Integration
/wiki/index.php/Atheros_AR6003_SDIO_WiFi_Integration#Open_Source_project
2 wl12xx Driver for Texas Instrumwl12xx
Driver for Texas Instruments' Wilink(tm) combo devices WL1271/3 and WL1281/3 ents' Wilink(tm) combo devices WL1271/3 and WL1281/
/en/users/Drivers/wl12xx
3 linux下MMC/SD/SDIO驱动系列之二 ---- host注册过程(一)
/xieweihua/article/details/12844733
4 How to Support New WiFi Card in AndroidHow to Support New WiFi Card in Android
/docs/DOC-93603
TI ReF:
-1 TI E2E for wireless
WiLink™ WiFi + Bluetooth Forum
WL18xx & WL127x Applications.
/support/wireless_connectivity/f/307.aspx
-2 TI Linux SDKs
/lsds/ti/tools-software/linux.page
0 basic WL18xx Linux Wireless Architecture
WL18xx Linux Wireless Architecture
http://processors./index.php/WL18xx_Linux_Wireless_Architecture
1 WL18xx Guide list
1 http://processors./index.php/WL18xx?DCMP=wilink8&HQS=wilink8wiki
2 WL18xx Platform Integration Guide
http://processors./index.php/WL18xx_Platform_Integration_Guide
3 TI mail list
/listinfo/meta-ti
4 TI support and question website
/
http://www.wi-/
/question_answer/dsp_arm/sitara_arm/f/25/t/59289.aspx
5 TI-Android-ICS-PortingGuide
http://processors./index.php/TI-Android-ICS-PortingGuide#WLAN
TI-Android-ICS-4.0.3-DevKit-3.0.1 ReleaseNotes
http://processors./index.php/TI-Android-ICS-4.0.3-DevKit-3.0.1_ReleaseNotes
Ref: Deep:
1 Linux WPA/WPA2/IEEE 802.1X Supplicant
http://w1.fi/wpa_supplicant/
Source Referece:
1 完整的TI解决方案
http://processors./index.php/TI-Android-ICS-4.0.3-DevKit-3.0.1_ReleaseNotes
2 WL8 Rlease:
http://processors./index.php/WL8_release_download_page
本文系统:
ARM cotext-A8 x210 platform
Android 4.0
Ubuntu 10.10
Made by Frank Huang @ makin.huang@