desflynn / realtek-8192cu-concurrent-softAP

Some scripts to build and install the Realtek 8192cu driver via dkms, with concurrent mode enabled, allowing simultaneous AP and client mode. All necessary files including hostapd 2.4 with rtl871xdrv patches and config files for hostapd, dhcpd, /etc/network/interfaces are included.
38 stars 13 forks source link

Compilation failed #1

Open ghost opened 7 years ago

ghost commented 7 years ago

Hello, I'm trying to compile the driver on kernel 4.12.2 and I'm getting this

make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/4.12.2-041202-generic/build M=/home/crataegus/Drivers/realtek-8192cu-concurrent-softAP/rtl8192cu-fixes  modules
make[1]: Entering directory '/usr/src/linux-headers-4.12.2-041202-generic'
  CC [M]  /home/crataegus/Drivers/realtek-8192cu-concurrent-softAP/rtl8192cu-fixes/core/rtw_cmd.o
In file included from /home/crataegus/Drivers/realtek-8192cu-concurrent-softAP/rtl8192cu-fixes/core/rtw_cmd.c:23:0:
/home/crataegus/Drivers/realtek-8192cu-concurrent-softAP/rtl8192cu-fixes/include/osdep_service.h: In function ‘thread_enter’:
/home/crataegus/Drivers/realtek-8192cu-concurrent-softAP/rtl8192cu-fixes/include/osdep_service.h:1482:2: error: implicit declaration of function ‘allow_signal’ [-Werror=implicit-function-declaration]
  allow_signal(SIGTERM);
  ^
/home/crataegus/Drivers/realtek-8192cu-concurrent-softAP/rtl8192cu-fixes/include/osdep_service.h: In function ‘flush_signals_thread’:
/home/crataegus/Drivers/realtek-8192cu-concurrent-softAP/rtl8192cu-fixes/include/osdep_service.h:1495:6: error: implicit declaration of function ‘signal_pending’ [-Werror=implicit-function-declaration]
  if (signal_pending (current)) 
      ^
/home/crataegus/Drivers/realtek-8192cu-concurrent-softAP/rtl8192cu-fixes/include/osdep_service.h:1497:3: error: implicit declaration of function ‘flush_signals’ [-Werror=implicit-function-declaration]
   flush_signals(current);
   ^
cc1: some warnings being treated as errors
scripts/Makefile.build:302: recipe for target '/home/crataegus/Drivers/realtek-8192cu-concurrent-softAP/rtl8192cu-fixes/core/rtw_cmd.o' failed
make[2]: *** [/home/crataegus/Drivers/realtek-8192cu-concurrent-softAP/rtl8192cu-fixes/core/rtw_cmd.o] Error 1
Makefile:1512: recipe for target '_module_/home/crataegus/Drivers/realtek-8192cu-concurrent-softAP/rtl8192cu-fixes' failed
make[1]: *** [_module_/home/crataegus/Drivers/realtek-8192cu-concurrent-softAP/rtl8192cu-fixes] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.12.2-041202-generic'
Makefile:584: recipe for target 'modules' failed
make: *** [modules] Error 2

Do you please have any idea what is it?

Thanks!

desflynn commented 7 years ago

It looks like something may have changed in kernel version 4.11. I see a few issues and comments on related driver repos etc.

Try modifying osdep_service.h as described in the following link and see if it will build then?

https://forum.manjaro.org/t/error-with-rtl8812au/24066/5

If that doesn't do it I'll dig into it a little more!

desflynn commented 6 years ago

Any update on this - did the fix above work?

xnosek00 commented 6 years ago

Hi, I had the same problem and your link helps me.

I've modified osdep_service.h and add these lines at line 23:

include <linux/version.h>

if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0)

include <linux/sched/signal.h>

endif

Now I can compile source code.

This fix is also added in rtl8192cu_fixes: https://github.com/pvaret/rtl8192cu-fixes/blob/master/include/osdep_service.h

So I can confirm, it works and you can apply patch in your repository.

xnosek00 commented 6 years ago

Hi,

I have feedback for you. I'm using Banana pi R1 (lamobo). After instalation - there is kernel 4.9.7. Everything works with your driver and manual. I want wifi-ap a it works.

I tried to upgrade kernel. Now - there is kernel 4.13.16 and drivers does not work. Obviosly - I compiled drivers for new kernel. The same procedure. I had problem with compilation, but it reloves the post above. Module is compilled. But I can use wifi only in non AP mode. If I tried to connect to other wifi, it works. But if I tried to create host ap, I have this error report:

hostapd_setup_bss(hapd=0x972568 (wlan0), first=1) wlan0: Flushing old station entries ioctl[RTL_IOCTL_HOSTAPD]: Operation not supported wlan0: Could not connect to kernel driver wlan0: Deauthenticate all stations +rtl871x_sta_deauth_ops, ff:ff:ff:ff:ff:ff is deauth, reason=2 rtl871x_set_key_ops ioctl[RTL_IOCTL_HOSTAPD]: Operation not supported

root@lamobo:~# dkms status 8192cu, 1.10, 4.13.16-sunxi, armv7l: installed

root@lamobo:~# lsmod Module Size Used by bridge 106496 0 stp 16384 1 bridge llc 16384 2 bridge,stp sun4i_gpadc_iio 16384 0 8192cu 421888 0 mac80211 450560 0 cfg80211 376832 1 mac80211 rfkill 20480 2 cfg80211 evdev 20480 1 sun4i_codec 32768 3 sun4i_ts 16384 0 snd_soc_core 118784 1 sun4i_codec snd_pcm_dmaengine 16384 1 snd_soc_core snd_pcm 69632 2 snd_pcm_dmaengine,snd_soc_core snd_timer 24576 1 snd_pcm nvmem_sunxi_sid 16384 0 snd 45056 3 snd_timer,snd_soc_core,snd_pcm sun4i_gpadc 16384 0 soundcore 16384 1 snd ir_lirc_codec 16384 0 lirc_dev 16384 1 ir_lirc_codec sun4i_ss 24576 0 sunxi_cir 16384 0 uio_pdrv_genirq 16384 0 uio 16384 1 uio_pdrv_genirq fuse 73728 1 b53_mdio 16384 0 b53_common 28672 1 b53_mdio dsa_core 36864 7 b53_mdio,b53_common devlink 28672 1 dsa_core

root@lamobo:~# uname -a Linux lamobo 4.13.16-sunxi #20 SMP Fri Nov 24 19:50:07 CET 2017 armv7l GNU/Linux

There are some changes in this repository: https://github.com/pvaret/rtl8192cu-fixes. I tried to compile that driver, but there is the same result - AP mode does not work.

That's a pitty, because I need an access point. I can't use drivers with newer kernel. Do you have any tip, why wlan can't connect to kernel driver when using AP mode? hostapd-error-log.txt

xnosek00 commented 6 years ago

Hi,

I think, you do not have to deal with it. I tested driver on kernel 4.9.7. and AP mode is unstable. So It will be still unstable in newer kernel. No solution for this hardware :(

mjkirk12 commented 5 years ago

Does this procedure support Debian Stretch (9)?
I am getting errors with this on Raspberry Pi 3B cat /etc/os-release PRETTY_NAME="Raspbian GNU/Linux 9 (stretch)" uname -a Linux bridge-19 4.19.42-v7+ #1219 SMP Tue May 14 21:20:58 BST 2019 armv7l GNU/Linux

ERROR: sudo dkms status 8192cu, 1.11, 4.19.42-v7+, armv7l: installed (WARNING! Diff between built and installed module!)

Also this error: sudo /usr/sbin/hostapd /etc/hostapd/hostapd.conf Configuration file: /etc/hostapd/hostapd.conf Line 19: invalid/unknown driver 'rtl871xdrv' 1 errors found in configuration file '/etc/hostapd/hostapd.conf' Failed to set up interface with /etc/hostapd/hostapd.conf Failed to initialize interface

mjkirk12 commented 5 years ago

I also see this error if I comment out the driver=rtl871xdrv in the hostapd.conf file:

sudo hostapd /etc/hostapd/hostapd.conf Configuration file: /etc/hostapd/hostapd.conf wlan1: Could not connect to kernel driver Using interface wlan1 with hwaddr b8:27:eb:af:6f:1b and ssid "Soft_AP" wlan1: interface state UNINITIALIZED->ENABLED wlan1: AP-ENABLED

So it is not crashing, but not running either. iwconfig wlan1 IEEE 802.11 Mode:Master Tx-Power=31 dBm Retry short limit:7 RTS thr:off Fragment thr:off Power Management:on

lo no wireless extensions.

lanbr0 no wireless extensions.

wlan0 unassociated ESSID:"" Nickname:"WIFI@REALTEK" Mode:Auto Frequency=2.412 GHz Access Point: Not-Associated Sensitivity:0/0 Retry:off RTS thr:off Fragment thr:off Power Management:off Link Quality:0 Signal level:0 Noise level:0 Rx invalid nwid:0 Rx invalid crypt:0 Rx invalid frag:0 Tx excessive retries:0 Invalid misc:0 Missed beacon:0

ifconfig wlan0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500 ether 50:3e:aa:78:be:55 txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 0 bytes 0 (0.0 B) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

wlan1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.1.1 netmask 255.255.255.0 broadcast 192.168.1.255 inet6 fe80::ba27:ebff:feaf:6f1b prefixlen 64 scopeid 0x20 ether b8:27:eb:af:6f:1b txqueuelen 1000 (Ethernet) RX packets 0 bytes 0 (0.0 B) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 32 bytes 4902 (4.7 KiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0