From: Wolfgang Grandegger <wg@grandegger.com>
To: Steffen Rose <ro@emtas.de>
Cc: linux-can@vger.kernel.org
Subject: Re: Error Active
Date: Mon, 14 Apr 2014 14:38:44 +0000 [thread overview]
Message-ID: <81adc4d92d94ab4bcbd3cdadbd56853e@grandegger.com> (raw)
In-Reply-To: <2625052.FRqudkDGEA@lisa>
On Mon, 14 Apr 2014 14:13:33 +0200, Steffen Rose <ro@emtas.de> wrote:
> Hello Wolfgang,
>
> thank you very much for your answers.
>
>> libsocketcan, like ip uses a netlink socket to get the configuration
and
>> statistics of the CAN device. This includes the "state" property.
>
> Do all implementation support the netlink socket, especially the CAN
state?
Yes.
> I think, state is UNKNOWN and don't mean the Can state, is it?
> $ ip -det -stat link show can0
> 3: can0: <NOARP,UP,LOWER_UP,ECHO> mtu 16 qdisc pfifo_fast *state*
UNKNOWN
> qlen
This "state" is network related.
> 10000
It follows the CAN related settings and statistics.
> link/can
> *can state* ERROR-ACTIVE restart-ms 0
> bitrate 250000 sample-point 0.875
> tq 250 prop-seg 6 phase-seg1 7 phase-seg2 2 sjw 1
> ems_usb: tseg1 1..16 tseg2 1..8 sjw 1..4 brp 1..64 brp-inc 1
> clock 8000000
> re-started bus-errors arbit-lost error-warn error-pass bus-off
> 0 0 0 0 0 0
> RX: bytes packets errors dropped overrun mcast
> 0 0 0 0 0 0
> TX: bytes packets errors dropped carrier collsns
> 0 0 0 0 0 0
>
>
>> > Do socketcan have different ways to get the current state? Is it a
low
>> > level
>> > driver part to read and hold the current state?
>>
>> No. Both get the infos via netlink socket from the kernel.
This answer is wrong. It has nothing to do with the netlink socket.
Sorry for confusion. Yes, the low-level driver does handle the state
changes
reported by the CAN hardware.
> I'm not so familiar with the parts of the system and the correct naming
of
> it.
>
> I understand, that socketcan has a common part for all (many) driver
> adaptations (can_bcm, can_raw) and a CAN controller specific part
(can).
There is CAN protocol, common CAN devices interface and specific device
drivers.
> As I understand, for the last point exists many different
implementations
> with
> different feature implementation.
Ideally they do implement the same features but it depends on the hardware
to some extend, of course. The big goal is to provide a *common* interface
for CAN error state and error message handling.
>> > (I'm sorry. I'm unsure about the driver I tested in this situation. I
>> > think,
>> > it was the EMS CPC driver and kernel 3.2.0-60-generic. )
>>
>> This device uses a SJA1000.
>>
>
> My mistake
> USB interface from EMS
>
> vcan 12686 0
> can_bcm 22077 0
> can_raw 17120 0
> can 36556 2 can_bcm,can_raw
> ems_usb 17510 0
> can_dev 15321 1 ems_usb
OK.
Wolfgang.
prev parent reply other threads:[~2014-04-14 14:38 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-14 8:03 Error Active Steffen Rose
2014-04-14 8:50 ` Wolfgang Grandegger
2014-04-14 9:56 ` Steffen Rose
2014-04-14 11:05 ` Wolfgang Grandegger
2014-04-14 12:13 ` Steffen Rose
2014-04-14 14:38 ` 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=81adc4d92d94ab4bcbd3cdadbd56853e@grandegger.com \
--to=wg@grandegger.com \
--cc=linux-can@vger.kernel.org \
--cc=ro@emtas.de \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox