git: 0dee359c0942 - stable/14 - LinuxKPI: netdevice: add alloc_netdev_dummy()
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 31 Oct 2024 14:34:50 UTC
The branch stable/14 has been updated by bz:
URL: https://cgit.FreeBSD.org/src/commit/?id=0dee359c094209a56ae96546c1c4b03551e3b305
commit 0dee359c094209a56ae96546c1c4b03551e3b305
Author: Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2024-09-26 21:06:52 +0000
Commit: Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2024-10-31 14:33:56 +0000
LinuxKPI: netdevice: add alloc_netdev_dummy()
Add alloc_netdev_dummy() which is needed by an updated rtw88 driver.
Given we already call linuxkpi_init_dummy_netdev() ourselves allow the
setup function to be NULL to not initialize and start a tasq td twice.
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D46802
(cherry picked from commit 105331f658e2f14fb4daa64dcd076c7369505295)
---
sys/compat/linuxkpi/common/include/linux/netdevice.h | 2 ++
sys/compat/linuxkpi/common/src/linux_netdev.c | 3 ++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/sys/compat/linuxkpi/common/include/linux/netdevice.h b/sys/compat/linuxkpi/common/include/linux/netdevice.h
index dde3ad07dec2..cd7d23077a62 100644
--- a/sys/compat/linuxkpi/common/include/linux/netdevice.h
+++ b/sys/compat/linuxkpi/common/include/linux/netdevice.h
@@ -466,6 +466,8 @@ void linuxkpi_free_netdev(struct net_device *);
#define alloc_netdev(_l, _n, _f, _func) \
linuxkpi_alloc_netdev(_l, _n, _f, _func)
+#define alloc_netdev_dummy(_l) \
+ linuxkpi_alloc_netdev(_l, "dummy", NET_NAME_UNKNOWN, NULL)
#define free_netdev(_n) \
linuxkpi_free_netdev(_n)
diff --git a/sys/compat/linuxkpi/common/src/linux_netdev.c b/sys/compat/linuxkpi/common/src/linux_netdev.c
index 61342395f03c..2ca1784896de 100644
--- a/sys/compat/linuxkpi/common/src/linux_netdev.c
+++ b/sys/compat/linuxkpi/common/src/linux_netdev.c
@@ -410,7 +410,8 @@ linuxkpi_alloc_netdev(size_t len, const char *name, uint32_t flags,
/* This needs extending as we support more. */
- setup_func(ndev);
+ if (setup_func != NULL)
+ setup_func(ndev);
return (ndev);
}