diff --git a/package/kernel/rtl8812au-ac/Makefile b/package/kernel/rtl8812au-ac/Makefile index 5c80c3fee1..7a13b926b9 100644 --- a/package/kernel/rtl8812au-ac/Makefile +++ b/package/kernel/rtl8812au-ac/Makefile @@ -3,20 +3,20 @@ # Copyright (C) 2020 stepheny # # -# Copyright (C) 2021 ImmortalWrt.org +# Copyright (C) 2021-2022 ImmortalWrt.org include $(TOPDIR)/rules.mk PKG_NAME:=rtl8812au-ac -PKG_RELEASE:=$(AUTORELEASE) +PKG_RELEASE:=1 PKG_SOURCE_URL:=https://github.com/aircrack-ng/rtl8812au.git PKG_SOURCE_PROTO:=git -PKG_SOURCE_DATE:=2021-06-27 -PKG_SOURCE_VERSION:=b8167e66b4ac046b3b76c2c40008d84528e91594 -PKG_MIRROR_HASH:=f3608afb663ccfc796e776bd26b99d9f9cb8dd053bd302eab5c077e498010ce9 +PKG_SOURCE_DATE:=2022-12-23 +PKG_SOURCE_VERSION:=ee299797bcd54d5b8c58d2da8576c54cea1a03a2 +PKG_MIRROR_HASH:=fb72b28e123f9dead470a0b94ef9d56e59c10e4f0baf09ba820e5c34a743decc -PKG_LICENSE:=GPL-2.0 +PKG_LICENSE:=GPL-2.0-only PKG_LICENSE_FILES:=LICENSE PKG_MAINTAINER:=Marty Jones @@ -36,7 +36,7 @@ define KernelPackage/rtl8812au-ac CONFLICTS:=kmod-rtl8812au-ct endef -NOSTDINC_FLAGS = \ +NOSTDINC_FLAGS:= \ -I$(PKG_BUILD_DIR) \ -I$(PKG_BUILD_DIR)/include \ -I$(STAGING_DIR)/usr/include/mac80211-backport \ @@ -46,33 +46,24 @@ NOSTDINC_FLAGS = \ -include backport/autoconf.h \ -include backport/backport.h -EXTRA_KCONFIG:= \ - CONFIG_88XXAU=m \ - USER_MODULE_NAME=rtl8812au - -EXTRA_CFLAGS:= \ +NOSTDINC_FLAGS+= \ -DRTW_SINGLE_WIPHY \ -DRTW_USE_CFG80211_STA_EVENT \ -DCONFIG_IOCTL_CFG80211 \ - -DCONFIG_CONCURRENT_MODE \ -DBUILD_OPENWRT ifeq ($(CONFIG_BIG_ENDIAN),y) -EXTRA_CFLAGS += -DCONFIG_BIG_ENDIAN +NOSTDINC_FLAGS+= -DCONFIG_BIG_ENDIAN else -EXTRA_CFLAGS += -DCONFIG_LITTLE_ENDIAN +NOSTDINC_FLAGS+= -DCONFIG_LITTLE_ENDIAN endif -MAKE_OPTS:= \ - $(KERNEL_MAKE_FLAGS) \ - M="$(PKG_BUILD_DIR)" \ - NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \ - USER_EXTRA_CFLAGS="$(EXTRA_CFLAGS)" \ - $(EXTRA_KCONFIG) - define Build/Compile - +$(MAKE) $(PKG_JOBS) -C "$(LINUX_DIR)" \ - $(MAKE_OPTS) \ + +$(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/010-disable-default-build-x86.patch b/package/kernel/rtl8812au-ac/patches/010-disable-default-build-x86.patch index d2621542ee..1cfa22bd9a 100644 --- a/package/kernel/rtl8812au-ac/patches/010-disable-default-build-x86.patch +++ b/package/kernel/rtl8812au-ac/patches/010-disable-default-build-x86.patch @@ -1,6 +1,6 @@ --- a/Makefile +++ b/Makefile -@@ -92,7 +92,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 ####################### 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 index 5e3abce660..32fe0e0644 100644 --- 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 @@ -1,6 +1,6 @@ --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c -@@ -2803,6 +2803,7 @@ static int netdev_vir_if_close(struct ne +@@ -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; diff --git a/package/kernel/rtl8812au-ac/patches/040-wireless-5.8.patch b/package/kernel/rtl8812au-ac/patches/040-wireless-5.8.patch index acb0b73918..b887b76f99 100644 --- a/package/kernel/rtl8812au-ac/patches/040-wireless-5.8.patch +++ b/package/kernel/rtl8812au-ac/patches/040-wireless-5.8.patch @@ -1,29 +1,132 @@ --- a/os_dep/linux/ioctl_cfg80211.c +++ b/os_dep/linux/ioctl_cfg80211.c -@@ -460,7 +460,7 @@ u8 rtw_cfg80211_ch_switch_notify(_adapte +@@ -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(5, 11, 0)) -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 11, 0) || defined(BUILD_OPENWRT)) +-#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); -@@ -7733,7 +7733,7 @@ exit: +@@ -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,8,0)) -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0)) || defined(BUILD_OPENWRT) - static void cfg80211_rtw_update_mgmt_frame_register(struct wiphy *wiphy, - struct wireless_dev *wdev, - struct mgmt_frame_regs *upd) -@@ -10185,7 +10185,7 @@ static struct cfg80211_ops rtw_cfg80211_ - - #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 37)) || defined(COMPAT_KERNEL_RELEASE) - .mgmt_tx = cfg80211_rtw_mgmt_tx, --#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0)) -+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0)) || defined(BUILD_OPENWRT) - .update_mgmt_frame_registrations = cfg80211_rtw_update_mgmt_frame_register, +-#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 - .mgmt_frame_register = cfg80211_rtw_mgmt_frame_register, + 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 +@@ -1740,7 +1740,7 @@ int rtw_os_ndev_register(_adapter *adapt + #if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) + netif_napi_add_weight(ndev, &adapter->napi, rtw_recv_napi_poll, RTL_NAPI_WEIGHT); + #else +- netif_napi_add(ndev, &adapter->napi, rtw_recv_napi_poll, RTL_NAPI_WEIGHT); ++ netif_napi_add(ndev, &adapter->napi, rtw_recv_napi_poll); + #endif + #endif /* CONFIG_RTW_NAPI */ + +@@ -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)) ++ wdev->links[0].client.current_bss = NULL; ++ #elif (LINUX_VERSION_CODE >= KERNEL_VERSION(5,19, 2) || defined(BUILD_OPENWRT)) ++ 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;