blob: fd50c274fcca787d04a72c1914a018f8c85e3707 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
|
# vhost-device-can - CAN emulation backend daemon
## Description
This program is a vhost-user backend that emulates a VirtIO CAN device.
The device's binary takes three (3) parameters: a socket, a 'can-out' and a
'can-in' device name. The socket is commonly used across all vhost-devices to
communicate with the vhost-user frontend device.
The 'can-out' represents
the actual CAN/FD device appears in the host system which vhost-device-can will
forward the messages from the frontend side. Finaly, the 'can-in' is again a
CAN/FD device connected on the host systems and vhost-device-can reads CAN/FD
frames and sends them to the frontend. The 'can-in' and 'can-out' can be find
by "ip link show" command. Also, the vhost-device-can may have the same CAN/FD
device name for both 'can-in' and 'can-out', if the user desires to setup a
loopback configuration.
This program is tested with Virtio-loopback's `-device vhost-user-can`.
Examples section below.
## Synopsis
**vhost-device-can** [*OPTIONS*]
## Options
.. program:: vhost-device-gpio
.. option:: -h, --help
Print help.
.. option:: -s, --socket-path=PATH
.. option:: -i, --can-int='CAN/FD interface name'
The name of the input CAN interface to retrive CAN frames by
.. option:: -o, --can-out='CAN/FD interface name'
The name of the ouput CAN interface to send the CAN frames
## Examples
The daemon should be started first:
::
host# vhost-device-can --socket-path=can.sock --can-in="can0" --can-out="can1"
The virtio-looback invocation needs to insert the [virtio-loopback-transport](https://git.virtualopensystems.com/virtio-loopback/loopback_driver/-/tree/epsilon-release) driver
and then start the [virito-loopback-adapter](https://git.virtualopensystems.com/virtio-loopback/adapter_app/-/tree/epsilon-release) which is the intermediate between
vhost-device and virtio-loopback-transport driver.
::
host# sudo insmod loopback_driver.ko
host# sudo ./adapter -s /path/to/can.sock0 -d vhucan
## License
This project is licensed under either of
- [Apache License](http://www.apache.org/licenses/LICENSE-2.0), Version 2.0
- [BSD-3-Clause License](https://opensource.org/licenses/BSD-3-Clause)
|