gnab / rtl8812au

Realtek 802.11n WLAN Adapter Linux driver
1.7k stars 552 forks source link

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

Open siddharth99 opened 6 years ago

siddharth99 commented 6 years ago

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.

donahue95 commented 6 years ago

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

NTOTL commented 6 years ago

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.

siddharth99 commented 6 years ago

@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.

Jeansen commented 6 years ago

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

kimocoder commented 6 years ago

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

simon0451 commented 6 years ago

@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...

NTOTL commented 6 years ago

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

Please?

fgl27 commented 6 years ago

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.

NTOTL commented 6 years ago

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

kimocoder commented 6 years ago

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

NTOTL commented 6 years ago

@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.

kimocoder commented 6 years ago

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

Rantelo commented 6 years ago

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

NTOTL commented 6 years ago

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

I hope someone can merge it

kimocoder commented 6 years ago

Your welcome!

mcman56 commented 6 years ago

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

mcman56 commented 6 years ago

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

trentbrown13 commented 6 years ago

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

enrydell commented 6 years ago

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!

kimocoder commented 6 years ago

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

NTOTL commented 6 years ago

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

kimocoder commented 6 years ago

Exactly. The patch is merged.

mridowijayanto commented 5 years ago

error what problem here, please halp me

gnumoksha commented 4 years ago

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

hgupta481994 commented 4 years ago

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 commented 4 years ago

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

Light-- commented 4 years ago

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.