Index: uspace/srv/hid/input/include/input.h
===================================================================
--- uspace/srv/hid/input/include/input.h	(revision b72efe87f3e33beaa3b0d0cf7c8b598a58f6a6de)
+++ uspace/srv/hid/input/include/input.h	(revision b366a6f4b86cb7fe82fcf415965c5a7de1a59638)
@@ -42,13 +42,8 @@
 
 #define NAME       "input"
-#define NAMESPACE  "hid_in"
+#define NAMESPACE  "hid"
 
 extern bool irc_service;
 extern int irc_phone;
-
-extern list_t mouse_devs;
-
-void input_event_move(int, int);
-void input_event_button(int bnum, int press);
 
 #endif
Index: uspace/srv/hid/input/include/kbd.h
===================================================================
--- uspace/srv/hid/input/include/kbd.h	(revision b72efe87f3e33beaa3b0d0cf7c8b598a58f6a6de)
+++ uspace/srv/hid/input/include/kbd.h	(revision b366a6f4b86cb7fe82fcf415965c5a7de1a59638)
@@ -71,6 +71,6 @@
 } kbd_dev_t;
 
-extern void kbd_push_scancode(kbd_dev_t *, int);
-extern void kbd_push_ev(kbd_dev_t *, int, unsigned int);
+extern void kbd_push_data(kbd_dev_t *, sysarg_t);
+extern void kbd_push_event(kbd_dev_t *, int, unsigned int);
 
 #endif
Index: uspace/srv/hid/input/include/kbd_ctl.h
===================================================================
--- uspace/srv/hid/input/include/kbd_ctl.h	(revision b72efe87f3e33beaa3b0d0cf7c8b598a58f6a6de)
+++ uspace/srv/hid/input/include/kbd_ctl.h	(revision b366a6f4b86cb7fe82fcf415965c5a7de1a59638)
@@ -28,6 +28,6 @@
 
 /** @addtogroup inputgen generic
- * @brief	Keyboard controller driver interface.
- * @ingroup  input
+ * @brief Keyboard controller driver interface.
+ * @ingroup input
  * @{
  */
@@ -43,7 +43,7 @@
 
 typedef struct kbd_ctl_ops {
-	void (*parse_scancode)(int);
+	void (*parse)(sysarg_t);
 	int (*init)(struct kbd_dev *);
-	void (*set_ind)(struct kbd_dev *, unsigned);
+	void (*set_ind)(struct kbd_dev *, unsigned int);
 } kbd_ctl_ops_t;
 
@@ -59,4 +59,3 @@
 /**
  * @}
- */ 
-
+ */
Index: uspace/srv/hid/input/include/kbd_port.h
===================================================================
--- uspace/srv/hid/input/include/kbd_port.h	(revision b72efe87f3e33beaa3b0d0cf7c8b598a58f6a6de)
+++ uspace/srv/hid/input/include/kbd_port.h	(revision b366a6f4b86cb7fe82fcf415965c5a7de1a59638)
@@ -28,6 +28,6 @@
 
 /** @addtogroup inputgen generic
- * @brief	Keyboard port driver interface.
- * @ingroup  input
+ * @brief Keyboard port driver interface.
+ * @ingroup input
  * @{
  */
@@ -51,5 +51,4 @@
 extern kbd_port_ops_t adb_port;
 extern kbd_port_ops_t chardev_port;
-extern kbd_port_ops_t dummy_port;
 extern kbd_port_ops_t gxemul_port;
 extern kbd_port_ops_t msim_port;
@@ -65,4 +64,3 @@
 /**
  * @}
- */ 
-
+ */
Index: uspace/srv/hid/input/include/mouse.h
===================================================================
--- uspace/srv/hid/input/include/mouse.h	(revision b72efe87f3e33beaa3b0d0cf7c8b598a58f6a6de)
+++ uspace/srv/hid/input/include/mouse.h	(revision b366a6f4b86cb7fe82fcf415965c5a7de1a59638)
@@ -40,13 +40,24 @@
 #include <adt/list.h>
 
+struct mouse_port_ops;
+struct mouse_proto_ops;
+
 typedef struct mouse_dev {
 	/** Link to mouse_devs list */
 	link_t mouse_devs;
-
-	/** Path to the device */
+	
+	/** Path to the device (only for mouseev devices) */
 	const char *dev_path;
+	
+	/** Port ops */
+	struct mouse_port_ops *port_ops;
+	
+	/** Protocol ops */
+	struct mouse_proto_ops *proto_ops;
 } mouse_dev_t;
 
-int mouse_add_dev(const char *dev_path);
+extern void mouse_push_data(mouse_dev_t *, sysarg_t);
+extern void mouse_push_event_move(mouse_dev_t *, int, int);
+extern void mouse_push_event_button(mouse_dev_t *, int, int);
 
 #endif
Index: uspace/srv/hid/input/include/mouse_port.h
===================================================================
--- uspace/srv/hid/input/include/mouse_port.h	(revision b366a6f4b86cb7fe82fcf415965c5a7de1a59638)
+++ uspace/srv/hid/input/include/mouse_port.h	(revision b366a6f4b86cb7fe82fcf415965c5a7de1a59638)
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2011 Martin Decky
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup inputgen generic
+ * @brief Mouse port driver interface.
+ * @ingroup input
+ * @{
+ */
+/** @file
+ */
+
+#ifndef MOUSE_PORT_H_
+#define MOUSE_PORT_H_
+
+#include <sys/types.h>
+
+struct mouse_dev;
+
+typedef struct mouse_port_ops {
+	int (*init)(struct mouse_dev *);
+	void (*yield)(void);
+	void (*reclaim)(void);
+	void (*write)(uint8_t);
+} mouse_port_ops_t;
+
+extern mouse_port_ops_t adb_mouse_port;
+extern mouse_port_ops_t chardev_mouse_port;
+
+#endif
+
+/**
+ * @}
+ */
Index: uspace/srv/hid/input/include/mouse_proto.h
===================================================================
--- uspace/srv/hid/input/include/mouse_proto.h	(revision b366a6f4b86cb7fe82fcf415965c5a7de1a59638)
+++ uspace/srv/hid/input/include/mouse_proto.h	(revision b366a6f4b86cb7fe82fcf415965c5a7de1a59638)
@@ -0,0 +1,57 @@
+/*
+ * Copyright (c) 2011 Martin Decky
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup inputgen generic
+ * @brief Mouse protocol driver interface.
+ * @ingroup input
+ * @{
+ */
+/** @file
+ */
+
+#ifndef MOUSE_PROTO_H_
+#define MOUSE_PROTO_H_
+
+#include <mouse_port.h>
+
+struct mouse_dev;
+
+typedef struct mouse_proto_ops {
+	void (*parse)(sysarg_t);
+	int (*init)(struct mouse_dev *);
+} mouse_proto_ops_t;
+
+extern mouse_proto_ops_t adb_proto;
+extern mouse_proto_ops_t ps2_proto;
+extern mouse_proto_ops_t mousedev_proto;
+
+#endif
+
+/**
+ * @}
+ */
