aboutsummaryrefslogtreecommitdiff
path: root/sys/compat/linuxkpi/common
diff options
context:
space:
mode:
authorBjoern A. Zeeb <bz@FreeBSD.org>2024-09-26 21:06:52 +0000
committerBjoern A. Zeeb <bz@FreeBSD.org>2024-10-17 13:27:05 +0000
commit105331f658e2f14fb4daa64dcd076c7369505295 (patch)
tree0756bbc94b6cf16d1ed927f1049fdf1bcf0ecd7a /sys/compat/linuxkpi/common
parent17120e4bc3e61557816ca0558a60ab969b3df404 (diff)
downloadsrc-105331f658e2f14fb4daa64dcd076c7369505295.tar.gz
src-105331f658e2f14fb4daa64dcd076c7369505295.zip
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 MFC after: 3 days Differential Revision: https://reviews.freebsd.org/D46802
Diffstat (limited to 'sys/compat/linuxkpi/common')
-rw-r--r--sys/compat/linuxkpi/common/include/linux/netdevice.h2
-rw-r--r--sys/compat/linuxkpi/common/src/linux_netdev.c3
2 files changed, 4 insertions, 1 deletions
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 fe00e929c168..c36684f9fd97 100644
--- a/sys/compat/linuxkpi/common/src/linux_netdev.c
+++ b/sys/compat/linuxkpi/common/src/linux_netdev.c
@@ -409,7 +409,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);
}