Linux CAN drivers development
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: linux-can@vger.kernel.org
Cc: manivannan.sadhasivam@linaro.org,
	dev.kurt@vandijck-laurijssen.be,
	Marc Kleine-Budde <mkl@pengutronix.de>
Subject: [PATCH v41 1/3] can: rx-offload: can_rx_offload_add_manual(): add new initialization function
Date: Mon, 22 Jun 2020 13:46:01 +0200	[thread overview]
Message-ID: <20200622114603.965371-2-mkl@pengutronix.de> (raw)
In-Reply-To: <20200622114603.965371-1-mkl@pengutronix.de>

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.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/rx-offload.c   | 11 +++++++++++
 include/linux/can/rx-offload.h |  3 +++
 2 files changed, 14 insertions(+)

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);
diff --git a/include/linux/can/rx-offload.h b/include/linux/can/rx-offload.h
index 1b78a0cfb615..f1b38088b765 100644
--- a/include/linux/can/rx-offload.h
+++ b/include/linux/can/rx-offload.h
@@ -35,6 +35,9 @@ int can_rx_offload_add_timestamp(struct net_device *dev,
 int can_rx_offload_add_fifo(struct net_device *dev,
 			    struct can_rx_offload *offload,
 			    unsigned int weight);
+int can_rx_offload_add_manual(struct net_device *dev,
+			      struct can_rx_offload *offload,
+			      unsigned int weight);
 int can_rx_offload_irq_offload_timestamp(struct can_rx_offload *offload,
 					 u64 reg);
 int can_rx_offload_irq_offload_fifo(struct can_rx_offload *offload);
-- 
2.27.0

  reply	other threads:[~2020-06-22 11:46 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-22 11:46 [PATCH v41 0/3] can: add mcp25xxfd support Marc Kleine-Budde
2020-06-22 11:46 ` Marc Kleine-Budde [this message]
2020-06-22 11:46 ` [PATCH v41 2/3] dt-binding: can: mcp25xxfd: document device tree bindings Marc Kleine-Budde
2020-06-22 16:53   ` Manivannan Sadhasivam
2020-06-22 18:12     ` Marc Kleine-Budde
2020-06-23  3:26       ` Manivannan Sadhasivam
2020-06-23  6:02         ` Oleksij Rempel
2020-06-23  6:12           ` Manivannan Sadhasivam
2020-06-23  7:27         ` Marc Kleine-Budde
2020-06-23 12:46 ` [PATCH v41 0/3] can: add mcp25xxfd support Manivannan Sadhasivam
2020-06-23 12:49   ` Marc Kleine-Budde
     [not found] ` <20200622114603.965371-4-mkl@pengutronix.de>
     [not found]   ` <20200626133243.GA8333@Mani-XPS-13-9360>
2020-06-26 14:41     ` [PATCH v41 3/3] can: mcp25xxfd: initial commit Marc Kleine-Budde
2020-07-16 13:28       ` Manivannan Sadhasivam
2020-08-17 15:51         ` Manivannan Sadhasivam
2020-06-27 19:56     ` Kurt Van Dijck
2020-06-28  6:48       ` Manivannan Sadhasivam
2020-08-31 10:10 ` [PATCH v41 0/3] can: add mcp25xxfd support Manivannan Sadhasivam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200622114603.965371-2-mkl@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=dev.kurt@vandijck-laurijssen.be \
    --cc=linux-can@vger.kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox