CGarces / rtl8192eu-linux-driver

Drivers for the rtl8192eu chipset for wireless adapters (D-Link DWA-131 rev E1 included!)
5 stars 2 forks source link

Untested dkms commits #1

Closed CGarces closed 7 years ago

CGarces commented 7 years ago

From @CGarces on May 7, 2017 19:58

I have sync the masterzorag/RTL8192EU-linux repository with Mange/rtl8192eu-linux-driver as requested at https://github.com/Mange/rtl8192eu-linux-driver/issues/10

The changes include

But are untested, I don't have the real hardware

@nomadmzl, @masterzorag, can you check this branch to send back the changes to Mange (if everything looks fine)?

Copied from original issue: CGarces/RTL8192EU-linux#1

CGarces commented 7 years ago

From @nomadmzl on May 8, 2017 3:35

Hi, I've tested it, this is how I did it:

  1. Download from git: sudo git clone https://github.com/CGarces/RTL8192EU-linux.git
  2. Uninstall actual driver: sudo dkms remove rtl8192eu/1.0 --all
  3. Change directory where the Cgarces's git is stored, so I've installed it: sudo dkms add ./RTL8192EU-linux then sudo dkms install rtl8192eu/1.0 (ran flawless)
  4. Reboot
  5. With the line "8192eu" in etc/modules-load.d/modules.conf, I use lshw -c network to check which driver is loaded for the Wifi adapter, I get back rtl8xxxu.
  6. Check at speedtest.net which is the connection speed, I get slow connection (bit rate 1 Mb/s).

For some reason the instruction "8192eu" in the modules.conf file is being ignored. So, again I execute the steps 1 to 4 but now using the git from Mange. When I check again using lshw -c network I get back "8192eu", iwconfig gives me a bit rate of 144 Mb/s, a test in speedtest.net confirms good connection speeds both down/up.

We are missing something here @CGarces can you make a dkms arrange for only the masterzorag driver?

CGarces commented 7 years ago

can you make a dkms arrange for only the masterzorag driver?

This branch is the masterzorag driver.

CGarces commented 7 years ago

From @nomadmzl on May 8, 2017 13:53

Hi

ummmm I see... maybe there is something with the dirver internally that doesn't allows it to be installed in this kernel. I will test compilling it and let you know.

CGarces commented 7 years ago

From @nomadmzl on May 8, 2017 18:37

Tests done:

I've downloaded both code from Mange and Masterzorag, compiled it but I couldn't get the 8192eu driver working in any test. I must be doing something wrong, when I restart only the rtl8xxxu module is loaded, I unload it, uninstall it and try to get the 8192eu one up but it doesn't load.

I've returned to the Mange's versión being installed via DKMS and it works fine. I don't know what to do.

CGarces commented 7 years ago

From @masterzorag on May 8, 2017 20:6

@CGarces about sending back the changes to Mange: merging directly this fork will be like overwrite all the old v4.3.8 with v4.4.1, if this is what you want, it's ok; I mean, just before merging, Mange should at least tag the version, and documenting upgrading to v4.4.1 somewhere Or better, using branches for versions, and for linux-4.x.y various fixes in my repo I'm keeping a clean Realtek source, using this scheme

Also, we are just facing issues about, like dkms related etc.

We have to document install note, extending readme

CGarces commented 7 years ago

Yes @masterzorag , I was thinking on a new branch, I need to rebase/reorder again the commits and get something like 4.3.8->4.4.1->Mange patches on top.

CGarces commented 7 years ago

From @masterzorag on May 8, 2017 21:3

@CGarces I've merged your edits into linux-4.11 @nomadmzl check new file or reach me on #freenode 👍

CGarces commented 7 years ago

From @nomadmzl on May 9, 2017 2:28

Hi, I get an error:

Building module:
cleaning build area....
'make' all KVER=4.8.0-51-generic............(bad exit status: 2)
ERROR (dkms apport): binary package for rtl8192eu: 1.0 not found
Error! Bad return status for module build on kernel: 4.8.0-51-generic (x86_64)
Consult /var/lib/dkms/rtl8192eu/1.0/build/make.log for more information.

this is the make.log:

DKMS make.log for rtl8192eu-1.0 for kernel 4.8.0-51-generic (x86_64)
lun may  8 21:25:47 COT 2017
make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/4.8.0-51-generic/build M=/var/lib/dkms/rtl8192eu/1.0/build  modules
make[1]: se entra en el directorio '/usr/src/linux-headers-4.8.0-51-generic'
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_cmd.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_security.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_debug.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_io.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_ioctl_query.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_ioctl_set.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_ieee80211.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_mlme.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_mlme_ext.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_wlan_util.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_vht.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_pwrctrl.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_rf.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_recv.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_sta_mgt.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_ap.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_xmit.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_p2p.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_tdls.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_br_ext.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_iol.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_sreset.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_btcoex.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_beamforming.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_odm.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/efuse/rtw_efuse.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/os_dep/osdep_service.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/os_dep/linux/os_intfs.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/os_dep/linux/usb_intf.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/os_dep/linux/usb_ops_linux.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/os_dep/linux/ioctl_linux.o
/var/lib/dkms/rtl8192eu/1.0/build/os_dep/linux/ioctl_linux.c: In function ‘rtw_ioctl_wext_private’:
/var/lib/dkms/rtl8192eu/1.0/build/os_dep/linux/ioctl_linux.c:14035:5: error: implicit declaration of function ‘is_compat_task’ [-Werror=implicit-function-declaration]
  if(is_compat_task())
     ^
cc1: some warnings being treated as errors
scripts/Makefile.build:289: fallo en las instrucciones para el objetivo '/var/lib/dkms/rtl8192eu/1.0/build/os_dep/linux/ioctl_linux.o'
make[2]: *** [/var/lib/dkms/rtl8192eu/1.0/build/os_dep/linux/ioctl_linux.o] Error 1
Makefile:1491: fallo en las instrucciones para el objetivo '_module_/var/lib/dkms/rtl8192eu/1.0/build'
make[1]: *** [_module_/var/lib/dkms/rtl8192eu/1.0/build] Error 2
make[1]: se sale del directorio '/usr/src/linux-headers-4.8.0-51-generic'
Makefile:1697: fallo en las instrucciones para el objetivo 'modules'
make: *** [modules] Error 2
CGarces commented 7 years ago

From @masterzorag on May 9, 2017 19:56

Here there is the ubuntu binary kernel linux-4.4.y Give it a try See here for directions Also, post gcc -v output

CGarces commented 7 years ago

From @gilcu3 on May 9, 2017 22:59

I have tested the original driver:

#uname -a
Linux reyPC 4.4.9-1-lts #1 SMP Thu May 5 07:43:50 CEST 2016 x86_64 GNU/Linux
#lsusb
Bus 003 Device 003: ID 2357:0108               // (mine is TL-W822N V4)
#iwconfig
wlp0s20u1  IEEE 802.11gn  ESSID:"SSID_NAME"  Nickname:"<WIFI@REALTEK>"
          Mode:Managed  Frequency:2.437 GHz  Access Point: XX:XX:XX:XX:XX:XX   
          Bit Rate:144.4 Mb/s   Sensitivity:0/0  
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:****-****-****-****-****-****-****-****   Security mode:open
          Power Management:off
          Link Quality=50/100  Signal level=58/100  Noise level=0/100
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0
#iw wlp0s20u1 info
Interface wlp0s20u1
    ifindex 4
    wdev 0x100000001
    addr XX:XX:XX:XX:XX:XX
    ssid SSID_NAME
    type managed
    wiphy 1
    txpower 12.00 dBm
#iw phy1 info
Wiphy phy1
    max # scan SSIDs: 9
    max scan IEs length: 2304 bytes
    max # sched scan SSIDs: 0
    max # match sets: 0
    max # scan plans: 1
    max scan plan interval: -1
    max scan plan iterations: 0
    Retry short limit: 7
    Retry long limit: 4
    Coverage class: 0 (up to 0m)
    Supported Ciphers:
        * WEP40 (00-0f-ac:1)
        * WEP104 (00-0f-ac:5)
        * TKIP (00-0f-ac:2)
        * CCMP-128 (00-0f-ac:4)
    Available Antennas: TX 0 RX 0
    Supported interface modes:
         * IBSS
         * managed
         * AP
         * P2P-client
         * P2P-GO
    Band 1:
        Capabilities: 0x1962
            HT20/HT40
            Static SM Power Save
            RX HT20 SGI
            RX HT40 SGI
            RX STBC 1-stream
            Max AMSDU length: 7935 bytes
            DSSS/CCK HT40
        Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
        Minimum RX AMPDU time spacing: 16 usec (0x07)
        HT Max RX data rate: 300 Mbps
        HT TX/RX MCS rate indexes supported: 0-15
        Bitrates (non-HT):
            * 1.0 Mbps
            * 2.0 Mbps
            * 5.5 Mbps
            * 11.0 Mbps
            * 6.0 Mbps
            * 9.0 Mbps
            * 12.0 Mbps
            * 18.0 Mbps
            * 24.0 Mbps
            * 36.0 Mbps
            * 48.0 Mbps
            * 54.0 Mbps
        Frequencies:
            * 2412 MHz [1] (30.0 dBm)
            * 2417 MHz [2] (30.0 dBm)
            * 2422 MHz [3] (30.0 dBm)
            * 2427 MHz [4] (30.0 dBm)
            * 2432 MHz [5] (30.0 dBm)
            * 2437 MHz [6] (30.0 dBm)
            * 2442 MHz [7] (30.0 dBm)
            * 2447 MHz [8] (30.0 dBm)
            * 2452 MHz [9] (30.0 dBm)
            * 2457 MHz [10] (30.0 dBm)
            * 2462 MHz [11] (30.0 dBm)
            * 2467 MHz [12] (30.0 dBm)
            * 2472 MHz [13] (30.0 dBm)
            * 2484 MHz [14] (disabled)
    Supported commands:
         * new_interface
         * set_interface
         * new_key
         * start_ap
         * new_station
         * set_bss
         * join_ibss
         * set_pmksa
         * del_pmksa
         * flush_pmksa
         * remain_on_channel
         * frame
         * set_channel
         * connect
         * disconnect
    Supported TX frame types:
         * IBSS: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
         * managed: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
         * AP: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
         * AP/VLAN: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
         * P2P-client: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
         * P2P-GO: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
    Supported RX frame types:
         * IBSS: 0xd0
         * managed: 0x40 0xd0
         * AP: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
         * AP/VLAN: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
         * P2P-client: 0x40 0xd0
         * P2P-GO: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
    WoWLAN support:
         * wake up on anything (device continues operating normally)
    software interface modes (can always be added):
    interface combinations are not supported
    Device supports scan flush.

#modinfo 8192eu 
filename:       /lib/modules/4.4.9-1-lts/kernel/drivers/net/wireless/8192eu.ko
version:        v4.4.1_17696.20160509_BTCOEX20160412-0042
author:         Realtek Semiconductor Corp.
description:    Realtek Wireless Lan Driver
license:        GPL
srcversion:     16E573E327DA9985B40B933
alias:          usb:v2357p0109d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p0108d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p0107d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp818Cd*dc*dsc*dp*icFFiscFFipFFin*
alias:          usb:v0BDAp818Bd*dc*dsc*dp*icFFiscFFipFFin*
depends:        cfg80211,usbcore
vermagic:       4.4.9-1-lts SMP mod_unload modversions 
parm:           rtw_ips_mode:The default IPS mode (int)
parm:           rtw_usb_rxagg_mode:int
parm:           rtw_country_code:The default country code (in alpha2) (charp)
parm:           rtw_channel_plan:The default chplan ID when rtw_alpha2 is not specified or valid (int)
parm:           rtw_excl_chs:exclusive channel array (array of uint)
parm:           rtw_force_igi_lb:force IGI low-bound, 0:no specified (int)
parm:           rtw_qos_opt_enable:int
parm:           ifname:The default name to allocate for first interface (charp)
parm:           if2name:The default name to allocate for second interface (charp)
parm:           rtw_pwrtrim_enable:int
parm:           rtw_initmac:charp
parm:           rtw_special_rf_path:int
parm:           rtw_chip_version:int
parm:           rtw_rfintfs:int
parm:           rtw_lbkmode:int
parm:           rtw_network_mode:int
parm:           rtw_channel:int
parm:           rtw_mp_mode:int
parm:           rtw_wmm_enable:int
parm:           rtw_vrtl_carrier_sense:int
parm:           rtw_vcs_type:int
parm:           rtw_busy_thresh:int
parm:           rtw_ht_enable:int
parm:           rtw_bw_mode:int
parm:           rtw_ampdu_enable:int
parm:           rtw_rx_stbc:int
parm:           rtw_ampdu_amsdu:int
parm:           rtw_lowrate_two_xmit:int
parm:           rtw_rf_config:int
parm:           rtw_power_mgnt:int
parm:           rtw_smart_ps:int
parm:           rtw_low_power:int
parm:           rtw_wifi_spec:int
parm:           rtw_full_ch_in_p2p_handshake:int
parm:           rtw_antdiv_cfg:int
parm:           rtw_antdiv_type:int
parm:           rtw_switch_usb_mode:int
parm:           rtw_enusbss:int
parm:           rtw_hwpdn_mode:int
parm:           rtw_hwpwrp_detect:int
parm:           rtw_hw_wps_pbc:int
parm:           rtw_max_roaming_times:The max roaming times to try (uint)
parm:           rtw_mc2u_disable:int
parm:           rtw_80211d:Enable 802.11d mechanism (int)
parm:           rtw_notch_filter:0:Disable, 1:Enable, 2:Enable only for P2P (uint)
parm:           rtw_hiq_filter:0:allow all, 1:allow special, 2:deny all (uint)
parm:           rtw_adaptivity_en:0:disable, 1:enable (uint)
parm:           rtw_adaptivity_mode:0:normal, 1:carrier sense (uint)
parm:           rtw_adaptivity_dml:0:disable, 1:enable (uint)
parm:           rtw_adaptivity_dc_backoff:DC backoff for Adaptivity (uint)
parm:           rtw_adaptivity_th_l2h_ini:TH_L2H_ini for Adaptivity (int)
parm:           rtw_adaptivity_th_edcca_hl_diff:TH_EDCCA_HL_diff for Adaptivity (int)
parm:           rtw_amplifier_type_2g:BIT3:2G ext-PA, BIT4:2G ext-LNA (uint)
parm:           rtw_amplifier_type_5g:BIT6:5G ext-PA, BIT7:5G ext-LNA (uint)
parm:           rtw_RFE_type:default init value:64 (uint)
parm:           rtw_GLNA_type:default init value:0 (uint)
parm:           rtw_TxBBSwing_2G:default init value:0xFF (uint)
parm:           rtw_TxBBSwing_5G:default init value:0xFF (uint)
parm:           rtw_OffEfuseMask:default open Efuse Mask value:0 (uint)
parm:           rtw_FileMaskEfuse:default drv Mask Efuse value:0 (uint)
parm:           rtw_rxgain_offset_2g:default RF Gain 2G Offset value:0 (uint)
parm:           rtw_rxgain_offset_5gl:default RF Gain 5GL Offset value:0 (uint)
parm:           rtw_rxgain_offset_5gh:uint
parm:           rtw_rxgain_offset_5gm:default RF Gain 5GM Offset value:0 (uint)
parm:           rtw_pll_ref_clk_sel:force pll_ref_clk_sel, 0xF:use autoload value (uint)
parm:           rtw_tx_pwr_lmt_enable:0:Disable, 1:Enable, 2: Depend on efuse (int)
parm:           rtw_tx_pwr_by_rate:0:Disable, 1:Enable, 2: Depend on efuse (int)
parm:           rtw_target_tx_pwr_2g_a:2.4G target tx power (unit:dBm) of RF path A for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm:           rtw_target_tx_pwr_2g_b:2.4G target tx power (unit:dBm) of RF path B for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm:           rtw_target_tx_pwr_2g_c:2.4G target tx power (unit:dBm) of RF path C for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm:           rtw_target_tx_pwr_2g_d:2.4G target tx power (unit:dBm) of RF path D for each rate section, should match the real calibrate power, -1: undefined (array of int)
parm:           rtw_phy_file_path:The path of phy parameter (charp)
parm:           rtw_load_phy_file:PHY File Bit Map (int)
parm:           rtw_decrypt_phy_file:Enable Decrypt PHY File (int)

A few comments though. Mine doesn't list Monitor mode as available, should it be there? Other thing, I have noticed every time I reboot the MAC address of the device changes. It didn't happen with the old Mange driver. Tried compiling in kernel 4.10 and got the same result as @nomadmzl. Thank all of you for your effort patching and porting the driver...

CGarces commented 7 years ago

From @masterzorag on May 10, 2017 7:55

@gilcu3 monitor mode is disabled by default, you have to set it and rebuild to get it supported. The MAC address is defaulting to a random one, check/use _rtwinitmac parameter on module loading.

@nomadmzl I'm tracking down the missing piece, but since module compiles fine for linux-4.9.25 here, can't reproduce (I don't use dkms/ubuntu):

gcc version 4.9.4 (Gentoo 4.9.4 p1.0, pie-0.6.4)

I'm assuming you are compiling with gcc >= 5.x

CGarces commented 7 years ago

Please check this to compile with gcc 5.x

CGarces commented 7 years ago

From @gilcu3 on May 10, 2017 11:26

@masterzorag about monitor mode, changed the Makefile option to yes, and now indeed I get it as a possible mode with iw, but when doing:

#uname -a
Linux reyPC 4.4.9-1-lts #1 SMP Thu May 5 07:43:50 CEST 2016 x86_64 GNU/Linux
#iw phy2 info
Wiphy phy2
    max # scan SSIDs: 9
    max scan IEs length: 2304 bytes
    max # sched scan SSIDs: 0
    max # match sets: 0
    max # scan plans: 1
    max scan plan interval: -1
    max scan plan iterations: 0
    Retry short limit: 7
    Retry long limit: 4
    Coverage class: 0 (up to 0m)
    Supported Ciphers:
        * WEP40 (00-0f-ac:1)
        * WEP104 (00-0f-ac:5)
        * TKIP (00-0f-ac:2)
        * CCMP-128 (00-0f-ac:4)
    Available Antennas: TX 0 RX 0
    Supported interface modes:
         * IBSS
         * managed
         * AP
         * monitor
         * P2P-client
         * P2P-GO
    Band 1:
        Capabilities: 0x1962
            HT20/HT40
            Static SM Power Save
            RX HT20 SGI
            RX HT40 SGI
            RX STBC 1-stream
            Max AMSDU length: 7935 bytes
            DSSS/CCK HT40
        Maximum RX AMPDU length 65535 bytes (exponent: 0x003)
        Minimum RX AMPDU time spacing: 16 usec (0x07)
        HT Max RX data rate: 300 Mbps
        HT TX/RX MCS rate indexes supported: 0-15
        Bitrates (non-HT):
            * 1.0 Mbps
            * 2.0 Mbps
            * 5.5 Mbps
            * 11.0 Mbps
            * 6.0 Mbps
            * 9.0 Mbps
            * 12.0 Mbps
            * 18.0 Mbps
            * 24.0 Mbps
            * 36.0 Mbps
            * 48.0 Mbps
            * 54.0 Mbps
        Frequencies:
            * 2412 MHz [1] (30.0 dBm)
            * 2417 MHz [2] (30.0 dBm)
            * 2422 MHz [3] (30.0 dBm)
            * 2427 MHz [4] (30.0 dBm)
            * 2432 MHz [5] (30.0 dBm)
            * 2437 MHz [6] (30.0 dBm)
            * 2442 MHz [7] (30.0 dBm)
            * 2447 MHz [8] (30.0 dBm)
            * 2452 MHz [9] (30.0 dBm)
            * 2457 MHz [10] (30.0 dBm)
            * 2462 MHz [11] (30.0 dBm)
            * 2467 MHz [12] (30.0 dBm)
            * 2472 MHz [13] (30.0 dBm)
            * 2484 MHz [14] (disabled)
    Supported commands:
         * new_interface
         * set_interface
         * new_key
         * start_ap
         * new_station
         * set_bss
         * join_ibss
         * set_pmksa
         * del_pmksa
         * flush_pmksa
         * remain_on_channel
         * frame
         * set_channel
         * connect
         * disconnect
    Supported TX frame types:
         * IBSS: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
         * managed: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
         * AP: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
         * AP/VLAN: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
         * P2P-client: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
         * P2P-GO: 0x00 0x10 0x20 0x30 0x40 0x50 0x60 0x70 0x80 0x90 0xa0 0xb0 0xc0 0xd0 0xe0 0xf0
    Supported RX frame types:
         * IBSS: 0xd0
         * managed: 0x40 0xd0
         * AP: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
         * AP/VLAN: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
         * P2P-client: 0x40 0xd0
         * P2P-GO: 0x00 0x20 0x40 0xa0 0xb0 0xc0 0xd0
    WoWLAN support:
         * wake up on anything (device continues operating normally)
    software interface modes (can always be added):
         * monitor
    interface combinations are not supported
    Device supports scan flush.

#airmonng --verbose start wlp0s20u1
LSB Version:    1.4
Distributor ID: Arch
Description:    Arch Linux
Release:    rolling
Codename:   n/a

Linux reyPC 4.4.9-1-lts #1 SMP Thu May 5 07:43:50 CEST 2016 x86_64 GNU/Linux

K indicates driver is from 4.4.9-1-lts
V indicates driver comes directly from the vendor, almost certainly a bad thing
S indicates driver comes from the staging tree, these drivers are meant for reference not actual use, BEWARE
? indicates we do not know where the driver comes from... report this

X[PHY]Interface     Driver[Stack]-FirmwareRev       Chipset                                     Extended Info

?[phy2]wlp0s20u1    ??????[mac80211]-unavailable                                                     Failure detecting driver properly please report
cat: /sys/class/ieee80211/phy2/device/net/wlp0s20u1mon/type: No such file or directory

Newly created monitor mode interface wlp0s20u1mon is *NOT* in monitor mode.
Removing non-monitor wlp0s20u1mon interface...

WARNING: unable to start monitor mode, please run "airmon-ng check kill"

I will try to find the parameter rtw_initmac later in dmesg, in case I don't find it, where can I set it? I will test compiling in kernel 4.10 later with the new patch, and come back with the results..

PS: something strange about monitor mode, yesterday I managed to recompile rt8xxxu and get it working with my dongle, and nothing worked except monitor mode :) So I'm sure my dongle is capable.

CGarces commented 7 years ago

From @masterzorag on May 10, 2017 17:58

on MAC address

It's working like expected in my test, it works by default this way:

  1. read MAC from EFUSE, if can't: randomize MAC
  2. set MAC address

We can override default by passing _rtwinitmac module parameter:

# rmmod 8192eu
# modprobe 8192eu rtw_initmac="00:de:ad:be:ef:00"

# ifconfig wlan1 up
# ifconfig wlan1
wlan1: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        ether 00:de:ad:be:ef:00  txqueuelen 1000  (Ethernet)

# grep mac_addr /var/log/dmesg 
[   14.812631] RTL871X: rtw_ndev_init(wlan1) if1 mac_addr=18:d6:c7:18:7e:18
# grep mac_addr /var/log/messages
...
May 10 19:46:11 blackbox kernel: RTL871X: rtw_ndev_init(wlan1) if1 mac_addr=00:e0:4c:7c:3f:69
May 10 19:46:22 blackbox kernel: RTL871X: rtw_ndev_init(wlan1) if1 mac_addr=00:e0:4c:9a:82:b6
May 10 19:46:33 blackbox kernel: RTL871X: rtw_ndev_init(wlan1) if1 mac_addr=00:e0:4c:a8:99:19
May 10 19:46:43 blackbox kernel: RTL871X: rtw_ndev_init(wlan1) if1 mac_addr=18:d6:c7:18:7e:18
May 10 19:47:09 blackbox kernel: RTL871X: rtw_ndev_init(wlan1) if1 mac_addr=18:d6:c7:18:7e:18
May 10 19:49:27 blackbox kernel: RTL871X: rtw_ndev_init(wlan1) if1 mac_addr=00:de:ad:be:ef:00

I can see my real MAC 18:d6:c7:18:7e:18 by default, readed. If I pass an incorrect one it defaults to random

May 10 19:46:33 blackbox kernel: RTL871X: ERROR invalid mac addr:ff:ff:ff:f2:ff:ff, assign random MAC

on monitor mode

It works, mon0 seems not working or having problems, so just use wlan1 directly

May 10 20:25:02 blackbox kernel: device wlan1 entered promiscuous mode
May 10 20:25:04 blackbox kernel: device wlan1 left promiscuous mode

new mac80211 wireless
# iw dev
phy#22
        Interface wlan1
                ifindex 25
                wdev 0x1600000001
                addr 00:de:ad:be:ef:00
                type monitor

WEXT reports:
# iwconfig 
wlan1     IEEE 802.11bgn  Mode:Monitor  Tx-Power=12 dBm   
          Retry short limit:7   RTS thr:off   Fragment thr:off
          Power Management:on

 CH  2 ][ Elapsed: 36 s ][ 2017-05-10 20:29 ][ fixed channel wlan1: -1                                                                                                                                          
 BSSID              PWR RXQ  Beacons    #Data, #/s  CH  MB   ENC  CIPHER AUTH ESSID
 32:CD:A7:9F:97:42  -49  96      388        0    0   2  54e  WPA2 CCMP   PSK  DIRECT-zdM2020 Series                                  

We have just to rfkill unblock if blocked when down, injection seems not working, but not needed now.

CGarces commented 7 years ago

From @gilcu3 on May 10, 2017 21:13

about MAC: when I insert the device, I get

[ 4307.767762] RTL871X: rtw_ndev_init(wlan0) if1 mac_addr=18:a6:f7:1f:10:eb
[ 4307.768062] RTL871X:  [0x00100000,5]-871x_drv - drv_init, success!
[ 4308.303195] rtl8192eu 3-1:1.0 wlp0s20u1: renamed from wlan0

in dmesg, and that's the correct MAC address, the interface is changed by something at the end, not sure if it's the driver, although it seems something related to udev, or I don't know. After that:

#ip addr show dev wlp0s20u1
9: wlp0s20u1: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 0e:b9:19:32:73:58 brd ff:ff:ff:ff:ff:ff

so the MAC address changed, and I see nothing about it on dmesg. Do you have any clue about who could be changing MAC?

About monitor, how do you activate monitor mode? Or maybe the problem here is related with the former? When I used rt8xxxu and got monitor mode, wireshark captured packets, so sniffing was working rigth?

CGarces commented 7 years ago

From @masterzorag on May 10, 2017 21:41

Don't unplug nothing, just:

# rmmod 8192eu
# modprobe 8192eu rtw_initmac="00:de:ad:be:ef:00"

* check:
# grep mac_addr /var/log/messages
* double check with systool:
# systool -v -m 8192eu | grep mac
    rtw_initmac         = "00:de:ad:be:ef:00"

maybe some other setting is changing your MAC, somewhere; For monitor mode, you can use a wrapper # airmon-ng start wlan1 or # iw dev wlan1 set monitor none

CGarces commented 7 years ago

From @gilcu3 on May 10, 2017 21:46

#dmesg -w | grep mac_addr
[ 6627.504454] RTL871X: rtw_ndev_init(wlan0) if1 mac_addr=18:a6:f7:1f:10:eb
#systool -v -m 8192eu | grep mac
    rtw_initmac         = "(null)"

So, why null??

CGarces commented 7 years ago

From @gilcu3 on May 10, 2017 22:20

About monitor mode (following this guide), with iw command works like a charm, no error or warning, don't know why airmon-ng doesn't find the driver. Anyway using tcpdum like this: tcpdump -i mon0 -n -w wireless.cap couldn't capture anything, although I know there are packets around :) Does packet capture work for you?

CGarces commented 7 years ago

From @gilcu3 on May 11, 2017 0:37

@masterzorag I found the source of the MAC changing problem, I had NetworkManager doing some stuff under the hood. Please confirm if you are able to capture packets. Next I'll test on kernel 4.10

CGarces commented 7 years ago

From @nomadmzl on May 11, 2017 1:16

Hi I have gcc version 5.4.0, I've installed the driver with your correction on include/linux/wireless.h but I'm having the same output:

kernel 4.8.0-51-generic (x86_64)
make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/4.8.0-51-generic/build M=/var/lib/dkms/rtl8192eu/1.0/build  modules
make[1]: se entra en el directorio '/usr/src/linux-headers-4.8.0-51-generic'
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_cmd.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_security.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_debug.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_io.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_ioctl_query.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_ioctl_set.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_ieee80211.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_mlme.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_mlme_ext.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_wlan_util.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_vht.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_pwrctrl.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_rf.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_recv.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_sta_mgt.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_ap.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_xmit.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_p2p.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_tdls.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_br_ext.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_iol.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_sreset.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_btcoex.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_beamforming.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_odm.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/efuse/rtw_efuse.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/os_dep/osdep_service.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/os_dep/linux/os_intfs.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/os_dep/linux/usb_intf.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/os_dep/linux/usb_ops_linux.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/os_dep/linux/ioctl_linux.o
/var/lib/dkms/rtl8192eu/1.0/build/os_dep/linux/ioctl_linux.c: In function ‘rtw_ioctl_wext_private’:
/var/lib/dkms/rtl8192eu/1.0/build/os_dep/linux/ioctl_linux.c:14035:5: error: implicit declaration of function ‘is_compat_task’ [-Werror=implicit-function-declaration]
  if(is_compat_task())
     ^
cc1: some warnings being treated as errors
scripts/Makefile.build:289: fallo en las instrucciones para el objetivo '/var/lib/dkms/rtl8192eu/1.0/build/os_dep/linux/ioctl_linux.o'
make[2]: *** [/var/lib/dkms/rtl8192eu/1.0/build/os_dep/linux/ioctl_linux.o] Error 1
Makefile:1491: fallo en las instrucciones para el objetivo '_module_/var/lib/dkms/rtl8192eu/1.0/build'
make[1]: *** [_module_/var/lib/dkms/rtl8192eu/1.0/build] Error 2
make[1]: se sale del directorio '/usr/src/linux-headers-4.8.0-51-generic'
Makefile:1697: fallo en las instrucciones para el objetivo 'modules'
make: *** [modules] Error 2
CGarces commented 7 years ago

From @masterzorag on May 11, 2017 8:30

Monitor mode :gem:

@gilcu3 capturing is working, tested airodump-ng and tcpdump:

# /etc/init.d/net.wlan1 -D stop
# iw dev wlan1 set monitor none
# rfkill list
2: phy2: Wireless LAN
        Soft blocked: yes
        Hard blocked: no
# rfkill unblock 2
# ifconfig wlan1 up
# iw dev
phy#2
        Interface wlan1
                ifindex 5
                wdev 0x200000001
                addr 18:d6:c7:18:7e:18
                type monitor

# tcpdump -i wlan1 -n -w wireless.cap
dropped privs to tcpdump
tcpdump: listening on wlan1, link-type IEEE802_11_RADIO (802.11 plus radiotap header), capture size 262144 bytes
^C42276 packets captured
42306 packets received by filter
0 packets dropped by kernel
1 packet dropped by interface

# file wireless.cap 
wireless.cap: tcpdump capture file (little-endian) - version 2.4 (802.11 with radiotap header, capture length 262144)

# hexdump -C wireless.cap | head
00000000  d4 c3 b2 a1 02 00 04 00  00 00 00 00 00 00 00 00  |................|
00000010  00 00 04 00 7f 00 00 00  54 1f 14 59 cd 3b 04 00  |........T..Y.;..|
00000020  fe 00 00 00 fe 00 00 00  00 00 12 00 2e 48 00 00  |.............H..|
00000030  10 0c 71 09 c0 00 ca 00  00 00 80 00 00 00 ff ff  |..q.............|
00000040  ff ff ff ff 32 cd a7 9f  97 42 32 cd a7 9f 97 42  |....2....B2....B|
00000050  80 fe 3a 40 30 5d 00 00  00 00 64 00 11 04 00 15  |..:@0]....d.....|
00000060  44 49 52 45 43 54 2d 7a  64 4d 32 30 32 30 20 53  |DIRECT-zdM2020 S|
00000070  65 72 69 65 73 01 08 8c  12 18 24 30 48 60 6c 03  |eries.....$0H`l.|
...

# aircrack-ng wireless.cap 
Opening wireless.cap
Read 42276 packets.
   1  32:CD:A7:9F:97:42  DIRECT-zdM2020 Series     No data - WEP or WPA
   ...
   3  E8:CC:18:48:76:30  ----                      WPA (1 handshake)

Also, _rtwinitmac is "NULL" when you don't pass the module parameter, so it's right.

CGarces commented 7 years ago

From @masterzorag on May 11, 2017 8:49

@nomadmzl can you pull my changes and test?

CGarces commented 7 years ago

From @gilcu3 on May 11, 2017 11:43

@masterzorag Great!!! Following your steps to the letter, I got monitor mode and captured packets 🥇 The MAC address problem was indeed the default in NetworkManager in recent versions, randomized when not connected, disabled that and got normal behaviour. So for me no problem with the driver in 4.4 kernel. Thank you

CGarces commented 7 years ago

From @gilcu3 on May 11, 2017 12:12

I'm now compiling the module in linux-4.10, got the same error as @nomadmzl before:

/home/rey/opt/drivers_wlan/linux/masterzorag/RTL8192EU-linux/os_dep/linux/ioctl_linux.c: In function ‘rtw_ioctl_wext_private’:
/home/rey/opt/drivers_wlan/linux/masterzorag/RTL8192EU-linux/os_dep/linux/ioctl_linux.c:14036:5: error: implicit declaration of function ‘is_compat_task’ [-Werror=implicit-function-declaration]
  if(is_compat_task())
     ^~~~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:295: /home/rey/opt/drivers_wlan/linux/masterzorag/RTL8192EU-linux/os_dep/linux/ioctl_linux.o] Error 1
make[1]: *** [Makefile:1490: _module_/home/rey/opt/drivers_wlan/linux/masterzorag/RTL8192EU-linux] Error 2
make[1]: Leaving directory '/usr/lib/modules/4.10.11-1-ARCH/build'
make: *** [Makefile:1697: modules] Error 2

search for the definition of that "function" in my kernel source, found it here:

cat /usr/lib/modules/4.10.11-1-ARCH/build/include/linux/compat.h | grep is_compat
#define is_compat_task() (0)

So it's not a function, just a define, couldn't it be messing things up?

CGarces commented 7 years ago

From @gilcu3 on May 11, 2017 12:21

found this:

cat /usr/lib/modules/4.10.11-1-ARCH/build/include/linux/compat.h | grep is_compat
static inline bool in_compat_syscall(void) { return is_compat_task(); }
#define is_compat_task() (0)

In old kernels it was an inline function, so tried changing all references from is_compat_task to in_compat_syscall and now it compiles :)

CGarces commented 7 years ago

From @gilcu3 on May 11, 2017 12:25

Right now tested on 4.10, and it's working :)

CGarces commented 7 years ago

@gilcu3 I don't have time to patch my branch or send a PR to @masterzorag

If any one needs to patch the code and solve the is_compat_task issue, please use this as reference.

CGarces commented 7 years ago

From @masterzorag on May 11, 2017 16:6

If tests will be good, I've prepared a tag for this point :label:

CGarces commented 7 years ago

First of all sorry for move the original issue to this repository

I know that this will add more confusion, but I have created this branch as fork from Mange, with the following "improvements"

nomadmzl commented 7 years ago

It worked using this branch 4.11 in Ubuntu, Kernel 4.8 (compiles fine: 0 errors) - with a Comfast dongle:

~$ modinfo 8192eu
filename:       /lib/modules/4.8.0-51-generic/updates/dkms/8192eu.ko
version:        v4.4.1_17696.20160509_BTCOEX20160412-0042
author:         Realtek Semiconductor Corp.
description:    Realtek Wireless Lan Driver
license:        GPL
srcversion:     70FC1BC9480AB71C03638FD
alias:          usb:v2357p0109d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p0108d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p0107d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp818Cd*dc*dsc*dp*icFFiscFFipFFin*
alias:          usb:v0BDAp818Bd*dc*dsc*dp*icFFiscFFipFFin*
depends:        cfg80211
vermagic:       4.8.0-51-generic SMP mod_unload modversions 
masterzorag commented 7 years ago

Notes: https://github.com/CGarces/rtl8192eu-linux-driver/commit/0ed0b178540438f59a0e217bac2de15c1530145a is in sync 🔗 with first tag on mine

nomadmzl commented 7 years ago

Hi, @CGarces I've checked your 4.4.1 branch, I'm having this output when installing:

DKMS make.log for rtl8192eu-1.0 for kernel 4.8.0-51-generic (x86_64)
make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/4.8.0-51-generic/build M=/var/lib/dkms/rtl8192eu/1.0/build  modules
make[1]: se entra en el directorio '/usr/src/linux-headers-4.8.0-51-generic'
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_cmd.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_security.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_debug.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_io.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_ioctl_query.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_ioctl_set.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_ieee80211.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_mlme.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_mlme_ext.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_wlan_util.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_vht.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_pwrctrl.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_rf.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_recv.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_sta_mgt.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_ap.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_xmit.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_p2p.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_tdls.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_br_ext.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_iol.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_sreset.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_btcoex.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_beamforming.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/rtw_odm.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/core/efuse/rtw_efuse.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/os_dep/osdep_service.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/os_dep/linux/os_intfs.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/os_dep/linux/usb_intf.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/os_dep/linux/usb_ops_linux.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/os_dep/linux/ioctl_linux.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/os_dep/linux/xmit_linux.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/os_dep/linux/mlme_linux.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/os_dep/linux/recv_linux.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/os_dep/linux/ioctl_cfg80211.o
/var/lib/dkms/rtl8192eu/1.0/build/os_dep/linux/ioctl_cfg80211.c: In function ‘rtw_spt_band_free’:
/var/lib/dkms/rtl8192eu/1.0/build/os_dep/linux/ioctl_cfg80211.c:288:20: warning: comparison between ‘enum nl80211_band’ and ‘enum ieee80211_band’ [-Wenum-compare]
  if(spt_band->band == IEEE80211_BAND_2GHZ)
                    ^
/var/lib/dkms/rtl8192eu/1.0/build/os_dep/linux/ioctl_cfg80211.c:294:25: warning: comparison between ‘enum nl80211_band’ and ‘enum ieee80211_band’ [-Wenum-compare]
  else if(spt_band->band == IEEE80211_BAND_5GHZ)
                         ^
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/os_dep/linux/rtw_cfgvendor.o
  CC [M]  /var/lib/dkms/rtl8192eu/1.0/build/os_dep/linux/wifi_regd.o
/var/lib/dkms/rtl8192eu/1.0/build/os_dep/linux/wifi_regd.c: In function ‘_rtw_reg_apply_radar_flags’:
/var/lib/dkms/rtl8192eu/1.0/build/os_dep/linux/wifi_regd.c:261:20: error: ‘IEEE80211_BAND_5GHZ’ undeclared (first use in this function)
  if (!wiphy->bands[IEEE80211_BAND_5GHZ])
                    ^
/var/lib/dkms/rtl8192eu/1.0/build/os_dep/linux/wifi_regd.c:261:20: note: each undeclared identifier is reported only once for each function it appears in
/var/lib/dkms/rtl8192eu/1.0/build/os_dep/linux/wifi_regd.c: In function ‘_rtw_reg_apply_flags’:
/var/lib/dkms/rtl8192eu/1.0/build/os_dep/linux/wifi_regd.c:319:18: error: ‘IEEE80211_NUM_BANDS’ undeclared (first use in this function)
  for (i = 0; i < IEEE80211_NUM_BANDS; i++) {
                  ^
scripts/Makefile.build:289: fallo en las instrucciones para el objetivo '/var/lib/dkms/rtl8192eu/1.0/build/os_dep/linux/wifi_regd.o'
make[2]: *** [/var/lib/dkms/rtl8192eu/1.0/build/os_dep/linux/wifi_regd.o] Error 1
Makefile:1491: fallo en las instrucciones para el objetivo '_module_/var/lib/dkms/rtl8192eu/1.0/build'
make[1]: *** [_module_/var/lib/dkms/rtl8192eu/1.0/build] Error 2
make[1]: se sale del directorio '/usr/src/linux-headers-4.8.0-51-generic'
Makefile:1697: fallo en las instrucciones para el objetivo 'modules'
make: *** [modules] Error 2

Maybe is there an issue merging Menge's and Masterzorag's'? if you have time to check it, I'll test it again.

masterzorag commented 7 years ago

@nomadmzl could you try my branch? Seems this commit have conflicts and misses changes in those files. See https://github.com/masterzorag/RTL8192EU-linux/commit/a6e0d023e42239e7d091b880fefebb757e5e4dc2

CGarces commented 7 years ago

Fixed with f064ed9a694245693c7eb419e83e84779528c5d0

nomadmzl commented 7 years ago

I've tested some of your versions:

@cgarces tree f064ed9a694245693c7eb419e83e84779528c5d0 Runs fine

~$ modinfo 8192eu
filename:       /lib/modules/4.8.0-51-generic/updates/dkms/8192eu.ko
version:        v4.4.1_17696.20160509_BTCOEX20160412-0042
author:         Realtek Semiconductor Corp.
description:    Realtek Wireless Lan Driver
license:        GPL
srcversion:     C418888AEF4F6B5451B033E
alias:          usb:v2019pAB33d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p0109d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p0108d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p0107d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp818Cd*dc*dsc*dp*icFFiscFFipFFin*
alias:          usb:v0BDAp818Bd*dc*dsc*dp*icFFiscFFipFFin*
depends:        cfg80211
vermagic:       4.8.0-51-generic SMP mod_unload modversions 
~$ iwconfig
wlx40     IEEE 802.11bgn  ESSID:""  Nickname:"<WIFI@REALTEK>"
          Mode:Managed  Frequency:2.412 GHz  Access Point: .......
          Bit Rate:144.4 Mb/s   Sensitivity:0/0
          Retry:off   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=100/100  Signal level=100/100  Noise level=0/100
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

@Masterzorag tree a6e0d023e42239e7d091b880fefebb757e5e4dc2 Compilation problems

~/rtl8192eu$ sudo make && make install
make ARCH=x86_64 CROSS_COMPILE= -C /lib/modules/4.8.0-51-generic/build M=/home/desktop/zoraga6e/rtl8192eu  modules
make[1]: se entra en el directorio '/usr/src/linux-headers-4.8.0-51-generic'
  CC [M]  /home/desktop/zoraga6e/rtl8192eu/core/rtw_cmd.o
  CC [M]  /home/desktop/zoraga6e/rtl8192eu/core/rtw_security.o
  CC [M]  /home/desktop/zoraga6e/rtl8192eu/core/rtw_debug.o
/home/desktop/zoraga6e/rtl8192eu/core/rtw_debug.c: In function ‘dump_drv_version’:
/home/desktop/zoraga6e/rtl8192eu/core/rtw_debug.c:71:64: warning: macro "__DATE__" might prevent reproducible builds [-Wdate-time]
  DBG_871X_SEL_NL(sel, "build time: %s %s\n", __DATE__, __TIME__);
                                                                ^
/home/desktop/zoraga6e/rtl8192eu/core/rtw_debug.c:71:64: warning: macro "__TIME__" might prevent reproducible builds [-Wdate-time]
/home/desktop/zoraga6e/rtl8192eu/core/rtw_debug.c:71:64: warning: macro "__DATE__" might prevent reproducible builds [-Wdate-time]
/home/desktop/zoraga6e/rtl8192eu/core/rtw_debug.c:71:64: warning: macro "__TIME__" might prevent reproducible builds [-Wdate-time]
/home/desktop/zoraga6e/rtl8192eu/core/rtw_debug.c:71:64: warning: macro "__DATE__" might prevent reproducible builds [-Wdate-time]
/home/desktop/zoraga6e/rtl8192eu/core/rtw_debug.c:71:64: warning: macro "__TIME__" might prevent reproducible builds [-Wdate-time]
  CC [M]  /home/desktop/zoraga6e/rtl8192eu/core/rtw_io.o
  CC [M]  /home/desktop/zoraga6e/rtl8192eu/core/rtw_ioctl_query.o
  CC [M]  /home/desktop/zoraga6e/rtl8192eu/core/rtw_ioctl_set.o
  CC [M]  /home/desktop/zoraga6e/rtl8192eu/core/rtw_ieee80211.o
  CC [M]  /home/desktop/zoraga6e/rtl8192eu/core/rtw_mlme.o
  CC [M]  /home/desktop/zoraga6e/rtl8192eu/core/rtw_mlme_ext.o
  CC [M]  /home/desktop/zoraga6e/rtl8192eu/core/rtw_wlan_util.o
  CC [M]  /home/desktop/zoraga6e/rtl8192eu/core/rtw_vht.o
  CC [M]  /home/desktop/zoraga6e/rtl8192eu/core/rtw_pwrctrl.o
  CC [M]  /home/desktop/zoraga6e/rtl8192eu/core/rtw_rf.o
  CC [M]  /home/desktop/zoraga6e/rtl8192eu/core/rtw_recv.o
  CC [M]  /home/desktop/zoraga6e/rtl8192eu/core/rtw_sta_mgt.o
  CC [M]  /home/desktop/zoraga6e/rtl8192eu/core/rtw_ap.o
  CC [M]  /home/desktop/zoraga6e/rtl8192eu/core/rtw_xmit.o
  CC [M]  /home/desktop/zoraga6e/rtl8192eu/core/rtw_p2p.o
  CC [M]  /home/desktop/zoraga6e/rtl8192eu/core/rtw_tdls.o
  CC [M]  /home/desktop/zoraga6e/rtl8192eu/core/rtw_br_ext.o
  CC [M]  /home/desktop/zoraga6e/rtl8192eu/core/rtw_iol.o
  CC [M]  /home/desktop/zoraga6e/rtl8192eu/core/rtw_sreset.o
  CC [M]  /home/desktop/zoraga6e/rtl8192eu/core/rtw_btcoex.o
  CC [M]  /home/desktop/zoraga6e/rtl8192eu/core/rtw_beamforming.o
  CC [M]  /home/desktop/zoraga6e/rtl8192eu/core/rtw_odm.o
  CC [M]  /home/desktop/zoraga6e/rtl8192eu/core/efuse/rtw_efuse.o
  CC [M]  /home/desktop/zoraga6e/rtl8192eu/os_dep/osdep_service.o
  CC [M]  /home/desktop/zoraga6e/rtl8192eu/os_dep/linux/os_intfs.o
  CC [M]  /home/desktop/zoraga6e/rtl8192eu/os_dep/linux/usb_intf.o
  CC [M]  /home/desktop/zoraga6e/rtl8192eu/os_dep/linux/usb_ops_linux.o
  CC [M]  /home/desktop/zoraga6e/rtl8192eu/os_dep/linux/ioctl_linux.o
/home/desktop/zoraga6e/rtl8192eu/os_dep/linux/ioctl_linux.c: In function ‘rtw_ioctl_wext_private’:
/home/desktop/zoraga6e/rtl8192eu/os_dep/linux/ioctl_linux.c:14035:5: error: implicit declaration of function ‘is_compat_task’ [-Werror=implicit-function-declaration]
  if(is_compat_task())
     ^
cc1: some warnings being treated as errors
scripts/Makefile.build:289: fallo en las instrucciones para el objetivo '/home/desktop/zoraga6e/rtl8192eu/os_dep/linux/ioctl_linux.o'
make[2]: *** [/home/desktop/zoraga6e/rtl8192eu/os_dep/linux/ioctl_linux.o] Error 1
Makefile:1491: fallo en las instrucciones para el objetivo '_module_/home/desktop/zoraga6e/rtl8192eu'
make[1]: *** [_module_/home/desktop/zoraga6e/rtl8192eu] Error 2
make[1]: se sale del directorio '/usr/src/linux-headers-4.8.0-51-generic'
Makefile:1686: fallo en las instrucciones para el objetivo 'modules'
make: *** [modules] Error 2

@Masterzorag tree 4.4.1_rc1 Runs fine

~$ modinfo 8192eu
filename:       /lib/modules/4.8.0-51-generic/updates/dkms/8192eu.ko
version:        v4.4.1_17696.20160509_BTCOEX20160412-0042
author:         Realtek Semiconductor Corp.
description:    Realtek Wireless Lan Driver
license:        GPL
srcversion:     70FC1BC9480AB71C03638FD
alias:          usb:v2357p0109d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p0108d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p0107d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp818Cd*dc*dsc*dp*icFFiscFFipFFin*
alias:          usb:v0BDAp818Bd*dc*dsc*dp*icFFiscFFipFFin*
depends:        cfg80211
vermagic:       4.8.0-51-generic SMP mod_unload modversions
~$ iwconfig 
wlx40  IEEE 802.11bgn  ESSID:""  Nickname:"<WIFI@REALTEK>"
          Mode:Managed  Frequency:2.412 GHz  Access Point: .......   
          Bit Rate:144.4 Mb/s   Sensitivity:0/0  
          Retry:off   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=100/100  Signal level=100/100  Noise level=0/100
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

@Masterzorag branch 441 Runs fine

~$  modinfo 8192eu
filename:       /lib/modules/4.8.0-51-generic/updates/dkms/8192eu.ko
version:        v4.4.1_17696.20160509_BTCOEX20160412-0042
author:         Realtek Semiconductor Corp.
description:    Realtek Wireless Lan Driver
license:        GPL
srcversion:     70FC1BC9480AB71C03638FD
alias:          usb:v2357p0109d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p0108d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v2357p0107d*dc*dsc*dp*ic*isc*ip*in*
alias:          usb:v0BDAp818Cd*dc*dsc*dp*icFFiscFFipFFin*
alias:          usb:v0BDAp818Bd*dc*dsc*dp*icFFiscFFipFFin*
depends:        cfg80211
vermagic:       4.8.0-51-generic SMP mod_unload modversions 
~$ iwconfig  
wlx40a IEEE 802.11bgn  ESSID:"SEB"  Nickname:"<WIFI@REALTEK>"
          Mode:Managed  Frequency:2.412 GHz  Access Point: ......   
          Bit Rate:144.4 Mb/s   Sensitivity:0/0  
          Retry:off   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=100/100  Signal level=100/100  Noise level=0/100
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

@masterzorag branch 4.4.1 and 4.4.1_rc1 are the same, right?

masterzorag commented 7 years ago

Exactly, same point: you can verify on your output about: srcversion: 70FC1BC9480AB71C03638FD Thanks for testing and feedback