[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4D8A02F7.7050607@grandegger.com>
Date: Wed, 23 Mar 2011 15:25:59 +0100
From: Wolfgang Grandegger <wg@...ndegger.com>
To: Jan Altenberg <jan@...utronix.de>
CC: Kurt Van Dijck <kurt.van.dijck@....be>, bhupesh.sharma@...com,
b.spranger@...utronix.de, netdev@...r.kernel.org
Subject: Re: can: c_can: TX echo
Hi Jan,
On 03/23/2011 02:54 PM, Jan Altenberg wrote:
> Hi,
>
>>> So, we first invalidate the message object and afterwards we read
>>> the DLC value from the msg_cntrl (which is 0 after invalidating the
>>> message object) to account the TX bytes. So tx_bytes will always be
>>> 0. The fix should be easy, I think, we can just move
>>> c_can_inval_msg_object to the end of that loop.
This means that "ifconfig" will report *0* TX Bytes!?
>> IMO, it looks necessary to call c_can_inval_msg_object inside the if
>> (), after it has been transmitted. Otherwise, if for some other (TX)
>> reason you get in this loop, you may clear a pending transmission?
>> Again, I haven't read this one's datasheet. I was familiar with its
>> predecessor.
>
> I tried to check, but the datasheet is a bit unclear regarding that
> point ;-) My interpretation is, that c_can_inval_msg_object()
> shouldn't affect the txrqst bit, but nevertheless calling it inside
> the if() statement would make the code more readable.
>
> I can prepare a patch, but I'd like to wait for Wolfgang's / Bupesh's
> feedback.
I'm following the discussion and as I'm not familiar with that chip, I'm
waiting for Bupesh's answer as well... before I start digging. You can
also have a look to the pch_can driver, which is C_CAN based as well.
Wolfgang.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists