RT3070 在S3C2440平台上的移植

來源:互聯網
上載者:User
RT3070 在S3C2440平台上的移植

1.從官方下載原驅動程式
http://www.ralinktech.com/en/04_support/license.php?sn=5016

然後把驅動代碼放到/home/tango/code/linux-2.6.32.2/drivers/net/wireless/目錄下
其中/home/tango/code/linux-2.6.32.2 是 linux2.6.32.2核心源碼路徑。

2.在rt3070驅動程式根目錄的Makefile檔案的修改
2.1.定義晶片類型及標頭檔包含路徑以及選擇硬體運行平台

CHIPSET = 3070

C_INCLUDE_PATH ?= $(PWD)/include

PLATFORM = SMDK

2.2修改LINUX_SRC及CROSS_COMPILE參數

ifeq ($(PLATFORM),SMDK)

#LINUX_SRC = /home/bhushan/itcenter/may28/linux-2.6-samsung

#CROSS_COMPILE = /usr/local/arm/4.2.2-eabi/usr/bin/arm-linux-
#以下設定根據自己的置放位置及編譯具體路徑設定

LINUX_SRC = /home/tango/code/linux-2.6.32.2

CROSS_COMPILE = /opt/FriendlyARM/toolschain/4.4.3/bin/arm-linux-

endif

3.在os/linux/config.mk 檔案中
定義

CHIPSET = 3070

CROSS_COMPILE ?=/opt/FriendlyARM/toolschain/4.4.3/bin/arm-linux-

修改以下兩個選項

# Support Wpa_Supplicant

HAS_WPA_SUPPLICANT=y

# Support Native WpaSupplicant for Network Maganger

HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y

然後再make即可產生rt3070sta.ko檔案。

把RT2870STA.dat檔案複製到etc/Wireless/RT2870STA 目錄下

若編譯中出現

/home/arm443/code/linux-2.6.32.2/drivers/net/wireless/rt3070/os/linux/../../chips/rtmp_chip.c:470: error: implicit declaration of function 'RT33xx_Init'

make[2]: *** [/home/arm443/code/linux-2.6.32.2/drivers/net/wireless/rt3070/os/linux/../../chips/rtmp_chip.o] Error 1

make[1]: *** [_module_/home/arm443/code/linux-2.6.32.2/drivers/net/wireless/rt3070/os/linux] Error 2

make[1]: Leaving directory `/home/arm443/code/linux-2.6.32.2'

make: *** [LINUX] Error 2

錯誤,則把/chips/rtmp_chip.c中的470行代碼給屏蔽掉,然後再編譯。

iwlist  scan  搜尋網路

ifconfig eth0 down  關閉有線網路

insmod rt3070sta.ko   動態載入rt3070驅動

ifconfig ra0 192.168.1.231 up  設定無線網線的ip

route add default gw 192.168.1.1 添加網關

wpa_supplicant -Dwext -i ra0 -c /etc/wpa_supplicant.conf -dd  &  串連無線路由,因為現大部分是wpa、wpa2加密的,所以使用wpa_supplicant 工具。

在開發板終端建立無線網卡運行目錄:

mkdir –p /var/run/wpa_supplicant

建立/etc/wpa_supplicant檔案,檔案的內容如下,其中ssid為網路名稱,psk為密碼  

ctrl_interface=/var/run/wpa_supplicant

 

network={

    ssid="aaa 001"

    scan_ssid=1

    key_mgmt=WPA-EAP WPA-PSK IEEE8021X NONE

    pairwise=TKIP CCMP

    group=CCMP TKIP WEP104 WEP40

    psk="aaa2007"

}

另:若驅動移植好後,用ifconfig -a可以看到這時多了一組ra0裝置,它就是無線網卡的相關資訊。
如果看到的是wlan0而不是ra0 的話,可能是在與rt2800驅動衝突導致的,在linux核心中讓以下幾項不編譯進核心中。
 --- Ralink driver support                                        │ │  
  │ │    < >   Ralink rt2500 (USB) support                                │ │  
  │ │    < >   Ralink rt2501/rt73 (USB) support                           │ │  
  │ │    < >   Ralink rt2800 (USB) support                                │ │  
  │ │                                  

參考網站:

http://blog.csdn.net/armeasy/article/details/6252389

http://www.gentoo.org/doc/zh_cn/handbook/hb-net-wireless.xml

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.