zebulon2 / rtl8812au

RTL8812AU/21AU Driver for Linux
82 stars 23 forks source link

Unable to compile in Arch Linux with 5.12.4-arch1-2 kernel #36

Open ilgiznurgaliev opened 3 years ago

ilgiznurgaliev commented 3 years ago

Hi,

After system upgrade I'm unable to compile the driver, getting the error below:

  CC [M]  /home/casper/build/rtl8812au/core/efuse/rtw_efuse.o
/home/casper/build/rtl8812au/core/efuse/rtw_efuse.c: In function ‘rtw_read_efuse_from_file’:
/home/casper/build/rtl8812au/core/efuse/rtw_efuse.c:2565:14: error: implicit declaration of function ‘get_fs’; did you mean ‘get_sa’? [-Werror=implicit-function-declaration]
 2565 |         fs = get_fs();
      |              ^~~~~~
      |              get_sa
/home/casper/build/rtl8812au/core/efuse/rtw_efuse.c:2565:14: error: incompatible types when assigning to type ‘mm_segment_t’ from type ‘int’
/home/casper/build/rtl8812au/core/efuse/rtw_efuse.c:2566:9: error: implicit declaration of function ‘set_fs’; did you mean ‘sget_fc’? [-Werror=implicit-function-declaration]
 2566 |         set_fs(KERNEL_DS);
      |         ^~~~~~
      |         sget_fc
/home/casper/build/rtl8812au/core/efuse/rtw_efuse.c:2566:16: error: ‘KERNEL_DS’ undeclared (first use in this function); did you mean ‘KERNFS_NS’?
 2566 |         set_fs(KERNEL_DS);
      |                ^~~~~~~~~
      |                KERNFS_NS
/home/casper/build/rtl8812au/core/efuse/rtw_efuse.c:2566:16: note: each undeclared identifier is reported only once for each function it appears in
/home/casper/build/rtl8812au/core/efuse/rtw_efuse.c: In function ‘rtw_read_macaddr_from_file’:
/home/casper/build/rtl8812au/core/efuse/rtw_efuse.c:2646:14: error: incompatible types when assigning to type ‘mm_segment_t’ from type ‘int’
 2646 |         fs = get_fs();
      |              ^~~~~~
/home/casper/build/rtl8812au/core/efuse/rtw_efuse.c:2647:16: error: ‘KERNEL_DS’ undeclared (first use in this function); did you mean ‘KERNFS_NS’?
 2647 |         set_fs(KERNEL_DS);
      |                ^~~~~~~~~
      |                KERNFS_NS
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:271: /home/casper/build/rtl8812au/core/efuse/rtw_efuse.o] Error 1
make[1]: *** [Makefile:1851: /home/casper/build/rtl8812au] Error 2
make[1]: Leaving directory '/usr/lib/modules/5.12.4-arch1-2/build'
make: *** [Makefile:1870: modules] Error 2

OS: Arch Linux Kernel: 5.12.4-arch1-2 Device ID: 0bda:c811

Could anyone please help to fix it?

zebulon2 commented 3 years ago

Seems that from reading https://github.com/aircrack-ng/rtl8812au/issues/721 you may have an RTL8821CU. Can you look if: https://github.com/ulli-kroll/rtl8821cu or https://github.com/brektrou/rtl8821CU compile and work for you?

zebulon2 commented 3 years ago

See also: https://askubuntu.com/questions/1162974/wireless-usb-adapter-0bdac811-realtek-semiconductor-corp

ilgiznurgaliev commented 3 years ago

@zebulon2 thanks for your response. Unable to compile the modules above. Got same error for both of them:

...
  CC [M]  /home/casper/build/rtl8821CU/os_dep/linux/recv_linux.o
/home/casper/build/rtl8821CU/os_dep/linux/recv_linux.c: In function ‘napi_recv’:
/home/casper/build/rtl8821CU/os_dep/linux/recv_linux.c:358:76: error: ‘GRO_DROP’ undeclared (first use in this function)
  358 |                         if (rtw_napi_gro_receive(&padapter->napi, pskb) != GRO_DROP)
      |                                                                            ^~~~~~~~
/home/casper/build/rtl8821CU/os_dep/linux/recv_linux.c:358:76: note: each undeclared identifier is reported only once for each function it appears in
make[2]: *** [scripts/Makefile.build:271: /home/casper/build/rtl8821CU/os_dep/linux/recv_linux.o] Error 1
make[1]: *** [Makefile:1851: /home/casper/build/rtl8821CU] Error 2
make[1]: Leaving directory '/usr/lib/modules/5.12.4-arch1-2/build'
make: *** [Makefile:2212: modules] Error 2
zebulon2 commented 3 years ago

5.12 compatibility has just been proposed a few hours ago: https://github.com/brektrou/rtl8821CU/pull/134 The patch is approved but not yet merged to the main branch. You would have to patch your sources yourself: https://github.com/brektrou/rtl8821CU/pull/134/commits/d4a3d37441a3a17064eeebada09c30c264b44b23

ilgiznurgaliev commented 3 years ago

@zebulon2 , thank you very much. With the patch works perfectly.