lord2y / rtl8192eu-arm-linux-driver

Raspberry Pi Drivers for the rtl8192eu chipset for wireless adapters (D-Link DWA-131 rev E1 included!)
62 stars 19 forks source link

Trying to install via DKMS fails for Raspberry Pi Model B Rev 1 and Kernel 5.10.11+ #7

Closed btreut closed 3 years ago

btreut commented 3 years ago
# dkms install rtl8192eu/1.0

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
'make' all KVER=5.10.11+...................(bad exit status: 2)
Error! Bad return status for module build on kernel: 5.10.11+ (armv6l)
Consult /var/lib/dkms/rtl8192eu/1.0/build/make.log for more information.
# cat /var/lib/dkms/rtl8192eu/1.0/build/make.log
DKMS make.log for rtl8192eu-1.0 for kernel 5.10.11+ (armv6l)
Wed 24 Feb 19:28:24 GMT 2021
make ARCH=arm CROSS_COMPILE= -C /lib/modules/5.10.11+/build M=/var/lib/dkms/rtl8192eu/1.0/build  modules
make[1]: Entering directory '/usr/src/linux-headers-5.10.11+'
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_cmd.o
In file included from /var/lib/dkms/rtl8192eu/1.0/build/include/drv_types.h:79,
                 from /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_cmd.c:17:
/var/lib/dkms/rtl8192eu/1.0/build/include/rtw_security.h:255:8: error: redefinition of ‘struct sha256_state’
 struct sha256_state {
        ^~~~~~~~~~~~
In file included from ./include/linux/filter.h:24,
                 from ./include/net/sock.h:59,
                 from ./include/linux/tcp.h:19,
                 from ./include/linux/ipv6.h:88,
                 from ./include/net/addrconf.h:50,
                 from /var/lib/dkms/rtl8192eu/1.0/build/include/osdep_service_linux.h:48,
                 from /var/lib/dkms/rtl8192eu/1.0/build/include/osdep_service.h:50,
                 from /var/lib/dkms/rtl8192eu/1.0/build/include/drv_types.h:27,
                 from /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_cmd.c:17:
./include/crypto/sha.h:84:8: note: originally defined here
 struct sha256_state {
        ^~~~~~~~~~~~
make[2]: *** [scripts/Makefile.build:279: /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_cmd.o] Error 1
make[1]: *** [Makefile:1808: /var/lib/dkms/rtl8192eu/1.0/build] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-5.10.11+'
make: *** [Makefile:2299: modules] Error 2
root@raspi:/home/pi# # uname -a
Linux raspi 5.10.11+ #1399 Thu Jan 28 12:02:28 GMT 2021 armv6l GNU/Linux

The puzzling fact is that I had no problems some time ago executing exactly the same steps, but it may be that this was with an older kernel, i. e. before 28. Jan. 2021. Moreover this time the first attempt to install failed due to a missing bc. I had to additionally do an apt install bc. But after installing bc, I encountered the error above, which goes beyond my knowledge.

Apparently an existing structure definition is redefined, but I don't have any idea how to resolve that. I am not very fluent in C, so any help is apreciated.

How could I switch back to the previous kernel to test/verify my observation that it worked some time ago without any problems?

btreut commented 3 years ago

guessing wildly, I added the following #ifndef frame to rtw_security.h

--- rtw_security.h_org  2021-02-22 16:31:28.000000000 +0100
+++ rtw_security.h      2021-03-01 08:20:02.000000000 +0100
@@ -252,11 +252,13 @@
 #define SEC_IS_BIP_KEY_INSTALLED(sec) _FALSE
 #endif

+#ifndef _CRYPTO_SHA_H
 struct sha256_state {
        u64 length;
        u32 state[8], curlen;
        u8 buf[64];
 };
+#endif

 #define GET_ENCRY_ALGO(psecuritypriv, psta, encry_algo, bmcst)\
        do {\

and came quite some way further with dkms install rtl8192eu/1.0, but the next error

/var/lib/dkms/rtl8192eu/1.0/build/os_dep/linux/ioctl_cfg80211.c:9906:3: error: ‘struct cfg80211_ops’ has no member name
d ‘mgmt_frame_register’
  .mgmt_frame_register = cfg80211_rtw_mgmt_frame_register,
   ^~~~~~~~~~~~~~~~~~~

(see included complete make.log) leads me at the dead end of my knowledge.

btreut commented 3 years ago

Finally I got a hint pointing to the Rapberry Pi Forum article and I was able to solve my problem. The driver from fars-robotics.net works nicely.