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 <jjm2473@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/18801
Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
This commit is contained in:
Liangbin Lian 2025-05-14 14:09:31 +08:00 committed by Hauke Mehrtens
parent a6822d5980
commit 800ea46bd5
2 changed files with 38 additions and 1 deletions

View file

@ -1,7 +1,7 @@
include $(TOPDIR)/rules.mk
PKG_NAME:=rtl8812au-ct
PKG_RELEASE=1
PKG_RELEASE=2
PKG_LICENSE:=GPLv2
PKG_LICENSE_FILES:=

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);