Welcome! Log In Create A New Profile

Advanced

rtl8192eu driver on GoFLEX Net (4.17.2)

Posted by ElMariachi 
rtl8192eu driver on GoFLEX Net (4.17.2)
August 04, 2018 11:46PM
Hello Bodhi!

Sorry, I have to bother you again, with such a problem.
I made a new thread, because I found that I have another device.
My WiFi device is an 'Bus 001 Device 004: ID 0bda:818b Realtek Semiconductor Corp.'
I have been trying to build a module for this device on my GoFlex Net, with Debian and Kernel 4.17.2 for about 30 hours, yet. But still it doesn't work.
I encountered multiple problems, with the weirdest of them being, that I have to add massess of symlinks for actually getting the compilation started.
For example, symlinks like: 'ln -s /usr/include/arm-linux-gnueabi/bits/* /usr/src/linux-headers-4.17.2-kirkwood-tld-1/include/bits/'
Same for asm, gnueabi, sys and so on. Why is this? Is there something wrong with the header files, or did I install them wrong?

Then, when I finally had gotten the git driver-packets (I tried about 5 different sources) to actually start compiling, the build stopped. Always with errors about missing declarations, non defined structs and so on. I guess the reason is that I simply 'replaced' all those missing header files by symlinks towards another file with same name, that I had found to be the best guess for a replacement. What could I do about this?
Thank you and have a nice day :)
Re: rtl8192eu driver on GoFLEX Net (4.17.2)
August 05, 2018 01:05AM
ElMariachi,

I am away from home so it’s hard to see your problem clearly.

Which model of Realtek device is this, do you know for sure that is rtl8192eu?

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 1 time(s). Last edit at 08/05/2018 01:06AM by bodhi.
Re: rtl8192eu driver on GoFLEX Net (4.17.2)
August 05, 2018 07:25AM
Hello Bodhi, yes it is an 8192eu for sure.

lsusb tells me it's an 0bda:818b
lsusb
Bus 001 Device 004: ID 0bda:818b Realtek Semiconductor Corp.

And this table tells, that this device id is an 8192eu: https://wiki.ubuntuusers.de/WLAN/Karten/Realtek/
lsusb
RTL8192eu 	USB 	0bda:818b 	Realtek 	WEP WPA WPA2 	b/g/n 2,4GH

But besides this, I think that there is a general problem with the build setup, that I don't understand, yet, because the header files seem to be spread around so many folders, where they are not found by each other.



Edited 2 time(s). Last edit at 08/05/2018 07:46AM by ElMariachi.
Re: rtl8192eu driver on GoFLEX Net (4.17.2)
August 07, 2018 04:32AM
ElMariachi,

> Hello Bodhi, yes it is an 8192eu for sure.

It is already supported in the mainline kernel. Not sure which module you can load, though. I need to look at the source code to find out.

Perhaps also I need to configure it in 4.17.2-kirkwood-tld-1.

-bodhi
===========================
Forum Wiki
bodhi's corner



Edited 1 time(s). Last edit at 08/07/2018 04:50AM by bodhi.
Re: rtl8192eu driver on GoFLEX Net (4.17.2)
August 07, 2018 05:59AM
Perhaps not. I could not find the ID 818b in staging driver folder. Only 8192u driver.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: rtl8192eu driver on GoFLEX Net (4.17.2)
August 08, 2018 08:56PM
Yes, this driver really is a pain. I think I have read somewhere, that it couldn't be included in the main branches, just because Realtek forgot to add a proper license.

I remember having compiled it from sources before, but with the older Kernel, not the 4.17.
Re: rtl8192eu driver on GoFLEX Net (4.17.2)
August 08, 2018 11:32PM
ElMariachi,

Have you tried

apt-get update
apt-get upgrade

before compiling the module?

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: rtl8192eu driver on GoFLEX Net (4.17.2)
August 09, 2018 02:15PM
Yes, I do update adn dist-upgrade everytime, before doing any modifications.
Also I installed the header files and created like dozens of symlinks for making the header files being found.
But then I had errors about undefined structs and such from gcc.

In file included from ./include/sys/socket.h:38:0,
                 from ./include/linux/if.h:28,
                 from ./include/linux/netfilter.h:8,
                 from ./include/linux/netfilter/nf_conntrack_tuple_common.h:6,
                 from ./include/linux/netfilter/nf_conntrack_dccp.h:29,
                 from ./include/net/netns/conntrack.h:11,
                 from ./include/net/net_namespace.h:27,
                 from ./include/linux/netdevice.h:42,
                 from /root/rtl8192EU/include/osdep_service_linux.h:30,
                 from /root/rtl8192EU/include/osdep_service.h:47,
                 from /root/rtl8192EU/include/drv_types.h:27,
                 from /root/rtl8192EU/core/rtw_cmd.c:17:
./include/net/netlink.h: In function 'nlmsg_unicast':
./include/bits/socket.h:212:22: error: 'MSG_DONTWAIT' undeclared (first use in this function)
 #define MSG_DONTWAIT MSG_DONTWAIT
                      ^
./include/net/netlink.h:608:41: note: in expansion of macro 'MSG_DONTWAIT'
  err = netlink_unicast(sk, skb, portid, MSG_DONTWAIT);
                                         ^~~~~~~~~~~~
In file included from ./include/linux/kernel.h:10:0,
                 from ./include/linux/list.h:9,
                 from ./include/linux/module.h:9,
                 from /root/rtl8192EU/include/basic_types.h:76,
                 from /root/rtl8192EU/include/drv_types.h:26,
                 from /root/rtl8192EU/core/rtw_cmd.c:17:
./include/net/sock.h: In function 'sk_peek_offset':
./include/bits/socket.h:197:18: error: 'MSG_PEEK' undeclared (first use in this function)
 #define MSG_PEEK MSG_PEEK
                  ^
./include/linux/compiler.h:77:42: note: in definition of macro 'unlikely'
 # define unlikely(x) __builtin_expect(!!(x), 0)
                                          ^
./include/net/sock.h:515:23: note: in expansion of macro 'MSG_PEEK'
  if (unlikely(flags & MSG_PEEK)) {
                       ^~~~~~~~
In file included from /root/rtl8192EU/include/osdep_service.h:47:0,
                 from /root/rtl8192EU/include/drv_types.h:27,
                 from /root/rtl8192EU/core/rtw_cmd.c:17:
/root/rtl8192EU/include/osdep_service_linux.h: In function '_init_timer':
/root/rtl8192EU/include/osdep_service_linux.h:299:8: error: '_timer {aka struct timer_list}' has no member named 'data'
  ptimer->data = (unsigned long)cntx;
        ^~
/root/rtl8192EU/include/osdep_service_linux.h:300:2: error: implicit declaration of function 'init_timer' [-Werror=implicit-function-declaration]
  init_timer(ptimer);
  ^~~~~~~~~~
cc1: some warnings being treated as errors
scripts/Makefile.build:312: recipe for target '/root/rtl8192EU/core/rtw_cmd.o' failed
make[2]: *** [/root/rtl8192EU/core/rtw_cmd.o] Error 1
Makefile:1571: recipe for target '_module_/root/rtl8192EU' failed
make[1]: *** [_module_/root/rtl8192EU] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-4.17.2-kirkwood-tld-1'
Makefile:1828: recipe for target 'modules' failed
make: *** [modules] Error 2


I believe these errors came either because the symlinks I made where wrong, or because the driver might need some patches for working with the current kernel. I don't know how I could find out, which of both is the true reason, or where I would have to search for a patch.

I tried building the 5 most recent forks on github: https://github.com/search?utf8=%E2%9C%93&q=RTL8192eu and
also I have tried the dkms packet that someone made for Ubuntu with Kernel 4.3 there:https://forum.ubuntuusers.de/post/7323198, but there where build errors, too.
And then there's rtl8xxxu in the mainline sources. It's said to work with 8192eu somehow (but slow and unstable), but I could not build it, because when I tried cloning the kernel sources to my GOFLEX, the NAS obviouslly stalled for 2 days, until I pulled the power cord.

Before I hade created that masses of symlinks, I always got this error first:
root@prtsrv:~/mange-github/rtl8192eu-linux-driver# dkms install rtl8192eu/1.0

Kernel preparation unnecessary for this kernel.  Skipping...

Building module:
cleaning build area...
'make' all KVER=4.17.2-kirkwood-tld-1.....(bad exit status: 2)
Error! Bad return status for module build on kernel: 4.17.2-kirkwood-tld-1 (armv5tel)
Consult /var/lib/dkms/rtl8192eu/1.0/build/make.log for more information.
root@prtsrv:~/mange-github/rtl8192eu-linux-driver# cat /var/lib/dkms/rtl8192eu/1.0/build/make.log
DKMS make.log for rtl8192eu-1.0 for kernel 4.17.2-kirkwood-tld-1 (armv5tel)
Thu Aug  9 16:04:23 PDT 2018
make ARCH=armv5tel CROSS_COMPILE= -C /lib/modules/4.17.2-kirkwood-tld-1/build M=/var/lib/dkms/rtl8192eu/1.0/build  modules
make[1]: Entering directory '/usr/src/linux-headers-4.17.2-kirkwood-tld-1'
Makefile:637: arch/armv5tel/Makefile: No such file or directory
make[1]: *** No rule to make target 'arch/armv5tel/Makefile'.  Stop.
make[1]: Leaving directory '/usr/src/linux-headers-4.17.2-kirkwood-tld-1'
Makefile:1700: recipe for target 'modules' failed
make: *** [modules] Error 2


PS:
After reading this, I am pretty sure it's a problem with the header files. But where does this problem come from? Why are the header files not matching each other, regarding their search pathes?



Edited 14 time(s). Last edit at 08/09/2018 05:06PM by ElMariachi.
Re: rtl8192eu driver on GoFLEX Net (4.17.2)
August 09, 2018 10:43PM
ElMariachi,

> because the driver
> might need some patches for working with the
> current kernel.

I have not tried comple it to see for myself, but looks like this is the case.


> Why
> are the header files not matching each other,
> regarding their search pathes?

It is typical to see problem like this when header files are not found because the driver build did not set up correctly with the kernel headers and libraries you are building with.The best approach to track this down by yourself (if there is no active supports) is to try building with an older kernel that you know working and go from there forward.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: rtl8192eu driver on GoFLEX Net (4.17.2)
August 10, 2018 08:36PM
How would I get an older Kernel onto the GoFlex/Debian?
Isn't there a better alternative for building?
What are you building on?

I watched some tutorial about Linaro toolchain, but they where all Android-Centric and depend on sources provided by the smartphone's vendor. How would I replace that part for a device like the GoFlex?

Thank you!
Re: rtl8192eu driver on GoFLEX Net (4.17.2)
August 11, 2018 12:14AM
ElMariachi,

Look in the release thread:

https://forum.doozan.com/read.php?2,12096

Try this rootfs


Quote

Updated 20 Feb 2016:

This Debian-4.4.0-kirkwood-tld-1-rootfs-bodhi.tar.bz2 is to keep in sync with kernel Linux-4.4.0-kirkwood-tld-1.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: rtl8192eu driver on GoFLEX Net (4.17.2)
August 21, 2018 12:26PM
Hello!

I tried to get Kernel 4.4.0 working for some time now, but with no success. net console showed it booted fine, but after loading the kernel there was no network connectivity. I could not even ping the GoFlex, even with setting a static ip in /etc/interfaces.

So I installed Debian with the included Kernel 4.12.1 now, as it's at least somewhat older than the 4.17 kernel that I tried before.
Re: rtl8192eu driver on GoFLEX Net (4.17.2)
August 23, 2018 12:31PM
ElMariachi,

> I tried to get Kernel 4.4.0 working for some time
> now, but with no success. net console showed it
> booted fine, but after loading the kernel there
> was no network connectivity. I could not even ping
> the GoFlex, even with setting a static ip in
> /etc/interfaces.

Did you install kernel 4.4, or did you create a new 4.4 rootfs from the released tarrball?

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: rtl8192eu driver on GoFLEX Net (4.17.2)
August 23, 2018 10:44PM
I formatted the partition and freshly created the rootfs from Debian-4.4.0-kirkwood-tld-1-rootfs-bodhi.tar.bz2.



Edited 1 time(s). Last edit at 08/24/2018 01:38AM by ElMariachi.
Re: rtl8192eu driver on GoFLEX Net (4.17.2)
August 24, 2018 05:00AM
ElMariachi,

> I formatted the partition and freshly created the
> rootfs from
> Debian-4.4.0-kirkwood-tld-1-rootfs-bodhi.tar.bz2.

That should work.

The only thing I would look for is your router. Does it use MAC address to assign certain IP address range?

Also, mount the Debian 4.4 rootfs on another Linux box and look at this issue:

https://forum.doozan.com/read.php?2,25683,30100#msg-30100

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: rtl8192eu driver on GoFLEX Net (4.17.2)
August 24, 2018 05:34PM
ElMariachi,

Please post the link for the driver source code or kernel patch (preferred). Perhaps I could try to include this in the kernel 4.18.4 that I am starting to build to see if I get these errors (I can't promise that I will spend lot of time, but my build environment should be a good test for this).

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: rtl8192eu driver on GoFLEX Net (4.17.2)
August 29, 2018 10:01AM
Hello bodhi!

The most recent driver sources for the 8192eu I have found are those by Mange: https://github.com/Mange/rtl8192eu-linux-driver. They are only patched for up to Kernel 4.15. though.

For building the dkms drivers I did the following changes:
1. Added an entry for the glofex net to the makefile:
ifeq ($(CONFIG_PLATFORM_GOFLEX), y)
EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN -DCONFIG_PLATFORM_TI_DM365
EXTRA_CFLAGS += -DCONFIG_USE_USB_BUFFER_ALLOC_RX
EXTRA_CFLAGS += -DCONFIG_SINGLE_XMIT_BUF -DCONFIG_SINGLE_RECV_BUF
ARCH := arm
#CROSS_COMPILE := /home/cnsd4/Appro/mv_pro_5.0/montavista/pro/devkit/arm/v5t_le/bin/arm_v5t_le-
#KSRC := /home/cnsd4/Appro/mv_pro_5.0/montavista/pro/devkit/lsp/ti-davinci/linux-dm365
#CROSS_COMPILE := /opt/montavista/pro5.0/devkit/arm/v5t_le/bin/arm-linux-
#KSRC:= /home/vivotek/lsp/DM365/kernel_platform/kernel/linux-2.6.18
CROSS_COMPILE ?=
KSRC:= /usr/src/linux-headers-4.18.4-kirkwood-tld-1/
KERNELOUTPUT := ${PRODUCTDIR}/tmp
KVER  := 4.18.4
endif

2. created a line for adding the goflex config in the makefile:
CONFIG_PLATFORM_GOFLEX = y

3. added an symlink that seems to be required:
ln -s /usr/src/linux-headers-4.18.4-kirkwood-tld-1/ /lib/modules/4.18.4-kirkwood-tld-1/build

4. and then get the following error:
root@debian:~/rtl8192eu-linux-driver# cat /var/lib/dkms/rtl8192eu/1.0/build/make.log
DKMS make.log for rtl8192eu-1.0 for kernel 4.18.4-kirkwood-tld-1 (armv5tel)
Wed Aug 29 11:03:14 PDT 2018
make ARCH=armv5tel CROSS_COMPILE= -C /lib/modules/4.18.4-kirkwood-tld-1/build M=/var/lib/dkms/rtl8192eu/1.0/build  modules
make[1]: Entering directory '/usr/src/linux-headers-4.18.4-kirkwood-tld-1'
Makefile:606: arch/armv5tel/Makefile: No such file or directory
make[1]: *** No rule to make target 'arch/armv5tel/Makefile'.  Stop.
make[1]: Leaving directory '/usr/src/linux-headers-4.18.4-kirkwood-tld-1'
Makefile:1700: recipe for target 'modules' failed
make: *** [modules] Error 2

A path containing "arch/armv5tel/Makefile" doesn't seem to exist on the system.
When I try a simple make, I get:
oot@debian:~/rtl8192eu-linux-driver# make
make ARCH=arm CROSS_COMPILE= -C /usr/src/linux-headers-4.18.4-kirkwood-tld-1/ M=/root/rtl8192eu-linux-driver  modules
make[1]: Entering directory '/usr/src/linux-headers-4.18.4-kirkwood-tld-1'
  CC [M]  /root/rtl8192eu-linux-driver/core/rtw_cmd.o
In file included from ./include/linux/compat.h:16:0,
                 from ./include/linux/ethtool.h:17,
                 from ./include/linux/netdevice.h:41,
                 from /root/rtl8192eu-linux-driver/include/osdep_service_linux.h:35,
                 from /root/rtl8192eu-linux-driver/include/osdep_service.h:45,
                 from /root/rtl8192eu-linux-driver/include/drv_types.h:32,
                 from /root/rtl8192eu-linux-driver/core/rtw_cmd.c:22:
./include/linux/if.h:28:54: fatal error: sys/socket.h: No such file or directory
 #include <sys/socket.h>   /* for struct sockaddr.  */

I tried adding a symlink to /usr/include/arm-linux-gnueabi/sys/socket.h, but this just lead to hundreds more of missing files.
I don't know what's wrong with the header files. They are installed like the instructions say.



I have also seen someone offering compiled packages for the RasPi with Kernel 4.17, but he did not provide sources.

Also there's a driver in the kernel that is supposed to be a generic Realtek wireless driver, I think: https://github.com/torvalds/linux/tree/master/drivers/net/wireless/realtek/rtl8xxxu. But when I tried cloning the sources of this from the kernel, my GoFlex worked for like 3 days and then crashed, because it couldn't handle all the load.



Edited 12 time(s). Last edit at 08/29/2018 12:12PM by ElMariachi.
Re: rtl8192eu driver on GoFLEX Net (4.17.2)
August 30, 2018 04:40PM
ElMariachi,

I have not tried this compilation yet. However, here is my observation.

> Makefile:606: arch/armv5tel/Makefile: No such file
> or directory

> oot@debian:~/rtl8192eu-linux-driver# make
> make ARCH=arm CROSS_COMPILE= -C
> /usr/src/linux-headers-4.18.4-kirkwood-tld-1/
> M=/root/rtl8192eu-linux-driver modules

ARCH=arm is correct.

> ./include/linux/if.h:28:54: fatal error:
> sys/socket.h: No such file or directory
> #include <sys/socket.h> /* for struct sockaddr.

I believe this file sys/socket.h is in glibc. So your build environment might have been not correct. It was because either the script is out-of-date, or the script expects it is already in your enviroment but could not find it.

Since you said you've already install build-essential, I think the script has problem.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: rtl8192eu driver on GoFLEX Net (4.17.2)
August 31, 2018 02:47AM
And that's not the only problem. As soon as I symlink this file, there are literally hundreds more of missing header files; they are all at the wrong path. For example, a directory named 'armv5tel' does not even exist in the header's tree.
Re: rtl8192eu driver on GoFLEX Net (4.17.2)
September 05, 2018 01:09PM
Do you mean one of your scripts for installing the header files?
Re: rtl8192eu driver on GoFLEX Net (4.17.2)
September 05, 2018 04:38PM
ElMariachi Wrote:
-------------------------------------------------------
> Do you mean one of your scripts for installing the
> header files?

No, I meant the build script. Somehow your glibc path is not there (or not right) so you could not find that header.

-bodhi
===========================
Forum Wiki
bodhi's corner
Re: rtl8192eu driver on GoFLEX Net (4.17.2)
September 06, 2018 06:33AM
I have discovered that the same problem occur when trying other build scripts, like this one: RTL8188EUS_linux_v4.1.4_6773.20130222 (First sockets.h is missing and after fixing with a symlink the other missing files follow..)

What I have seen in the docs that where delivered with that driver sources, the build script was made for "PCLinuxOS".



Edited 1 time(s). Last edit at 09/06/2018 06:38AM by ElMariachi.
Re: rtl8192eu driver on GoFLEX Net (4.17.2)
September 09, 2018 12:40PM
Hello Bodhi!

I just tried ndiwrapper-dkms with hope I could use it or my wifi dongle. But the dkms version from Debian won't build:
root@debian:~# cat /var/lib/dkms/ndiswrapper/1.60/build/make.log
DKMS make.log for ndiswrapper-1.60 for kernel 4.18.4-kirkwood-tld-1 (armv5tel)
Sun Sep  9 11:38:25 PDT 2018
make: Entering directory '/usr/src/linux-headers-4.18.4-kirkwood-tld-1'
  MKEXPORT /var/lib/dkms/ndiswrapper/1.60/build/crt_exports.h
  MKEXPORT /var/lib/dkms/ndiswrapper/1.60/build/hal_exports.h
  MKEXPORT /var/lib/dkms/ndiswrapper/1.60/build/ndis_exports.h
  MKEXPORT /var/lib/dkms/ndiswrapper/1.60/build/ntoskernel_exports.h
  MKEXPORT /var/lib/dkms/ndiswrapper/1.60/build/ntoskernel_io_exports.h
  MKEXPORT /var/lib/dkms/ndiswrapper/1.60/build/rtl_exports.h
  MKEXPORT /var/lib/dkms/ndiswrapper/1.60/build/usb_exports.h
  CC [M]  /var/lib/dkms/ndiswrapper/1.60/build/crt.o
In file included from ./include/linux/compat.h:16:0,
                 from ./include/linux/ethtool.h:17,
                 from ./include/linux/netdevice.h:41,
                 from /var/lib/dkms/ndiswrapper/1.60/build/ntoskernel.h:25,
                 from /var/lib/dkms/ndiswrapper/1.60/build/crt.c:16:
./include/linux/if.h:28:54: fatal error: sys/socket.h: No such file or directory
 #include <sys/socket.h>   /* for struct sockaddr.  */
                                                      ^
compilation terminated.
scripts/Makefile.build:317: recipe for target '/var/lib/dkms/ndiswrapper/1.60/build/crt.o' failed
make[1]: *** [/var/lib/dkms/ndiswrapper/1.60/build/crt.o] Error 1
Makefile:1500: recipe for target '_module_/var/lib/dkms/ndiswrapper/1.60/build' failed
make: *** [_module_/var/lib/dkms/ndiswrapper/1.60/build] Error 2
make: Leaving directory '/usr/src/linux-headers-4.18.4-kirkwood-tld-1'

I don't understand why this is, but it's the same problem with another source for another code. So the problem cannot originate in the source self, can it?



Edited 2 time(s). Last edit at 09/17/2018 09:58AM by ElMariachi.
Author:

Your Email:


Subject:


Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically. If the code is hard to read, then just try to guess it right. If you enter the wrong code, a new image is created and you get another chance to enter it right.
Message: