diff --git a/package/kernel/rtl8812au-ac/Makefile b/package/kernel/rtl8812au-ac/Makefile index df1c82c12..80ec906e5 100644 --- a/package/kernel/rtl8812au-ac/Makefile +++ b/package/kernel/rtl8812au-ac/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=rtl8812au-ac -PKG_RELEASE:=1 +PKG_RELEASE:=2 PKG_LICENSE:=GPLv2 PKG_LICENSE_FILES:= @@ -12,7 +12,10 @@ PKG_SOURCE_DATE:=2023-01-23 PKG_SOURCE_VERSION:=e72dacdc4af7cf421484ce9567ef2cc995a16f3a PKG_MIRROR_HASH:=4e2168712f62a6d736fbc3422f651c6738a37a40d226617f7d8248ad8abd2433 +PKG_LICENSE:=GPL-2.0-only +PKG_LICENSE_FILES:=LICENSE # PKG_MAINTAINER:= + PKG_BUILD_PARALLEL:=1 STAMP_CONFIGURED_DEPENDS := $(STAGING_DIR)/usr/include/mac80211-backport/backport/autoconf.h @@ -22,14 +25,15 @@ include $(INCLUDE_DIR)/package.mk define KernelPackage/rtl8812au-ac SUBMENU:=Wireless Drivers - TITLE:=Realtek rtl8812au/21au and rtl8814au driver - DEPENDS:=+kmod-cfg80211 +kmod-usb-core +@DRIVER_11N_SUPPORT +@DRIVER_11AC_SUPPORT - FILES:=\ - $(PKG_BUILD_DIR)/rtl8812au.ko + TITLE:=Realtek RTL8812AU/21AU wireless drivers + DEPENDS:=+kmod-cfg80211 +kmod-usb-core +@DRIVER_11AC_SUPPORT + FILES:=$(PKG_BUILD_DIR)/rtl8812au.ko AUTOLOAD:=$(call AutoProbe,rtl8812au) + CONFLICTS:=kmod-rtl8812au-ct endef -NOSTDINC_FLAGS = \ +NOSTDINC_FLAGS:= \ + $(KERNEL_NOSTDINC_FLAGS) \ -I$(PKG_BUILD_DIR) \ -I$(PKG_BUILD_DIR)/include \ -I$(STAGING_DIR)/usr/include/mac80211-backport \ @@ -39,25 +43,24 @@ NOSTDINC_FLAGS = \ -include backport/autoconf.h \ -include backport/backport.h -NOSTDINC_FLAGS += -DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT \ - -D_LINUX_BYTEORDER_SWAB_H -DBUILD_OPENWRT -DRTW_SINGLE_WIPHY -ifeq ($(CONFIG_BIG_ENDIAN), y) -NOSTDINC_FLAGS += -DCONFIG_BIG_ENDIAN -endif -ifeq ($(CONFIG_LITTLE_ENDIAN), y) -NOSTDINC_FLAGS += -DCONFIG_LITTLE_ENDIAN -endif +NOSTDINC_FLAGS+= \ + -DRTW_SINGLE_WIPHY \ + -DRTW_USE_CFG80211_STA_EVENT \ + -DCONFIG_IOCTL_CFG80211 \ + -DBUILD_OPENWRT -PKG_MAKE_FLAGS += USER_MODULE_NAME=rtl8812au -PKG_MAKE_FLAGS += USER_DRV_NAME=rtl8812au -KERNEL_MAKE_FLAGS += CONFIG_88XXAU=m +ifeq ($(CONFIG_BIG_ENDIAN),y) +NOSTDINC_FLAGS+= -DCONFIG_BIG_ENDIAN +else +NOSTDINC_FLAGS+= -DCONFIG_LITTLE_ENDIAN +endif define Build/Compile - +$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \ - $(KERNEL_MAKE_FLAGS) \ - $(PKG_MAKE_FLAGS) \ + +$(KERNEL_MAKE) $(PKG_JOBS) \ M="$(PKG_BUILD_DIR)" \ NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \ + CONFIG_88XXAU=m \ + USER_MODULE_NAME=rtl8812au \ modules endef diff --git a/package/kernel/rtl8812au-ac/patches/001-use-kernel-byteorder.patch b/package/kernel/rtl8812au-ac/patches/001-use-kernel-byteorder.patch new file mode 100644 index 000000000..17013bfec --- /dev/null +++ b/package/kernel/rtl8812au-ac/patches/001-use-kernel-byteorder.patch @@ -0,0 +1,16 @@ +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 +@@ -24,7 +24,7 @@ + #include + #include + #include +-#include ++#include + #include + #include + #include + \ No newline at end of file diff --git a/package/kernel/rtl8812au-ac/patches/0001-Modify-Makefile-for-openwrt-toolchain.patch b/package/kernel/rtl8812au-ac/patches/010-disable-default-build-x86.patch.patch similarity index 86% rename from package/kernel/rtl8812au-ac/patches/0001-Modify-Makefile-for-openwrt-toolchain.patch rename to package/kernel/rtl8812au-ac/patches/010-disable-default-build-x86.patch.patch index 1a380b88e..1cfa22bd9 100644 --- a/package/kernel/rtl8812au-ac/patches/0001-Modify-Makefile-for-openwrt-toolchain.patch +++ b/package/kernel/rtl8812au-ac/patches/010-disable-default-build-x86.patch.patch @@ -1,6 +1,6 @@ --- a/Makefile +++ b/Makefile -@@ -91,7 +91,7 @@ CONFIG_RTW_SDIO_PM_KEEP_POWER = y +@@ -98,7 +98,7 @@ CONFIG_RTW_SDIO_PM_KEEP_POWER = y ###################### MP HW TX MODE FOR VHT ####################### CONFIG_MP_VHT_HW_TX_MODE = n ###################### Platform Related ####################### @@ -9,4 +9,3 @@ CONFIG_PLATFORM_ANDROID_ARM64 = n CONFIG_PLATFORM_ARM_RPI = n CONFIG_PLATFORM_ARM64_RPI = n --- diff --git a/package/kernel/rtl8812au-ac/patches/0002-Change-default-value-of-vht_enable-switch_usb_mode.patch b/package/kernel/rtl8812au-ac/patches/020-change-value-of-vht-enable-and-usb-mode.patch similarity index 100% rename from package/kernel/rtl8812au-ac/patches/0002-Change-default-value-of-vht_enable-switch_usb_mode.patch rename to package/kernel/rtl8812au-ac/patches/020-change-value-of-vht-enable-and-usb-mode.patch diff --git a/package/kernel/rtl8812au-ac/patches/030-add-missing-code-for-concurrent-mode.patch b/package/kernel/rtl8812au-ac/patches/030-add-missing-code-for-concurrent-mode.patch new file mode 100644 index 000000000..32fe0e064 --- /dev/null +++ b/package/kernel/rtl8812au-ac/patches/030-add-missing-code-for-concurrent-mode.patch @@ -0,0 +1,10 @@ +--- a/os_dep/linux/os_intfs.c ++++ b/os_dep/linux/os_intfs.c +@@ -2807,6 +2807,7 @@ static int netdev_vir_if_close(struct ne + { + _adapter *padapter = (_adapter *)rtw_netdev_priv(pnetdev); + struct mlme_priv *pmlmepriv = &padapter->mlmepriv; ++ struct wireless_dev *wdev = padapter->rtw_wdev; + + RTW_INFO(FUNC_NDEV_FMT" , bup=%d\n", FUNC_NDEV_ARG(pnetdev), padapter->bup); + padapter->net_closed = _TRUE; diff --git a/package/kernel/rtl8812au-ac/patches/040-wireless-5.8.patch b/package/kernel/rtl8812au-ac/patches/040-wireless-5.8.patch new file mode 100644 index 000000000..4b57e0bed --- /dev/null +++ b/package/kernel/rtl8812au-ac/patches/040-wireless-5.8.patch @@ -0,0 +1,123 @@ +--- a/os_dep/linux/ioctl_cfg80211.c ++++ b/os_dep/linux/ioctl_cfg80211.c +@@ -460,9 +460,9 @@ u8 rtw_cfg80211_ch_switch_notify(_adapte + + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)) + if (started) { +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) || defined(BUILD_OPENWRT)) + cfg80211_ch_switch_started_notify(adapter->pnetdev, &chdef, 0, 0, false); +-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0)) ++#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0) || defined(BUILD_OPENWRT)) + cfg80211_ch_switch_started_notify(adapter->pnetdev, &chdef, 0, false); + #else + cfg80211_ch_switch_started_notify(adapter->pnetdev, &chdef, 0); +@@ -474,7 +474,7 @@ u8 rtw_cfg80211_ch_switch_notify(_adapte + if (!rtw_cfg80211_allow_ch_switch_notify(adapter)) + goto exit; + +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2) || defined(BUILD_OPENWRT)) + cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0); + #else + cfg80211_ch_switch_notify(adapter->pnetdev, &chdef); +@@ -1151,7 +1151,7 @@ check_bss: + #endif + + #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || defined(BUILD_OPENWRT)) + roam_info.links[0].bssid = cur_network->network.MacAddress; + #else + roam_info.bssid = cur_network->network.MacAddress; +@@ -1721,7 +1721,7 @@ exit: + } + + static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) || defined(BUILD_OPENWRT)) + , int link_id + #endif + , u8 key_index +@@ -1868,7 +1868,7 @@ addkey_end: + } + + static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct net_device *ndev +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) || defined(BUILD_OPENWRT)) + , int link_id + #endif + , u8 keyid +@@ -2036,7 +2036,7 @@ exit: + } + + static int cfg80211_rtw_del_key(struct wiphy *wiphy, struct net_device *ndev, +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) || defined(BUILD_OPENWRT)) + int link_id, + #endif + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE) +@@ -2060,7 +2060,7 @@ static int cfg80211_rtw_del_key(struct w + + static int cfg80211_rtw_set_default_key(struct wiphy *wiphy, + struct net_device *ndev, +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) || defined(BUILD_OPENWRT)) + int link_id, + #endif + u8 key_index +@@ -2112,7 +2112,7 @@ static int cfg80211_rtw_set_default_key( + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)) + int cfg80211_rtw_set_default_mgmt_key(struct wiphy *wiphy, + struct net_device *ndev, +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) || defined(BUILD_OPENWRT)) + int link_id, + #endif + u8 key_index) +@@ -5248,7 +5248,7 @@ static int cfg80211_rtw_change_beacon(st + return ret; + } + +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2) || defined(BUILD_OPENWRT)) + static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev, unsigned int link_id) + #else + static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev) +@@ -6125,7 +6125,7 @@ static int cfg80211_rtw_set_channel(stru + return 0; + } + +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2) || defined(BUILD_OPENWRT)) + static int cfg80211_rtw_get_channel(struct wiphy *wiphy, struct wireless_dev *wdev, unsigned int link_id, struct cfg80211_chan_def *chandef){ + #else + static int cfg80211_rtw_get_channel(struct wiphy *wiphy, struct wireless_dev *wdev, struct cfg80211_chan_def *chandef){ +@@ -10434,9 +10434,9 @@ void rtw_wdev_unregister(struct wireless + rtw_cfg80211_indicate_scan_done(adapter, _TRUE); + + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)) || defined(COMPAT_KERNEL_RELEASE) +- #if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)) ++ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || defined(BUILD_OPENWRT)) + if (wdev->links[0].client.current_bss) { +- #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2)) ++ #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2) || defined(BUILD_OPENWRT)) + if (wdev->connected) { + #else + if (wdev->current_bss) { +--- a/os_dep/linux/os_intfs.c ++++ b/os_dep/linux/os_intfs.c +@@ -2823,7 +2823,13 @@ static int netdev_vir_if_close(struct ne + + #ifdef CONFIG_IOCTL_CFG80211 + wdev->iftype = NL80211_IFTYPE_MONITOR; ++ #if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || defined(BUILD_OPENWRT)) ++ wdev->links[0].client.current_bss = NULL; ++ #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2)) ++ wdev->connected = NULL; ++ #else + wdev->current_bss = NULL; ++ #endif + rtw_scan_abort(padapter); + rtw_cfg80211_wait_scan_req_empty(padapter, 200); + adapter_wdev_data(padapter)->bandroid_scan = _FALSE; diff --git a/package/kernel/rtl8812au-ac/patches/050-backport-6.1.patch b/package/kernel/rtl8812au-ac/patches/050-backport-6.1.patch new file mode 100644 index 000000000..2c6fa17c7 --- /dev/null +++ b/package/kernel/rtl8812au-ac/patches/050-backport-6.1.patch @@ -0,0 +1,127 @@ +--- a/os_dep/linux/ioctl_cfg80211.c ++++ b/os_dep/linux/ioctl_cfg80211.c +@@ -460,9 +460,7 @@ + + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0)) + if (started) { +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) || defined(BUILD_OPENWRT)) +- cfg80211_ch_switch_started_notify(adapter->pnetdev, &chdef, 0, 0, false); +-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0) || defined(BUILD_OPENWRT)) ++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0) || defined(BUILD_OPENWRT)) + cfg80211_ch_switch_started_notify(adapter->pnetdev, &chdef, 0, false); + #else + cfg80211_ch_switch_started_notify(adapter->pnetdev, &chdef, 0); +@@ -475,7 +473,7 @@ + goto exit; + + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2) || defined(BUILD_OPENWRT)) +- cfg80211_ch_switch_notify(adapter->pnetdev, &chdef, 0); ++ cfg80211_ch_switch_notify(adapter->pnetdev, &chdef); + #else + cfg80211_ch_switch_notify(adapter->pnetdev, &chdef); + #endif +@@ -1152,7 +1150,7 @@ + + #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0) + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || defined(BUILD_OPENWRT)) +- roam_info.links[0].bssid = cur_network->network.MacAddress; ++ roam_info.bssid = cur_network->network.MacAddress; + #else + roam_info.bssid = cur_network->network.MacAddress; + #endif +@@ -1721,9 +1719,6 @@ + } + + static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) || defined(BUILD_OPENWRT)) +- , int link_id +-#endif + , u8 key_index + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE) + , bool pairwise +@@ -1868,9 +1863,6 @@ + } + + static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct net_device *ndev +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) || defined(BUILD_OPENWRT)) +- , int link_id +-#endif + , u8 keyid + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE) + , bool pairwise +@@ -2036,9 +2028,6 @@ + } + + static int cfg80211_rtw_del_key(struct wiphy *wiphy, struct net_device *ndev, +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) || defined(BUILD_OPENWRT)) +- int link_id, +-#endif + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE) + u8 key_index, bool pairwise, const u8 *mac_addr) + #else /* (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) */ +@@ -2059,11 +2048,7 @@ + } + + static int cfg80211_rtw_set_default_key(struct wiphy *wiphy, +- struct net_device *ndev, +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) || defined(BUILD_OPENWRT)) +- int link_id, +-#endif +- u8 key_index ++ struct net_device *ndev, u8 key_index + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 38)) || defined(COMPAT_KERNEL_RELEASE) + , bool unicast, bool multicast + #endif +@@ -2111,11 +2096,7 @@ + + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 30)) + int cfg80211_rtw_set_default_mgmt_key(struct wiphy *wiphy, +- struct net_device *ndev, +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0) || defined(BUILD_OPENWRT)) +- int link_id, +-#endif +- u8 key_index) ++ struct net_device *ndev, u8 key_index) + { + #define SET_DEF_KEY_PARAM_FMT " key_index=%d" + #define SET_DEF_KEY_PARAM_ARG , key_index +@@ -5248,11 +5229,7 @@ + return ret; + } + +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2) || defined(BUILD_OPENWRT)) +-static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev, unsigned int link_id) +-#else + static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev) +-#endif + { + _adapter *adapter = (_adapter *)rtw_netdev_priv(ndev); + +@@ -6125,11 +6102,8 @@ + return 0; + } + +-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2) || defined(BUILD_OPENWRT)) +-static int cfg80211_rtw_get_channel(struct wiphy *wiphy, struct wireless_dev *wdev, unsigned int link_id, struct cfg80211_chan_def *chandef){ +-#else ++ + static int cfg80211_rtw_get_channel(struct wiphy *wiphy, struct wireless_dev *wdev, struct cfg80211_chan_def *chandef){ +-#endif + _adapter *padapter= wiphy_to_adapter(wiphy); + int channel; + int control_freq; +@@ -10434,13 +10408,8 @@ + rtw_cfg80211_indicate_scan_done(adapter, _TRUE); + + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(3, 11, 0)) || defined(COMPAT_KERNEL_RELEASE) +- #if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0) || defined(BUILD_OPENWRT)) +- if (wdev->links[0].client.current_bss) { +- #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 19, 2) || defined(BUILD_OPENWRT)) +- if (wdev->connected) { +- #else ++ + if (wdev->current_bss) { +- #endif + RTW_INFO(FUNC_ADPT_FMT" clear current_bss by cfg80211_disconnected\n", FUNC_ADPT_ARG(adapter)); + rtw_cfg80211_indicate_disconnect(adapter, 0, 1); + }