All of lore.kernel.org
 help / color / mirror / Atom feed
* Clear transmit buffer (of pending queued tx-messages)
@ 2016-06-22 12:11 ajneu
  2016-06-23  8:45 ` ajneu
  0 siblings, 1 reply; 5+ messages in thread
From: ajneu @ 2016-06-22 12:11 UTC (permalink / raw)
  To: linux-can

Hi,

how do you guys handle clearing of the transmit buffer?
(Usage-case example:
Imaging: buffer is filled with tx-messages, but no other participant on the
bus. After 1 minute, those queued tx-messages are outdated. We definitely
want to clear the queue, to prevent those messages from getting sent out, if
a participant connects to the bus again.)


I think... 
that one has to distinguish between 
a) non-blocking or blocking mode of write... on the userspace side;
and 
b) the buffering in qdisc
c) the buffering of tx-messages queued inside the CAN controller itself.

Whew!

Concerning 
a)
Is it correct that I need non-blocking, if I want to prevent userspace
sticking in blocking write calls? 
(Or is it possible to get a blocking write call to return immediately?
Perhaps sending a signal?)

Concerning 
b) and c)
How does one clear the qdisc and messages still queued inside the CAN
controller?
One method is probably using libsocketcan and issuing can_do_stop() followed
by can_do_start()... Would that work?
Any other possibilities?
Anybody willing to share some best practices?

Thanks.
ajneu


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-06-27 22:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-06-22 12:11 Clear transmit buffer (of pending queued tx-messages) ajneu
2016-06-23  8:45 ` ajneu
2016-06-23  9:26   ` Wolfgang Grandegger
2016-06-27 22:01     ` Kurt Van Dijck
2016-06-26 23:31   ` Tom Evans

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.