rebrane / mt7610u

There are many forks of the mt7610u driver. This one builds and works on Linux 4.14, unlike the rest.
MIT License
13 stars 7 forks source link

Cant build on linux 4.15.15-63.current #3

Open ElNovi opened 6 years ago

ElNovi commented 6 years ago

This is the error that i get, can you please advise me what to do?:

<command-line>:0:0: note: this is the location of the previous definition
In file included from ./include/linux/workqueue.h:9:0,
                 from ./include/linux/srcu.h:34,
                 from ./include/linux/notifier.h:16,
                 from ./include/linux/memory_hotplug.h:7,
                 from ./include/linux/mmzone.h:775,
                 from ./include/linux/gfp.h:6,
                 from ./include/linux/umh.h:4,
                 from ./include/linux/kmod.h:22,
                 from ./include/linux/module.h:13,
                 from /home/lthen/Stažené/Driver/mt7610u/include/os/rt_linux.h:31,
                 from /home/lthen/Stažené/Driver/mt7610u/include/rtmp_os.h:44,
                 from /home/lthen/Stažené/Driver/mt7610u/include/rtmp_comm.h:75,
                 from /home/lthen/Stažené/Driver/mt7610u/os/linux/../../os/linux/rt_linux.c:31:
/home/lthen/Stažené/Driver/mt7610u/os/linux/../../os/linux/rt_linux.c: In function ‘__RTMP_OS_Init_Timer’:
./include/linux/timer.h:116:27: error: passing argument 2 of ‘init_timer_key’ from incompatible pointer type [-Werror=incompatible-pointer-types]
  init_timer_key((_timer), (_fn), (_flags), NULL, NULL)
                           ^
./include/linux/timer.h:132:2: note: in expansion of macro ‘__init_timer’
  __init_timer((timer), (callback), (flags))
  ^~~~~~~~~~~~
/home/lthen/Stažené/Driver/mt7610u/os/linux/../../os/linux/rt_linux.c:129:3: note: in expansion of macro ‘timer_setup’
   timer_setup(pTimer, function, 0);
   ^~~~~~~~~~~
./include/linux/timer.h:81:6: note: expected ‘void (*)(struct timer_list *)’ but argument is of type ‘TIMER_FUNCTION {aka void (*)(long unsigned int)}’
 void init_timer_key(struct timer_list *timer,
      ^~~~~~~~~~~~~~
/home/lthen/Stažené/Driver/mt7610u/os/linux/../../os/linux/rt_linux.c: In function ‘RtmpOsUsDelay’:
/home/lthen/Stažené/Driver/mt7610u/os/linux/../../os/linux/rt_linux.c:186:8: warning: unused variable ‘i’ [-Wunused-variable]
  ULONG i;
        ^
/home/lthen/Stažené/Driver/mt7610u/os/linux/../../os/linux/rt_linux.c: In function ‘RtmpOSIRQRelease’:
/home/lthen/Stažené/Driver/mt7610u/os/linux/../../os/linux/rt_linux.c:2169:21: warning: unused variable ‘net_dev’ [-Wunused-variable]
  struct net_device *net_dev = (struct net_device *)pNetDev;
                     ^~~~~~~
In file included from /home/lthen/Stažené/Driver/mt7610u/include/rtmp_os.h:44:0,
                 from /home/lthen/Stažené/Driver/mt7610u/include/rtmp_comm.h:75,
                 from /home/lthen/Stažené/Driver/mt7610u/os/linux/../../os/linux/rt_linux.c:31:
/home/lthen/Stažené/Driver/mt7610u/os/linux/../../os/linux/rt_linux.c: In function ‘CFG80211_SupBandInit’:
/home/lthen/Stažené/Driver/mt7610u/os/linux/../../os/linux/rt_linux.c:2673:31: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long unsigned int’ [-Wformat=]
  CFG80211DBG(RT_DEBUG_ERROR, ("80211> Number of channel = %d\n",
                               ^
/home/lthen/Stažené/Driver/mt7610u/include/os/rt_linux.h:669:16: note: in definition of macro ‘DBGPRINT_RAW’
         printk Fmt;               \
                ^~~
/home/lthen/Stažené/Driver/mt7610u/include/rtmp_comm.h:324:37: note: in expansion of macro ‘DBGPRINT’
 #define CFG80211DBG(__Flg, __pMsg)  DBGPRINT(__Flg, __pMsg)
                                     ^~~~~~~~
/home/lthen/Stažené/Driver/mt7610u/os/linux/../../os/linux/rt_linux.c:2673:2: note: in expansion of macro ‘CFG80211DBG’
  CFG80211DBG(RT_DEBUG_ERROR, ("80211> Number of channel = %d\n",
  ^~~~~~~~~~~
/home/lthen/Stažené/Driver/mt7610u/os/linux/../../os/linux/rt_linux.c: In function ‘CFG80211OS_ScanEnd’:
/home/lthen/Stažené/Driver/mt7610u/os/linux/../../os/linux/rt_linux.c:3235:54: warning: passing argument 2 of ‘cfg80211_scan_done’ makes pointer from integer without a cast [-Wint-conversion]
  cfg80211_scan_done(pCfg80211_CB->pCfg80211_ScanReq, FlgIsAborted);
                                                      ^~~~~~~~~~~~
In file included from ./include/net/mac80211.h:23:0,
                 from /home/lthen/Stažené/Driver/mt7610u/include/os/rt_linux.h:76,
                 from /home/lthen/Stažené/Driver/mt7610u/include/rtmp_os.h:44,
                 from /home/lthen/Stažené/Driver/mt7610u/include/rtmp_comm.h:75,
                 from /home/lthen/Stažené/Driver/mt7610u/os/linux/../../os/linux/rt_linux.c:31:
./include/net/cfg80211.h:4588:6: note: expected ‘struct cfg80211_scan_info *’ but argument is of type ‘BOOLEAN {aka unsigned char}’
 void cfg80211_scan_done(struct cfg80211_scan_request *request,
      ^~~~~~~~~~~~~~~~~~
/home/lthen/Stažené/Driver/mt7610u/os/linux/../../os/linux/rt_linux.c: In function ‘CFG80211OS_Scaning’:
/home/lthen/Stažené/Driver/mt7610u/os/linux/../../os/linux/rt_linux.c:3197:2: warning: ignoring return value of ‘cfg80211_inform_bss_frame’, declared with attribute warn_unused_result [-Wunused-result]
  cfg80211_inform_bss_frame(pCfg80211_CB->pCfg80211_Wdev->wiphy,
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         &pCfg80211_CB->ChanInfo[IdChan],
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         (struct ieee80211_mgmt *)pFrame,
         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         FrameLen,
         ~~~~~~~~~
         RSSI,
         ~~~~~
         GFP_ATOMIC);
         ~~~~~~~~~~~
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:325: /home/lthen/Stažené/Driver/mt7610u/os/linux/../../os/linux/rt_linux.o] Chyba 1
make[1]: *** [Makefile:1523: _module_/home/lthen/Stažené/Driver/mt7610u/os/linux] Chyba 2
make[1]: Opouští se adresář „/usr/src/linux-headers-4.15.15-63.current“
d7gonzo commented 6 years ago

I had the same issue with a 4.15 kernel. Decided to replace the MediaTek with a RealTek usb wifi adapter because I found a driver for that chipset where someone has already dealt with the 4.15 issue. The code looks like it isn't as much of a nightmare as well. But perhaps this could help come up with an easier solution. I simply don't have the time and resources to expend on learning how to fix this myself.

Instead of a boolean flag for an abort for the scan_done function there is a scan_info struct that needs to be thrown instead. Timings seem to be part of what is thrown through that if the issues are related.

The compiling RealTek driver: https://github.com/lwfinger/rtl8812au

Good luck!