Hey Vladislav,

(please don't top post)

[email protected] wrote:
> well, I do not really like name CAN_ERR_CRTL_UNSPEC, but this 
> has done the job for both MSCAN and SJA1000 (ixxat_pci to 

I don't like the name, too. For the naive reader like me it sounds like.
There's an error but we don't know which one.

> be more specific) drivers under rev 1033. The HW I use at the 
> moment (with rev 1181) is IXXAT HW (so the ixxat_pci driver).

> I of course may poll the interface state by the mean of 
> "can_get_state" from the netlink lib, but it will be nice to have

nah, we don't want to poll that :)

> a reliable event for that. CAN_ERR_PROT_ACTIVE however does not
> seems to be appropriate for me. According to the "error.h", the
> CAN_ERR_PROT_ACTIVE is from the data[2], which is used for
> indication errors in CAN protocol. What I need in my case is

Yes, but the comment says: "active error announcement". But there are
some bits free in data[1].

> to get an event, that CAN-controller has error-free status. And
> for the CAN-controller status the data[1] byte is used. Error 
> warning/passive events are indicated over corresponding bits of 
> that byte. And if all that errors are cleared, I actually expect 
> to get an event with no bits set for warning/passive bits. Rx/Tx 
> overflow bit may be still set. So you are right, instead of using
> 
> (CanFrame.data[1] == CAN_ERR_CRTL_UNSPEC)
> 
> The following construction shall be the proper signal of 
> CAN-controller became error active:
> 
> ((CanFrame.data[1] & (CAN_ERR_CRTL_RX_WARNING|
>                       CAN_ERR_CRTL_TX_WARNING|
>                       CAN_ERR_CRTL_RX_PASSIVE|
>                       CAN_ERR_CRTL_TX_PASSIVE)) == 0)

I'd like to see an explizid bit set to indicate a transition to error
active.

Looking though the at91 a transition to error active data[1] == 0 and
data[2] ==  CAN_ERR_PROT_ACTIVE;

cheers, 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: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Socketcan-users mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-users

Reply via email to