歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> Linux教程 >> Ubuntu 10.04上騰達W541U V2.0 無線網卡驅動的使用

Ubuntu 10.04上騰達W541U V2.0 無線網卡驅動的使用

日期:2017/2/28 16:30:25   编辑:Linux教程
備用記錄待測試。

買了塊騰達的Tenda W541U V2.0的無線網卡,當時沒想到要在Linux下用,回來後才發現驅動問題比較麻煩,官方不提供Linux下的驅動,網上的解決方案沒有試成功的,很是郁悶。

給Tenda的技術支持寫過信,給到了一個驅動,但沒有說具體編譯的細節,自己試著編譯出一個.o文件,lsmod後還是檢測不到無線網卡。再寫信就無回音了。可能這個問題很好解決,但自己確實搞不定。

前兩天到Ubuntu論壇網站上去看,發現老外的一篇貼子,說是解決了這個問題,按照相應步驟試了一下,果然編譯了可以使用的驅動,現將步驟和應注意事項總結如下,還希望能幫助和我一樣用Tenda W541U V2.0(這個型號我現在是倒背如流了)無線網卡的人!

標題是:Tenda W541U V2.0 Wireless USB Adapter / Ralink RT2070

具體的流程大家可以參考貼子上的步驟進行,我只是簡單的總結一下流程與要需注意的地方:

一、需求:

1 硬件:
無線網卡型號:
Tenda W541U V2.0 Wireless USB Adapter ( Ralink RT2070L Chipset)

在命令終端裡輸入:lsusb
關於無線網卡的內容應該是類似於以下:
Bus 001 Device 003: ID 148f:2070 Ralink Technology, Corp.
其中ID 後面必須是148f:2070 ,如果不是,不能保證後面是否成功。|

2 驅動下載:(LinuxIDC.com的FTP裡)
RT3070USB(RT307x)

二、步驟:
注意: 以下操作凡是因權限問題而未執行的,請在前面加上sudo再次嘗試!
1. 下載RT3070USB driver(上面的網址)
2. 解壓:
#sudo tar jxvf 2009_0525_RT3070_Linux_STA_v2.1.1.0.bz2
3 在 os/linux下的usb_main_dev.c 裡的#ifdef RT3070下面增加以下語句:
{USB_DEVICE(0x148F,0x2070)}, /* Ralink 2070L */
4 編譯模塊:
回到剛開始的目錄,即解決完進入的第一層目錄:
cd ../..
make
5 如果編譯成功,則安裝:|
make install
如果編譯不成功,且你的LINUX 內核版本高於等於2.6.31 的情況,比如最新的Ubuntu 10.04,請到步驟11查看並處理!

6 COPY .DAT文件到 /etc/Wireless,copy .bin 到 /lib/firmware

#mkdir -p /etc/Wireless/RT2870STA
#cp RT2870STA.dat /etc/Wireless/RT2870STA/
#apt-get install tofrodos
#dos2unix /etc/Wireless/RT2870STA/RT2870STA.dat
#chmod +x /etc/Wireless/RT2870STA/RT2870STA.dat

#cp common/rt2870.bin /lib/firmware/

注意:要安裝dos2unix來去掉一些windows下文件轉過來時的多余的字符。
7 啟動模塊:
#modprobe rt3070sta
8 測試模塊(以下192.168.0.33的IP地址自己定 ):
#ifconfig ra0 inet 192.168.0.33 up

#iwconfig ra0
這時,如果輸入:ifconfig,應該可以看到ra0設備
9 配置網卡:
因為我用的不是ubuntu默認的網絡管理工具,而是WICD工具,只需要 無線網絡 處填入 ra0後其它的按相應網絡設定配置後 即可配置完畢。
有兩點要注意的:
a) 至於有用到WPA方式加密的情況,參考貼裡有提到需要修改編譯時的配置文件 os/linux/config.mk:
HAS_WPA_SUPPLICANT=y
HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y
b) 如果使用WICD工具的話,將WPA Suppliant Driver選為wext。

10 刷新後,無線網絡應該能被檢測到,終於可以告別有線的日子了。happy一個!

11 對於LINUX 內核版本高於等於2.6.31 的情況,編譯時會出現一個編譯錯誤,參考貼中提供了patch。
下面這段我就不翻了,大家基本上都能看明白的。(patch在LinuxIDC.com的FTP裡)

UPDATE: Linux Kernel >= 2.6.31 / Ubuntu Karmic Koala 9.10 compile patch!
Ok, after speaking with another person and installing Ubuntu 9.10 on my other box I noticed this driver will not compile on my brand new 2.6.31-14-generic kernel.

The error I received (and probably many people do when attempting to compile most ralink drivers under 2.6.31 because this kernel replaced the old net_device structure with a new one called net_device_ops) was:
Code:

CC [M] /root/2009_0525_RT3070_Linux_STA_v2.1.1.0/os/linux/../../os/linux/rt_linux.o
/root/2009_0525_RT3070_Linux_STA_v2.1.1.0/os/linux/../../os/linux/rt_linux.c: In function ‘RtmpOSNetDevAttach’:
/root/2009_0525_RT3070_Linux_STA_v2.1.1.0/os/linux/../../os/linux/rt_linux.c:1510: error: ‘struct net_device’ has no member named ‘open’
/root/2009_0525_RT3070_Linux_STA_v2.1.1.0/os/linux/../../os/linux/rt_linux.c:1511: error: ‘struct net_device’ has no member named ‘stop’
/root/2009_0525_RT3070_Linux_STA_v2.1.1.0/os/linux/../../os/linux/rt_linux.c:1512: error: ‘struct net_device’ has no member named ‘hard_start_xmit’
/root/2009_0525_RT3070_Linux_STA_v2.1.1.0/os/linux/../../os/linux/rt_linux.c:1513: error: ‘struct net_device’ has no member named ‘do_ioctl’
/root/2009_0525_RT3070_Linux_STA_v2.1.1.0/os/linux/../../os/linux/rt_linux.c:1519: error: ‘struct net_device’ has no member named ‘get_stats’
/root/2009_0525_RT3070_Linux_STA_v2.1.1.0/os/linux/../../os/linux/rt_linux.c:1553: error: ‘struct net_device’ has no member named ‘validate_addr’
make[2]: *** [/root/2009_0525_RT3070_Linux_STA_v2.1.1.0/os/linux/../../os/linux/rt_linux.o] Error 1
make[1]: *** [_module_/root/2009_0525_RT3070_Linux_STA_v2.1.1.0/os/linux] Error 2
make[1]: Leaving directory `/usr/src/linux-headers-2.6.31-14-generic'
make: *** [LINUX] Error 2

After some deep searching I found this rt3070-2.6.31-compile.patch (a part of rt3070-kmod Fedora 11 package) on lists.rpmfusion.org/pipermail/rpmfusion-commits/2009-August/006214.html. Once you apply it, it will compile just fine.

I have attached it to this post, just:
Code:

$gunzip rt3070-2.6.31-compile.patch.gz

$patch -p0 < rt3070-2.6.31-compile.patch

patching file 2009_0525_RT3070_Linux_STA_v2.1.1.0/include/rtmp_os.h
patching file 2009_0525_RT3070_Linux_STA_v2.1.1.0/os/linux/rt_linux.c
patching file 2009_0525_RT3070_Linux_STA_v2.1.1.0/os/linux/rt_main_dev.c

$cd 2009_0525_RT3070_Linux_STA_v2.1.1.0/

$make

Also make sure that rt2800usb, rt2x00usb and rt2x00lib are blacklisted as they now recognize this device (under Ubuntu 9.10) but the device will not function properly (no scan results).
Code:

$sudo pico /etc/modprobe.d/blacklist.conf

add the following lines:
blacklist rt2x00usb
blacklist rt2x00lib
blacklist rt2800usb
close and save.

$sudo rmmod rt2x00usb (just in case)
$sudo rmmod rt2x00lib (just in case)
$sudo rmmod rt2800usb (just in case)

12 我只是將W541U用來當Station模式來用,AP模式還沒用過,具體設置不知如何操作。

祝各位好運!

相關附件2009_0525_RT3070_Linux_STA_v2.1.1.0 與rt3070-2.6.31-compile.patch
下載:

FTP地址:ftp://www.6688.cc/

用戶名:www.linuxidc.net

密碼:www.6688.cc

在2010年LinuxIDC.com\9月\Ubuntu 10.04上騰達W541U V2.0 無線網卡驅動的使用\

Copyright © Linux教程網 All Rights Reserved