From 800ea46bd5df6bc65ef389394db8aec0d3b2f355 Mon Sep 17 00:00:00 2001 From: Liangbin Lian Date: Wed, 14 May 2025 14:09:31 +0800 Subject: [PATCH] rtl8812au-ct: fix netdevice notifier call warning 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. Signed-off-by: Liangbin Lian Link: https://github.com/openwrt/openwrt/pull/18801 Signed-off-by: Hauke Mehrtens --- package/kernel/rtl8812au-ct/Makefile | 2 +- .../patches/005-fix-netdevice-notifier.patch | 37 +++++++++++++++++++ 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 package/kernel/rtl8812au-ct/patches/005-fix-netdevice-notifier.patch diff --git a/package/kernel/rtl8812au-ct/Makefile b/package/kernel/rtl8812au-ct/Makefile index 1492a753205..c6d09e50b8f 100644 --- a/package/kernel/rtl8812au-ct/Makefile +++ b/package/kernel/rtl8812au-ct/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=rtl8812au-ct -PKG_RELEASE=1 +PKG_RELEASE=2 PKG_LICENSE:=GPLv2 PKG_LICENSE_FILES:= diff --git a/package/kernel/rtl8812au-ct/patches/005-fix-netdevice-notifier.patch b/package/kernel/rtl8812au-ct/patches/005-fix-netdevice-notifier.patch new file mode 100644 index 00000000000..6bc0cb59e8d --- /dev/null +++ b/package/kernel/rtl8812au-ct/patches/005-fix-netdevice-notifier.patch @@ -0,0 +1,37 @@ +From 010badc96adbafed214d9cba0236a8a832dbfc77 Mon Sep 17 00:00:00 2001 +From: Liangbin Lian +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);