>Does it work if you *unset* IFF_ECHO and do *not* use 
can_get/put_echo_skb?
Case 1
------
I commented IFF_ECHO and also commented the can_get/put_echo_skb, now, 
without enabling the loopback itself, the data is looped back.

Case 2
----------
If I enable IFF_ECHO, and commented can_get/put_echo_skb, now, data is 
looped back when the loopback is on (#ip link set can0 type can loopback 
on) but CAN_RAW_RECV_OWN_MSGS is not working.

case 3
----------
If I enable  IFF_ECHO and also enabled can_get/put_echo_skb, result is 
same as case 1. without enabling the loopback data is looped back.

Regards,
Navaneethan P 




Wolfgang Grandegger <[email protected]> 
05/31/2010 09:14 PM

To
Navaneethan P <[email protected]>
cc
Oliver Hartkopp <[email protected]>, [email protected]
Subject
Re: [Socketcan-users] linux-2.6.31 CAN driver - CAN_RAW_RECV_OWN_MSGS - 
receive own messages problem






On 05/31/2010 05:29 PM, Navaneethan P wrote:
> Hi Oliver and Wolfgang,
> 
> Sorry for late reply. 
> 
>> The normal loopback is done in software by setting IFF_ECHO and 
handling
>> echo skb's appropriately. can_put_echo_skb() should be called in the
>> xmit function and can_get_echo_skb() when the TX is done (normally when
>> the TX done interrupt occurs). This seems not be implemented in your
>> driver.
> 
> If I enable, can_get_echo_skb and can_pet_echo_skb, irrespective of the 
> CAN_RAW_RECV_OWN_MSG, sent frames are looped back.
> Is this because I set the IFF_ECHO in my driver?

Setting IFF_ECHO means that the driver is doing the loopback via
can_get/put_echo_skb.

> Can you please make me understand this issue?

If you don't set it (and don't use can_get/put_echo_skb), the upper
layer will do the loopback for you. See:

http://lxr.linux.no/#linux+v2.6.34/net/can/af_can.c#L248

> CAN_RAW_RECV_OWN_MSGS may not be frequently used. but it has to be 
> supported by the CAN driver as per the can documentation section 4.1.3. 
> right?
> 
> Has any body tested CAN_RAW_RECV_OWN_MSGS on linux kernel 2.6.31?or is 
it 
> the problem with my driver. 

Does it work if you *unset* IFF_ECHO and do *not* use 
can_get/put_echo_skb?

Wolfgang.

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

Reply via email to