基於FS2410的SDIO WIFI移植

來源:互聯網
上載者:User

 

一、SDIO 裝置驅動移植
(1)修改SD卡驅動使核心支援SD卡
修改檔案:arch/arm/mach-s3c2410/mach-smdk2410.c
 添加所需標頭檔:
 #include<mach/gpio.h>
 #include<linux/mmc/host.h>
 #include<plat/mci.h>
 
 //增加平台裝置對sd卡的支援
 static struct platform_device *smdk2410_devices[] __initdata = {
 &s3c_device_ohci,
 &s3c_device_lcd,
 &s3c_device_wdt,
 &s3c_device_i2c0,
 &s3c_device_iis,
 &s3c_device_sdi,   
 };

 添加平台資料dev->platform_data
 Static struct s3c24xx_mci_pdata smdk2410_mmc_cfg__initdata={
  .gpio_detect = S3C2410_GPG(10),
  .set_power = NULL,
  .ocr_avail = MMC_VDD_32_33,
 };
(2)在smdk2410_init中添加
S3c24xx_mci_set_platdata(&smdk2410_mmc_cfg);
二、配置核心以支援Marvel無線WIFI
選擇35核心中的wlan marwell sdio模組

 device drivers ---->
           [*] Network device support  --->
                     [*] Wireless LAN  --->
                           <M> Marwell 8xxx Libertas WLAN driver support
                           <M> Marwell Libertas 8385/8686/8688 SDIO 802.11b/g cards
 Networking support --->
            -*-   Wireless  --->
                   <*> cfg80211 - wireless configureation API
                    {*} common routines for IEEE 802.11 drivers

 三、編譯核心,產生驅動模組
(1)先執行make 然後make modules  //核心產生模組的方式
(2)將產生的wlan相關ko檔案拷貝到目標板中,在這我放在/sdio目錄下

home/kernel/linux-2.6.35/drivers/net/wireless/libertas/$ cp
libertas.ko libertas_sdio.ko
  /rootfs/filesystem/sdio/
/rootfs/filesystem/sdio$ls
libertas.ko  libertas_sdio.ko
(3)把韌體helper_sd.bin sd8686.bin拷貝到相應的位置/rootfs/filesystem/lib/firmware/mrvl/ (Android中wifi.c有定義,屬於HAL層,後面兩個目錄是自己建立的)
(4)在目標板子插入SDIO WIFI 並載入驅動
首先插入SDIO WIFI 然後載入驅動
/sdio#insmod libertas.ko
/sdio#insmod libertas_sdio.ko helper_name=/lib/firmware/mrvl/helper_sd.bin fw_name=/lib/firmware/mrvl/sd8686.bin (注意要在一行)
驅動載入完成會提示:(注意:如果沒有,則再次熱插拔你的sdio wifi卡便可以看到)
  if_sdio_intterupt
  libertas: 00:01:36:19:b3:6b, fw 9.70.3p23, cap 0x00000303
  if_sdio_intterupt
  libertas: wlan0: Marvell WLAN 802.11 adapter
  sdio_havefister_driver
  sdio_init_module have done
四、製作無線測試載入器
測試無線網卡用無線工具iwconfig iwlist等命令是通過開源軟體wireless_tools_29.rar編譯得到。
步驟:
(1)首先在windows目錄解壓上面那個軟體包,把解壓後的檔案夾複製到虛擬機器/home$ls
wireless_tools_29
/home/wireless_tools_29$
(2)修改Makefile   

  8   PREFIX = /home/wtools  //指定安裝路徑
 12  CC = arm-linux-gnu-gcc (和編譯你的檔案系統所用保持一致,也可靜態編譯,對Makefile適當修改)
 14  AR = arm-linux-gnu-ar

接著make 然後執行make install 即可。在/home/wtools下查看有:
lib sbin usr
目錄,libiw.so(這是個軟串連) libiw.so.29庫在lib目錄  而sbin目錄為一些網路工具,如:iwlist、iwconfig等  可以man xxx查看功能
(3)拷貝libiw.so、libiw.so.29庫和測試載入器
/home/wtools/lib/$cp * /rootfs/filesystem/lib
-a

/home/wtools/sbin/$cp * /rootfs/filesystem/bin (這樣就不用考慮環境變數了)
五、測試
ifconfig -a
      查看是否檢測到無線網卡 
在測試載入器目錄下測試
/sdio/wtools#ifconfig wlan0 up      
/sdio/wtools#iwlist wlan0 scanning                    //搜尋熱點
/sdio/wtools#iwconfig wlan0 essid "FS241"    //連結熱點
/sdio/wtools#ifconfig wlan0 192.168.1.99 netmask 255.255.255.0 up
(靜態分配,也可以動態分配。參考我的《基於FS2410的DHCP移植》)
/sdio/wtools#route add default gw 192.168.1.1
/sdio/wtools#ping 192.168.1.1 (測試ping通後,就可以接著給它加密了)
待更新……

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.