From: Oliver Hartkopp <socketcan@hartkopp.net>
To: Alexander Gerasiov <gq@cs.msu.su>, linux-can@vger.kernel.org
Subject: Re: [PATCH] can: sja1000: Fix error location forwarding
Date: Sun, 3 Apr 2016 11:32:17 +0200 [thread overview]
Message-ID: <5700E321.3020504@hartkopp.net> (raw)
In-Reply-To: <20160401191645.36722a06@brick.gerasiov.net>
Hello Alexander,
you are right. Thanks for the fix.
On 04/01/2016 06:16 PM, Alexander Gerasiov wrote:
> According to SJA1000 documentation the location of error is available
> regardless of an error type. Therefore it should always be forwarded to
> SocketCAN.
>
> Signed-off-by: Nikita Edward Baruzdin <nebaruzdin@lvk.cs.msu.su>
> Signed-off-by: Alexander GQ Gerasiov <gq@cs.msu.su>
Acked-by: Oliver Hartkopp <socketcan@hartkopp.net>
Best regards,
Oliver
> ---
> drivers/net/can/sja1000/sja1000.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/can/sja1000/sja1000.c b/drivers/net/can/sja1000/sja1000.c
> index 8dda3b7..9f10779 100644
> --- a/drivers/net/can/sja1000/sja1000.c
> +++ b/drivers/net/can/sja1000/sja1000.c
> @@ -438,6 +438,7 @@ static int sja1000_err(struct net_device *dev, uint8_t isrc, uint8_t status)
>
> cf->can_id |= CAN_ERR_PROT | CAN_ERR_BUSERROR;
>
> + /* set error type */
> switch (ecc & ECC_MASK) {
> case ECC_BIT:
> cf->data[2] |= CAN_ERR_PROT_BIT;
> @@ -449,9 +450,12 @@ static int sja1000_err(struct net_device *dev, uint8_t isrc, uint8_t status)
> cf->data[2] |= CAN_ERR_PROT_STUFF;
> break;
> default:
> - cf->data[3] = ecc & ECC_SEG;
> break;
> }
> +
> + /* set error location */
> + cf->data[3] = ecc & ECC_SEG;
> +
> /* Error occurred during transmission? */
> if ((ecc & ECC_DIR) == 0)
> cf->data[2] |= CAN_ERR_PROT_TX;
>
next prev parent reply other threads:[~2016-04-03 9:32 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-01 16:16 [PATCH] can: sja1000: Fix error location forwarding Alexander Gerasiov
2016-04-03 9:32 ` Oliver Hartkopp [this message]
2016-04-11 9:19 ` Marc Kleine-Budde
2016-04-11 17:00 ` Oliver Hartkopp
2016-04-12 10:19 ` Marc Kleine-Budde
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=5700E321.3020504@hartkopp.net \
--to=socketcan@hartkopp.net \
--cc=gq@cs.msu.su \
--cc=linux-can@vger.kernel.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 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.