lwfinger / rtl8723bu

Driver for RTL8723BU
283 stars 143 forks source link

It does not compile for 4.11.0-next anymore #64

Open Karl-opec opened 7 years ago

Karl-opec commented 7 years ago

After succesfully compiling it for 4.11-rc6-next-20170411, compilation breaks with following Error for 4.11.0-next-2017051 on arm64:

/usr/src/rtl8723bu/os_dep/ioctl_cfg80211.c:744:6: error: passing argument 2 of ‘cfg80211_roamed’ from incompatible pointer type [-Werror=incompatible-pointer-types]
    , notify_channel
      ^~~~~~~~~~~~~~
In file included from /usr/src/rtl8723bu/include/osdep_service_linux.h:74:0,
                 from /usr/src/rtl8723bu/include/osdep_service.h:40,
                 from /usr/src/rtl8723bu/include/drv_types.h:32,
                 from /usr/src/rtl8723bu/os_dep/ioctl_cfg80211.c:22:
./include/net/cfg80211.h:5435:6: note: expected ‘struct cfg80211_roam_info *’ but argument is of type ‘struct ieee80211_channel *’
 void cfg80211_roamed(struct net_device *dev, struct cfg80211_roam_info *info,
      ^~~~~~~~~~~~~~~
/usr/src/rtl8723bu/os_dep/ioctl_cfg80211.c:746:6: warning: passing argument 3 of ‘cfg80211_roamed’ makes integer from pointer without a cast [-Wint-conversion]
    , cur_network->network.MacAddress
      ^~~~~~~~~~~
In file included from /usr/src/rtl8723bu/include/osdep_service_linux.h:74:0,
                 from /usr/src/rtl8723bu/include/osdep_service.h:40,
                 from /usr/src/rtl8723bu/include/drv_types.h:32,
                 from /usr/src/rtl8723bu/os_dep/ioctl_cfg80211.c:22:
./include/net/cfg80211.h:5435:6: note: expected ‘gfp_t {aka unsigned int}’ but argument is of type ‘unsigned char *’
 void cfg80211_roamed(struct net_device *dev, struct cfg80211_roam_info *info,
      ^~~~~~~~~~~~~~~
/usr/src/rtl8723bu/os_dep/ioctl_cfg80211.c:742:3: error: too many arguments to function ‘cfg80211_roamed’
   cfg80211_roamed(padapter->pnetdev
   ^~~~~~~~~~~~~~~
In file included from /usr/src/rtl8723bu/include/osdep_service_linux.h:74:0,
                 from /usr/src/rtl8723bu/include/osdep_service.h:40,
                 from /usr/src/rtl8723bu/include/drv_types.h:32,
                 from /usr/src/rtl8723bu/os_dep/ioctl_cfg80211.c:22:
./include/net/cfg80211.h:5435:6: note: declared here
 void cfg80211_roamed(struct net_device *dev, struct cfg80211_roam_info *info,
      ^~~~~~~~~~~~~~~
/usr/src/rtl8723bu/os_dep/ioctl_cfg80211.c: In function ‘rtw_cfg80211_preinit_wiphy’:
/usr/src/rtl8723bu/os_dep/ioctl_cfg80211.c:5805:18: error: ‘WIPHY_FLAG_SUPPORTS_SCHED_SCAN’ undeclared (first use in this function)
  wiphy->flags |= WIPHY_FLAG_SUPPORTS_SCHED_SCAN;
                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/rtl8723bu/os_dep/ioctl_cfg80211.c:5805:18: note: each undeclared identifier is reported only once for each function it appears in
/usr/src/rtl8723bu/os_dep/ioctl_cfg80211.c: At top level:
/usr/src/rtl8723bu/os_dep/ioctl_cfg80211.c:5835:25: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
  .change_virtual_intf = cfg80211_rtw_change_iface,
                         ^~~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/rtl8723bu/os_dep/ioctl_cfg80211.c:5835:25: note: (near initialization for ‘rtw_cfg80211_ops.change_virtual_intf’)
/usr/src/rtl8723bu/os_dep/ioctl_cfg80211.c:5855:22: error: initialization from incompatible pointer type [-Werror=incompatible-pointer-types]
  .add_virtual_intf = cfg80211_rtw_add_virtual_intf,
                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/src/rtl8723bu/os_dep/ioctl_cfg80211.c:5855:22: note: (near initialization for ‘rtw_cfg80211_ops.add_virtual_intf’)
cc1: some warnings being treated as errors
scripts/Makefile.build:302: die Regel für Ziel „/usr/src/rtl8723bu/os_dep/ioctl_cfg80211.o“ scheiterte
make[2]: *** [/usr/src/rtl8723bu/os_dep/ioctl_cfg80211.o] Fehler 1
Makefile:1512: die Regel für Ziel „_module_/usr/src/rtl8723bu“ scheiterte
make[1]: *** [_module_/usr/src/rtl8723bu] Fehler 2
make[1]: Verzeichnis „/usr/src/linux-next-20170501“ wird verlassen
Makefile:322: die Regel für Ziel „modules“ scheiterte
make: *** [modules] Fehler 2

Any Idea?

lwfinger commented 7 years ago

Yes. Keep in mind that any -next repo can be a mixture of kernel X and X+1. In kernel 4.11, the prototype for change_virtual_intf() is int (change_virtual_intf)(struct wiphy wiphy, struct net_device dev, enum nl80211_iftype type, u32 flags, struct vif_params *params);

In kernel 4.12 and already in linux-next, the prototype will change into int (change_virtual_intf)(struct wiphy wiphy, struct net_device dev, enum nl80211_iftype type, struct vif_params params);

In other words, the argument of "u32 *flags" is dropped. The same thing happens in the prototype for add_virtual_intf().

The complicated part is that the source for rtl8723bu relies on being able to use the kernel version macro to determine what form of the API we should use. I have committed the correct patch, but it will not work for you. The change required for your code would break every user of kernel 4.11. If you pull the new source, and edit the two places that mention KERNEL(4, 12, 0) by replacing the 12 with 11, then your build will work. Once you switch to a 4.12-rcX kernel, your build will fail. At that point use "git checkout -f" to remove your changes.