Patchwork can/netlink: add CAN_CTRLMODE_ONE_SHOT

login
register
mail settings
Submitter Marc Kleine-Budde
Date Dec. 23, 2009, 11:27 a.m.
Message ID <1261567668-21692-1-git-send-email-mkl@pengutronix.de>
Download mbox | patch
Permalink /patch/41659/
State Accepted
Delegated to: David Miller
Headers show

Comments

Marc Kleine-Budde - Dec. 23, 2009, 11:27 a.m.
This patch adds the flag CAN_CTRLMODE_ONE_SHOT. It is used as mask
or flag in the "struct can_ctrlmode".

It allows userspace via netlink to set a CAN controller into the special
"one-shot" mode. In this mode, if supported by the CAN controller, it
tries only once to deliver a CAN frame and aborts it if an error
(e.g.: arbitration lost) happens.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Acked-by: Wolfgang Grandegger <wg@grandegger.com>
---
 include/linux/can/netlink.h |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
David Miller - Jan. 4, 2010, 5:31 a.m.
From: Marc Kleine-Budde <mkl@pengutronix.de>
Date: Wed, 23 Dec 2009 12:27:48 +0100

> This patch adds the flag CAN_CTRLMODE_ONE_SHOT. It is used as mask
> or flag in the "struct can_ctrlmode".
> 
> It allows userspace via netlink to set a CAN controller into the special
> "one-shot" mode. In this mode, if supported by the CAN controller, it
> tries only once to deliver a CAN frame and aborts it if an error
> (e.g.: arbitration lost) happens.
> 
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> Acked-by: Wolfgang Grandegger <wg@grandegger.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/include/linux/can/netlink.h b/include/linux/can/netlink.h
index 9ecbb78..c818335 100644
--- a/include/linux/can/netlink.h
+++ b/include/linux/can/netlink.h
@@ -80,6 +80,7 @@  struct can_ctrlmode {
 #define CAN_CTRLMODE_LOOPBACK	0x1	/* Loopback mode */
 #define CAN_CTRLMODE_LISTENONLY	0x2 	/* Listen-only mode */
 #define CAN_CTRLMODE_3_SAMPLES	0x4	/* Triple sampling mode */
+#define CAN_CTRLMODE_ONE_SHOT	0x8	/* One-Shot mode */
 
 /*
  * CAN device statistics