aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2015-06-23 13:32:50 +0100
committerPeter Maydell <peter.maydell@linaro.org>2015-06-23 13:32:50 +0100
commit6966b2a07190004e18ede33ce50a65009b36f3a6 (patch)
treefc6f9a9585687329bbd6fa763866cb01cbe7b938 /include
parenta3206972a9eab65ec8e8f9ae320ad628ba4b58f1 (diff)
parenta5d4d7b580f42c47d240a2068c810e4147147f6e (diff)
Merge remote-tracking branch 'remotes/kraxel/tags/pull-input-20150623-1' into staging
virtio-input: property fixes, add evdev passthrough # gpg: Signature made Tue Jun 23 09:33:29 2015 BST using RSA key ID D3E87138 # gpg: Good signature from "Gerd Hoffmann (work) <kraxel@redhat.com>" # gpg: aka "Gerd Hoffmann <gerd@kraxel.org>" # gpg: aka "Gerd Hoffmann (private) <kraxel@gmail.com>" * remotes/kraxel/tags/pull-input-20150623-1: Add MAINTAINERS entry for virtio-input virtio-input: evdev passthrough virtio-input: move properties, use virtio_instance_init_common Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/hw/virtio/virtio-input.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/include/hw/virtio/virtio-input.h b/include/hw/virtio/virtio-input.h
index 8134178bcd..fd5417d1a3 100644
--- a/include/hw/virtio/virtio-input.h
+++ b/include/hw/virtio/virtio-input.h
@@ -50,17 +50,17 @@ typedef struct virtio_input_event virtio_input_event;
#define VIRTIO_INPUT_HID_GET_PARENT_CLASS(obj) \
OBJECT_GET_PARENT_CLASS(obj, TYPE_VIRTIO_INPUT_HID)
-#define DEFINE_VIRTIO_INPUT_PROPERTIES(_state, _field) \
- DEFINE_PROP_STRING("serial", _state, _field.serial)
+#define TYPE_VIRTIO_INPUT_HOST "virtio-input-host-device"
+#define VIRTIO_INPUT_HOST(obj) \
+ OBJECT_CHECK(VirtIOInputHost, (obj), TYPE_VIRTIO_INPUT_HOST)
+#define VIRTIO_INPUT_HOST_GET_PARENT_CLASS(obj) \
+ OBJECT_GET_PARENT_CLASS(obj, TYPE_VIRTIO_INPUT_HOST)
typedef struct VirtIOInput VirtIOInput;
typedef struct VirtIOInputClass VirtIOInputClass;
typedef struct VirtIOInputConfig VirtIOInputConfig;
typedef struct VirtIOInputHID VirtIOInputHID;
-
-struct virtio_input_conf {
- char *serial;
-};
+typedef struct VirtIOInputHost VirtIOInputHost;
struct VirtIOInputConfig {
virtio_input_config config;
@@ -74,7 +74,7 @@ struct VirtIOInput {
uint32_t cfg_size;
QTAILQ_HEAD(, VirtIOInputConfig) cfg_list;
VirtQueue *evt, *sts;
- virtio_input_conf input;
+ char *serial;
virtio_input_event *queue;
uint32_t qindex, qsize;
@@ -100,6 +100,12 @@ struct VirtIOInputHID {
int ledstate;
};
+struct VirtIOInputHost {
+ VirtIOInput parent_obj;
+ char *evdev;
+ int fd;
+};
+
void virtio_input_send(VirtIOInput *vinput, virtio_input_event *event);
void virtio_input_init_config(VirtIOInput *vinput,
virtio_input_config *config);