rtl88x2bu: build with mac80211

This commit is contained in:
AmadeusGhost 2020-08-11 19:01:10 +08:00
parent 53f3c8819f
commit 6d48688828
3 changed files with 63 additions and 16 deletions

View File

@ -9,11 +9,11 @@ PKG_LICENSE_FILES:=
PKG_SOURCE_URL:=https://github.com/cilynx/rtl88x2bu.git
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2020-06-05
PKG_SOURCE_VERSION:=64aa087c5ead11960425125c955dcfe98233202e
PKG_MIRROR_HASH:=3532897af3cd3b327c825708d1c4db750c171647ddeaf21fb003f575f6b1ec82
PKG_SOURCE_DATE:=2020-07-21
PKG_SOURCE_VERSION:=a2abcaf523dfab2afeda8cc2cdb5e3c9510fc5f3
PKG_MIRROR_HASH:=ba79fb9a823a38c5acf22999210645ba881da0b5498ee765383dc5eaa8234e62
PKG_MAINTAINER:=ElonH <elonhhuang@gmail.com>
PKG_MAINTAINER:=[CTCGFW] Project OpenWrt
PKG_BUILD_PARALLEL:=1
STAMP_CONFIGURED_DEPENDS := $(STAGING_DIR)/usr/include/mac80211-backport/backport/autoconf.h
@ -21,26 +21,24 @@ STAMP_CONFIGURED_DEPENDS := $(STAGING_DIR)/usr/include/mac80211-backport/backpor
include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/package.mk
NOSTDINC_FLAGS = \
-I$(PKG_BUILD_DIR)/include \
-I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \
-I$(STAGING_DIR)/usr/include/mac80211-backport \
-I$(STAGING_DIR)/usr/include/mac80211/uapi \
-I$(STAGING_DIR)/usr/include/mac80211 \
-include backport/autoconf.h \
-include backport/backport.h
NOSTDINC_FLAGS+=-DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT -DCONFIG_CONCURRENT_MODE -DBUILD_OPENWRT
define KernelPackage/rtl88x2bu
SUBMENU:=Wireless Drivers
TITLE:=Realtek 8812BU/8822BU support
DEPENDS:=+@USB_SUPPORT +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT +kmod-mac80211 +kmod-usb-core
DEPENDS:=+kmod-cfg80211 +kmod-usb-core +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT
FILES:=$(PKG_BUILD_DIR)/rtl88x2bu.ko
AUTOLOAD:=$(call AutoProbe,rtl88x2bu)
PROVIDES:=kmod-rtl88x2bu
endef
NOSTDINC_FLAGS = \
-I$(PKG_BUILD_DIR) \
-I$(PKG_BUILD_DIR)/include \
-I$(STAGING_DIR)/usr/include/mac80211-backport \
-I$(STAGING_DIR)/usr/include/mac80211-backport/uapi \
-I$(STAGING_DIR)/usr/include/mac80211 \
-I$(STAGING_DIR)/usr/include/mac80211/uapi \
-include backport/backport.h
EXTRA_CFLAGS=-DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT -DCONFIG_RADIO_WORK -DCONFIG_CONCURRENT_MODE
# CONFIG_IOCTL_CFG80211: If kernel version is after 2.6.35, we recommend user to use the new nl80211 API.
@ -53,6 +51,7 @@ define Build/Compile
+$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \
$(KERNEL_MAKE_FLAGS) \
M="$(PKG_BUILD_DIR)" \
NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
USER_EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \
CONFIG_RTL8822BU=m \
USER_MODULE_NAME=rtl88x2bu \

View File

@ -0,0 +1,15 @@
Fix compile problem when rtw_byteorder.h and asm/byteorder.h gets
included in addition for example indirectly, do not use realtek own copy
of the byteorder headers.
--- a/include/drv_types.h
+++ b/include/drv_types.h
@@ -25,7 +25,7 @@
#include <drv_conf.h>
#include <basic_types.h>
#include <osdep_service.h>
-#include <rtw_byteorder.h>
+#include <asm/byteorder.h>
#include <wlan_bssdef.h>
#include <wifi.h>
#include <ieee80211.h>

View File

@ -0,0 +1,33 @@
diff --git a/include/linux/wireless.h b/include/linux/wireless.h
index c7f4a6c..f7ef486 100644
--- a/include/linux/wireless.h
+++ b/include/linux/wireless.h
@@ -18,10 +18,11 @@
/***************************** INCLUDES *****************************/
-#if 0
+#if 1
#include <linux/types.h> /* for __u* and __s* typedefs */
#include <linux/socket.h> /* for "struct sockaddr" et al */
#include <linux/if.h> /* for IFNAMSIZ and co... */
+ #include <uapi/linux/wireless.h>
#else
#define __user
/* typedef uint16_t __u16; */
@@ -37,6 +38,8 @@ struct compat_iw_point {
__u16 flags;
};
#endif
+
+#if 0
/* --------------------------- SUBTYPES --------------------------- */
/*
* For all data larger than 16 octets, we need to use a
@@ -83,5 +86,6 @@ struct iwreq {
/* Data part (defined just above) */
union iwreq_data u;
};
+#endif
#endif /* _LINUX_WIRELESS_H */