From 1378a8440a359c126ff3e3fbe40f1a2559316699 Mon Sep 17 00:00:00 2001 From: Jian Jun Chen Date: Wed, 1 Aug 2018 15:02:42 +0800 Subject: [PATCH] dm: virtio: add support for VBS-K device reset A new ioctl is introduced in VBS-K to issue reset command to kernel VBS-K driver. This is used to support VBS-K S3. When FE enters S3 reset command is sent to device model. Backend driver in device model should use this ioctl to inform the VBS-K drvier in kernel. Signed-off-by: Jian Jun Chen Reviewed-by: Shuo Liu Acked-by: Yu Wang --- devicemodel/hw/pci/virtio/virtio_kernel.c | 2 +- devicemodel/include/vbs_common_if.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/devicemodel/hw/pci/virtio/virtio_kernel.c b/devicemodel/hw/pci/virtio/virtio_kernel.c index e37e0d23e..654d8b063 100644 --- a/devicemodel/hw/pci/virtio/virtio_kernel.c +++ b/devicemodel/hw/pci/virtio/virtio_kernel.c @@ -38,7 +38,7 @@ vbs_kernel_init(int fd) int vbs_kernel_reset(int fd) { - return VIRTIO_SUCCESS; + return ioctl(fd, VBS_K_RESET_DEV, NULL); } /* diff --git a/devicemodel/include/vbs_common_if.h b/devicemodel/include/vbs_common_if.h index 54d171371..9e0336c14 100644 --- a/devicemodel/include/vbs_common_if.h +++ b/devicemodel/include/vbs_common_if.h @@ -43,5 +43,6 @@ struct vbs_dev_info { #define VBS_K_SET_DEV _IOW(VBS_K_IOCTL, 0x00, struct vbs_dev_info) #define VBS_K_SET_VQ _IOW(VBS_K_IOCTL, 0x01, struct vbs_vqs_info) +#define VBS_K_RESET_DEV _IO(VBS_K_IOCTL, 0x02) #endif /* _VBS_COMMON_IF_H_ */