Skip to content

Commit

Permalink
src: Add support for kernel 6.1 or above
Browse files Browse the repository at this point in the history
Signed-off-by: Deokgyu Yang <[email protected]>
  • Loading branch information
awesometic committed Dec 19, 2022
1 parent d506c2f commit 65f9a57
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/r8125.h
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,11 @@ typedef int *napi_budget;
typedef struct napi_struct *napi_ptr;
typedef int napi_budget;

#if LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)
#define RTL_NAPI_CONFIG(ndev, priv, function, weight) netif_napi_add(ndev, &priv->napi, function, weight)
#else
#define RTL_NAPI_CONFIG(ndev, priv, function, weight) netif_napi_add_weight(ndev, &priv->napi, function, weight)
#endif
#define RTL_NAPI_QUOTA(budget, ndev) min(budget, budget)
#define RTL_GET_PRIV(stuct_ptr, priv_struct) container_of(stuct_ptr, priv_struct, stuct_ptr)
#define RTL_GET_NETDEV(priv_ptr) struct net_device *dev = priv_ptr->dev;
Expand Down

0 comments on commit 65f9a57

Please sign in to comment.