Skip to contentSkip to conversation

rtl8192* wifi driver

DISCUSSION Roman Krylov 2 participants 7 messages Aug 12, 2011 – Aug 13, 2011 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

Hi kernel developers!
I have a USB wifi adapter from Reltek (0bda:8176).
I had 2.6.38 kernel and tried to install the driver provided by realtek - by their support I was suggested to use 8192cu. It did not compile due to discontinued support of explicit mutexes in newer kernels. I changed it using instructions I've found on the internet, compiled and it worked well.
Now in the linux kernel 3.0.1 I have found rtl8192* drivers in the kernel source tree which I included in the install, but they did not work, though modules loaded without error. Then I took my cranked realtek driver for 2.6.38 and this time I had to remove the #include <linux/smp_lock.h> to compile it and it works again.

The question is: can someone take care of importing this driver into the kernel tree and support it? Let the name be something like 'rtl8192cu_usb' to distinguish from others.

Thanks in advance,
Roman.

P.S. Please reply to me, or CC me, cause I am not subscribed to the mailing list yet.

#1 lore raw
Quoted 13 lines · Roman Krylov

Hi kernel developers!
I have a USB wifi adapter from Reltek (0bda:8176).
I had 2.6.38 kernel and tried to install the driver provided by realtek - by their support I was suggested to use 8192cu. It did not compile due to discontinued support of explicit mutexes in newer kernels.
I changed it using instructions I've found on the internet, compiled and it worked well.
Now in the linux kernel 3.0.1 I have found rtl8192* drivers in the kernel source tree which I included in the install, but they did not work, though modules loaded without error.
Then I took my cranked realtek driver for 2.6.38 and this time I had to remove the #include <linux/smp_lock.h> to compile it and it works again.

Quoted 3 lines

The question is: can someone take care of importing this driver into the kernel tree and support it?
Let the name be something like 'rtl8192cu_usb' to distinguish from others.

The driver rtl8192cu, which supports your device, has been in the kernel since 2.6.39. It is well integrated with the other Realtek 802.11n devices and drivers (rtl8192ce, rtl8192se, and rtl8192de).

Driver rtl8192cu works here. What failed with your system? Did you install the firmware? Check the output of the dmesg command.

The driver you posted does not use mac80211, but implements its own 802.11 stack. Such drivers are admitted to the staging directories under certain circumstances; however, not if they duplicate USB IDs for a mainline driver.

I unpacked your driver and tried to compile it under 3.1-rc1. It failed with

make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/3.1.0-rc1-wl+/build M=/home/finger/realtek/my_rtl8192CU_linux3.x modules make[1]: Entering directory `/home/finger/wireless-testing-new'
CC [M] /home/finger/realtek/my_rtl8192CU_linux3.x/core/rtw_cmd.o
In file included from /home/finger/realtek/my_rtl8192CU_linux3.x/include/drv_types.h:80:0,

                 from /home/finger/realtek/my_rtl8192CU_linux3.x/core/rtw_cmd.c:24:
/home/finger/realtek/my_rtl8192CU_linux3.x/include/rtw_xmit.h:343:24: error: field ‘xmit_tasklet’ has incomplete type
In file included from /home/finger/realtek/my_rtl8192CU_linux3.x/include/drv_types.h:81:0,
                 from /home/finger/realtek/my_rtl8192CU_linux3.x/core/rtw_cmd.c:24:

/home/finger/realtek/my_rtl8192CU_linux3.x/include/rtw_recv.h:217:24: error: field ‘recv_tasklet’ has incomplete type make[2]: *** [/home/finger/realtek/my_rtl8192CU_linux3.x/core/rtw_cmd.o] Error 1
make[1]: *** [_module_/home/finger/realtek/my_rtl8192CU_linux3.x] Error 2

You really need to find out why rtl8192cu does not work.

Larry

A message that is not in the archive (sent off-list or not yet received): [email protected]

#3 lore raw
Quoted 18 lines · Roman Krylov

Hi Larry,
I can't figure out why this happens, this is what I see in dmesg with the drivers supplied with the kernel:

rtl8192cu 1-6:1.0: usb_probe_interface rtl8192cu 1-6:1.0: usb_probe_interface - got id
rtl8192cu: MAC address: 00:08:a1:ca:6a:33
rtl8192cu: Board Type 0
rtl8192cu: rx_max_size 15360, rx_urb_num 8, in_ep 1 ieee80211 phy1: Selected rate control algorithm 'rtl_rc' drivers/usb/core/inode.c: creating file '004' hub 1-0:1.0: state 7 ports 8 chg 0000 evt 0040
udev: renamed network interface wlan0 to wlan3
rtl8192cu: MAC auto ON okay!
rtl8192cu: Tx queue select: 0x05
rtl8192c: Loading firmware file rtlwifi/rtl8192cufw.bin ADDRCONF(NETDEV_UP): wlan3: link is not ready

Quoted 5 lines

Though I can see the list of networks in NetworkManager, but I cannot connect to any of these networks.
So I'm stuck with what I have.
It probably did not compile on your computer because you were cross-compiling. Thanks,

Do NOT drop the mailing list. ALWAYS Reply All. I do not do private debugging unless you are paying!

The dmesg fragment showed no reason for a failure to even try to connect. On my system, I get

[24756.876119] usb 1-2: new high speed USB device number 7 using ehci_hcd
[24757.467946] rtl8192cu: MAC address: 00:1f:1f:c8:8e:cb
[24757.467968] rtl8192cu: Board Type 0
[24757.507037] rtlwifi: rx_max_size 15360, rx_urb_num 8, in_ep 1
[24757.510400] ieee80211 phy5: Selected rate control algorithm 'rtl_rc'
[24757.520562] usbcore: registered new interface driver rtl8192cu
[24757.605980] udev[1038]: renamed network interface wlan0 to wlan5
[24757.693068] rtl8192cu: MAC auto ON okay!
[24757.776251] rtl8192cu: Tx queue select: 0x05
[24757.780586] rtl8192c_common: Loading firmware file rtlwifi/rtl8192cufw.bin
[24758.527878] ADDRCONF(NETDEV_UP): wlan5: link is not ready
[24761.249067] wlan5: authenticate with c0:3f:0e:be:2b:44 (try 1)
[24761.254431] wlan5: authenticated
[24761.254540] wlan5: associate with c0:3f:0e:be:2b:44 (try 1)
[24761.266899] wlan5: RX AssocResp from c0:3f:0e:be:2b:44 (capab=0x411 status=0 aid=2)
[24761.266912] wlan5: associated
[24761.289844] ADDRCONF(NETDEV_CHANGE): wlan5: link becomes ready

It looks exactly like your output through the "link is not ready" message. At that point, NetworkManager starts the authentication process.

What do you see in the NM log file? It should be at /var/log/NetworkManager?

I would also like to see the output of the 'iwlist scan' command when run as root.

Larry

#4 lore raw
Quoted 6 lines

What do you see in the NM log file? It should be at /var/log/NetworkManager?

I would also like to see the output of the 'iwlist scan' command when run as root.

Larry

Aug 12 21:26:11 volyrkr NetworkManager: <info>  Activation (wlan3/wireless): connection 'Auto bhn 310' has security, and secrets exist.  No new secrets needed.
Aug 12 21:26:11 volyrkr NetworkManager: <info>  Config: added 'ssid' value 'bhn 310'
Aug 12 21:26:11 volyrkr NetworkManager: <info>  Config: added 'scan_ssid' value '1'
Aug 12 21:26:11 volyrkr NetworkManager: <info>  Config: added 'key_mgmt' value 'NONE'
Aug 12 21:26:11 volyrkr NetworkManager: <info>  Config: added 'auth_alg' value 'OPEN'
Aug 12 21:26:11 volyrkr NetworkManager: <info>  Config: added 'wep_key0' value '<omitted>'
Aug 12 21:26:11 volyrkr NetworkManager: <info>  Config: added 'wep_key1' value '<omitted>'
Aug 12 21:26:11 volyrkr NetworkManager: <info>  Config: added 'wep_tx_keyidx' value '0'
Aug 12 21:26:11 volyrkr NetworkManager: <info>  Activation (wlan3) Stage 2 of 5 (Device Configure) complete.
Aug 12 21:26:11 volyrkr NetworkManager: <info>  Config: set interface ap_scan to 1
Aug 12 21:26:11 volyrkr NetworkManager: <info>  (wlan3): supplicant connection state:  inactive -> scanning
Aug 12 21:26:36 volyrkr NetworkManager: <info>  Activation (wlan3/wireless): association took too long.
Aug 12 21:26:36 volyrkr NetworkManager: <info>  (wlan3): device state change: 5 -> 9 (reason 7)
Aug 12 21:26:36 volyrkr NetworkManager: <info>  Activation (wlan3) failed for access point (bhn 310)

Roman.

#5 lore raw
Quoted 10 lines · Roman Krylov
Quoted 7 lines

What do you see in the NM log file? It should be at /var/log/NetworkManager?

I would also like to see the output of the 'iwlist scan' command when run as root.

Larry

Aug 12 21:26:11 volyrkr NetworkManager: <info> Activation (wlan3/wireless):
connection 'Auto bhn 310' has security, and secrets exist. No new secrets needed.
Aug 12 21:26:11 volyrkr NetworkManager: <info> Config: added 'ssid' value 'bhn 310'

What is your ESSID? Two lines up, I see 'Auto bhn 310' and one line up I see 'bhn 310'. Based on my logs, those two should be the same. I'll set one of my APs to the first ESSID and see if I can connect.

I found the problem in the driver you sent. One needs to add

#include <linux/interrupt.h>

to file include/osdep_service.h. Once I did that, it built and works.

Larry

#6 lore raw
Quoted 2 lines

What is your ESSID? Two lines up, I see 'Auto bhn 310' and one line up I see 'bhn 310'. Based on my logs, those two should be the same. I'll set one of my APs to the first ESSID and see if I can connect.

The first one 'Auto bhn 310' is NetworkManager's alias, the essid is 'bhn 310'.

Quoted 5 lines

I found the problem in the driver you sent. One needs to add

#include <linux/interrupt.h>

to file include/osdep_service.h. Once I did that, it built and works.

This is probably due some changes in 3.1 since 3.0.1.

#7 lore raw
In reply to Roman Krylov
Quoted 31 lines · Roman Krylov
Quoted 7 lines

What do you see in the NM log file? It should be at /var/log/NetworkManager?

I would also like to see the output of the 'iwlist scan' command when run as root.

Larry

Aug 12 21:26:11 volyrkr NetworkManager: <info> Activation (wlan3/wireless):
connection 'Auto bhn 310' has security, and secrets exist. No new secrets needed.
Aug 12 21:26:11 volyrkr NetworkManager: <info> Config: added 'ssid' value 'bhn 310'
Aug 12 21:26:11 volyrkr NetworkManager: <info> Config: added 'scan_ssid' value '1'
Aug 12 21:26:11 volyrkr NetworkManager: <info> Config: added 'key_mgmt' value
'NONE'
Aug 12 21:26:11 volyrkr NetworkManager: <info> Config: added 'auth_alg' value
'OPEN'
Aug 12 21:26:11 volyrkr NetworkManager: <info> Config: added 'wep_key0' value
'<omitted>'
Aug 12 21:26:11 volyrkr NetworkManager: <info> Config: added 'wep_key1' value
'<omitted>'
Aug 12 21:26:11 volyrkr NetworkManager: <info> Config: added 'wep_tx_keyidx'
value '0'
Aug 12 21:26:11 volyrkr NetworkManager: <info> Activation (wlan3) Stage 2 of 5
(Device Configure) complete.
Aug 12 21:26:11 volyrkr NetworkManager: <info> Config: set interface ap_scan to 1
Aug 12 21:26:11 volyrkr NetworkManager: <info> (wlan3): supplicant connection
state: inactive -> scanning
Aug 12 21:26:36 volyrkr NetworkManager: <info> Activation (wlan3/wireless):
association took too long.
Aug 12 21:26:36 volyrkr NetworkManager: <info> (wlan3): device state change: 5
-> 9 (reason 7)
Aug 12 21:26:36 volyrkr NetworkManager: <info> Activation (wlan3) failed for
Quoted 1 line

access point (bhn 310)

It worked here:

Aug 12 22:35:15 larrylap NetworkManager[3258]: <info> Activation (wlan5/wireless): connection 'Auto bhn 310' has security, and secrets exist.  No new secrets
 needed.
Aug 12 22:35:15 larrylap NetworkManager[3258]: <info> Config: added 'ssid' value 'Auto bhn 310'
Aug 12 22:35:15 larrylap NetworkManager[3258]: <info> Config: added 'scan_ssid' value '1'
Aug 12 22:35:15 larrylap NetworkManager[3258]: <info> Config: added 'key_mgmt' value 'NONE'
Aug 12 22:35:15 larrylap NetworkManager[3258]: <info> Config: added 'wep_key0' value '<omitted>'
Aug 12 22:35:15 larrylap NetworkManager[3258]: <info> Config: added 'wep_tx_keyidx' value '0'
Aug 12 22:35:15 larrylap NetworkManager[3258]: <info> Activation (wlan5) Stage 2 of 5 (Device Configure) complete.
Aug 12 22:35:15 larrylap NetworkManager[3258]: <info> Config: set interface ap_scan to 1
Aug 12 22:35:15 larrylap NetworkManager[3258]: <info> (wlan5): supplicant connection state:  disconnected -> scanning
Aug 12 22:35:16 larrylap NetworkManager[3258]: <info> (wlan5): supplicant connection state:  scanning -> associating
Aug 12 22:35:16 larrylap NetworkManager[3258]: <info> (wlan5): supplicant connection state:  associating -> associated
Aug 12 22:35:16 larrylap NetworkManager[3258]: <info> (wlan5): supplicant connection state:  associated -> completed
Aug 12 22:35:16 larrylap NetworkManager[3258]: <info> Activation (wlan5/wireless) Stage 2 of 5 (Device Configure) successful.  Connected to wireless network 'Auto bhn 310'.

Something is wrong with your configuration. I suggest killing the connection in NM and remake it. Do you use KDE or Gnome? My tests were with KDE.

Larry