Index: uspace/drv/bus/usb/usbhid/mouse/mousedev.c
===================================================================
--- uspace/drv/bus/usb/usbhid/mouse/mousedev.c	(revision edb3cf2f04d2b108284b32ca61af972d4d06ac35)
+++ uspace/drv/bus/usb/usbhid/mouse/mousedev.c	(revision 8989f2a774b615602212f33fc67b9072bc8d0cea)
@@ -52,7 +52,4 @@
 #include "../usbhid.h"
 
-/** Number of simulated arrow-key presses for singel wheel step. */
-#define ARROWS_PER_SINGLE_WHEEL 3
-
 #define NAME "mouse"
 
@@ -69,7 +66,5 @@
 
 const char *HID_MOUSE_FUN_NAME = "mouse";
-const char *HID_MOUSE_WHEEL_FUN_NAME = "mouse-wheel";
 const char *HID_MOUSE_CATEGORY = "mouse";
-const char *HID_MOUSE_WHEEL_CATEGORY = "keyboard";
 
 /** Default idle rate for mouses. */
@@ -126,15 +121,12 @@
 
 	usb_log_debug("%s: fun->name: %s\n", __FUNCTION__, fun->name);
-	usb_log_debug("%s: mouse_sess: %p, wheel_sess: %p\n",
-	    __FUNCTION__, mouse_dev->mouse_sess, mouse_dev->wheel_sess);
-
-	async_sess_t **sess_ptr = (fun == mouse_dev->mouse_fun) ?
-	    &mouse_dev->mouse_sess : &mouse_dev->wheel_sess;
+	usb_log_debug("%s: mouse_sess: %p\n",
+	    __FUNCTION__, mouse_dev->mouse_sess);
 
 	async_sess_t *sess =
 	    async_callback_receive_start(EXCHANGE_SERIALIZE, icall);
 	if (sess != NULL) {
-		if (*sess_ptr == NULL) {
-			*sess_ptr = sess;
+		if (mouse_dev->mouse_sess == NULL) {
+			mouse_dev->mouse_sess = sess;
 			usb_log_debug("Console session to %s set ok (%p).\n",
 			    fun->name, sess);
@@ -144,4 +136,5 @@
 			    fun->name);
 			async_answer_0(icallid, ELIMIT);
+			async_hangup(sess);
 		}
 	} else {
@@ -150,34 +143,5 @@
 	}
 }
-
-/*----------------------------------------------------------------------------*/
-#if 0
-static void usb_mouse_send_wheel(const usb_mouse_t *mouse_dev, int wheel)
-{
-	unsigned int key = (wheel > 0) ? KC_UP : KC_DOWN;
-
-	if (mouse_dev->wheel_sess == NULL) {
-		usb_log_warning(
-		    "Connection to console not ready, wheel roll discarded.\n");
-		return;
-	}
-
-	const unsigned count =
-	    ((wheel < 0) ? -wheel : wheel) * ARROWS_PER_SINGLE_WHEEL;
-	for (unsigned i = 0; i < count; i++) {
-		/* Send arrow press and release. */
-		usb_log_debug2("Sending key %d to the console\n", key);
-		
-		async_exch_t *exch = async_exchange_begin(mouse_dev->wheel_sess);
-		
-		async_msg_4(exch, KBDEV_EVENT, KEY_PRESS, key, 0, 0);
-		async_msg_4(exch, KBDEV_EVENT, KEY_RELEASE, key, 0, 0);
-		
-		async_exchange_end(exch);
-	}
-}
-#endif
-/*----------------------------------------------------------------------------*/
-
+/*----------------------------------------------------------------------------*/
 static int get_mouse_axis_move_value(uint8_t rid, usb_hid_report_t *report,
     int32_t usage)
@@ -203,5 +167,5 @@
 	return result;
 }
-
+/*----------------------------------------------------------------------------*/
 static bool usb_mouse_process_report(usb_hid_dev_t *hid_dev,
     usb_mouse_t *mouse_dev)
@@ -230,8 +194,5 @@
 		}
 	}
-#if 0
-	if (wheel != 0)
-		(void)usb_mouse_send_wheel(mouse_dev, wheel);
-#endif
+
 	/* Buttons */
 	usb_hid_report_path_t *path = usb_hid_report_path();
@@ -342,58 +303,7 @@
 	mouse->mouse_fun = fun;
 
-	/*
-	 * Special function for acting as keyboard (wheel)
-	 */
-	usb_log_debug("Creating DDF function %s...\n",
-	              HID_MOUSE_WHEEL_FUN_NAME);
-	fun = ddf_fun_create(hid_dev->usb_dev->ddf_dev, fun_exposed,
-	    HID_MOUSE_WHEEL_FUN_NAME);
-	if (fun == NULL) {
-		usb_log_error("Could not create DDF function node `%s'.\n",
-		    HID_MOUSE_WHEEL_FUN_NAME);
-		FUN_UNBIND_DESTROY(mouse->mouse_fun);
-		mouse->mouse_fun = NULL;
-		return ENOMEM;
-	}
-
-	/*
-	 * Store the initialized HID device and HID ops
-	 * to the DDF function.
-	 */
-	fun->ops = &mouse->ops;
-	fun->driver_data = mouse;
-
-	rc = ddf_fun_bind(fun);
-	if (rc != EOK) {
-		usb_log_error("Could not bind DDF function `%s': %s.\n",
-		    fun->name, str_error(rc));
-		FUN_UNBIND_DESTROY(mouse->mouse_fun);
-		mouse->mouse_fun = NULL;
-
-		fun->driver_data = NULL;
-		ddf_fun_destroy(fun);
-		return rc;
-	}
-
-	usb_log_debug("Adding DDF function to category %s...\n", 
-	    HID_MOUSE_WHEEL_CATEGORY);
-	rc = ddf_fun_add_to_category(fun, HID_MOUSE_WHEEL_CATEGORY);
-	if (rc != EOK) {
-		usb_log_error(
-		    "Could not add DDF function to category %s: %s.\n",
-		    HID_MOUSE_WHEEL_CATEGORY, str_error(rc));
-
-		FUN_UNBIND_DESTROY(mouse->mouse_fun);
-		mouse->mouse_fun = NULL;
-		FUN_UNBIND_DESTROY(fun);
-		return rc;
-	}
-	mouse->wheel_fun = fun;
-
 	return EOK;
 }
-
-/*----------------------------------------------------------------------------*/
-
+/*----------------------------------------------------------------------------*/
 /** Get highest index of a button mentioned in given report.
  *
@@ -517,13 +427,5 @@
 	}
 
-	if (mouse_dev->wheel_sess != NULL) {
-		const int ret = async_hangup(mouse_dev->wheel_sess);
-		if (ret != EOK)
-			usb_log_warning("Failed to hang up wheel session: "
-			    "%p, %s.\n", mouse_dev->wheel_sess, str_error(ret));
-	}
-
 	FUN_UNBIND_DESTROY(mouse_dev->mouse_fun);
-	FUN_UNBIND_DESTROY(mouse_dev->wheel_fun);
 
 	free(mouse_dev->buttons);
