From fccde138332a820031f20c3c0683bee73c86fc19 Mon Sep 17 00:00:00 2001 From: sungmin ha Date: Tue, 3 Dec 2013 11:23:16 +0900 Subject: [PATCH] host-keyboard: added reset function initialize index in the virtioqueue when reset state Change-Id: I4c5a312ea0ec90c1fa7e1764b491af28db96a73f Signed-off-by: sungmin ha --- package/changelog | 4 ++++ package/pkginfo.manifest | 2 +- tizen/src/hw/maru_virtio_hwkey.c | 6 +++--- tizen/src/hw/maru_virtio_keyboard.c | 16 ++++++++++++++++ 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/package/changelog b/package/changelog index 7c6bcba7d4..898f854f6b 100644 --- a/package/changelog +++ b/package/changelog @@ -1,3 +1,7 @@ +* 1.7.2 +- added reset function for host keyboard +- deleted blank in maru_virtio_hwkey.c +== Sungmin Ha 2013-12-03 * 1.7.1 - method for initial scale factor value determining == GiWoong Kim 2013-11-26 diff --git a/package/pkginfo.manifest b/package/pkginfo.manifest index 0cec2f7245..394e37a741 100644 --- a/package/pkginfo.manifest +++ b/package/pkginfo.manifest @@ -1,4 +1,4 @@ -Version: 1.7.1 +Version: 1.7.2 Maintainer: Yeong-Kyoon Lee Source: emulator diff --git a/tizen/src/hw/maru_virtio_hwkey.c b/tizen/src/hw/maru_virtio_hwkey.c index 421c1e5aba..907f28f8d1 100644 --- a/tizen/src/hw/maru_virtio_hwkey.c +++ b/tizen/src/hw/maru_virtio_hwkey.c @@ -233,8 +233,8 @@ static int virtio_hwkey_device_exit(DeviceState *qdev) static void virtio_hwkey_device_reset(VirtIODevice *vdev) { - INFO("reset hwkey device\n"); - vqidx = 0; + INFO("reset hwkey device\n"); + vqidx = 0; } static void virtio_hwkey_class_init(ObjectClass *klass, void *data) @@ -243,7 +243,7 @@ static void virtio_hwkey_class_init(ObjectClass *klass, void *data) VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); dc->exit = virtio_hwkey_device_exit; vdc->init = virtio_hwkey_device_init; - vdc->reset = virtio_hwkey_device_reset; + vdc->reset = virtio_hwkey_device_reset; vdc->get_features = virtio_hwkey_get_features; } diff --git a/tizen/src/hw/maru_virtio_keyboard.c b/tizen/src/hw/maru_virtio_keyboard.c index 5e77a65cae..3e2bc3bdf3 100644 --- a/tizen/src/hw/maru_virtio_keyboard.c +++ b/tizen/src/hw/maru_virtio_keyboard.c @@ -121,6 +121,11 @@ static void virtio_keyboard_event(void *opaque, int keycode) return; } + if (!virtio_queue_ready(vkbd->vq)) { + INFO("virtqueue is not ready.\n"); + return; + } + index = &(vkbd->kbdqueue.index); TRACE("[Enter] input_event handler. cnt %d\n", vkbd->kbdqueue.wptr); @@ -269,12 +274,23 @@ static int virtio_keyboard_device_exit(DeviceState *qdev) return 0; } +static void virtio_keyboard_device_reset(VirtIODevice *vdev) +{ + VirtIOKeyboard *vkbd; + vkbd = VIRTIO_KEYBOARD(vdev); + + INFO("reset keyboard device\n"); + vkbd->kbdqueue.rptr = 0; + vkbd->kbdqueue.index = 0; +} + static void virtio_keyboard_class_init(ObjectClass *klass, void *data) { DeviceClass *dc = DEVICE_CLASS(klass); VirtioDeviceClass *vdc = VIRTIO_DEVICE_CLASS(klass); dc->exit = virtio_keyboard_device_exit; vdc->init = virtio_keyboard_device_init; + vdc->reset = virtio_keyboard_device_reset; vdc->get_features = virtio_keyboard_get_features; } -- 2.34.1