fix netif_napi_add Linux 6.1/6.3 execution issue (#321)

* fix netif_napi_add Linux 6.1/6.3 compile issue
This commit is contained in:
Dmitry Geurkov 2023-06-13 15:58:04 +03:00 committed by GitHub
parent 528ae31705
commit f2fc8af7ab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 */