Ubuntu12.04下安装TL-WN322G+无线网卡驱动(RT5370芯片)

点滴 admin 5年前 (2014-04-09) 348次浏览 已收录 0个评论 扫描二维码

实验室有一块TL-WN322G+ USB无线网卡,于是就想着能不能在Ubuntu12.04下面安装驱动,捣鼓了两天终于成功了。

第一天

从晚上开始奋战,首先去TPLINK的官网找到了这块无线网卡的驱动,无奈TPLINK只给了windows的驱动,真的想吐槽一下国内的厂商出的设备对
linux的支持实在是,不过本人可没这么容易妥协,于是直接谷歌TL-WN332G+
LINUX,果然出来一堆资料,不过大部分的资料都是2008年之前的,参考了几个网页,主要的思路就是:TL-WN322G+无线网卡使用的是
ZD1211b的芯片组,所以我需要去下载ZD1211b芯片组的驱动程序,废了不少力气终于找到了ZD1211b的驱动程序(同样是08年更新的),然
后解压缩,make,刚敲下去就报错,各种头文件找不到,然后谷歌了一下,说是编译模块驱动需要内核源码,然后又去找内核源码,内核源码下好了以后设置好
头文件路径,还是各种头文件找不到,仔细一看,貌似这回是3.2内核源码里面也没有那些头文件,后来再google相关的词条,原来这块USB网卡的芯片
组只支持2.4以及2.6的内核,对于我ubuntu12.04的3.2内核,我只能说欲哭无泪。

第二天

早上到了实验室使用ndiswrapper安装还是不成功,本想着放弃吧,突然想起来实验室还有另一块USB无线网卡,找过来插上去之后居然能够直接识
别,而且Network
Manager里面居然已经能够直接配置无线网络,可是为什么第一快网卡就不行,想着想着本人就是不死,于是继续google,鉴于昨天的经
验,google的时候我更加具体地搜索了USB设备号,设备号是从终端中使用lsusb获得的:

    <p>
        <span class="pln">thinki@G31T</span><span class="pun">-</span><span class="pln">M2</span><span class="pun">:~</span><span class="pln">$ ls<a href="https://www.whatled.com/post-tag/usb" title="查看更多关于usb的文章" target="_blank">usb</a></span> <span class="typ">Bus</span><span class="pln"> </span><span class="lit">001</span><span class="pln"> </span><span class="typ">Device</span><span class="pln"> </span><span class="lit">001</span><span class="pun">:</span><span class="pln"> ID </span><span class="lit">1d6b</span><span class="pun">:</span><span class="lit">0002</span><span class="pln"> </span><span class="typ"><a href="https://www.whatled.com/post-tag/Linux" title="查看更多关于Linux的文章" target="_blank">Linux</a></span><span class="pln"> </span><span class="typ">Foundation</span><span class="pln"> </span><span class="lit">2.0</span><span class="pln"> root hub</span> <span class="typ">Bus</span><span class="pln"> </span><span class="lit">002</span><span class="pln"> </span><span class="typ">Device</span><span class="pln"> </span><span class="lit">001</span><span class="pun">:</span><span class="pln"> ID </span><span class="lit">1d6b</span><span class="pun">:</span><span class="lit">0001</span><span class="pln"> </span><span class="typ"><a href="https://www.whatled.com/post-tag/Linux" title="查看更多关于Linux的文章" target="_blank">Linux</a></span><span class="pln"> </span><span class="typ">Found<a href="https://www.whatled.com/post-tag/ati" title="查看更多关于ati的文章" target="_blank">ati</a>on</span><span class="pln"> </span><span class="lit">1.1</span><span class="pln"> <a href="https://www.whatled.com/post-tag/root" title="查看更多关于root的文章" target="_blank">root</a> hub</span> <span class="typ">Bus</span><span class="pln"> </span><span class="lit">003</span><span class="pln"> </span><span class="typ">Device</span><span class="pln"> </span><span class="lit">001</span><span class="pun">:</span><span class="pln"> ID </span><span class="lit">1d6b</span><span class="pun">:</span><span class="lit">0001</span><span class="pln"> </span><span class="typ"><span class="kl_auto_internal_links_tag"><a href="http://www.whatled.com/tag/Linux" title="查看标签为 Linux 的文章" target="_blank">Linux</a></span></span><span class="pln"> </span><span class="typ">Foundation</span><span class="pln"> </span><span class="lit">1.1</span><span class="pln"> root hub</span> <span class="typ">Bus</span><span class="pln"> </span><span class="lit">004</span><span class="pln"> </span><span class="typ">Device</span><span class="pln"> </span><span class="lit">001</span><span class="pun">:</span><span class="pln"> ID </span><span class="lit">1d6b</span><span class="pun">:</span><span class="lit">0001</span><span class="pln"> </span><span class="typ"><a href="https://www.whatled.com/post-tag/Linux" title="查看更多关于Linux的文章" target="_blank">Linux</a></span><span class="pln"> </span><span class="typ">Found<a href="https://www.whatled.com/post-tag/ati" title="查看更多关于ati的文章" target="_blank">ati</a>on</span><span class="pln"> </span><span class="lit">1.1</span><span class="pln"> <a href="https://www.whatled.com/post-tag/root" title="查看更多关于root的文章" target="_blank">root</a> hub</span> <span class="typ">Bus</span><span class="pln"> </span><span class="lit">005</span><span class="pln"> </span><span class="typ">Device</span><span class="pln"> </span><span class="lit">001</span><span class="pun">:</span><span class="pln"> ID </span><span class="lit">1d6b</span><span class="pun">:</span><span class="lit">0001</span><span class="pln"> </span><span class="typ"><a href="https://www.whatled.com/post-tag/Linux" title="查看更多关于Linux的文章" target="_blank">Linux</a></span><span class="pln"> </span><span class="typ">Foundation</span><span class="pln"> </span><span class="lit">1.1</span><span class="pln"> <a href="https://www.whatled.com/post-tag/root" title="查看更多关于root的文章" target="_blank">root</a> hub</span> <span><b><u><span class="typ">Bus</span><span class="pln"> </span><span class="lit">001</span><span class="pln"> </span><span class="typ">Device</span><span class="pln"> </span><span class="lit">004</span><span class="pun">:</span><span class="pln"> ID f201</span><span class="pun">:</span><span class="lit">5370</span></u></b></span><span class="pln"> </span> <span class="typ">Bus</span><span class="pln"> </span><span class="lit">002</span><span class="pln"> </span><span class="typ">Device</span><span class="pln"> </span><span class="lit">002</span><span class="pun">:</span><span class="pln"> ID </span><span class="lit">0e8f</span><span class="pun">:</span><span class="lit">0022</span><span class="pln"> </span><span class="typ">GreenAsia</span><span class="pln"> </span><span class="typ">Inc</span><span class="pun">.</span><span class="pln"> </span> <span class="typ">Bus</span><span class="pln"> </span><span class="lit">003</span><span class="pln"> </span><span class="typ">Device</span><span class="pln"> </span><span class="lit">002</span><span class="pun">:</span><span class="pln"> ID </span><span class="lit">046d</span><span class="pun">:</span><span class="pln">c018 </span><span class="typ">Logitech</span><span class="pun">,</span><span class="pln"> </span><span class="typ">Inc</span><span class="pun">.</span><span class="pln"> </span><span class="typ">Optical</span><span class="pln"> </span><span class="typ">Wheel</span><span class="pln"> </span><span class="typ">Mouse</span>
    </p>

这回被我搜索到一个博客,
主居然也和我遇到了相似的问题,看完一遍之后真的无力吐槽了,原来这块网卡的USB ID
f201:5370对应是新版的芯片组,使用的是RanLink的RT5370芯片(即TL-WN322G+
V3)。现在问题很清楚了,我只要去找RanLink的RT5370Linux驱动就OK了,现在看来TPLINK这类公司也都是买国外的芯片回来包装
一下,离自己生产IC差远了。不过之前那位博主的博客我只能参考一半,由于他用的是3.4的内核,而我的3.2内核对于RanLink无线网卡的驱动支持
还没到位,所以我决定自己编译模块驱动,这样对于驱动安装流程也有一个大体的了解,找到RanLink官网的驱动链接:
http://www.mediatek.com/_en/07_downloads/01_windows.php?sn=501

果然这方面还是国外的厂商比较给力,不仅有windows,还有Linux和Mac的驱动。下载驱动之后还有几个地方需要修改:
将2011_0719_RT3070_RT3370_RT5370_RT5372_Linux_STA_V2.5.0.3_DPO.bz2解压以后
1. 修改源码包下的 os/linux/config.mk 文件(将原来的n改为y):
# Support Wpa_Supplicant
HAS_WPA_SUPPLICANT=y
# Support Native WpaSupplicant for Network Maganger
HAS_NATIVE_WPA_SUPPLICANT_SUPPORT=y
2. 修改usb口识别的文件 rtusb_dev_id.c文件这个文件在源码包的common/rtusb_dev_id.c,如果没有你的设备的usb id号的话就要在里面添加lsusb命令后得到的id号,红色粗体字是需要添加上去的:
#ifdef RT5370

{USB_DEVICE(0x148F,0x5370)}, /* Ralink 5370 */

{USB_DEVICE(0x148F,0x5372)}, /* Ralink 5370 */

{USB_DEVICE(0x13D3,0x3365)}, /* Azurewave */

{USB_DEVICE(0x13D3,0x3329)}, /* Azurewave */

{USB_DEVICE(0x2001,0x3C15)}, /* Alpha */

{USB_DEVICE(0x2001,0x3C19)}, /* Alpha */

{USB_DEVICE(0x2001,0x3C1C)}, /* DLink */

{USB_DEVICE(0x2001,0x3C1D)}, /* DLink */

{USB_DEVICE(0x043E,0x7A12)}, /* Arcadyan */

{USB_DEVICE(0x043E,0x7A22)}, /* LG innotek */

{USB_DEVICE(0xF201,0x5370)}, /* TP-LINK TL-WN322G+ v3 */

#endif // RT5370 //

注意:这一步很关键,网上好多教程都没有解决问题,就是因为这一步,这就是USB无线网卡识别的关键部分
  1. 接下来进行编译和安装
不过在编译之前需要当前Ubuntu发行版的Linux内核源码以及编译工具,安装如下开发包即可:
        <p>
            <span class="pln">sudo apt</span><span class="pun">-</span><span class="kwd">get</span><span class="pln"> install build</span><span class="pun">-</span><span class="pln">essential linux</span><span class="pun">-</span><span class="pln">source</span>
        </p>

接下来即可开始编译:
        <div>
            <span class="pln">sudo make</span>
        </div>

        <div>
            <span class="pln">sudo make install</span>
        </div>
4. 接下来加载驱动模块
    <p>
        <span class="pln">sudo modprobe rt5370sta</span>
    </p>
5. 一般到第4步就能用了,不过我到了第4部还没有成功,于是接下来将驱动模块添加到开机启动列表,注意这一步需要在root用户下操作
            <div>
                <span class="pln">sudo </span><span class="pun">-</span><span class="pln">i</span>
            </div>

            <div>
                <span class="pln">echo rt5370sta </span><span class="pun"></span><span class="pln"> </span><span class="str">/etc/</span><span class="pln">modules</span>
            </div>

重启系统后在面板上就能看到无线网卡识别出来了,并且能够通过Network Manager配置无线网络

Ubuntu12.04下安装TL-WN322G+无线网卡驱动(RT5370芯片) - 小辉辉 - 小辉辉的博客

参考链接:

少将博客 , 版权所有丨如未注明 , 均为原创丨本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:Ubuntu12.04下安装TL-WN322G+无线网卡驱动(RT5370芯片)
喜欢 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址