🎉 Sync 2026-01-19 10:51:40
All checks were successful
package_kernel_rtl8812au-ct / Update package_kernel_rtl8812au-ct (openwrt-25.12) (push) Successful in 7s

This commit is contained in:
2026-01-19 10:51:40 +00:00
parent 92a6b8ea2d
commit 4b93b12145
14 changed files with 684 additions and 0 deletions

56
Makefile Normal file
View File

@@ -0,0 +1,56 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=rtl8812au-ct
PKG_RELEASE=2
PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=
PKG_SOURCE_URL:=https://github.com/greearb/rtl8812AU_8821AU_linux.git
PKG_MIRROR_HASH:=880c0ddd968a8f4bfdf4263318e925635c9abe4cc20a79bbdc905d46e00018d0
PKG_SOURCE_PROTO:=git
PKG_SOURCE_DATE:=2022-10-26
PKG_SOURCE_VERSION:=9b2b203a217e1320602a0eb07c338a1bfca0f5a6
PKG_MAINTAINER:=Ben Greear <greearb@candelatech.com>
PKG_BUILD_PARALLEL:=1
#PKG_EXTMOD_SUBDIRS:=rtl8812au-ct
STAMP_CONFIGURED_DEPENDS := $(STAGING_DIR)/usr/include/mac80211-backport/backport/autoconf.h
include $(INCLUDE_DIR)/kernel.mk
include $(INCLUDE_DIR)/package.mk
define KernelPackage/rtl8812au-ct
SUBMENU:=Wireless Drivers
TITLE:=Driver for Realtek 8812 AU devices comfast 912-ac, etc
DEPENDS:=+kmod-cfg80211 +kmod-usb-core +@DRIVER_11AC_SUPPORT
FILES:=\
$(PKG_BUILD_DIR)/rtl8812au.ko
AUTOLOAD:=$(call AutoProbe,rtl8812au)
PROVIDES:=@kmod-rtl8812au-any
endef
NOSTDINC_FLAGS := \
$(KERNEL_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 \
-Wno-error=address \
-Wno-error=missing-prototypes \
-Wno-error=stringop-overread
NOSTDINC_FLAGS+=-DCONFIG_IOCTL_CFG80211 -DRTW_USE_CFG80211_STA_EVENT -DBUILD_OPENWRT
define Build/Compile
+$(KERNEL_MAKE) $(PKG_JOBS) \
M="$(PKG_BUILD_DIR)" \
NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
modules
endef
$(eval $(call KernelPackage,rtl8812au-ct))

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
@@ -30,7 +30,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,156 @@
mac80211 from kernel 5.3 and later checks the new policy attribute.
As this driver does not define any policies and does strange things,
just tell mac80211 to ignore the policies.
--- a/os_dep/linux/rtw_cfgvendor.c
+++ b/os_dep/linux/rtw_cfgvendor.c
@@ -1173,7 +1173,8 @@ static const struct wiphy_vendor_command
.subcmd = BRCM_VENDOR_SCMD_PRIV_STR
},
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
- .doit = wl_cfgvendor_priv_string_handler
+ .doit = wl_cfgvendor_priv_string_handler,
+ .policy = VENDOR_CMD_RAW_DATA,
},
#if defined(GSCAN_SUPPORT) && 0
{
@@ -1182,7 +1183,8 @@ static const struct wiphy_vendor_command
.subcmd = GSCAN_SUBCMD_GET_CAPABILITIES
},
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
- .doit = wl_cfgvendor_gscan_get_capabilities
+ .doit = wl_cfgvendor_gscan_get_capabilities,
+ .policy = VENDOR_CMD_RAW_DATA,
},
{
{
@@ -1190,7 +1192,8 @@ static const struct wiphy_vendor_command
.subcmd = GSCAN_SUBCMD_SET_CONFIG
},
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
- .doit = wl_cfgvendor_set_scan_cfg
+ .doit = wl_cfgvendor_set_scan_cfg,
+ .policy = VENDOR_CMD_RAW_DATA,
},
{
{
@@ -1198,7 +1201,8 @@ static const struct wiphy_vendor_command
.subcmd = GSCAN_SUBCMD_SET_SCAN_CONFIG
},
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
- .doit = wl_cfgvendor_set_batch_scan_cfg
+ .doit = wl_cfgvendor_set_batch_scan_cfg,
+ .policy = VENDOR_CMD_RAW_DATA,
},
{
{
@@ -1206,7 +1210,8 @@ static const struct wiphy_vendor_command
.subcmd = GSCAN_SUBCMD_ENABLE_GSCAN
},
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
- .doit = wl_cfgvendor_initiate_gscan
+ .doit = wl_cfgvendor_initiate_gscan,
+ .policy = VENDOR_CMD_RAW_DATA,
},
{
{
@@ -1214,7 +1219,8 @@ static const struct wiphy_vendor_command
.subcmd = GSCAN_SUBCMD_ENABLE_FULL_SCAN_RESULTS
},
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
- .doit = wl_cfgvendor_enable_full_scan_result
+ .doit = wl_cfgvendor_enable_full_scan_result,
+ .policy = VENDOR_CMD_RAW_DATA,
},
{
{
@@ -1222,7 +1228,8 @@ static const struct wiphy_vendor_command
.subcmd = GSCAN_SUBCMD_SET_HOTLIST
},
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
- .doit = wl_cfgvendor_hotlist_cfg
+ .doit = wl_cfgvendor_hotlist_cfg,
+ .policy = VENDOR_CMD_RAW_DATA,
},
{
{
@@ -1230,7 +1237,8 @@ static const struct wiphy_vendor_command
.subcmd = GSCAN_SUBCMD_SET_SIGNIFICANT_CHANGE_CONFIG
},
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
- .doit = wl_cfgvendor_significant_change_cfg
+ .doit = wl_cfgvendor_significant_change_cfg,
+ .policy = VENDOR_CMD_RAW_DATA,
},
{
{
@@ -1238,7 +1246,8 @@ static const struct wiphy_vendor_command
.subcmd = GSCAN_SUBCMD_GET_SCAN_RESULTS
},
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
- .doit = wl_cfgvendor_gscan_get_batch_results
+ .doit = wl_cfgvendor_gscan_get_batch_results,
+ .policy = VENDOR_CMD_RAW_DATA,
},
{
{
@@ -1246,7 +1255,8 @@ static const struct wiphy_vendor_command
.subcmd = GSCAN_SUBCMD_GET_CHANNEL_LIST
},
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
- .doit = wl_cfgvendor_gscan_get_channel_list
+ .doit = wl_cfgvendor_gscan_get_channel_list,
+ .policy = VENDOR_CMD_RAW_DATA,
},
#endif /* GSCAN_SUPPORT */
#if defined(RTT_SUPPORT) && 0
@@ -1256,7 +1266,8 @@ static const struct wiphy_vendor_command
.subcmd = RTT_SUBCMD_SET_CONFIG
},
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
- .doit = wl_cfgvendor_rtt_set_config
+ .doit = wl_cfgvendor_rtt_set_config,
+ .policy = VENDOR_CMD_RAW_DATA,
},
{
{
@@ -1264,7 +1275,8 @@ static const struct wiphy_vendor_command
.subcmd = RTT_SUBCMD_CANCEL_CONFIG
},
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
- .doit = wl_cfgvendor_rtt_cancel_config
+ .doit = wl_cfgvendor_rtt_cancel_config,
+ .policy = VENDOR_CMD_RAW_DATA,
},
{
{
@@ -1272,7 +1284,8 @@ static const struct wiphy_vendor_command
.subcmd = RTT_SUBCMD_GETCAPABILITY
},
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
- .doit = wl_cfgvendor_rtt_get_capability
+ .doit = wl_cfgvendor_rtt_get_capability,
+ .policy = VENDOR_CMD_RAW_DATA,
},
#endif /* RTT_SUPPORT */
{
@@ -1281,7 +1294,8 @@ static const struct wiphy_vendor_command
.subcmd = ANDR_WIFI_SUBCMD_GET_FEATURE_SET
},
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
- .doit = rtw_cfgvendor_get_feature_set
+ .doit = rtw_cfgvendor_get_feature_set,
+ .policy = VENDOR_CMD_RAW_DATA,
},
{
{
@@ -1289,7 +1303,8 @@ static const struct wiphy_vendor_command
.subcmd = ANDR_WIFI_SUBCMD_GET_FEATURE_SET_MATRIX
},
.flags = WIPHY_VENDOR_CMD_NEED_WDEV | WIPHY_VENDOR_CMD_NEED_NETDEV,
- .doit = rtw_cfgvendor_get_feature_set_matrix
+ .doit = rtw_cfgvendor_get_feature_set_matrix,
+ .policy = VENDOR_CMD_RAW_DATA,
}
};

View File

@@ -0,0 +1,30 @@
--- a/os_dep/linux/ioctl_cfg80211.c
+++ b/os_dep/linux/ioctl_cfg80211.c
@@ -5196,6 +5196,15 @@ exit:
return ret;
}
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 8, 0)) || defined(BUILD_OPENWRT)
+static void cfg80211_rtw_update_mgmt_frame_registrations(struct wiphy *wiphy,
+ struct wireless_dev *wdev,
+ struct mgmt_frame_regs *upd)
+{
+
+}
+#endif
+
#if defined(CONFIG_TDLS) && (LINUX_VERSION_CODE >= KERNEL_VERSION(3,2,0))
static int cfg80211_rtw_tdls_mgmt(struct wiphy *wiphy,
struct net_device *ndev,
@@ -6009,7 +6018,10 @@ static struct cfg80211_ops rtw_cfg80211_
.cancel_remain_on_channel = cfg80211_rtw_cancel_remain_on_channel,
#endif
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE)
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5,8,0)) || defined(BUILD_OPENWRT)
+ .mgmt_tx = cfg80211_rtw_mgmt_tx,
+ .update_mgmt_frame_registrations = cfg80211_rtw_update_mgmt_frame_registrations,
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE)
.mgmt_tx = cfg80211_rtw_mgmt_tx,
#elif (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,34) && LINUX_VERSION_CODE<=KERNEL_VERSION(2,6,35))
.action = cfg80211_rtw_mgmt_tx,

View File

@@ -0,0 +1,24 @@
--- a/include/ieee80211.h
+++ b/include/ieee80211.h
@@ -1313,18 +1313,18 @@ enum ieee80211_state {
(((Addr[2]) & 0xff) == 0xff) && (((Addr[3]) & 0xff) == 0xff) && (((Addr[4]) & 0xff) == 0xff) && \
(((Addr[5]) & 0xff) == 0xff))
#else
-extern __inline int is_multicast_mac_addr(const u8 *addr)
+__inline static int is_multicast_mac_addr(const u8 *addr)
{
return ((addr[0] != 0xff) && (0x01 & addr[0]));
}
-extern __inline int is_broadcast_mac_addr(const u8 *addr)
+__inline static int is_broadcast_mac_addr(const u8 *addr)
{
return ((addr[0] == 0xff) && (addr[1] == 0xff) && (addr[2] == 0xff) && \
(addr[3] == 0xff) && (addr[4] == 0xff) && (addr[5] == 0xff));
}
-extern __inline int is_zero_mac_addr(const u8 *addr)
+__inline static int is_zero_mac_addr(const u8 *addr)
{
return ((addr[0] == 0x00) && (addr[1] == 0x00) && (addr[2] == 0x00) && \
(addr[3] == 0x00) && (addr[4] == 0x00) && (addr[5] == 0x00));

View File

@@ -0,0 +1,37 @@
From 010badc96adbafed214d9cba0236a8a832dbfc77 Mon Sep 17 00:00:00 2001
From: Liangbin Lian <jjm2473@gmail.com>
Date: Mon, 21 Aug 2023 10:26:28 +0800
Subject: [PATCH] fix netdevice notifier
rtw_ndev_notifier_call should ignore network devices created by other drivers,
and it does so, but when CONFIG_WIRELESS_EXT=n, it does not behave as expected.
---
os_dep/linux/os_intfs.c | 9 +++++++++
1 file changed, 9 insertions(+)
--- a/os_dep/linux/os_intfs.c
+++ b/os_dep/linux/os_intfs.c
@@ -746,6 +746,8 @@ u16 rtw_recv_select_queue(struct sk_buff
}
#endif
+int rtw_ndev_init(struct net_device *dev);
+
static int rtw_ndev_notifier_call(struct notifier_block * nb, unsigned long state, void *ptr)
{
#if (LINUX_VERSION_CODE>=KERNEL_VERSION(3,11,0))
@@ -761,6 +763,13 @@ static int rtw_ndev_notifier_call(struct
if (dev->do_ioctl != rtw_ioctl)
#endif
return NOTIFY_DONE;
+#else
+#if (LINUX_VERSION_CODE>=KERNEL_VERSION(2,6,29))
+ if (dev->netdev_ops->ndo_init != rtw_ndev_init)
+#else
+ if (dev->init != rtw_ndev_init)
+#endif
+ return NOTIFY_DONE;
#endif
DBG_871X_LEVEL(_drv_info_, FUNC_NDEV_FMT" state:%lu\n", FUNC_NDEV_ARG(dev), state);

View File

@@ -0,0 +1,72 @@
From dc4024894c9deefc56f8dd6b2d2822b277f268a5 Mon Sep 17 00:00:00 2001
From: Christian Marangi <ansuelsmth@gmail.com>
Date: Sun, 30 Jul 2023 11:18:48 +0200
Subject: [PATCH 2/5] treewide: fix always TRUE condition warning
Fix always TRUE condition warning an drop redundant check.
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
---
core/rtw_sta_mgt.c | 3 +--
hal/OUTSRC/phydm_debug.c | 16 ++++++----------
os_dep/linux/ioctl_cfg80211.c | 3 +--
3 files changed, 8 insertions(+), 14 deletions(-)
--- a/core/rtw_sta_mgt.c
+++ b/core/rtw_sta_mgt.c
@@ -207,8 +207,7 @@ void rtw_mfree_stainfo(struct sta_info *
{
_func_enter_;
- if(&psta->lock != NULL)
- _rtw_spinlock_free(&psta->lock);
+ _rtw_spinlock_free(&psta->lock);
_rtw_free_sta_xmit_priv_lock(&psta->sta_xmitpriv);
_rtw_free_sta_recv_priv_lock(&psta->sta_recvpriv);
--- a/hal/OUTSRC/phydm_debug.c
+++ b/hal/OUTSRC/phydm_debug.c
@@ -870,12 +870,10 @@ phydm_cmd_parser(
case PHYDM_RA:
for(i=0; i<5; i++) {
- if(input[i+1]) {
- PHYDM_SSCANF(input[i+1], DCMD_DECIMAL, &var1[i]);
+ PHYDM_SSCANF(input[i+1], DCMD_DECIMAL, &var1[i]);
- PHYDM_SNPRINTF((output+used, out_len-used, "new SET, RA_var[%d]= (( %d ))\n", i , var1[i]));
- input_idx++;
- }
+ PHYDM_SNPRINTF((output+used, out_len-used, "new SET, RA_var[%d]= (( %d ))\n", i , var1[i]));
+ input_idx++;
}
if(input_idx>=1) {
@@ -891,12 +889,10 @@ phydm_cmd_parser(
case PHYDM_PATHDIV:
for(i=0; i<5; i++) {
- if(input[i+1]) {
- PHYDM_SSCANF(input[i+1], DCMD_HEX, &var1[i]);
+ PHYDM_SSCANF(input[i+1], DCMD_HEX, &var1[i]);
- PHYDM_SNPRINTF((output+used, out_len-used, "new SET, PATHDIV_var[%d]= (( %d ))\n", i , var1[i]));
- input_idx++;
- }
+ PHYDM_SNPRINTF((output+used, out_len-used, "new SET, PATHDIV_var[%d]= (( %d ))\n", i , var1[i]));
+ input_idx++;
}
if(input_idx>=1) {
--- a/os_dep/linux/ioctl_cfg80211.c
+++ b/os_dep/linux/ioctl_cfg80211.c
@@ -2185,8 +2185,7 @@ static int cfg80211_rtw_scan(struct wiph
#ifdef CONFIG_P2P
if( pwdinfo->driver_interface == DRIVER_CFG80211 ) {
- if(ssids->ssid != NULL
- && _rtw_memcmp(ssids->ssid, "DIRECT-", 7)
+ if(_rtw_memcmp(ssids->ssid, "DIRECT-", 7)
&& rtw_get_p2p_ie((u8 *)request->ie, request->ie_len, NULL, NULL)
) {
if(rtw_p2p_chk_state(pwdinfo, P2P_STATE_NONE)) {

View File

@@ -0,0 +1,11 @@
--- a/core/rtw_bt_mp.c
+++ b/core/rtw_bt_mp.c
@@ -169,7 +169,7 @@ mptbt_CheckBtRspStatus(
PBT_EXT_C2H pExtC2h
)
{
- BT_CTRL_STATUS retStatus=BT_OP_STATUS_SUCCESS;
+ BT_CTRL_STATUS retStatus=BT_STATUS_SUCCESS;
switch(pExtC2h->statusCode) {
case BT_OP_STATUS_SUCCESS:

View File

@@ -0,0 +1,29 @@
--- a/os_dep/linux/ioctl_cfg80211.c
+++ b/os_dep/linux/ioctl_cfg80211.c
@@ -4020,6 +4020,18 @@ static int cfg80211_rtw_start_ap(struct
return ret;
}
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,7,0))|| defined(BUILD_OPENWRT)
+static int cfg80211_rtw_change_beacon(struct wiphy *wiphy, struct net_device *ndev,
+ struct cfg80211_ap_update *info)
+{
+ int ret = 0;
+ _adapter *adapter = (_adapter *)rtw_netdev_priv(ndev);
+
+ DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
+
+ ret = rtw_add_beacon(adapter, info->beacon.head, info->beacon.head_len,
+ info->beacon.tail, info->beacon.tail_len);
+#else
static int cfg80211_rtw_change_beacon(struct wiphy *wiphy, struct net_device *ndev,
struct cfg80211_beacon_data *info)
{
@@ -4029,6 +4041,7 @@ static int cfg80211_rtw_change_beacon(st
DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
ret = rtw_add_beacon(adapter, info->head, info->head_len, info->tail, info->tail_len);
+#endif
return ret;
}

View File

@@ -0,0 +1,47 @@
From: Shiji Yang <yangshiji66@outlook.com>
Date: Tue, 29 Apr 2025 01:49:40 +0800
Subject: [PATCH] fix usb_driver .shutdown callback
Update API to fix build error on 6.12 kernel:
/workspaces/openwrt/build_dir/target-x86_64_musl/linux-x86_64/rtl8812au-ct-2022.10.26~9b2b203a/os_dep/linux/usb_intf.c:393:17: error: 'struct usb_driver' has no member named 'drvwrap'
393 | .usbdrv.drvwrap.driver.shutdown = rtw_dev_shutdown,
| ^~~~~~~
/workspaces/openwrt/build_dir/target-x86_64_musl/linux-x86_64/rtl8812au-ct-2022.10.26~9b2b203a/os_dep/linux/usb_intf.c:393:43: error: initialization of 'const char *' from incompatible pointer type 'void (*)(struct device *)' [-Werror=incompatible-pointer-types]
393 | .usbdrv.drvwrap.driver.shutdown = rtw_dev_shutdown,
| ^~~~~~~~~~~~~~~~
Link: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-6.11.y&id=a5f81642a7228489292f842a106e33c558121e8b
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
---
os_dep/linux/usb_intf.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
--- a/os_dep/linux/usb_intf.c
+++ b/os_dep/linux/usb_intf.c
@@ -49,9 +49,14 @@ static int rtw_resume(struct usb_interfa
static int rtw_drv_init(struct usb_interface *pusb_intf,const struct usb_device_id *pdid);
static void rtw_dev_remove(struct usb_interface *pusb_intf);
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 11, 0))
+static void rtw_dev_shutdown(struct usb_interface *usb_intf)
+{
+#else
static void rtw_dev_shutdown(struct device *dev)
{
struct usb_interface *usb_intf = container_of(dev, struct usb_interface, dev);
+#endif
struct dvobj_priv *dvobj = NULL;
_adapter *adapter = NULL;
int i;
@@ -389,7 +394,9 @@ struct rtw_usb_drv usb_drv = {
.usbdrv.supports_autosuspend = 1,
#endif
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19))
+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 11, 0))
+ .usbdrv.shutdown = rtw_dev_shutdown,
+#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 19))
.usbdrv.drvwrap.driver.shutdown = rtw_dev_shutdown,
#else
.usbdrv.driver.shutdown = rtw_dev_shutdown,

View File

@@ -0,0 +1,28 @@
From: Shiji Yang <yangshiji66@outlook.com>
Date: Tue, 29 Apr 2025 00:21:50 +0800
Subject: [PATCH] fix sprintf() overlaps destination object warning
/workspaces/openwrt/build_dir/target-x86_64_musl/linux-x86_64/rtl8812au-ct-2022.10.26~9b2b203a/core/rtw_mp.c: In function 'mp_query_psd':
/workspaces/openwrt/build_dir/target-x86_64_musl/linux-x86_64/rtl8812au-ct-2022.10.26~9b2b203a/core/rtw_mp.c:1874:17: error: 'sprintf' argument 3 overlaps destination object 'data' [-Werror=restrict]
1874 | sprintf(data, "%s%x ", data, psd_data);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/workspaces/openwrt/build_dir/target-x86_64_musl/linux-x86_64/rtl8812au-ct-2022.10.26~9b2b203a/core/rtw_mp.c:1839:41: note: destination object referenced by 'restrict'-qualified argument 1 was declared here
1839 | u32 mp_query_psd(PADAPTER pAdapter, u8 *data)
| ~~~~^~~~
Signed-off-by: Shiji Yang <yangshiji66@outlook.com>
---
core/rtw_mp.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/core/rtw_mp.c
+++ b/core/rtw_mp.c
@@ -1871,7 +1871,7 @@ u32 mp_query_psd(PADAPTER pAdapter, u8 *
} else {
psd_data = rtw_GetPSDData(pAdapter, i);
}
- sprintf(data, "%s%x ", data, psd_data);
+ sprintf(data + strlen(data), "%x ", psd_data);
i++;
}

View File

@@ -0,0 +1,86 @@
From 30fc9d96fa2ce16209306237e677d3d3cbb12685 Mon Sep 17 00:00:00 2001
From: John Thomson <git@johnthomson.fastmail.com.au>
Date: Sun, 28 May 2023 13:26:46 +1000
Subject: [PATCH] Revert "fix kernel 6.1 80211 link_id"
This reverts commit a027da58e8d8e95827f97222ca321cd0b2d377dd.
---
os_dep/linux/ioctl_cfg80211.c | 29 +++++------------------------
1 file changed, 5 insertions(+), 24 deletions(-)
--- a/os_dep/linux/ioctl_cfg80211.c
+++ b/os_dep/linux/ioctl_cfg80211.c
@@ -797,14 +797,9 @@ check_bss:
#endif
DBG_871X(FUNC_ADPT_FMT" call cfg80211_roamed\n", FUNC_ADPT_ARG(padapter));
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 0, 0)
- roam_info.links[0].channel = notify_channel;
- roam_info.links[0].bssid = cur_network->network.MacAddress;
-#elif LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
roam_info.channel = notify_channel;
roam_info.bssid = cur_network->network.MacAddress;
-#endif
-#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
roam_info.req_ie = pmlmepriv->assoc_req + sizeof(struct rtw_ieee80211_hdr_3addr) + 2;
roam_info.req_ie_len = pmlmepriv->assoc_req_len - sizeof(struct rtw_ieee80211_hdr_3addr) - 2;
roam_info.resp_ie = pmlmepriv->assoc_rsp + sizeof(struct rtw_ieee80211_hdr_3addr) + 6;
@@ -1393,9 +1388,7 @@ exit:
}
static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev,
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
- int link_id, u8 key_index, bool pairwise, const u8 *mac_addr,
-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE)
+#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))
u8 key_index, const u8 *mac_addr,
@@ -1535,9 +1528,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))
- int link_id, u8 key_index, bool pairwise, const u8 *mac_addr,
-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE)
+#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))
u8 key_index, const u8 *mac_addr,
@@ -1570,9 +1561,7 @@ static int cfg80211_rtw_get_key(struct w
}
static int cfg80211_rtw_del_key(struct wiphy *wiphy, struct net_device *ndev,
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
- int link_id, u8 key_index, bool pairwise, const u8 *mac_addr)
-#elif (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE)
+#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))
u8 key_index, const u8 *mac_addr)
@@ -1592,11 +1581,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))
- 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
@@ -4046,11 +4031,7 @@ static int cfg80211_rtw_change_beacon(st
return ret;
}
-#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6,0,0))
-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
{
DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
return 0;

View File

@@ -0,0 +1,82 @@
--- a/os_dep/linux/ioctl_cfg80211.c
+++ b/os_dep/linux/ioctl_cfg80211.c
@@ -798,8 +798,8 @@ check_bss:
DBG_871X(FUNC_ADPT_FMT" call cfg80211_roamed\n", FUNC_ADPT_ARG(padapter));
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 12, 0)
- roam_info.channel = notify_channel;
- roam_info.bssid = cur_network->network.MacAddress;
+ roam_info.links[0].channel = notify_channel;
+ roam_info.links[0].bssid = cur_network->network.MacAddress;
roam_info.req_ie = pmlmepriv->assoc_req + sizeof(struct rtw_ieee80211_hdr_3addr) + 2;
roam_info.req_ie_len = pmlmepriv->assoc_req_len - sizeof(struct rtw_ieee80211_hdr_3addr) - 2;
roam_info.resp_ie = pmlmepriv->assoc_rsp + sizeof(struct rtw_ieee80211_hdr_3addr) + 6;
@@ -1389,6 +1389,7 @@ exit:
static int cfg80211_rtw_add_key(struct wiphy *wiphy, struct net_device *ndev,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE)
+ int link_id,
u8 key_index, bool pairwise, const u8 *mac_addr,
#else // (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
u8 key_index, const u8 *mac_addr,
@@ -1529,6 +1530,7 @@ addkey_end:
static int cfg80211_rtw_get_key(struct wiphy *wiphy, struct net_device *ndev,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE)
+ int link_id,
u8 key_index, bool pairwise, const u8 *mac_addr,
#else // (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
u8 key_index, const u8 *mac_addr,
@@ -1562,6 +1564,7 @@ static int cfg80211_rtw_get_key(struct w
static int cfg80211_rtw_del_key(struct wiphy *wiphy, struct net_device *ndev,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37)) || defined(COMPAT_KERNEL_RELEASE)
+ int link_id,
u8 key_index, bool pairwise, const u8 *mac_addr)
#else // (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,37))
u8 key_index, const u8 *mac_addr)
@@ -1581,7 +1584,7 @@ static int cfg80211_rtw_del_key(struct w
}
static int cfg80211_rtw_set_default_key(struct wiphy *wiphy,
- struct net_device *ndev, u8 key_index
+ struct net_device *ndev, int link_id, u8 key_index
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,38)) || defined(COMPAT_KERNEL_RELEASE)
, bool unicast, bool multicast
#endif
@@ -2349,7 +2352,7 @@ exit:
}
-static int cfg80211_rtw_set_wiphy_params(struct wiphy *wiphy, u32 changed)
+static int cfg80211_rtw_set_wiphy_params(struct wiphy *wiphy, int radio_idx, u32 changed)
{
#if 0
struct iwm_priv *iwm = wiphy_to_iwm(wiphy);
@@ -3142,6 +3145,7 @@ static int cfg80211_rtw_set_txpower(stru
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
struct wireless_dev *wdev,
#endif
+ int radio_idx,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,36)) || defined(COMPAT_KERNEL_RELEASE)
enum nl80211_tx_power_setting type, int mbm)
#else
@@ -3180,7 +3184,7 @@ static int cfg80211_rtw_set_txpower(stru
static int cfg80211_rtw_get_txpower(struct wiphy *wiphy,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
- struct wireless_dev *wdev,
+ struct wireless_dev *wdev, int radio_idx,
#endif
int *dbm)
{
@@ -4031,7 +4035,8 @@ static int cfg80211_rtw_change_beacon(st
return ret;
}
-static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev)
+static int cfg80211_rtw_stop_ap(struct wiphy *wiphy, struct net_device *ndev,
+ unsigned int link_id)
{
DBG_871X(FUNC_NDEV_FMT"\n", FUNC_NDEV_ARG(ndev));
return 0;

11
patches/110-link_id.patch Normal file
View File

@@ -0,0 +1,11 @@
--- a/os_dep/linux/ioctl_cfg80211.c
+++ b/os_dep/linux/ioctl_cfg80211.c
@@ -3184,7 +3184,7 @@ static int cfg80211_rtw_set_txpower(stru
static int cfg80211_rtw_get_txpower(struct wiphy *wiphy,
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,8,0))
- struct wireless_dev *wdev, int radio_idx,
+ struct wireless_dev *wdev, int radio_idx, unsigned int link_id,
#endif
int *dbm)
{