diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2020-09-16 00:35:22 +0200 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2020-09-21 10:13:19 +0200 |
commit | 728fc9ff73d3f25220f6b8a52aaf063ec51ef294 (patch) | |
tree | 5ca826d707e4fd0af2cfafc0d410d13b659224c0 /drivers/net/can | |
parent | b2527eb271c81d0ba83446063f91c74a2df3718e (diff) | |
download | lwn-728fc9ff73d3f25220f6b8a52aaf063ec51ef294.tar.gz lwn-728fc9ff73d3f25220f6b8a52aaf063ec51ef294.zip |
can: rx-offload: can_rx_offload_add_manual(): add new initialization function
This patch adds a new initialization function:
can_rx_offload_add_manual()
It should be used to add support rx-offload to a driver, if the callback
mechanism should not be used. Use e.g. can_rx_offload_queue_sorted() to queue
skbs into rx-offload.
Link: https://lore.kernel.org/r/20200915223527.1417033-33-mkl@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can')
-rw-r--r-- | drivers/net/can/rx-offload.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/net/can/rx-offload.c b/drivers/net/can/rx-offload.c index e8328910a234..3b180269a92d 100644 --- a/drivers/net/can/rx-offload.c +++ b/drivers/net/can/rx-offload.c @@ -351,6 +351,17 @@ int can_rx_offload_add_fifo(struct net_device *dev, } EXPORT_SYMBOL_GPL(can_rx_offload_add_fifo); +int can_rx_offload_add_manual(struct net_device *dev, + struct can_rx_offload *offload, + unsigned int weight) +{ + if (offload->mailbox_read) + return -EINVAL; + + return can_rx_offload_init_queue(dev, offload, weight); +} +EXPORT_SYMBOL_GPL(can_rx_offload_add_manual); + void can_rx_offload_enable(struct can_rx_offload *offload) { napi_enable(&offload->napi); |