diff options
author | 2023-11-29 12:44:40 +0100 | |
---|---|---|
committer | 2023-11-29 14:15:20 +0000 | |
commit | 274aa4832d16af5a6b10ffe6021b278bffca4eb8 (patch) | |
tree | 5b8bb165d7c593504188ba7ecd85bdeb86fcf1af /adapter.c | |
parent | 9ad83030ef18c04beae09a6acf9800378a8378bc (diff) |
Add vhost-user support for the virtio-can device
Enables support to probe, handle and connect virtio-can device
with vhost-user-can via the virtio-loopback-adapter
Depends: 29398
Bug-AGL: SPEC-4834
Change-Id: I31e328aee25b101f51911eab6fd15dc3dd78c771
Signed-off-by: Angelos Mouzakitis <a.mouzakitis@virtualopensystems.com>
Diffstat (limited to 'adapter.c')
-rw-r--r-- | adapter.c | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -49,6 +49,7 @@ #include "vhost_user_input.h" #include "vhost_user_gpio.h" #include "vhost_user_sound.h" +#include "vhost_user_can.h" #ifdef DEBUG @@ -158,9 +159,10 @@ int find_arg(int argc, char **argv, char *str) int val_device_arg(char *str) { char *adapter_devices[] = {"vrng", "vhurng", "vhublk", "vhuinput", - "vhusnd", "vhugpio"}; - char *vhu_devices[] = {"vhurng", "vhublk", "vhuinput", "vhusnd", "vhugpio"}; - int adapter_devices_num = 6, i; + "vhusnd", "vhugpio", "vhucan"}; + char *vhu_devices[] = {"vhurng", "vhublk", "vhuinput", "vhusnd", + "vhugpio", "vhucan"}; + int adapter_devices_num = 7, i; for (i = 0; i < adapter_devices_num; i++) { if (!strcmp(adapter_devices[i], str)) { @@ -173,8 +175,9 @@ int val_device_arg(char *str) bool check_vhu_device(char *str) { - char *vhu_devices[] = {"vhurng", "vhublk", "vhuinput", "vhusnd", "vhugpio"}; - int vhu_devices_num = 5, i; + char *vhu_devices[] = {"vhurng", "vhublk", "vhuinput", "vhusnd", + "vhugpio", "vhucan"}; + int vhu_devices_num = 6, i; for (i = 0; i < vhu_devices_num; i++) { if (!strcmp(vhu_devices[i], str)) { @@ -297,6 +300,9 @@ int main(int argc, char **argv) case 6: vu_gpio_device_realize(); break; + case 7: + vhost_user_can_realize(); + break; default: exit(1); } |