From f2fc8af7ab58d2123eed1aa4428e713cdfc27976 Mon Sep 17 00:00:00 2001 From: Dmitry Geurkov Date: Tue, 13 Jun 2023 15:58:04 +0300 Subject: [PATCH] fix netif_napi_add Linux 6.1/6.3 execution issue (#321) * fix netif_napi_add Linux 6.1/6.3 compile issue --- os_dep/linux/os_intfs.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/os_dep/linux/os_intfs.c b/os_dep/linux/os_intfs.c index 1630e782..291f192c 100644 --- a/os_dep/linux/os_intfs.c +++ b/os_dep/linux/os_intfs.c @@ -1673,9 +1673,10 @@ int rtw_os_ndev_register(_adapter *adapter, const char *name) u8 rtnl_lock_needed = rtw_rtnl_lock_needed(dvobj); #ifdef CONFIG_RTW_NAPI - netif_napi_add(ndev, &adapter->napi, rtw_recv_napi_poll -#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)) - , RTL_NAPI_WEIGHT +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0)) + netif_napi_add_weight(ndev, &adapter->napi, rtw_recv_napi_poll, RTL_NAPI_WEIGHT +#else + netif_napi_add(ndev, &adapter->napi, rtw_recv_napi_poll, RTL_NAPI_WEIGHT #endif ); #endif /* CONFIG_RTW_NAPI */