public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public•gmane.org>
To: Matthias Fuchs <matthias.fuchs-iOnpLzIbIdM@public•gmane.org>
Cc: Socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public•gmane.org,
	netdev-u79uwXL29TY76Z2rM5mHXA@public•gmane.org,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public•gmane.org
Subject: Re: [PATCH v2] can: Add driver for esd CAN-USB/2 device
Date: Mon, 10 May 2010 16:59:01 +0200	[thread overview]
Message-ID: <4BE81F35.60607@grandegger.com> (raw)
In-Reply-To: <201005101640.39048.matthias.fuchs-iOnpLzIbIdM@public.gmane.org>

On 05/10/2010 04:40 PM, Matthias Fuchs wrote:
> Hi Wolfgang,
> 
> On Monday 10 May 2010 15:43, Wolfgang Grandegger wrote:
>> Hi Matthias,
>>
>> On 05/10/2010 03:28 PM, Matthias Fuchs wrote:
>>> This patch adds a driver for esd's USB high speed
>>> CAN interface. The driver supports devices with
>>> multiple CAN interfaces.
>>>
>>> Signed-off-by: Matthias Fuchs <matthias.fuchs-iOnpLzIbIdM@public•gmane.org>
>>> ---
>>>
>>> version 2: 
>>>  - use bus-error reporting and counters
>>
>> I don't find support for CAN_CTRLMODE_BERR_REPORTING, apart from setting
>> the flag. If it's set bus error interrupts should be enabled or disabled
>> otherwise.
>>
>> Wolfgang.
> I expect my implementation to be complete.
> 
> 1) In esd_usb2_rx_event() I pass tx/rxerr in cf->data[6/7].
> 2) I implemented esd_usb2_get_berr_counter(). This function will 
>    return the last tx/rx error counters from the hardware that
>    are kept in priv->bec.
> 3) tx/rx error counter cannot be requested from the hardware so
>    they are stored in priv->bec when they are received from the hardware.
>    There is no way to enable or disable this behavior.
> 4) Finally I enabled the whole interface via CAN_CTRLMODE_BERR_REPORTING
>    for the CAN framework.

BERR_REPORTING != bus error counter

> I don't see where I missed anything.

The equivalent to the following SJA1000 code is missing:

           /* enable interrupts */
           if (priv->can.ctrlmode & CAN_CTRLMODE_BERR_REPORTING)
                   priv->write_reg(priv, REG_IER, IRQ_ALL);
           else
                   priv->write_reg(priv, REG_IER, IRQ_ALL & ~IRQ_BEI);

The user must now explicitly enable bus error reporting with
"ip ... type can berr_reporting on ....

Wolfgang.

 
> Matthias
> 
> 

      parent reply	other threads:[~2010-05-10 14:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-10 13:28 [PATCH v2] can: Add driver for esd CAN-USB/2 device Matthias Fuchs
     [not found] ` <201005101528.50834.matthias.fuchs-iOnpLzIbIdM@public.gmane.org>
2010-05-10 13:43   ` Wolfgang Grandegger
     [not found]     ` <4BE80D6E.3040205-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>
2010-05-10 14:40       ` Matthias Fuchs
     [not found]         ` <201005101640.39048.matthias.fuchs-iOnpLzIbIdM@public.gmane.org>
2010-05-10 14:59           ` Wolfgang Grandegger [this message]

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=4BE81F35.60607@grandegger.com \
    --to=wg-5yr1bzd7o62+xt7jha+gda@public$(echo .)gmane.org \
    --cc=Socketcan-core-0fE9KPoRgkgATYTw5x5z8w@public$(echo .)gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public$(echo .)gmane.org \
    --cc=matthias.fuchs-iOnpLzIbIdM@public$(echo .)gmane.org \
    --cc=netdev-u79uwXL29TY76Z2rM5mHXA@public$(echo .)gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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