From: Stefan Weil <sw@weilnetz.de>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Gedare Bloom <gedare@rtems.org>, Amar Takhar <verm@darkbeer.org>,
Petr Benes <petben@petben.net>,
Thomas Doerfler <Thomas.Doerfler@embedded-brains.de>,
"Sebastian.Huber@embedded-brains.de"
<Sebastian.Huber@embedded-brains.de>,
"Rempel, Cynthia" <cynt6007@vandals.uidaho.edu>,
"qemu-devel@nongnu.org" <qemu-devel@nongnu.org>,
Jennifer Averett <Jennifer.Averett@oarcorp.com>,
Chris Johns <chrisj@rtems.org>,
Cl?udio Silva <claudiodcsilva@gmail.com>,
Joel Sherrill <joel.sherrill@oarcorp.com>,
Pavel Pisa <pisa@cmp.felk.cvut.cz>
Subject: Re: [Qemu-devel] Writing a CAN driver for QEMU
Date: Sun, 19 May 2013 18:14:50 +0200 [thread overview]
Message-ID: <5198FA7A.8070906@weilnetz.de> (raw)
In-Reply-To: <5198D16E.4070505@redhat.com>
Am 19.05.2013 15:19, schrieb Paolo Bonzini:
> Il 19/05/2013 14:58, Paolo Bonzini ha scritto:
>> Is this CAN device just an Ethernet device? QEMU does not support other
>> link-level protocols. Adding them would be possible and interesting,
>> however it would add a bit to the complexity.
>>
>> Both would be the same. In the first case, you'd probably use "-netdev
>> socket" to share a virtual network between two virtual machines. In the
>> second, you would use something like "-netdev tap" (again assuming it's
>> just an Ethernet device).
> Ok, learnt a bit more... You could probably implement this in two ways:
> 1) "-netdev socket" would probably work as a CAN->UDP gateway; 2)
> connecting to a virtual CAN interface in the host, created using
> SocketCAN (similar to "-netdev tap", e.g. "-netdev cantap").
>
> In the first case, it would probably be useful to write the matching
> UDP->CAN gateway program.
>
> In any case, you have to implement both the backend and the actual device.
>
> Paolo
I used TCP instead of UDP in a proprietary solution more than
10 years ago.
CAN devices are connected to CAN buses, so I had a CAN device
emulation (on CAN API level, not on hardware level like with QEMU)
and a CAN bus emulation.
The CAN bus emulation was a TCP server process. It could simulate
several CAN buses.
Each CAN controllerwas a TCP client connected to the CAN bus emulation.
The TCP clients sent CAN data packets (length, packet type and data)
to the TCP server and received such packets from the server.
They also exchanged control packets with the server (topology = which bus,
data rate, CAN filter settings).
The CAN bus emulation routed each received packet to other CAN controllers
on the same bus (CAN is a broadcast protocol) and could also simulate
error packets (for example when there was a mismatch of the data rates
between sender and receiver). In debug mode, the bus emulation could
also display the packets (raw data or CAN Open packets).
Several CAN vendors provide bidirectional CAN-Ethernet gateways,
but I don't know whether there is a standard for CAN-over-Ethernet.
Regards,
Stefan
next prev parent reply other threads:[~2013-05-19 16:15 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-17 20:29 [Qemu-devel] Writing a CAN driver for QEMU Rempel, Cynthia
2013-05-18 13:55 ` Paolo Bonzini
2013-05-18 18:24 ` Rempel, Cynthia
2013-05-18 20:15 ` Stefan Weil
2013-05-18 21:23 ` Rempel, Cynthia
2013-05-19 0:44 ` Pavel Pisa
2013-05-19 6:58 ` Jean-Christophe PLAGNIOL-VILLARD
2013-05-19 7:23 ` Peter Maydell
2013-05-19 9:21 ` Stefan Weil
2013-05-19 12:58 ` Paolo Bonzini
2013-05-19 13:19 ` Paolo Bonzini
2013-05-19 16:14 ` Stefan Weil [this message]
2013-05-19 18:23 ` Andreas Färber
2013-05-19 19:06 ` Pavel Pisa
2013-05-20 16:15 ` Andreas Färber
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=5198FA7A.8070906@weilnetz.de \
--to=sw@weilnetz.de \
--cc=Jennifer.Averett@oarcorp.com \
--cc=Sebastian.Huber@embedded-brains.de \
--cc=Thomas.Doerfler@embedded-brains.de \
--cc=chrisj@rtems.org \
--cc=claudiodcsilva@gmail.com \
--cc=cynt6007@vandals.uidaho.edu \
--cc=gedare@rtems.org \
--cc=joel.sherrill@oarcorp.com \
--cc=pbonzini@redhat.com \
--cc=petben@petben.net \
--cc=pisa@cmp.felk.cvut.cz \
--cc=qemu-devel@nongnu.org \
--cc=verm@darkbeer.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.