diff options
author | norly <ny-git@enpas.org> | 2022-03-17 21:23:10 +0100 |
---|---|---|
committer | norly <ny-git@enpas.org> | 2022-03-17 22:09:56 +0100 |
commit | 7553f57af5a80c80dcb7957d1347a06dcc580805 (patch) | |
tree | a25dfdb39b84c47f3626447c6bdffb245831a979 /module/elmcan.c | |
parent | 6b25b028af5f6a6ff0d96841f8679db60e0ffbe7 (diff) |
Get rid of dummy mailbox_read() for rx_offload
Use can_rx_offload_add_manual() instead of can_rx_offload_add_fifo(),
starting with Linux 5.10.
Diffstat (limited to 'module/elmcan.c')
-rw-r--r-- | module/elmcan.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/module/elmcan.c b/module/elmcan.c index 9a58655..81d21f4 100644 --- a/module/elmcan.c +++ b/module/elmcan.c @@ -755,6 +755,7 @@ static void elm327_parse_rxbuf(struct elmcan *elm) } } +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0) /* Dummy needed to use can_rx_offload */ static struct sk_buff *elmcan_mailbox_read(struct can_rx_offload *offload, unsigned int n, u32 *timestamp, @@ -764,6 +765,7 @@ static struct sk_buff *elmcan_mailbox_read(struct can_rx_offload *offload, return ERR_PTR(-ENOBUFS); } +#endif static int elmcan_netdev_open(struct net_device *dev) { @@ -792,8 +794,12 @@ static int elmcan_netdev_open(struct net_device *dev) elm327_init(elm); spin_unlock_bh(&elm->lock); +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,10,0) elm->offload.mailbox_read = elmcan_mailbox_read; err = can_rx_offload_add_fifo(dev, &elm->offload, ELM327_NAPI_WEIGHT); +#else + err = can_rx_offload_add_manual(dev, &elm->offload, ELM327_NAPI_WEIGHT); +#endif if (err) { close_candev(dev); return err; |