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