lwfinger / rtl8188eu

Repository for stand-alone RTL8188EU driver.
Other
1.68k stars 594 forks source link

OpenWrt Kernel 4.14.151 // Do not work! #299

Closed MrX0r closed 4 years ago

MrX0r commented 4 years ago

Hello I have the following problem, the driver does not work under kernel 4.14.151

What I have done

openwrt-sdk-19.07-SNAPSHOT-ath79-generic_gcc-7.4.0_musl.Linux-x86_64.tar.xz

export STAGING_DIR=/home/src/openwrt
export LD_LIBRARY_PATH=$TOOLCHAIN_DIR/usr/lib/
export LDCFLAGS=$TOOLCHAIN_DIR/usr/lib/
export PATH=$STAGING_DIR/bin:$PATH
export TOOLCHAIN_DIR=$STAGING_DIR/toolchain-mips_24kc_gcc-7.4.0_musl/

export ARCH=mips
export CROSS_COMPILE=$STAGING_DIR/staging_dir/toolchain-mips_24kc_gcc-7.4.0_musl/bin/mips-openwrt-linux-
make KSRC=/home/src/openwrt/build_dir/target-mips_24kc_musl/linux-ath79_generic/linux-4.14.151/
  Building modules, stage 2.
  MODPOST 1 modules
  CC      /home/src/rtl8188eu/8188eu.mod.o
  LD [M]  /home/src/rtl8188eu/8188eu.ko

I have put the file, 8188eu.ko (3.45 MB) in this folder and renamed it. /lib/modules/4.14.151/rtl8188eu.ko

And I created a file in /etc/modules.d/rtl8188eu

firmware (rtl8188eufw.bin) to /lib/firmware/rtlwifi/

Do I have to change anything in the wireless.mk (package \ linux \ modules)?

I heard I have to adjust something there!

root@OpenWrt:~#  dmesg | grep R8188EU
[   33.865339] R8188EU: Firmware Version 11, SubVersion 1, Signature 0x88e1
root@OpenWrt:~# dmesg | grep r8188eu
[   15.529034] usbcore: registered new interface driver r8188eu
root@OpenWrt:~# lsusb
Bus 001 Device 002: ID 2357:010c TP-Link TL-WN722N v2

root@OpenWrt:~# cat /sys/kernel/debug/usb/devices

I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=r8188eu

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480  MxCh= 1
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev= 4.14
S:  Manufacturer=Linux 4.14.151 ehci_hcd
S:  Product=EHCI Host Controller
S:  SerialNumber=1b000000.usb
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480  MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=2357 ProdID=010c Rev= 0.00
S:  Manufacturer=Realtek
S:  Product=802.11n NIC
S:  SerialNumber=00E04C0001
C:* #Ifs= 1 Cfg#= 1 Atr=a0 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=r8188eu
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
root@OpenWrt:~# lsmod
8188eu                652480  0
ath                    18240  4 ath9k,ath9k_common,ath9k_hw,ath10k_core
ath10k_core           381392  1 ath10k_pci
ath10k_pci             35312  0
ath9k                  98896  0
ath9k_common           11232  1 ath9k
ath9k_hw              343456  2 ath9k,ath9k_common
cfg80211              221776  6 ath9k,ath9k_common,ath10k_core,ath,rtlwifi,mac80                                                     211
compat                  5888  5 ath9k,ath9k_common,rtlwifi,mac80211,cfg80211
crc_ccitt                960  1 ppp_async
ehci_hcd               35280  1 ehci_platform
ehci_platform           4992  0
gpio_button_hotplug     6816  0
ip_set                 21840 16 xt_set,ip_set_list_set,ip_set_hash_netportnet,ip                                                     _set_hash_netport,ip_set_hash_netnet,ip_set_hash_netiface,ip_set_hash_net,ip_set                                                     _hash_mac,ip_set_hash_ipportnet,ip_set_hash_ipportip,ip_set_hash_ipport,ip_set_h                                                     ash_ipmark,ip_set_hash_ip,ip_set_bitmap_port,ip_set_bitmap_ipmac,ip_set_bitmap_i                                                     p
ip_set_bitmap_ip        6720  0
ip_set_bitmap_ipmac     6880  0
ip_set_bitmap_port      5984  0
ip_set_hash_ip         19616  0
ip_set_hash_ipmark     19840  0
ip_set_hash_ipport     20544  0
ip_set_hash_ipportip   21600  0
ip_set_hash_ipportnet   26272  0
ip_set_hash_mac        10336  0
ip_set_hash_net        23328  6
ip_set_hash_netiface   24928  0
ip_set_hash_netnet     26400  0
ip_set_hash_netport    24736  0
ip_set_hash_netportnet   27584  0
ip_set_list_set         7168  1
ip_tables              10544  5 iptable_nat,iptable_raw,iptable_mangle,iptable_f                                                     ilter
ip6_tables             10432 24 ip6table_mangle,ip6table_filter
ip6t_REJECT              992  2
ip6table_filter          608  1
ip6table_mangle         1152  1
ipt_ECN                 1344  0
ipt_MASQUERADE           640  1
ipt_REJECT               928  2
iptable_filter           608  1
iptable_mangle           896  1
iptable_nat              672  1
iptable_raw              576  1
ledtrig_usbport         2704  0
mac80211              441920  4 ath9k,rtl_usb,ath10k_core,rtlwifi
nf_conntrack           60256 17 nf_conntrack_ipv6,ipt_MASQUERADE,xt_state,xt_nat                                                     ,xt_helper,xt_conntrack,xt_connmark,xt_connlimit,xt_connbytes,xt_REDIRECT,xt_CT,                                                     nf_nat_masquerade_ipv4,nf_conntrack_ipv4,nf_nat_ipv4,nf_nat,nf_flow_table,nf_con                                                     ntrack_rtcache
nf_conntrack_ipv4       5056 11
nf_conntrack_ipv6       5424  5
nf_conntrack_rtcache    2592  0
nf_defrag_ipv4          1056  1 nf_conntrack_ipv4
nf_defrag_ipv6          4704  1 nf_conntrack_ipv6
nf_flow_table          13136  2 xt_FLOWOFFLOAD,nf_flow_table_hw
nf_flow_table_hw        2080  1
nf_log_common           2592  2 nf_log_ipv4,nf_log_ipv6
nf_log_ipv4             3296  0
nf_log_ipv6             4000  0
nf_nat                 10032  4 xt_nat,nf_nat_redirect,nf_nat_masquerade_ipv4,nf                                                     _nat_ipv4
nf_nat_ipv4             3824  1 iptable_nat
nf_nat_masquerade_ipv4    1424  1 ipt_MASQUERADE
nf_nat_redirect         1408  1 xt_REDIRECT
nf_reject_ipv4          2080  1 ipt_REJECT
nf_reject_ipv6          2432  1 ip6t_REJECT
nfnetlink               4128  1 ip_set
nls_base                4832  1 usbcore
ppp_async               6816  0
ppp_generic            22288  3 pppoe,ppp_async,pppox
pppoe                   9088  0
pppox                   1168  1 pppoe
rtl_usb                 9104  0
rtlwifi                56736  1 rtl_usb
slhc                    4960  1 ppp_generic
usb_common              2208  1 usbcore
usbcore               128432  5 rtl_usb,8188eu,ledtrig_usbport,ehci_platform,ehc                                                     i_hcd
x_tables               12656 41 ipt_REJECT,ipt_MASQUERADE,xt_time,xt_tcpudp,xt_t                                                     cpmss,xt_statistic,xt_state,xt_recent,xt_nat,xt_multiport,xt_mark,xt_mac,xt_limi                                                     t,xt_length,xt_hl,xt_helper,xt_ecn,xt_dscp,xt_conntrack,xt_connmark,xt_connlimit                                                     ,xt_connbytes,xt_comment,xt_TCPMSS,xt_REDIRECT,xt_LOG,xt_HL,xt_FLOWOFFLOAD,xt_DS                                                     CP,xt_CT,xt_CLASSIFY,iptable_raw,iptable_mangle,iptable_filter,ipt_ECN,ip_tables                                                     ,xt_set,ip6table_mangle,ip6table_filter,ip6_tables,ip6t_REJECT
xt_CLASSIFY              544  0
xt_CT                   2624  0
xt_DSCP                 1440  0
xt_FLOWOFFLOAD          2960  0
xt_HL                   1280  0
xt_LOG                   736  0
xt_REDIRECT              672  0
xt_TCPMSS               2720  2
xt_comment               448126
xt_connbytes            1568  0
xt_connlimit            4304  0
xt_connmark             1216  0
xt_conntrack            2272 14
xt_dscp                  960  0
xt_ecn                  1312  0
xt_helper                832  0
xt_hl                    768  0
xt_length                672  0
xt_limit                1152 20
xt_mac                   576  0
xt_mark                  640  0
xt_multiport            1216  0
xt_nat                  1504  0
xt_recent               7056  0
xt_set                  6912  0
xt_state                 672  0
xt_statistic             800  0
xt_tcpmss               1024  0
xt_tcpudp               1728 10
xt_time                 1728  0
lwfinger commented 4 years ago

You put the driver in the wrong directory. Use 'sudo make install' the way READ.md says!!!

MrX0r commented 4 years ago

lwfinger

You put the driver in the wrong directory. Use 'sudo make install' the way READ.md says!!!

Hello I can not do make install on the Openwrt system. I have created the driver on an Ubuntu system

install:
    install -p -m 644 8188eu.ko  $(MODDESTDIR)
    @if [ -a /lib/modules/$(KVER)/kernel/drivers/staging/rtl8188eu/r8188eu.ko ] ; then modprobe -r r8188eu; fi;
    @echo "blacklist r8188eu" > /etc/modules.d50-8188eu.conf
    cp rtl8188eufw.bin /lib/firmware/.
    /sbin/depmod -a ${KVER}
    mkdir -p /lib/firmware/rtlwifi
    cp rtl8188eufw.bin /lib/firmware/rtlwifi/.

lsmod I read I have to adjust cfg80211 and mac80211 that the driver is loaded there?

cfg80211              221776  6 ath9k,ath9k_common,ath10k_core,ath,rtlwifi,mac80
usbcore               128432  5 rtl_usb,ledtrig_usbport,8188eu,ehci_platform,ehc 
mac80211              441920  4 ath9k,rtl_usb,ath10k_core,rtlwifi

I have created 50-8188eu with the content r8188eu /etc/modules.d/50-8188eu

On openwrt there is no /etc/modprobe.d/

The driver comes in there! /lib/modules/4.14.151 /kernel/drivers/staging/ does not exist on openwrt

root@OpenWrt:~# ls -a /lib/modules/4.14.151
.                          hwmon.ko                   nf_conntrack_ipv4.ko       nf_reject_ipv4.ko          xt_REDIRECT.ko
..                         ip6_tables.ko              nf_conntrack_ipv6.ko       nf_reject_ipv6.ko          xt_TCPMSS.ko
ath.ko                     ip6t_REJECT.ko             nf_conntrack_rtcache.ko    nls_base.ko                xt_comment.ko
ath10k_core.ko             ip6table_filter.ko         nf_defrag_ipv4.ko          ppp_async.ko               xt_conntrack.ko
ath10k_pci.ko              ip6table_mangle.ko         nf_defrag_ipv6.ko          ppp_generic.ko             xt_limit.ko
ath9k.ko                   ip_tables.ko               nf_flow_table.ko           pppoe.ko                   xt_mac.ko
ath9k_common.ko            ipt_MASQUERADE.ko          nf_flow_table_hw.ko        pppox.ko                   xt_mark.ko
ath9k_hw.ko                ipt_REJECT.ko              nf_log_common.ko           slhc.ko                    xt_multiport.ko
cfg80211.ko                iptable_filter.ko          nf_log_ipv4.ko             usb-common.ko              xt_nat.ko
compat.ko                  iptable_mangle.ko          nf_log_ipv6.ko             usbcore.ko                 xt_state.ko
crc-ccitt.ko               iptable_nat.ko             nf_nat.ko                  x_tables.ko                xt_tcpudp.ko
ehci-hcd.ko                ledtrig-usbport.ko         nf_nat_ipv4.ko             xt_CT.ko                   xt_time.ko
ehci-platform.ko           mac80211.ko                nf_nat_masquerade_ipv4.ko  xt_FLOWOFFLOAD.ko
gpio-button-hotplug.ko     nf_conntrack.ko            nf_nat_redirect.ko         xt_LOG.ko
MrX0r commented 4 years ago

root@OpenWrt:~# modinfo r8188eu module: /lib/modules/4.9.184/r8188eu.ko license: GPL depends: usbcore

That can not work "depends: usbcore"

lwfinger commented 4 years ago

I know nothing of openWRT. You are on your own.

MrX0r commented 4 years ago

I know nothing of openWRT. You are on your own.

@lwfinger Can it be that I have to adjust the makefile?

He also had the same problem, but I'm not very good at it. Add with depends in the kernel!

https://github.com/lwfinger/rtl8188eu/issues/266#issuecomment-443289701

But where do I have to add that?

USB dongle with cfg80211

Result : Driver works on OpenWrt 18.06.1, detects my USB dongle with cfg80211 (No warnings with dmesg), able to scan (clients appear), but can't connect it to my WPA/WPA2 home router when i try either it does nothing or just hangs and i have to manually reboot the device.

OpenWRT is using drivers from "backports project". For this reason the cfg80211 module was compiled with a header file that has a slightly different wiphy structure from the standard kernel headers. To resolve this you need to apply a patch from the backports project to the kernel headers (in the OpenWRT-SDK) before compiling the driver:

https://git.kernel.org/pub/scm/linux/kernel/git/backports/backports.git/tree/patches/0003-cfg80211-wext-padding/include_net_cfg80211.patch

What do I have to change? and where?