家里的台式机采用的是Realtek RTL8188CUS USB无线网卡, 最近把Ubuntu 12.04升级到14.04版本,发现14.04系统自带的无线网卡驱动简直把我搞崩溃,稳定性很差,动不动就掉线,每次都得重新down/up一下才正常。
-
gorgira@vostro-260:~$ lsusb
-
Bus 002 Device 005: ID 0461:4d81 Primax Electronics, Ltd Dell N889 Optical Mouse
-
Bus 002 Device 004: ID 413c:2107 Dell Computer Corp.
-
Bus 002 Device 003: ID 0846:9041 NetGear, Inc. WNA1000M 802.11bgn [Realtek RTL8188CUS]
在Ubuntu论坛找到如下解决办法:
First change the wpa/wpa2 encryption to just wpa2 (CCMP)(AES) not (TKIP) if you have that option it will work best.
Second set your wireless channel in the router to 1 or 11 then save the router configuration and reboot it.
Third go into network manager at top right corner of the screen and click on edit connections>wireless tab and set IPV6 to ignore. (实践证明这个比较有效!)
Fourth shutdown your computer and unplug your usb wireless device so your internal wireless can work then reboot, if it does not connect then post a new file without usb wireless plugged in.
以上的设置确实能让系统自带的无线网卡驱动稳定些, 况且一般系统默认的无线网卡驱动里面都会配置了节能模式,这容易导致无线卡工作在低功耗状态,容易发生收发数据包不稳定问题。当然最好的解决办法是利用Realtek官方提供的无线网卡驱动:
很遗憾,发现官方的网卡驱动支持的内核版本为Linux Kernel 2.6.18~3.9,而笔者使用的Ubuntu内核版本如下:
-
gorgira@vostro-260:~$ uname -a
-
Linux vostro-260 3.13.0-32-generic #57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
显然3.13.0的内核版本目前还不支持,或许修改驱动会是解决办法,不是不可以,就是费时,忽然想到会不会别人也同样有这个问题困惑呢,于是在github找到如下的解决办法:
Using the kernel driver, you won't be able to connect unless your 20ft within range of the router.If you want your usb wireless device to work (rtl8192cu) properly, you may want to install the proprietary driver with the following commands:
sudo apt-get install git build-essential linux-headers-generic dkms
git clone https://github.com/dz0ny/rt8192cu.git --depth 1
cd rt8192cu
sudo make dkms
And use the following to load the driver
sudo modprobe 8192cu
Notice this module uses "8192cu" instead of "rtl8192cu" to load. Finally,update your /etc/modules folder accordingly with this command:
echo '8192cu' | sudo tee -a /etc/modules
With this driver you get full 300Mb/s instead of 150 and there is full encryption suport as well. Not only that but the range is at least 10 times better than the kernel driver and no more dropped signal.
由于这个版本针对的是3.13.0-24-generic的内核版本,利用该方法编译出来的在3.13.0-32-generic上会发生插入模块格式不正确的问题,于是笔者就利用了源码进行如下操作:
-
gorgira@vostro-260:~$ cd codesource/rt8192cu/
-
gorgira@vostro-260:~/codesource/rt8192cu$ make modules
-
gorgira@vostro-260:~/codesource/rt8192cu$ make install
此外,需要注意的是这份驱动默认是使能了网卡节能功能,并且打开debug信息,只需对源码修改如下:
-
commit ab09d3ba9372d89e24ce5174175257118f21a2ed
-
Author: Weiqiang Su <ipaper_purple@163.com>
-
Date: Tue Aug 5 10:08:02 2014 +0800
-
remove power saving mode by default and disable dbg information
-
-
diff --git a/.gitignore b/.gitignore
-
index a687040..852fb76 100644
-
--- a/.gitignore
-
+++ b/.gitignore
-
@@ -11,3 +11,4 @@ patches/original
-
patches/rt8192cu_diff.patch
-
patches/tmp
-
*~
-
+tags
-
diff --git a/Makefile b/Makefile
-
index 3088a7c..0e8b137 100755
-
--- a/Makefile
-
+++ b/Makefile
-
@@ -29,7 +29,7 @@ CONFIG_PCI_HCI = n
-
CONFIG_SDIO_HCI = n
-
-
CONFIG_MP_INCLUDED = n
-
-CONFIG_POWER_SAVING = y
-
+CONFIG_POWER_SAVING = n
-
CONFIG_USB_AUTOSUSPEND = n
-
CONFIG_HW_PWRP_DETECTION = n
-
CONFIG_WIFI_TEST = n
-
diff --git a/include/rtw_debug.h b/include/rtw_debug.h
-
index 0ccf220..f2828c2 100755
-
--- a/include/rtw_debug.h
-
+++ b/include/rtw_debug.h
-
@@ -310,6 +310,7 @@ extern u32 GlobalDebugLevel;
-
-
#define DBG_871X_LEVEL LOG_LEVEL
-
-
+#undef _dbgdump
-
#if defined (_dbgdump)
-
#undef DBG_871X
-
// #define DBG_871X _dbgdump
终于编译完成了,剩下的问题就是能让模块开机自动加载了,还需完成:
(1) 禁止默认的rtl8192cu模块加载
-
gorgira@vostro-260:~/codesource/rt8192cu$ sudo echo "blacklist rtl8192cu" >> /etc/modprobe.d/blacklist.conf
(2) 利用make install 或者采用手动创建目录/lib/modules/3.13.0-32-generic/kernel/drivers/net/wireless/rtlwifi/8192cu/,然后把编译生成的8192cu.ko拷贝到该目录下,并执行如下操作
-
gorgira@vostro-260:~/codesource/rt8192cu$ sudo depmod -a 3.13.0-32-generic
重启系统,一切OK!网卡超级稳定!
阅读(1937) | 评论(0) | 转发(0) |