Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1130257
  • 博文数量: 222
  • 博客积分: 5262
  • 博客等级: 大校
  • 技术积分: 3028
  • 用 户 组: 普通用户
  • 注册时间: 2009-11-22 19:10
文章分类

全部博文(222)

文章存档

2012年(2)

2011年(192)

2010年(28)

分类: 嵌入式

2011-05-18 20:18:44

我在学校的实验室安装realtek公司的rtl8188su版本的网卡驱动.
进入源码目录
make
./clean
sudo insmod 8712u.ko
ifconfig wlan0
提示:
SIOCSIFFLAGS: Resource temporarily unavailable
资源临时不可用


dmesg:
... ...
[ 279.636633] rtl819xU: --->FirmwareDownload92S()
[ 279.636635]
[ 279.636641] usb 1-6: firmware: requesting RTL8192SU/rtl8192sfw.bin
[ 279.638256] rtl819xU:request firmware fail!
[ 279.638258]
[ 279.638639] rtl819xU:Firmware Download Fail!!a
[ 279.638642]
[ 279.656126] rtl819xU: --->FirmwareDownload92S()
[ 279.656129]
[ 279.656134] usb 1-6: firmware: requesting RTL8192SU/rtl8192sfw.bin
[ 279.657677] rtl819xU:request firmware fail!
[ 279.657678]
[ 279.658123] rtl819xU:Firmware Download Fail!!a
[ 279.658124]
[ 279.658127] rtl819xU:ERR!!! _rtl8192_up(): initialization is failed!
... ...



swy@swy-desktop:~$ ls /lib/firmware/ | grep RTL
RTL8192E
RTL8192SE


swy@swy-desktop:~$ cp /lib/firmware/RTL8192S{E,U}


$ifconfig wlan0 up
能启用无线网卡,位面版上没有wireless有关的显示,
$ping 192.168.1.1
网络无法到达
$iwlist wlan0 scan
Cell 01 - Address: 00:1A:1E:6F:73:10
ESSID:"CUG"
Protocol:IEEE 802.11g
Mode:Master
Frequency:2.412 GHz (Channel 1)
Encryption key:off
Bit Rates:54 Mb/s
Signal level=100/100
Cell 02 - Address: 94:0C:6D:57:FC:5A
ESSID:"YxDong"
Protocol:IEEE 802.11bg
Mode:Master
Frequency:2.437 GHz (Channel 6)
Encryption key:on
Bit Rates:54 Mb/s
Extra:wpa_ie=dd1a0050f20101000050f20202000050f2020050f20401000050f202
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : TKIP CCMP
Authentication Suites (1) : PSK
Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac020100
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : TKIP CCMP
Authentication Suites (1) : PSK
Preauthentication Supported
Signal level=10/100
Cell 03 - Address: 00:1B:11:8C:02:4A
ESSID:"RoboCuP"
Protocol:IEEE 802.11bg
Mode:Master
Frequency:2.437 GHz (Channel 6)
Encryption key:on
Bit Rates:54 Mb/s
Extra:wpa_ie=dd1a0050f20101000050f20202000050f2020050f20401000050f202
IE: WPA Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : TKIP CCMP
Authentication Suites (1) : PSK
Extra:rsn_ie=30180100000fac020200000fac02000fac040100000fac020000
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : TKIP
Pairwise Ciphers (2) : TKIP CCMP
Authentication Suites (1) : PSK
Signal level=10/100
Cell 04 - Address: 00:24:01:20:BB:F0
ESSID:"PC_Network-436"
Protocol:IEEE 802.11bgn
Mode:Master
Frequency:2.437 GHz (Channel 6)
Encryption key:on
Bit Rates:300 Mb/s
Extra:rsn_ie=30140100000fac040100000fac040100000fac020000
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
IE: Unknown: DD750050F204104A00011010440001021041000100103B000103104700105E3C2B65950490A5629000240120BBF010210006442D4C696E6B102300074449522D363035102400074449522D3630351042000830303030303030301054000800060050F2040001101100074449522D36303510080002008E
Signal level=10/100
Cell 05 - Address: E0:05:C5:65:10:4C
ESSID:"N1#124"
Protocol:IEEE 802.11bg
Mode:Master
Frequency:2.462 GHz (Channel 11)
Encryption key:on
Bit Rates:54 Mb/s
Extra:wpa_ie=dd160050f20101000050f20401000050f20401000050f202
IE: WPA Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
Extra:rsn_ie=30140100000fac040100000fac040100000fac020100
IE: IEEE 802.11i/WPA2 Version 1
Group Cipher : CCMP
Pairwise Ciphers (1) : CCMP
Authentication Suites (1) : PSK
Preauthentication Supported
Signal level=80/100
Cell 06 - Address: 00:1A:1E:6F:75:70
ESSID:"CUG"
Protocol:IEEE 802.11g
Mode:Master
Frequency:2.462 GHz (Channel 11)
Encryption key:off
Bit Rates:54 Mb/s
Signal level=52/100
Cell 07 - Address: 00:1A:1E:68:61:C0
ESSID:"CUG"
Protocol:IEEE 802.11g
Mode:Master
Frequency:2.462 GHz (Channel 11)
Encryption key:off
Bit Rates:54 Mb/s
Signal level=10/100
Cell 08 - Address: 00:1A:1E:6D:E7:00
ESSID:"CUG"
Protocol:IEEE 802.11g
Mode:Master
Frequency:2.437 GHz (Channel 6)
Encryption key:off
Bit Rates:54 Mb/s
Signal level=10/100
能扫描到AP
但无法连接到网络

$dmesg

... ...
[ 89.270540] Linking with N1#124,channel:11, qos:0, myHT:1, networkHT:0, mode:6
[ 89.270550] Linking with N1#124,channel:11, qos:0, myHT:1, networkHT:0, mode:6
[ 89.270723] =====>rtl8192SU_link_change 1
[ 89.272904] <=====rtl8192SU_link_change 2
[ 89.272908] ===>ieee80211_associate_procedure_wq(), chan:11
[ 89.311986] rtl819xU:==>SetBWModeCallback8192SUsbWorkItem() Switch to 20MHz bandwidth
[ 89.311989]
[ 89.326641] rtl819xU:<==SetBWModeCallback8192SUsbWorkItem()
[ 89.326645] =================>ieee80211_authentication_req():auth->algorithm is 0
... ...
$ iwevent
Waiting for Wireless Events from interfaces...
Access Point/dCell : address : Not-Associated
... ...

添加ubuntu 10.10的源,升级至10.10
$ sudo apt-get update
$ sudo apt-get dist-upgrade
重启

面版上有无线网卡的图标,仍然是能检测到信号,但无法连接

[ 381.941806] Linking with CUG,channel:1, qos:0, myHT:1, networkHT:0, mode:4
[ 381.941815] Linking with CUG,channel:11, qos:0, myHT:1, networkHT:0, mode:4
[ 381.941973] =====>rtl8192SU_link_change 1
[ 381.945382] <=====rtl8192SU_link_change 2
[ 381.945389] ===>ieee80211_associate_procedure_wq(), chan:11
[ 381.986011] rtl819xU:==>SetBWModeCallback8192SUsbWorkItem() Switch to 20MHz bandwidth
[ 381.986013]
[ 382.000411] rtl819xU:<==SetBWModeCallback8192SUsbWorkItem()
[ 382.000415] =================>ieee80211_authentication_req():auth->algorithm is 0
[ 384.358475] Unknown InputIN=wlan0 OUT= MAC=ff:ff:ff:ff:ff:ff:00:1f:3c:e3:70:a2:08:00 SRC=0.0.0.0 DST=255.255.255.255 LEN=334 TOS=0x00 PREC=0x00 TTL=128 ID=11396 PROTO=UDP SPT=68 DPT=67 LEN=314
[ 384.500515] Linking with CUG,channel:11, qos:0, myHT:1, networkHT:0, mode:4
[ 384.500521] ===>ieee80211_associate_procedure_wq(), chan:11
[ 384.538777] rtl819xU:==>SetBWModeCallback8192SUsbWorkItem() Switch to 20MHz bandwidth
[ 384.538779]
[ 384.552930] rtl819xU:<==SetBWModeCallback8192SUsbWorkItem()
[ 384.552933] =================>ieee80211_authentication_req():auth->algorithm is 0
[ 385.485271] Unknown InputIN=wlan0 OUT= MAC=ff:ff:ff:ff:ff:ff:58:b0:35:4f:59:77:08:00 SRC=0.0.0.0 DST=255.255.255.255 LEN=328 TOS=0x00 PREC=0x00 TTL=255 ID=58847 PROTO=UDP SPT=68 DPT=67 LEN=308
[ 387.052520] Linking with CUG,channel:11, qos:0, myHT:1, networkHT:0, mode:4
[ 388.488523] ===>ieee80211_associate_procedure_wq(), chan:11
[ 388.526780] rtl819xU:==>SetBWModeCallback8192SUsbWorkItem() Switch to 20MHz bandwidth
[ 388.526783]
[ 388.541183] rtl819xU:<==SetBWModeCallback8192SUsbWorkItem()
[ 388.541188] =================>ieee80211_authentication_req():auth->algorithm is 0
[ 389.274933] Unknown InputIN=wlan0 OUT= MAC=ff:ff:ff:ff:ff:ff:20:7c:8f:10:b6:0c:08:00 SRC=0.0.0.0 DST=255.255.255.255 LEN=328 TOS=0x00 PREC=0x00 TTL=64 ID=7140 PROTO=UDP SPT=68 DPT=67 LEN=308
[ 391.040523] Linking with CUG,channel:11, qos:0, myHT:1, networkHT:0, mode:4
[ 391.040528] ===>ieee80211_associate_procedure_wq(), chan:11
[ 391.079797] rtl819xU:==>SetBWModeCallback8192SUsbWorkItem() Switch to 20MHz bandwidth
[ 391.079799]
[ 391.094202] rtl819xU:<==SetBWModeCallback8192SUsbWorkItem()
[ 391.094205] =================>ieee80211_authentication_req():auth->algorithm is 0
[ 391.736350] Unknown InputIN=wlan0 OUT= MAC=ff:ff:ff:ff:ff:ff:74:f0:6d:78:3e:f3:08:00 SRC=0.0.0.0 DST=255.255.255.255 LEN=328 TOS=0x00 PREC=0x00 TTL=128 ID=2302 PROTO=UDP SPT=68 DPT=67 LEN=308


Unknown InputIN=wlan0 OUT= MAC=ff:ff:ff:ff:ff:ff:20:7c:8f:10:b6:0c:08:00 SRC=0.0.0.0 DST=255.255.255.255 LEN=328 TOS=0x00 PREC=0x00 TTL=64 ID=7140 PROTO=UDP SPT=68 DPT=67 LEN=308
推测是数据格式不对


我注意到
swy@swy-desktop:~$ lsmod | grep ^r
r8192s_usb 287340 0

第二天早上:
我查看宿舍电脑(宿舍的电脑的ubuntu版本比较老,是2.6.2*.24,实验室的为2.6.32.25,升级后为2.6.35.23),加载8712u模块后无线网络自动启动,并能连接到网络.
davy@davy-desktop:~$ lsmod | grep ^r
上面命令没有输出.

猜测:驱动r8192s_usb与8712u都是网卡驱动,并且r8192s_usb是ubuntu自带驱动,与8712u发生irq-conflict(中断请求冲突)
依据:
$man ifconfig
... ...
NOTES
... ...

Interrupt problems with Ethernet device drivers fail with EAGAIN (SIOCSIIFLAGS: Resource temporarily unavailable) it is most likely a inter‐rupt conflict. See for more information.
... ...

解决方法:
卸载ubuntu自带驱动
$sudo rmmod_usb
面版上无线网卡图标消失
$sudo insmod 8712u.ko
$ ifconfig
eth0 Link encap:Ethernet HWaddr 00:e0:61:12:c4:b9
inet addr:192.168.1.102 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::2e0:61ff:fe12:c4b9/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:9 errors:0 dropped:0 overruns:0 frame:0
TX packets:80 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1940 (1.9 KB) TX bytes:12354 (12.3 KB)
Interrupt:16

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:20 errors:0 dropped:0 overruns:0 frame:0
TX packets:20 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1136 (1.1 KB) TX bytes:1136 (1.1 KB)

wlan0 Link encap:Ethernet HWaddr 00:0f:10:42:10:31
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)

系统自动检测到wireless
连接到网络,成功!!!

安装驱动,使其在系统启动时运行
$ sudo install -p -m 644 8712u.ko /lib/modules/2.6.35-23-generic/kernel/net/wireless/
$ sudo depmod -a 2.6.35-23-generic
$ sudo mv /lib/modules/2.6.35-23-generic/kernel/drivers/staging/rtl8192su/r8192s_usb.ko{,.bak} # 将ubuntu自带驱动改名令其无法在系统启动时加载

sudo reboot

$ lsmod | grep 8712u
8712u 301688 0
$ lsmod | grep ^r


wireless可以正常使用了.我没有卸载ubuntu原有驱动,担心以后有用的时候找不到.卸载的命令如下:
rm -f /lib/modules/2.6.35-23-generic/kernel/drivers/staging/rtl8192su.ko
/sbin/depmod -a 2.6.35-23-generic
阅读(7745) | 评论(0) | 转发(3) |
0

上一篇:什么是eFuse

下一篇:BGA植球和返修方法!

给主人留下些什么吧!~~