All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wolfgang Grandegger <wg@domain.hid>
To: Jan Kiszka <jan.kiszka@domain.hid>
Cc: xenomai-core <xenomai@xenomai.org>
Subject: Re: [Xenomai-core] [PATCH] RT-Socket-CAN, TX loopback and further improvements
Date: Wed, 15 Nov 2006 10:05:58 +0100	[thread overview]
Message-ID: <455AD876.7010606@domain.hid> (raw)
In-Reply-To: <455AC829.3080109@domain.hid>

Jan Kiszka wrote:
> Wolfgang Grandegger wrote:
>> Hi Jan,
>>
>> Jan Kiszka wrote:
>>> Hi Wolfgang,
>> [...deletions...]
>>
>>> Last remark: For the sake of completeness, tx-loopback should also be
>>> implemented in the virtual CAN driver.
>> The virtual CAN driver already works like TX loopback. It routes TX
>> messages to local foreign sockets (but without sending them to any bus).
> 
> There is a minor difference: When application A is attached to a socket
> on virtual CAN device 1, B to device 2, and C to 1 again, a message sent
> by A will only be received by B. TX loopback as you are introducing it
> should make C receive it as well - in order to have a fully compatible
> test environment.

Ah, I missed the case (rx_dev == tx_dev). This should work then:

	/* Deliver to all other devices on the virtual bus */
	for (i = 0; i < devices; i++) {
		rx_dev = rtcan_virt_devs[i];
		if (rx_dev->state == CAN_STATE_ACTIVE) {
			if (tx_dev != rx_dev) {
				rx_frame->can_ifindex = rx_dev->ifindex;
				rtcan_rcv(rx_dev, &skb);
			} else if (rtcan_tx_loopback_pending(tx_dev))
				rtcan_tx_loopback(tx_dev);
		}
	}

Thanks.

Wolfgang.


      reply	other threads:[~2006-11-15  9:05 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-14 14:32 [Xenomai-core] [PATCH] RT-Socket-CAN, TX loopback and further improvements Wolfgang Grandegger
2006-11-14 15:00 ` Wolfgang Grandegger
2006-11-14 17:53   ` Jan Kiszka
2006-11-14 19:10     ` Wolfgang Grandegger
2006-11-14 19:54       ` Jan Kiszka
2006-11-15  7:29         ` Wolfgang Grandegger
2006-11-15  8:00           ` Jan Kiszka
2006-11-15  9:11             ` Wolfgang Grandegger
2006-11-15  7:25     ` Wolfgang Grandegger
2006-11-15  7:56       ` Jan Kiszka
2006-11-15  9:05         ` 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=455AD876.7010606@domain.hid \
    --to=wg@domain.hid \
    --cc=jan.kiszka@domain.hid \
    --cc=xenomai@xenomai.org \
    /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 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.