diff options
author | Ira W. Snyder <iws@ovro.caltech.edu> | 2012-07-19 00:33:18 +0200 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2012-07-20 17:49:05 +0200 |
commit | 3b5c6b9e49f78f07ebcd34b38c1185e57a0fd9eb (patch) | |
tree | 8b15fe983e725690a0ed49a98e5b5816ded49459 /drivers/net/can/janz-ican3.c | |
parent | can: janz-ican3: avoid firmware lockup caused by infinite bus error quota (diff) | |
download | linux-3b5c6b9e49f78f07ebcd34b38c1185e57a0fd9eb.tar.xz linux-3b5c6b9e49f78f07ebcd34b38c1185e57a0fd9eb.zip |
can: janz-ican3: add support for one shot mode
The Janz VMOD-ICAN3 hardware has support for one shot packet
transmission. This means that a packet will be attempted to be sent
once, with no automatic retries.
The SocketCAN core has a controller-wide setting for this mode:
CAN_CTRLMODE_ONE_SHOT. The Janz VMOD-ICAN3 hardware supports this flag
on a per-packet level, but the SocketCAN core does not.
Signed-off-by: Ira W. Snyder <iws@ovro.caltech.edu>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'drivers/net/can/janz-ican3.c')
-rw-r--r-- | drivers/net/can/janz-ican3.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/can/janz-ican3.c b/drivers/net/can/janz-ican3.c index e06ec403521a..98ee43819911 100644 --- a/drivers/net/can/janz-ican3.c +++ b/drivers/net/can/janz-ican3.c @@ -116,6 +116,7 @@ #define ICAN3_BUSERR_QUOTA_MAX 255 /* Janz ICAN3 CAN Frame Conversion */ +#define ICAN3_SNGL 0x02 #define ICAN3_ECHO 0x10 #define ICAN3_EFF_RTR 0x40 #define ICAN3_SFF_RTR 0x10 @@ -848,6 +849,10 @@ static void can_frame_to_ican3(struct ican3_dev *mod, desc->data[0] |= cf->can_dlc; desc->data[1] |= ICAN3_ECHO; + /* support single transmission (no retries) mode */ + if (mod->can.ctrlmode & CAN_CTRLMODE_ONE_SHOT) + desc->data[1] |= ICAN3_SNGL; + if (cf->can_id & CAN_RTR_FLAG) desc->data[0] |= ICAN3_EFF_RTR; @@ -1810,7 +1815,8 @@ static int __devinit ican3_probe(struct platform_device *pdev) mod->can.do_set_mode = ican3_set_mode; mod->can.do_get_berr_counter = ican3_get_berr_counter; mod->can.ctrlmode_supported = CAN_CTRLMODE_3_SAMPLES - | CAN_CTRLMODE_BERR_REPORTING; + | CAN_CTRLMODE_BERR_REPORTING + | CAN_CTRLMODE_ONE_SHOT; /* find our IRQ number */ mod->irq = platform_get_irq(pdev, 0); |