rtl8812au icon indicating copy to clipboard operation
rtl8812au copied to clipboard

Compilation error on kernel 4.15.0-20-generic (Ubuntu 18.04)

Open siddharth99 opened this issue 6 years ago • 27 comments

I am running into compilation error with kernel 4.15 since the timer interface has changed.

make[1]: Entering directory '/usr/src/linux-headers-4.15.0-20-generic'
  CC [M]  /usr/local/src/rtl8812au/core/rtw_cmd.o
In file included from /usr/local/src/rtl8812au/include/osdep_service.h:41:0,
                 from /usr/local/src/rtl8812au/include/drv_types.h:32,
                 from /usr/local/src/rtl8812au/core/rtw_cmd.c:22:
/usr/local/src/rtl8812au/include/osdep_service_linux.h: In function ‘_init_timer’:
/usr/local/src/rtl8812au/include/osdep_service_linux.h:257:8: error: ‘_timer {aka struct timer_list}’ has no member named ‘data’
  ptimer->data = (unsigned long)cntx;
        ^~
/usr/local/src/rtl8812au/include/osdep_service_linux.h:258:2: error: implicit declaration of function ‘init_timer’; did you mean ‘_init_timer’? [-Werror=implicit-function-declaration]
  init_timer(ptimer);
  ^~~~~~~~~~
  _init_timer

I made a small change to make it compile but I obviously did something wrong since the code compiles but the kernel hangs as soon as I try to do insmod 8812au.ko

 __inline static void _init_timer(_timer *ptimer,_nic_hdl nic_hdl,void *pfunc,void* cntx)
 {
        //setup_timer(ptimer, pfunc,(u32)cntx); 
-       ptimer->function = pfunc;
-       ptimer->data = (unsigned long)cntx;
-       init_timer(ptimer);
+       //ptimer->function = pfunc;
+       //ptimer->data = (unsigned long)cntx;
+       // init_timer(ptimer);
+       timer_setup(ptimer, pfunc, (unsigned long)cntx);
 }

Any help would be greatly appreciated.

siddharth99 avatar May 13 '18 23:05 siddharth99

https://github.com/gordboy/rtl8812au provides working solution up to 4.17-rc4 someone with time and interest could borrow and adapt the code

donahue95 avatar May 14 '18 11:05 donahue95

I really hope someone can update the code to work in Ubuntu 18.04.

@donahue95 I tried the link you provided to use dkms to install, the installation completed fine but modprobe could not load the module. However, dkms status shows rtl8812au is installed.

NTOTL avatar May 14 '18 20:05 NTOTL

@donahue95 - I tried the link too and I'm able to compile and add the module manually using insmod which seems to work and adds the module. But I don't see the USB wifi device being recognized anywhere.

siddharth99 avatar May 16 '18 02:05 siddharth99

I also get the same error as @siddharth99 on debian testing with kernel 4.16

Jeansen avatar May 24 '18 19:05 Jeansen

You need to manually edit the driver for it to work, as our driver is slighty different, but the patch would work. Take a look at this https://github.com/aircrack-ng/rtl8812au/commit/f221a169f281dab9756a176ec2abd91e0eba7d19

Just manually edit changes

kimocoder avatar May 24 '18 20:05 kimocoder

@kimocoder There is no hal/phydm/phydem_types.h file in this repo. So I made the changes from the other two modifications from your link aircrack-ng/rtl8812au@f221a16 and it got a lot further than it was doing before...

But now /home/user/rtl8812au/hal/OUTSRC/odm_interface.c is dropping incompatible pointer type errors. It does not like pTimer...

simon0451 avatar May 28 '18 05:05 simon0451

Please someone make it compile and work with Ubuntu 18.04 LTS or the new kernel 4.15 and above?

Please?

NTOTL avatar Jun 07 '18 14:06 NTOTL

https://github.com/gnab/rtl8812au/pull/141 resolves this, but doesn't seems to have anyone to merge things here

I just intall using this: https://github.com/msharov/rtl8812au/commits/master

~$ dkms status
8812au, 4.2.2, 4.15.0-22-generic, x86_64

~$ lsb_release -a
No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 18.04 LTS
Release:	18.04
Codename:	bionic

@gnab can you merge the open PR? Or someone with access please.

fgl27 avatar Jun 07 '18 16:06 fgl27

It's been a while, can someone please do a merge?

NTOTL avatar Jun 21 '18 15:06 NTOTL

@penguin360 then just do "wget https://github.com/msharov/rtl8812au/commit/296fb88cf466fe07fffd1b9d2f42a33c420ceb1d.patch" and patch it yourself? "patch -p1 < *.patch"

kimocoder avatar Jun 21 '18 15:06 kimocoder

@kimocoder thanks for your reply. I am just a regular Ubuntu end user and I don't do Linux programming, so I don't know how to do it. I will be very grateful for anyone who can do it.

NTOTL avatar Jun 22 '18 14:06 NTOTL

I just told you..

1: git clone https://github.com/gnab/rtl8812au 2: cd rtl8812au 3: wget https://github.com/msharov/rtl8812au/commit/296fb88cf466fe07fffd1b9d2f42a33c420ceb1d.patch

4: patch -p1 < *.patch 5: make && make install

kimocoder avatar Jun 22 '18 14:06 kimocoder

@kimocoder solution to patch master worked well for me. I have Ubuntu 16.04.4 LTS with 4.15.0-24-generic Kernel version.

Rantelo avatar Jul 04 '18 03:07 Rantelo

@kimocoder Thank you very much for the patch. It worked like a charm.

I hope someone can merge it

NTOTL avatar Jul 05 '18 14:07 NTOTL

Your welcome!

kimocoder avatar Jul 05 '18 14:07 kimocoder

I'm on 16.04 but get an access warning at the last step. screenshot from 2018-07-17 19-06-41

mcman56 avatar Jul 18 '18 02:07 mcman56

a slight modification got this to work. For the last command I needed sudo make && sudo make install then I needed to reboot ...not that I know why

mcman56 avatar Jul 19 '18 02:07 mcman56

Thank you kimocoder, worked for me after changing to sudo make && sudo make install. I did not have to reboot

trentbrown13 avatar Jul 19 '18 22:07 trentbrown13

It worked like a charm in Elementary OS kernel 4.15.0-29, I just had to unplug and plug again the adapter. It's a shame that D-Link only supports til kernel 3.x

Well, thank you all that made it possible!

enrydell avatar Jul 22 '18 15:07 enrydell

Think @gnab just merged some pulls, adding kernel v4.14 support and few others. Takk @gnab - på tide du tok en runde her :+1:

kimocoder avatar Jul 22 '18 18:07 kimocoder

@gnab thank you! @kimocoder does it mean this issue has been fixed and the ticket can be closed?

NTOTL avatar Jul 25 '18 16:07 NTOTL

Exactly. The patch is merged.

kimocoder avatar Jul 25 '18 17:07 kimocoder

error what problem here, please halp me

mridowijayanto avatar Oct 02 '19 03:10 mridowijayanto

@mridowijayanto on unbuntu, you can run apt install rtl8812au-dkms and its done

gnumoksha avatar Jan 09 '20 02:01 gnumoksha

While running command make I am getting this error:: rtl8812au-1/os_dep/linux/os_intfs.c:1415:22: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types] .ndo_select_queue = rtw_select_queue,

hgupta481994 avatar Apr 19 '20 17:04 hgupta481994

rtl8812au-1/os_dep/linux/os_intfs.c:1415:22: note: (near initialization for ‘rtw_netdev_ops.ndo_select_queue’) cc1: warning: unrecognized command line option ‘-Wno-cast-function-type’ cc1: some warnings being treated as errors

hgupta481994 avatar Apr 19 '20 17:04 hgupta481994

I just told you..

1: git clone https://github.com/gnab/rtl8812au 2: cd rtl8812au 3: wget https://github.com/msharov/rtl8812au/commit/296fb88cf466fe07fffd1b9d2f42a33c420ceb1d.patch

@kimocoder the patch is not found....

--2020-10-11 09:45:01-- https://github.com/msharov/rtl8812au/commit/296fb88cf466fe07fffd1b9d2f42a33c420ceb1d.patch Resolving github.com (github.com)... 13.229.188.59 Connecting to github.com (github.com)|13.229.188.59|:443... connected. HTTP request sent, awaiting response... 404 Not Found 2020-10-11 09:45:02 ERROR 404: Not Found.

Light-- avatar Oct 11 '20 01:10 Light--