rtl8192 module doesn't auto load

I have a TP-Link TL-WN821N wireless usb device that I was using with hostapd to provide a wireless network in my office. The built in kernel driver for this device is rtl8192cu. When using this driver, I was having issues with intermittent stopping or slowing of traffic. So I thought I would try building the 8192-fixes driver using dkms. I used information from here . I found that the driver does not support the access point mode, so I switched back to using the built in driver. The problem I am having is the rtl8192cu driver does not get automatically loaded at boot up or if I plug the device in after the computer is up and running. - It will only load if I modprobe it. If I modprobe the module, unplug the device, and then plug it back in it does load the module. I’ve checked that it is not blacklisted in /etc/modprob.d.

Any ideas on where else to look?

Thanks.

Mark

Are you absolutely sure it is still not blacklisted? Check with

grep -rnw '/etc/modprobe.d/' -e "rtl8192cu"

I’m suspicious since you mentioned that you had previously built the 8192cu driver, and one of the steps includes blacklisting the rtl8192cu driver (in /etc/modprobe.d/blacklist-native-rtl8192.conf). If you did since remove the blacklist config file, did you then reboot after that?

Thanks for replying deano_ferrari

The search comes up empty:

petersenm@virt-fc:~> grep -rnw '/etc/modprobe.d/' -e "rtl8192cu"
petersenm@virt-fc:~> 

I’ve modprobed the module and then rebuilt the initrd. No change.

I’ve searched the udev directories for the usb vendor and device id but that came up empty. So I don’t understand how the module gets loaded.

Searching in /lib/modules/‘uname -r’/modules.alias shows:

petersenm@virt-fc:~> cat /lib/modules/4.8.14-1-default/modules.alias |grep 0BDAp8178
alias usb:v0BDAp8178d*dc*dsc*dp*ic*isc*ip*in* rtl8192cu
alias usb:v0BDAp8178d*dc*dsc*dp*icFFiscFFipFFin* rtl8xxxu

Mark

This is an alternative driver for various Realtek RTL8XXX parts written to utilize the Linux mac80211 stack. The driver is known to work with a number of RTL8723AU, RL8188CU, RTL8188RU, RTL8191CU, and RTL8192CU devices

This driver is under development and has a limited feature set. In particular it does not yet support 40MHz channels and power management. However it should have a smaller memory footprint than the vendor drivers and benefits from the in kernel mac80211 stack.

It can coexist with drivers from drivers/staging/rtl8723au, drivers/staging/rtl8192u, and drivers/net/wireless/rtlwifi, but you will need to control which module you wish to load.

https://cateee.net/lkddb/web-lkddb/RTL8XXXU.html

Post:

/usr/sbin/hwinfo --netcard

This is the result with the usb device plugged in but I havn’t yet modprobe rtl892cu

petersenm@virt-fc:~> sudo /usr/sbin/hwinfo --netcard38: PCI 300.0: 0200 Ethernet controller                         
  [Created at pci.378]
  Unique ID: UOJ9.YNURYwd7hn8
  Parent ID: qTvu.EJKSwmL3pe9
  SysFS ID: /devices/pci0000:00/0000:00:1c.1/0000:03:00.0
  SysFS BusID: 0000:03:00.0
  Hardware Class: network
  Model: "Gigabyte Onboard Ethernet"
  Vendor: pci 0x10ec "Realtek Semiconductor Co., Ltd."
  Device: pci 0x8168 "RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller"
  SubVendor: pci 0x1458 "Gigabyte Technology Co., Ltd"
  SubDevice: pci 0xe000 "Onboard Ethernet"
  Revision: 0x03
  Driver: "r8169"
  Driver Modules: "r8169"
  Device File: enp3s0
  I/O Ports: 0xde00-0xdeff (rw)
  Memory Range: 0xfbbff000-0xfbbfffff (ro,non-prefetchable)
  Memory Range: 0xfbbf8000-0xfbbfbfff (ro,non-prefetchable)
  Memory Range: 0xfbc00000-0xfbc1ffff (ro,non-prefetchable,disabled)
  IRQ: 36 (284222994 events)
  HW Address: 6c:f0:49:e3:9a:b4
  Permanent HW Address: 6c:f0:49:e3:9a:b4
  Link detected: yes
  Module Alias: "pci:v000010ECd00008168sv00001458sd0000E000bc02sc00i00"
  Driver Info #0:
    Driver Status: r8169 is active
    Driver Activation Cmd: "modprobe r8169"
  Config Status: cfg=no, avail=yes, need=no, active=unknown
  Attached to: #14 (PCI bridge)

After modprobe rtl8192cu the card shows up.

62: USB 00.0: 0282 WLAN controller  [Created at usb.122]
  Unique ID: ZmS7.jrYmOdSjfr1
  Parent ID: 7eqy.cO89g+iefn1
  SysFS ID: /devices/pci0000:00/0000:00:1a.7/usb6/6-1/6-1:1.0
  SysFS BusID: 6-1:1.0
  Hardware Class: network
  Model: "Realtek RTL8192CU 802.11n WLAN Adapter"
  Hotplug: USB
  Vendor: usb 0x0bda "Realtek Semiconductor Corp."
  Device: usb 0x8178 "RTL8192CU 802.11n WLAN Adapter"
  Revision: "2.00"
  Serial ID: "00e04c000001"
  Driver: "rtl8192cu"
  Driver Modules: "rtl8192cu"
  Device File: wlp0s26f7u1
  Features: WLAN
  Speed: 480 Mbps
  HW Address: 18:a6:f7:19:ff:df
  Permanent HW Address: 18:a6:f7:19:ff:df
  Link detected: no
  WLAN channels: 1 2 3 4 5 6 7 8 9 10 11 12 13
  WLAN frequencies: 2.412 2.417 2.422 2.427 2.432 2.437 2.442 2.447 2.452 2.457 2.462 2.467 2.472
  WLAN encryption modes: WEP40 WEP104 TKIP CCMP
  WLAN authentication modes: open sharedkey wpa-psk wpa-eap
  Module Alias: "usb:v0BDAp8178d0200dc00dsc00dp00icFFiscFFipFFin00"
  Driver Info #0:
    Driver Status: rtl8192cu is active
    Driver Activation Cmd: "modprobe rtl8192cu"
  Driver Info #1:
    Driver Status: rtl8xxxu is not active
    Driver Activation Cmd: "modprobe rtl8xxxu"
  Config Status: cfg=new, avail=yes, need=no, active=unknown
  Attached to: #59 (Hub)

Sauerland: Thanks. I will have to give this alternate driver a test drive. If it works, then I will have to create a udev rule?

Mark

After loading the rt8xxxu driver:

virt-fc:~ # hwinfo --netcard
62: USB 00.0: 0282 WLAN controller  [Created at usb.122]
  Unique ID: ZmS7.jrYmOdSjfr1
  Parent ID: 7eqy.cO89g+iefn1
  SysFS ID: /devices/pci0000:00/0000:00:1a.7/usb6/6-1/6-1:1.0
  SysFS BusID: 6-1:1.0
  Hardware Class: network
  Model: "Realtek RTL8192CU 802.11n WLAN Adapter"
  Hotplug: USB
  Vendor: usb 0x0bda "Realtek Semiconductor Corp."
  Device: usb 0x8178 "RTL8192CU 802.11n WLAN Adapter"
  Revision: "2.00"
  Serial ID: "00e04c000001"
  Driver: "rtl8xxxu"
  Driver Modules: "rtl8xxxu"
  Device File: wlp0s26f7u1
  Features: WLAN
  Speed: 480 Mbps
  HW Address: 18:a6:f7:19:ff:df
  Permanent HW Address: 18:a6:f7:19:ff:df
  Link detected: no
  WLAN channels: 1 2 3 4 5 6 7 8 9 10 11 12 13 14
  WLAN frequencies: 2.412 2.417 2.422 2.427 2.432 2.437 2.442 2.447 2.452 2.457 2.462 2.467 2.472 2.484
  WLAN encryption modes: WEP40 WEP104 TKIP CCMP
  WLAN authentication modes: open sharedkey wpa-psk wpa-eap
  Module Alias: "usb:v0BDAp8178d0200dc00dsc00dp00icFFiscFFipFFin00"
  Driver Info #0:
    Driver Status: rtl8192cu is not active
    Driver Activation Cmd: "modprobe rtl8192cu"
  Driver Info #1:
    Driver Status: rtl8xxxu is active
    Driver Activation Cmd: "modprobe rtl8xxxu"
  Config Status: cfg=new, avail=yes, need=no, active=unknown
  Attached to: #59 (Hub)

But hostapd is unable to configure it:

virt-fc:~ # systemctl status hostapd.service● hostapd.service - Hostapd IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator
   Loaded: loaded (/usr/lib/systemd/system/hostapd.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Thu 2016-12-29 12:06:49 CST; 4s ago
  Process: 21872 ExecStart=/usr/sbin/hostapd /etc/hostapd.conf (code=exited, status=1/FAILURE)
 Main PID: 21872 (code=exited, status=1/FAILURE)


Dec 29 12:06:49 virt-fc hostapd[21872]: Configuration file: /etc/hostapd.conf
Dec 29 12:06:49 virt-fc hostapd[21872]: nl80211: Could not configure driver mode
Dec 29 12:06:49 virt-fc hostapd[21872]: nl80211: deinit ifname=wlp0s26f7u1 disabled_11b_rates=0
Dec 29 12:06:49 virt-fc hostapd[21872]: nl80211 driver initialization failed.
Dec 29 12:06:49 virt-fc hostapd[21872]: wlp0s26f7u1: interface state UNINITIALIZED->DISABLED
Dec 29 12:06:49 virt-fc hostapd[21872]: wlp0s26f7u1: AP-DISABLED
Dec 29 12:06:49 virt-fc hostapd[21872]: hostapd_free_hapd_data: Interface wlp0s26f7u1 wasn't started
Dec 29 12:06:49 virt-fc systemd[1]: hostapd.service: Main process exited, code=exited, status=1/FAILURE
Dec 29 12:06:49 virt-fc systemd[1]: hostapd.service: Unit entered failed state.
Dec 29 12:06:49 virt-fc systemd[1]: hostapd.service: Failed with result 'exit-code'.

Mark

Returning back to basics here. Open a terminal and run

dmesg --follow

then plug the device in. What is reported?

On 12/28/2016 05:36 PM, chiefpete wrote:
>
> I have a TP-Link TL-WN821N wireless usb device that I was using with
> hostapd to provide a wireless network in my office. The built in kernel
> driver for this device is rtl8192cu. When using this driver, I was
> having issues with intermittent stopping or slowing of traffic.

I have this same device and also have the same problem. My “work around”
is to ping the router continuously to keep the link active.
Fortunately I only need the PC on for a couple of hours a day.


Ken
linux since 1994
S.u.S.E./openSUSE since 1996