All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc Kleine-Budde <mkl@pengutronix.de>
To: "Ira W. Snyder" <iws@ovro.caltech.edu>
Cc: Andreas Larsson <andreas@gaisler.com>,
	Wolfgang Grandegger <wg@grandegger.com>,
	linux-can@vger.kernel.org, software@gaisler.com
Subject: Re: [PATCH] can: sja1000: Add support for listen-only mode and one-shot mode
Date: Tue, 18 Sep 2012 18:20:40 +0200	[thread overview]
Message-ID: <50589F58.8020804@pengutronix.de> (raw)
In-Reply-To: <20120918161603.GC12449@ovro.caltech.edu>

[-- Attachment #1: Type: text/plain, Size: 1948 bytes --]

On 09/18/2012 06:16 PM, Ira W. Snyder wrote:
[...]

>>> The commit message is incomplete and confusing, I agree. The patch
>>> obviously implements listen-only and one-shot mode. From the data sheet:
>>>
>>> LOM FUNCTION:
>>>    1: listen only; in this mode the CAN controller would
>>>    give no acknowledge to the CAN-bus, even if a message is received
>>>    successfully; the error counters are stopped at the current value
>>>    normal
>>>
>>> Single-shot:
>>>    Setting the command bits CMR.0 (TR) and CMR.1 (AT) simultaneously
>>>    results in sending the transmit message once. No re-transmission will
>>>    be performed in the event of an error or arbitration lost
>>>    (single-shot transmission).
>>
>> The limitation is that when a one-shot message transmission fails, a 
>> Transmit Interrupt is generated and as a consequence can_get_echo_skb is 
>> called. Thus a can frame is echoed back even when the transmission fails 

The question is, can you identify somehow if the message has been
transmitted successfully or not.

>> (instead of being discarded). When one-shot mode is enabled no other 
>> interrupts are generated on a failed transmission. Thus, as far as I can 
>> see, there is no way for the failed frames not to be echoed back locally 
>> in this case.

> I worked around this limitation in the janz-ican3 driver by writing my
> own version of the can_put_echo_skb() and can_get_echo_skb() functions.
> Also notice the skb_dequeue() in ican3_handle_cevtind(), which handles
> the transmission failure case.
> 
> It is probably possible to modify the SJA1000 driver to do something
> similar.

Marc
-- 
Pengutronix e.K.                  | Marc Kleine-Budde           |
Industrial Linux Solutions        | Phone: +49-231-2826-924     |
Vertretung West/Dortmund          | Fax:   +49-5121-206917-5555 |
Amtsgericht Hildesheim, HRA 2686  | http://www.pengutronix.de   |


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 259 bytes --]

  reply	other threads:[~2012-09-18 16:20 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-17 15:58 [PATCH] can: sja1000: Add support for listen-only mode and one-shot mode Andreas Larsson
2012-09-18 13:46 ` Marc Kleine-Budde
2012-09-18 14:11   ` Wolfgang Grandegger
2012-09-18 15:54     ` Andreas Larsson
2012-09-18 16:16       ` Ira W. Snyder
2012-09-18 16:20         ` Marc Kleine-Budde [this message]
2012-09-18 16:34       ` [PATCH v2] " Andreas Larsson
2012-09-18 17:17         ` Marc Kleine-Budde
2012-09-18 17:23           ` Oliver Hartkopp
2012-09-19  5:55             ` Andreas Larsson
2012-09-18 18:27         ` Wolfgang Grandegger
2012-09-19  5:56           ` Andreas Larsson
2012-09-19  7:12             ` [PATCH v3] " Andreas Larsson
2012-09-19  7:33               ` Wolfgang Grandegger
2012-09-19 10:24                 ` [PATCH v4] " Andreas Larsson
2012-09-19 16:49                   ` Oliver Hartkopp
2012-09-20  7:50                     ` [PATCH v5] " Andreas Larsson
2012-09-21  8:08                       ` Marc Kleine-Budde
2012-09-21  8:12                         ` Andreas Larsson

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=50589F58.8020804@pengutronix.de \
    --to=mkl@pengutronix.de \
    --cc=andreas@gaisler.com \
    --cc=iws@ovro.caltech.edu \
    --cc=linux-can@vger.kernel.org \
    --cc=software@gaisler.com \
    --cc=wg@grandegger.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.