Index: uspace/drv/ohci/batch.c
===================================================================
--- uspace/drv/ohci/batch.c	(revision 27b85d9ebdc66e9e29d0e2194cb70e62a1180a40)
+++ uspace/drv/ohci/batch.c	(revision a91fbb153d56de5c4095bc221b0982f9fe1e89be)
@@ -147,4 +147,5 @@
 	    data->ed->next);
 	size_t i = 0;
+	instance->transfered_size = instance->buffer_size;
 	for (; i < tds; ++i) {
 		assert(data->tds[i] != NULL);
@@ -156,6 +157,4 @@
 		}
 		instance->error = td_error(data->tds[i]);
-		/* FIXME: calculate real transfered size */
-		instance->transfered_size = instance->buffer_size;
 		if (instance->error != EOK) {
 			usb_log_debug("Batch(%p) found error TD(%d):%x.\n",
@@ -174,4 +173,7 @@
 	assert(hcd_ep);
 	hcd_ep->td = data->tds[i];
+	if (i > 0)
+		instance->transfered_size -= td_remain_size(data->tds[i - 1]);
+
 	/* Clear possible ED HALT */
 	data->ed->td_head &= ~ED_TDHEAD_HALTED_FLAG;
@@ -238,7 +240,9 @@
 {
 	assert(instance);
-	instance->next_step = usb_transfer_batch_call_in_and_dispose;
+	/* We are data out, we are supposed to provide data */
+	memcpy(instance->data_buffer, instance->buffer, instance->buffer_size);
+	instance->next_step = usb_transfer_batch_call_out_and_dispose;
 	batch_data(instance);
-	usb_log_debug("Batch(%p) BULK IN initialized.\n", instance);
+	usb_log_debug("Batch(%p) BULK OUT initialized.\n", instance);
 }
 /*----------------------------------------------------------------------------*/
Index: uspace/drv/ohci/hw_struct/transfer_descriptor.c
===================================================================
--- uspace/drv/ohci/hw_struct/transfer_descriptor.c	(revision 27b85d9ebdc66e9e29d0e2194cb70e62a1180a40)
+++ uspace/drv/ohci/hw_struct/transfer_descriptor.c	(revision a91fbb153d56de5c4095bc221b0982f9fe1e89be)
@@ -52,4 +52,7 @@
 		instance->status |= togg[toggle] << TD_STATUS_T_SHIFT;
 	}
+	if (dir == USB_DIRECTION_IN) {
+		instance->status |= TD_STATUS_ROUND_FLAG;
+	}
 	if (buffer != NULL) {
 		assert(size != 0);
Index: uspace/drv/ohci/hw_struct/transfer_descriptor.h
===================================================================
--- uspace/drv/ohci/hw_struct/transfer_descriptor.h	(revision 27b85d9ebdc66e9e29d0e2194cb70e62a1180a40)
+++ uspace/drv/ohci/hw_struct/transfer_descriptor.h	(revision a91fbb153d56de5c4095bc221b0982f9fe1e89be)
@@ -59,4 +59,5 @@
 #define TD_STATUS_T_0 (0x2)
 #define TD_STATUS_T_1 (0x3)
+#define TD_STATUS_T_ED (0)
 #define TD_STATUS_EC_MASK (0x3) /* error count */
 #define TD_STATUS_EC_SHIFT (26)
@@ -102,4 +103,12 @@
 	return cc_to_rc(cc);
 }
+
+static inline size_t td_remain_size(td_t *instance)
+{
+	assert(instance);
+	if (instance->cbp == 0)
+		return 0;
+	return instance->be - instance->cbp + 1;
+}
 #endif
 /**
Index: uspace/drv/ohci/root_hub.c
===================================================================
--- uspace/drv/ohci/root_hub.c	(revision 27b85d9ebdc66e9e29d0e2194cb70e62a1180a40)
+++ uspace/drv/ohci/root_hub.c	(revision a91fbb153d56de5c4095bc221b0982f9fe1e89be)
@@ -198,5 +198,8 @@
 static int process_ctrl_request(rh_t *instance, usb_transfer_batch_t *request);
 
-
+static int process_interrupt(rh_t *instance, usb_transfer_batch_t * request,
+    void * change_buffer, size_t buffe_size);
+
+static bool is_zeros(void * buffer, size_t size);
 
 
@@ -213,5 +216,5 @@
 	// set port power mode to no-power-switching
 	instance->registers->rh_desc_a |= RHDA_NPS_FLAG;
-
+	instance->unfinished_interrupt_transfer = NULL;
 	usb_log_info("OHCI root hub with %d ports.\n", instance->port_count);
 	return EOK;
@@ -233,16 +236,27 @@
 		usb_log_info("Root hub got CONTROL packet\n");
 		opResult = process_ctrl_request(instance, request);
+		usb_transfer_batch_finish_error(request, opResult);
 	} else if (request->ep->transfer_type == USB_TRANSFER_INTERRUPT) {
 		usb_log_info("Root hub got INTERRUPT packet\n");
 		void * buffer;
+		size_t buffer_size;
 		create_interrupt_mask(instance, &buffer,
-			&(request->transfered_size));
-		memcpy(request->data_buffer, buffer,
-			request->transfered_size);
+			&buffer_size);
+		if(is_zeros(buffer,buffer_size)){
+			usb_log_debug("no changes..");
+			instance->unfinished_interrupt_transfer=
+			    request;
+			//will be finished later
+		}else{
+			usb_log_debug("processing changes..");
+			process_interrupt(instance, request,
+			    buffer, buffer_size);
+		}
+		free(buffer);
 		opResult = EOK;
 	} else {
 		opResult = EINVAL;
-	}
-	usb_transfer_batch_finish_error(request, opResult);
+		usb_transfer_batch_finish_error(request, opResult);
+	}
 	return EOK;
 }
@@ -252,7 +266,16 @@
 
 void rh_interrupt(rh_t *instance) {
-	usb_log_info("Whoa whoa wait, I`m not supposed to receive any "
-		"interrupts, am I?\n");
-	/* TODO: implement? */
+	//usb_log_info("Whoa whoa wait, I`m not supposed to receive any "
+	//	"interrupts, am I?\n");
+	if(!instance->unfinished_interrupt_transfer){
+		return;
+	}
+	size_t size;
+	void * buffer;
+	create_interrupt_mask(instance, &buffer,
+			&size);
+	process_interrupt(instance,instance->unfinished_interrupt_transfer,
+	    buffer,size);
+	free(buffer);
 }
 /*----------------------------------------------------------------------------*/
@@ -859,4 +882,51 @@
 	return opResult;
 }
+/*----------------------------------------------------------------------------*/
+
+/**
+ * process hanging interrupt request
+ *
+ * If an interrupt transfer has been received and there was no change,
+ * the driver stores the transfer information and waits for change to occcur.
+ * This routine is called when that happens and it finalizes the interrupt
+ * transfer.
+ *
+ * @param instance hub instance
+ * @param request batch request to be processed
+ * @param change_buffer chages on hub
+ * @param buffer_size size of change buffer
+ *
+ * @return
+ */
+static int process_interrupt(rh_t *instance, usb_transfer_batch_t * request,
+    void * change_buffer, size_t buffe_size){
+	create_interrupt_mask(instance, &change_buffer,
+	    &(request->transfered_size));
+	memcpy(request->data_buffer, change_buffer,request->transfered_size);
+	instance->unfinished_interrupt_transfer = NULL;
+	usb_transfer_batch_finish_error(request, EOK);
+	return EOK;
+}
+
+/*----------------------------------------------------------------------------*/
+
+/**
+ * return whether the buffer is full of zeros
+ *
+ * Convenience function.
+ * @param buffer
+ * @param size
+ * @return
+ */
+static bool is_zeros(void * buffer, size_t size){
+	if(!buffer) return true;
+	if(!size) return true;
+	size_t i;
+	for(i=0;i<size;++i){
+		if(((char*)buffer)[i])
+			return false;
+	}
+	return true;
+}
 
 /**
Index: uspace/drv/ohci/root_hub.h
===================================================================
--- uspace/drv/ohci/root_hub.h	(revision 27b85d9ebdc66e9e29d0e2194cb70e62a1180a40)
+++ uspace/drv/ohci/root_hub.h	(revision a91fbb153d56de5c4095bc221b0982f9fe1e89be)
@@ -54,4 +54,6 @@
 	/** hubs descriptors */
 	usb_device_descriptors_t descriptors;
+	/** interrupt transfer waiting for an actual interrupt to occur */
+	usb_transfer_batch_t * unfinished_interrupt_transfer;
 } rh_t;
 
Index: uspace/drv/usbhid/Makefile
===================================================================
--- uspace/drv/usbhid/Makefile	(revision 27b85d9ebdc66e9e29d0e2194cb70e62a1180a40)
+++ uspace/drv/usbhid/Makefile	(revision a91fbb153d56de5c4095bc221b0982f9fe1e89be)
@@ -46,4 +46,5 @@
 	generic/hiddev.c \
 	mouse/mousedev.c \
+	lgtch-ultrax/lgtch-ultrax.c \
 	$(STOLEN_LAYOUT_SOURCES)
 
Index: uspace/drv/usbhid/kbd/kbddev.c
===================================================================
--- uspace/drv/usbhid/kbd/kbddev.c	(revision 27b85d9ebdc66e9e29d0e2194cb70e62a1180a40)
+++ uspace/drv/usbhid/kbd/kbddev.c	(revision a91fbb153d56de5c4095bc221b0982f9fe1e89be)
@@ -176,4 +176,13 @@
 
 /*----------------------------------------------------------------------------*/
+
+static void usb_kbd_process_keycodes(const uint8_t *key_codes, size_t count,
+    uint8_t report_id, void *arg);
+
+static const usb_hid_report_in_callbacks_t usb_kbd_parser_callbacks = {
+	.keyboard = usb_kbd_process_keycodes
+};
+
+/*----------------------------------------------------------------------------*/
 /* Keyboard layouts                                                           */
 /*----------------------------------------------------------------------------*/
@@ -630,10 +639,4 @@
 {
 	assert(hid_dev->parser != NULL);
-	
-	usb_hid_report_in_callbacks_t *callbacks =
-	    (usb_hid_report_in_callbacks_t *)malloc(
-	        sizeof(usb_hid_report_in_callbacks_t));
-	
-	callbacks->keyboard = usb_kbd_process_keycodes;
 
 	usb_log_debug("Calling usb_hid_parse_report() with "
@@ -644,10 +647,10 @@
 	usb_hid_report_path_t *path = usb_hid_report_path();
 	usb_hid_report_path_append_item(path, USB_HIDUT_PAGE_KEYBOARD, 0);
-	usb_hid_report_path_set_report_id(path, 0);
+	//usb_hid_report_path_set_report_id(path, 0);
 	
 	int rc = usb_hid_parse_report(hid_dev->parser, buffer,
 	    actual_size, path, 
 	    USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 
-	    callbacks, hid_dev);
+	    &usb_kbd_parser_callbacks, hid_dev);
 
 	usb_hid_report_path_free(path);
Index: uspace/drv/usbhid/lgtch-ultrax/lgtch-ultrax.c
===================================================================
--- uspace/drv/usbhid/lgtch-ultrax/lgtch-ultrax.c	(revision a91fbb153d56de5c4095bc221b0982f9fe1e89be)
+++ uspace/drv/usbhid/lgtch-ultrax/lgtch-ultrax.c	(revision a91fbb153d56de5c4095bc221b0982f9fe1e89be)
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2011 Lubos Slovak, Vojtech Horky
+ * 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 drvusbhid
+ * @{
+ */
+/**
+ * @file
+ * USB Logitech UltraX Keyboard sample driver.
+ */
+
+
+#include "lgtch-ultrax.h"
+#include "../usbhid.h"
+
+#include <usb/classes/hidparser.h>
+#include <usb/debug.h>
+#include <errno.h>
+#include <str_error.h>
+
+#define NAME "lgtch-ultrax"
+
+/*----------------------------------------------------------------------------*/
+
+static void usb_lgtch_process_keycodes(const uint8_t *key_codes, size_t count,
+    uint8_t report_id, void *arg);
+
+static const usb_hid_report_in_callbacks_t usb_lgtch_parser_callbacks = {
+	.keyboard = usb_lgtch_process_keycodes
+};
+
+/*----------------------------------------------------------------------------*/
+
+static void usb_lgtch_process_keycodes(const uint8_t *key_codes, size_t count,
+    uint8_t report_id, void *arg)
+{
+	// TODO: checks
+	
+	usb_log_debug(NAME " Got keys from parser (report id: %u): %s\n", 
+	    report_id, usb_debug_str_buffer(key_codes, count, 0));
+}
+
+/*----------------------------------------------------------------------------*/
+
+bool usb_lgtch_polling_callback(struct usb_hid_dev *hid_dev, 
+    uint8_t *buffer, size_t buffer_size)
+{
+	// TODO: checks
+	
+	usb_log_debug(NAME " usb_lgtch_polling_callback(%p, %p, %zu)\n",
+	    hid_dev, buffer, buffer_size);
+
+	usb_log_debug(NAME " Calling usb_hid_parse_report() with "
+	    "buffer %s\n", usb_debug_str_buffer(buffer, buffer_size, 0));
+	
+	usb_hid_report_path_t *path = usb_hid_report_path();
+	usb_hid_report_path_append_item(path, 0xc, 0);
+	usb_hid_report_path_set_report_id(path, 1);
+	
+	int rc = usb_hid_parse_report(hid_dev->parser, buffer,
+	    buffer_size, path, 
+	    USB_HID_PATH_COMPARE_END | USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY, 
+	    &usb_lgtch_parser_callbacks, hid_dev);
+
+	usb_hid_report_path_free(path);
+	
+	if (rc != EOK) {
+		usb_log_warning("Error in usb_hid_boot_keyboard_input_report():"
+		    "%s\n", str_error(rc));
+	}
+	
+	return true;
+}
+
+/**
+ * @}
+ */
Index: uspace/drv/usbhid/lgtch-ultrax/lgtch-ultrax.h
===================================================================
--- uspace/drv/usbhid/lgtch-ultrax/lgtch-ultrax.h	(revision a91fbb153d56de5c4095bc221b0982f9fe1e89be)
+++ uspace/drv/usbhid/lgtch-ultrax/lgtch-ultrax.h	(revision a91fbb153d56de5c4095bc221b0982f9fe1e89be)
@@ -0,0 +1,61 @@
+/*
+ * Copyright (c) 2011 Lubos Slovak
+ * 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 drvusbhid
+ * @{
+ */
+/** @file
+ * USB Logitech UltraX Keyboard sample driver.
+ */
+
+#ifndef USB_HID_LGTCH_ULTRAX_H_
+#define USB_HID_LGTCH_ULTRAX_H_
+
+#include <usb/devdrv.h>
+
+struct usb_hid_dev;
+//struct usb_hid_subdriver_mapping;
+
+/*----------------------------------------------------------------------------*/
+
+//extern struct usb_hid_subdriver_mapping usb_lgtch_mapping;
+
+/*----------------------------------------------------------------------------*/
+
+//int usb_lgtch_init(struct usb_hid_dev *hid_dev);
+
+bool usb_lgtch_polling_callback(struct usb_hid_dev *hid_dev, uint8_t *buffer,
+    size_t buffer_size);
+
+/*----------------------------------------------------------------------------*/
+
+#endif // USB_HID_LGTCH_ULTRAX_H_
+
+/**
+ * @}
+ */
Index: uspace/drv/usbhid/main.c
===================================================================
--- uspace/drv/usbhid/main.c	(revision 27b85d9ebdc66e9e29d0e2194cb70e62a1180a40)
+++ uspace/drv/usbhid/main.c	(revision a91fbb153d56de5c4095bc221b0982f9fe1e89be)
@@ -75,4 +75,6 @@
 static int usb_hid_try_add_device(usb_device_t *dev)
 {
+	assert(dev != NULL);
+	
 	/* 
 	 * Initialize device (get and process descriptors, get address, etc.)
@@ -178,4 +180,9 @@
 	usb_log_debug("usb_hid_add_device()\n");
 	
+	if (dev == NULL) {
+		usb_log_warning("Wrong parameter given for add_device().\n");
+		return EINVAL;
+	}
+	
 	if (dev->interface_no < 0) {
 		usb_log_warning("Device is not a supported HID device.\n");
Index: uspace/drv/usbhid/mouse/mousedev.c
===================================================================
--- uspace/drv/usbhid/mouse/mousedev.c	(revision 27b85d9ebdc66e9e29d0e2194cb70e62a1180a40)
+++ uspace/drv/usbhid/mouse/mousedev.c	(revision a91fbb153d56de5c4095bc221b0982f9fe1e89be)
@@ -157,10 +157,10 @@
 static void usb_mouse_free(usb_mouse_t **mouse_dev)
 {
-	if (mouse_dev == NULL || *mouse_dev == NULL) {
-		return;
-	}
+	assert(mouse_dev != NULL && *mouse_dev != NULL);
 	
 	// hangup phone to the console
-	async_hangup((*mouse_dev)->console_phone);
+	if ((*mouse_dev)->console_phone >= 0) {
+		async_hangup((*mouse_dev)->console_phone);
+	}
 	
 	free(*mouse_dev);
Index: uspace/drv/usbhid/subdrivers.c
===================================================================
--- uspace/drv/usbhid/subdrivers.c	(revision 27b85d9ebdc66e9e29d0e2194cb70e62a1180a40)
+++ uspace/drv/usbhid/subdrivers.c	(revision a91fbb153d56de5c4095bc221b0982f9fe1e89be)
@@ -37,23 +37,47 @@
 #include "usb/classes/hidut.h"
 
-static usb_hid_subdriver_usage_t path_kbd[] = {{USB_HIDUT_PAGE_KEYBOARD, 0}};
+#include "lgtch-ultrax/lgtch-ultrax.h"
+
+static usb_hid_subdriver_usage_t path_kbd[] = {
+	{USB_HIDUT_PAGE_KEYBOARD, 0}, 
+	{0, 0}
+};
+
+static usb_hid_subdriver_usage_t lgtch_path[] = {
+	{0xc, 0},
+	{0, 0}
+};
 
 const usb_hid_subdriver_mapping_t usb_hid_subdrivers[] = {
 	{
 		path_kbd,
+		-1,
+		USB_HID_PATH_COMPARE_END 
+		| USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
+		0,
+		0,
+		{
+			.init = usb_kbd_init,
+			.deinit = usb_kbd_deinit,
+			.poll = usb_kbd_polling_callback,
+			.poll_end = NULL
+		},
+		
+	},
+	{
+		lgtch_path,
 		1,
 		USB_HID_PATH_COMPARE_END 
 		| USB_HID_PATH_COMPARE_USAGE_PAGE_ONLY,
-		NULL,
-		NULL,
+		0x046d,
+		0xc30e,
 		{
-			usb_kbd_init,
-			usb_kbd_deinit,
-			usb_kbd_polling_callback,
-			NULL
-		},
-		
+			.init = NULL,
+			.deinit = NULL,
+			.poll = usb_lgtch_polling_callback,
+			.poll_end = NULL
+		}
 	},
-	{NULL, 0, 0, NULL, NULL, {NULL, NULL, NULL, NULL}}
+	{NULL, -1, 0, 0, 0, {NULL, NULL, NULL, NULL}}
 };
 
Index: uspace/drv/usbhid/subdrivers.h
===================================================================
--- uspace/drv/usbhid/subdrivers.h	(revision 27b85d9ebdc66e9e29d0e2194cb70e62a1180a40)
+++ uspace/drv/usbhid/subdrivers.h	(revision a91fbb153d56de5c4095bc221b0982f9fe1e89be)
@@ -54,8 +54,8 @@
 typedef struct usb_hid_subdriver_mapping {
 	const usb_hid_subdriver_usage_t *usage_path;
-	int path_size;
+	int report_id;
 	int compare;
-	const char *vendor_id;
-	const char *product_id;
+	uint16_t vendor_id;
+	uint16_t product_id;
 	usb_hid_subdriver_t subdriver;
 } usb_hid_subdriver_mapping_t;
Index: uspace/drv/usbhid/usbhid.c
===================================================================
--- uspace/drv/usbhid/usbhid.c	(revision 27b85d9ebdc66e9e29d0e2194cb70e62a1180a40)
+++ uspace/drv/usbhid/usbhid.c	(revision a91fbb153d56de5c4095bc221b0982f9fe1e89be)
@@ -67,5 +67,5 @@
 static int usb_hid_set_boot_kbd_subdriver(usb_hid_dev_t *hid_dev)
 {
-	assert(hid_dev->subdriver_count == 0);
+	assert(hid_dev != NULL && hid_dev->subdriver_count == 0);
 	
 	hid_dev->subdrivers = (usb_hid_subdriver_t *)malloc(
@@ -97,5 +97,5 @@
 static int usb_hid_set_boot_mouse_subdriver(usb_hid_dev_t *hid_dev)
 {
-	assert(hid_dev->subdriver_count == 0);
+	assert(hid_dev != NULL && hid_dev->subdriver_count == 0);
 	
 	hid_dev->subdrivers = (usb_hid_subdriver_t *)malloc(
@@ -127,5 +127,5 @@
 static int usb_hid_set_generic_hid_subdriver(usb_hid_dev_t *hid_dev)
 {
-	assert(hid_dev->subdriver_count == 0);
+	assert(hid_dev != NULL && hid_dev->subdriver_count == 0);
 	
 	hid_dev->subdrivers = (usb_hid_subdriver_t *)malloc(
@@ -164,8 +164,8 @@
 
 static bool usb_hid_path_matches(usb_hid_dev_t *hid_dev, 
-    const usb_hid_subdriver_usage_t *path, int path_size, int compare)
+    const usb_hid_subdriver_mapping_t *mapping)
 {
 	assert(hid_dev != NULL);
-	assert(path != NULL);
+	assert(mapping != NULL);
 	
 	usb_hid_report_path_t *usage_path = usb_hid_report_path();
@@ -174,19 +174,27 @@
 		return false;
 	}
-	int i;
-	for (i = 0; i < path_size; ++i) {
+	int i = 0;
+	while (mapping->usage_path[i].usage != 0 
+	    || mapping->usage_path[i].usage_page != 0) {
 		if (usb_hid_report_path_append_item(usage_path, 
-		    path[i].usage_page, path[i].usage) != EOK) {
+		    mapping->usage_path[i].usage_page, 
+		    mapping->usage_path[i].usage) != EOK) {
 			usb_log_debug("Failed to append to usage path.\n");
 			usb_hid_report_path_free(usage_path);
 			return false;
 		}
+		++i;
+	}
+	
+	if (mapping->report_id >= 0) {
+		usb_hid_report_path_set_report_id(usage_path, 
+		    mapping->report_id);
 	}
 	
 	assert(hid_dev->parser != NULL);
 	
-	usb_log_debug("Compare flags: %d\n", compare);
+	usb_log_debug("Compare flags: %d\n", mapping->compare);
 	size_t size = usb_hid_report_input_length(hid_dev->parser, usage_path, 
-	    compare);
+	    mapping->compare);
 	usb_log_debug("Size of the input report: %d\n", size);
 	
@@ -231,35 +239,40 @@
 static int usb_hid_find_subdrivers(usb_hid_dev_t *hid_dev)
 {
+	assert(hid_dev != NULL);
+	
 	const usb_hid_subdriver_t *subdrivers[USB_HID_MAX_SUBDRIVERS];
 	
 	int i = 0, count = 0;
 	const usb_hid_subdriver_mapping_t *mapping = &usb_hid_subdrivers[i];
+
+	bool ids_matched;
+	bool matched;
 	
 	while (count < USB_HID_MAX_SUBDRIVERS &&
 	    (mapping->usage_path != NULL
-	    || mapping->vendor_id != NULL
-	    || mapping->product_id != NULL)) {
+	    || mapping->vendor_id != 0 || mapping->product_id != 0)) {
 		// check the vendor & product ID
-		if (mapping->vendor_id != NULL && mapping->product_id == NULL) {
-			usb_log_warning("Missing Product ID for Vendor ID %s\n",
+		if (mapping->vendor_id != 0 && mapping->product_id == 0) {
+			usb_log_warning("Missing Product ID for Vendor ID %u\n",
 			    mapping->vendor_id);
 			return EINVAL;
 		}
-		if (mapping->product_id != NULL && mapping->vendor_id == NULL) {
-			usb_log_warning("Missing Vendor ID for Product ID %s\n",
+		if (mapping->product_id != 0 && mapping->vendor_id == 0) {
+			usb_log_warning("Missing Vendor ID for Product ID %u\n",
 			    mapping->product_id);
 			return EINVAL;
 		}
 		
-		if (mapping->vendor_id != NULL) {
-			assert(mapping->product_id != NULL);
-			usb_log_debug("Comparing device against vendor ID %s"
-			    " and product ID %s.\n", mapping->vendor_id,
+		ids_matched = false;
+		matched = false;
+		
+		if (mapping->vendor_id != 0) {
+			assert(mapping->product_id != 0);
+			usb_log_debug("Comparing device against vendor ID %u"
+			    " and product ID %u.\n", mapping->vendor_id,
 			    mapping->product_id);
 			if (usb_hid_ids_match(hid_dev, mapping)) {
-				usb_log_debug("Matched.\n");
-				subdrivers[count++] = &mapping->subdriver;
-				// skip the checking of usage path
-				goto next;
+				usb_log_debug("IDs matched.\n");
+				ids_matched = true;
 			}
 		}
@@ -267,13 +280,17 @@
 		if (mapping->usage_path != NULL) {
 			usb_log_debug("Comparing device against usage path.\n");
-			if (usb_hid_path_matches(hid_dev, 
-			    mapping->usage_path, mapping->path_size,
-			    mapping->compare)) {
-				subdrivers[count++] = &mapping->subdriver;
-			} else {
-				usb_log_debug("Not matched.\n");
+			if (usb_hid_path_matches(hid_dev, mapping)) {
+				// does not matter if IDs were matched
+				matched = true;
 			}
-		}
-	next:
+		} else {
+			// matched only if IDs were matched and there is no path
+			matched = ids_matched;
+		}
+		
+		if (matched) {
+			subdrivers[count++] = &mapping->subdriver;
+		}
+		
 		mapping = &usb_hid_subdrivers[++i];
 	}
@@ -287,4 +304,6 @@
 static int usb_hid_check_pipes(usb_hid_dev_t *hid_dev, usb_device_t *dev)
 {
+	assert(hid_dev != NULL && dev != NULL);
+	
 	int rc = EOK;
 	
@@ -360,5 +379,5 @@
 	rc = usb_hid_check_pipes(hid_dev, dev);
 	if (rc != EOK) {
-		usb_hid_free(&hid_dev);
+		//usb_hid_free(&hid_dev);
 		return rc;
 	}
@@ -368,5 +387,5 @@
 	if (rc != EOK) {
 		usb_log_error("Failed to initialize report parser.\n");
-		usb_hid_free(&hid_dev);
+		//usb_hid_free(&hid_dev);
 		return rc;
 	}
@@ -386,4 +405,6 @@
 			    " device.\n");
 			fallback = true;
+			assert(hid_dev->subdrivers == NULL);
+			assert(hid_dev->subdriver_count == 0);
 		}
 	} else {
@@ -426,5 +447,7 @@
 		usb_log_error("No subdriver for handling this device could be"
 		    " initialized: %s.\n", str_error(rc));
-		usb_hid_free(&hid_dev);
+		usb_log_debug("Subdriver count: %d\n", 
+		    hid_dev->subdriver_count);
+		//usb_hid_free(&hid_dev);
 	} else {
 		bool ok = false;
@@ -550,4 +573,7 @@
 	}
 	
+	usb_log_debug("Subdrivers: %p, subdriver count: %d\n", 
+	    (*hid_dev)->subdrivers, (*hid_dev)->subdriver_count);
+	
 	assert((*hid_dev)->subdrivers != NULL 
 	    || (*hid_dev)->subdriver_count == 0);
Index: uspace/drv/usbhub/usbhub.c
===================================================================
--- uspace/drv/usbhub/usbhub.c	(revision 27b85d9ebdc66e9e29d0e2194cb70e62a1180a40)
+++ uspace/drv/usbhub/usbhub.c	(revision a91fbb153d56de5c4095bc221b0982f9fe1e89be)
@@ -105,5 +105,5 @@
 	}
 
-	usb_pipe_start_session(hub_info->control_pipe);
+	//usb_pipe_start_session(hub_info->control_pipe);
 	//set hub configuration
 	opResult = usb_hub_set_configuration(hub_info);
@@ -122,8 +122,8 @@
 		return opResult;
 	}
-	usb_pipe_end_session(hub_info->control_pipe);
-
-	/// \TODO what is this?
-	usb_log_debug("Creating `hub' function.\n");
+	//usb_pipe_end_session(hub_info->control_pipe);
+
+
+	usb_log_debug("Creating 'hub' function in DDF.\n");
 	ddf_fun_t *hub_fun = ddf_fun_create(hub_info->usb_device->ddf_dev,
 	    fun_exposed, "hub");
@@ -153,4 +153,5 @@
 bool hub_port_changes_callback(usb_device_t *dev,
     uint8_t *change_bitmap, size_t change_bitmap_size, void *arg) {
+	usb_log_debug("hub_port_changes_callback\n");
 	usb_hub_info_t *hub = (usb_hub_info_t *) arg;
 
@@ -217,5 +218,6 @@
 	// get hub descriptor
 	usb_log_debug("creating serialized descriptor\n");
-	void * serialized_descriptor = malloc(USB_HUB_MAX_DESCRIPTOR_SIZE);
+	//void * serialized_descriptor = malloc(USB_HUB_MAX_DESCRIPTOR_SIZE);
+	uint8_t serialized_descriptor[USB_HUB_MAX_DESCRIPTOR_SIZE];
 	usb_hub_descriptor_t * descriptor;
 	int opResult;
@@ -235,12 +237,17 @@
 	}
 	usb_log_debug2("deserializing descriptor\n");
-	descriptor = usb_deserialize_hub_desriptor(serialized_descriptor);
+	descriptor = usb_create_deserialized_hub_desriptor(
+	    serialized_descriptor);
 	if (descriptor == NULL) {
 		usb_log_warning("could not deserialize descriptor \n");
-		return opResult;
+		return ENOMEM;
 	}
 	usb_log_debug("setting port count to %d\n", descriptor->ports_count);
 	hub_info->port_count = descriptor->ports_count;
 	/// \TODO this is not semantically correct
+	bool is_power_switched =
+	    ((descriptor->hub_characteristics & 1) ==0);
+	bool has_individual_port_powering =
+	    ((descriptor->hub_characteristics & 1) !=0);
 	hub_info->ports = malloc(
 	    sizeof (usb_hub_port_t) * (hub_info->port_count + 1));
@@ -249,15 +256,31 @@
 		usb_hub_port_init(&hub_info->ports[port]);
 	}
-	for (port = 0; port < hub_info->port_count; port++) {
-		opResult = usb_hub_set_port_feature(hub_info->control_pipe,
-		    port+1, USB_HUB_FEATURE_PORT_POWER);
-		if (opResult != EOK) {
-			usb_log_error("cannot power on port %d;  %d\n",
-			    port+1, opResult);
-		}
+	if(is_power_switched){
+		usb_log_debug("is_power_switched\n");
+		if(has_individual_port_powering){
+			usb_log_debug("has_individual_port_powering\n");
+			for (port = 0; port < hub_info->port_count; port++) {
+				opResult = usb_hub_set_port_feature(hub_info->control_pipe,
+				    port+1, USB_HUB_FEATURE_PORT_POWER);
+				if (opResult != EOK) {
+					usb_log_error("cannot power on port %d;  %d\n",
+					    port+1, opResult);
+				}
+			}
+		}else{
+			usb_log_debug("!has_individual_port_powering\n");
+			opResult = usb_hub_set_feature(hub_info->control_pipe,
+			    USB_HUB_FEATURE_C_HUB_LOCAL_POWER);
+			if (opResult != EOK) {
+				usb_log_error("cannot power hub;  %d\n",
+				  opResult);
+			}
+		}
+	}else{
+		usb_log_debug("!is_power_switched\n");
 	}
 	usb_log_debug2("freeing data\n");
-	free(serialized_descriptor);
-	free(descriptor->devices_removable);
+	//free(serialized_descriptor);
+	//free(descriptor->devices_removable);
 	free(descriptor);
 	return EOK;
@@ -321,13 +344,7 @@
 	 * auto destruction, this could work better.
 	 */
-	int rc = usb_pipe_start_session(hub_info->control_pipe);
+	int rc = usb_hc_connection_open(&hub_info->connection);
 	if (rc != EOK) {
-		usb_log_error("Failed to start session on control pipe: %s.\n",
-		    str_error(rc));
-		return rc;
-	}
-	rc = usb_hc_connection_open(&hub_info->connection);
-	if (rc != EOK) {
-		usb_pipe_end_session(hub_info->control_pipe);
+		//usb_pipe_end_session(hub_info->control_pipe);
 		usb_log_error("Failed to open connection to HC: %s.\n",
 		    str_error(rc));
Index: uspace/drv/usbhub/usbhub_private.h
===================================================================
--- uspace/drv/usbhub/usbhub_private.h	(revision 27b85d9ebdc66e9e29d0e2194cb70e62a1180a40)
+++ uspace/drv/usbhub/usbhub_private.h	(revision a91fbb153d56de5c4095bc221b0982f9fe1e89be)
@@ -113,5 +113,5 @@
 
 	usb_device_request_setup_packet_t clear_request = {
-		.request_type = USB_HUB_REQ_TYPE_CLEAR_PORT_FEATURE,
+		.request_type = USB_HUB_REQ_TYPE_SET_PORT_FEATURE,
 		.request = USB_DEVREQ_SET_FEATURE,
 		.length = 0,
@@ -166,22 +166,15 @@
 }
 
-/**
- * create uint8_t array with serialized descriptor
- *
- * @param descriptor
- * @return newly created serializd descriptor pointer
- */
-void * usb_serialize_hub_descriptor(usb_hub_descriptor_t * descriptor);
 
-/**
- * create deserialized desriptor structure out of serialized descriptor
- *
- * The serialized descriptor must be proper usb hub descriptor,
- * otherwise an eerror might occur.
- *
- * @param sdescriptor serialized descriptor
- * @return newly created deserialized descriptor pointer
- */
-usb_hub_descriptor_t * usb_deserialize_hub_desriptor(void * sdescriptor);
+void * usb_create_serialized_hub_descriptor(usb_hub_descriptor_t * descriptor);
+
+void usb_serialize_hub_descriptor(usb_hub_descriptor_t * descriptor,
+    void * serialized_descriptor);
+
+usb_hub_descriptor_t * usb_create_deserialized_hub_desriptor(
+    void * serialized_descriptor);
+
+void usb_deserialize_hub_desriptor(void * serialized_descriptor,
+    usb_hub_descriptor_t * descriptor);
 
 
Index: uspace/drv/usbhub/utils.c
===================================================================
--- uspace/drv/usbhub/utils.c	(revision 27b85d9ebdc66e9e29d0e2194cb70e62a1180a40)
+++ uspace/drv/usbhub/utils.c	(revision a91fbb153d56de5c4095bc221b0982f9fe1e89be)
@@ -56,5 +56,11 @@
 //hub descriptor utils
 
-void * usb_serialize_hub_descriptor(usb_hub_descriptor_t * descriptor) {
+/**
+ * create uint8_t array with serialized descriptor
+ *
+ * @param descriptor
+ * @return newly created serializd descriptor pointer
+ */
+void * usb_create_serialized_hub_descriptor(usb_hub_descriptor_t * descriptor) {
 	//base size
 	size_t size = 7;
@@ -64,25 +70,55 @@
 	uint8_t * result = malloc(size);
 	//size
-	result[0] = size;
+	if(result)
+		usb_serialize_hub_descriptor(descriptor,result);
+	return result;
+}
+
+/**
+ * serialize descriptor into given buffer
+ *
+ * The buffer size is not checked.
+ * @param descriptor
+ * @param serialized_descriptor
+ */
+void usb_serialize_hub_descriptor(usb_hub_descriptor_t * descriptor,
+    void * serialized_descriptor) {
+	//base size
+	uint8_t * sdescriptor = serialized_descriptor;
+	size_t size = 7;
+	//variable size according to port count
+	size_t var_size = (descriptor->ports_count+7)/8;
+	size += 2 * var_size;
+	//size
+	sdescriptor[0] = size;
 	//descriptor type
-	result[1] = USB_DESCTYPE_HUB;
-	result[2] = descriptor->ports_count;
+	sdescriptor[1] = USB_DESCTYPE_HUB;
+	sdescriptor[2] = descriptor->ports_count;
 	/// @fixme handling of endianness??
-	result[3] = descriptor->hub_characteristics / 256;
-	result[4] = descriptor->hub_characteristics % 256;
-	result[5] = descriptor->pwr_on_2_good_time;
-	result[6] = descriptor->current_requirement;
+	sdescriptor[3] = descriptor->hub_characteristics / 256;
+	sdescriptor[4] = descriptor->hub_characteristics % 256;
+	sdescriptor[5] = descriptor->pwr_on_2_good_time;
+	sdescriptor[6] = descriptor->current_requirement;
 
 	size_t i;
 	for (i = 0; i < var_size; ++i) {
-		result[7 + i] = descriptor->devices_removable[i];
+		sdescriptor[7 + i] = descriptor->devices_removable[i];
 	}
 	for (i = 0; i < var_size; ++i) {
-		result[7 + var_size + i] = 255;
+		sdescriptor[7 + var_size + i] = 255;
 	}
-	return result;
 }
 
-usb_hub_descriptor_t * usb_deserialize_hub_desriptor(
+
+/**
+ * create deserialized desriptor structure out of serialized descriptor
+ *
+ * The serialized descriptor must be proper usb hub descriptor,
+ * otherwise an eerror might occur.
+ *
+ * @param sdescriptor serialized descriptor
+ * @return newly created deserialized descriptor pointer
+ */
+usb_hub_descriptor_t * usb_create_deserialized_hub_desriptor(
 void * serialized_descriptor) {
 	uint8_t * sdescriptor = serialized_descriptor;
@@ -95,22 +131,32 @@
 
 	usb_hub_descriptor_t * result = malloc(sizeof(usb_hub_descriptor_t));
-	
+	if(result)
+		usb_deserialize_hub_desriptor(serialized_descriptor,result);
+	return result;
+}
 
-	result->ports_count = sdescriptor[2];
+/**
+ * deserialize descriptor into given pointer
+ * 
+ * @param serialized_descriptor
+ * @param descriptor
+ * @return
+ */
+void usb_deserialize_hub_desriptor(
+void * serialized_descriptor, usb_hub_descriptor_t * descriptor) {
+	uint8_t * sdescriptor = serialized_descriptor;
+	descriptor->ports_count = sdescriptor[2];
 	/// @fixme handling of endianness??
-	result->hub_characteristics = sdescriptor[4] + 256 * sdescriptor[3];
-	result->pwr_on_2_good_time = sdescriptor[5];
-	result->current_requirement = sdescriptor[6];
-	size_t var_size = (result->ports_count+7) / 8;
-	result->devices_removable = (uint8_t*) malloc(var_size);
+	descriptor->hub_characteristics = sdescriptor[4] + 256 * sdescriptor[3];
+	descriptor->pwr_on_2_good_time = sdescriptor[5];
+	descriptor->current_requirement = sdescriptor[6];
+	size_t var_size = (descriptor->ports_count+7) / 8;
+	//descriptor->devices_removable = (uint8_t*) malloc(var_size);
 
 	size_t i;
 	for (i = 0; i < var_size; ++i) {
-		result->devices_removable[i] = sdescriptor[7 + i];
+		descriptor->devices_removable[i] = sdescriptor[7 + i];
 	}
-	return result;
 }
-
-
 
 /**
Index: uspace/lib/usb/include/usb/classes/hub.h
===================================================================
--- uspace/lib/usb/include/usb/classes/hub.h	(revision 27b85d9ebdc66e9e29d0e2194cb70e62a1180a40)
+++ uspace/lib/usb/include/usb/classes/hub.h	(revision a91fbb153d56de5c4095bc221b0982f9fe1e89be)
@@ -152,5 +152,5 @@
             maximum of 255 ports).
      */
-    uint8_t * devices_removable;
+    uint8_t devices_removable[32];
 
     /**
Index: uspace/lib/usb/src/hidreport.c
===================================================================
--- uspace/lib/usb/src/hidreport.c	(revision 27b85d9ebdc66e9e29d0e2194cb70e62a1180a40)
+++ uspace/lib/usb/src/hidreport.c	(revision a91fbb153d56de5c4095bc221b0982f9fe1e89be)
@@ -119,14 +119,4 @@
 	uint16_t length =  hid_desc->report_desc_info.length;
 	size_t actual_size = 0;
-	
-	/*
-	 * Start session for the control transfer.
-	 */
-	int sess_rc = usb_pipe_start_session(&dev->ctrl_pipe);
-	if (sess_rc != EOK) {
-		usb_log_warning("Failed to start a session: %s.\n",
-		    str_error(sess_rc));
-		return sess_rc;
-	}
 
 	/*
@@ -162,16 +152,4 @@
 		    "%u)\n", actual_size, length);
 		return EINVAL;
-	}
-	
-	/*
-	 * End session for the control transfer.
-	 */
-	sess_rc = usb_pipe_end_session(&dev->ctrl_pipe);
-	if (sess_rc != EOK) {
-		usb_log_warning("Failed to end a session: %s.\n",
-		    str_error(sess_rc));
-		free(*report_desc);
-		*report_desc = NULL;
-		return sess_rc;
 	}
 	
Index: uspace/lib/usb/src/hidreq.c
===================================================================
--- uspace/lib/usb/src/hidreq.c	(revision 27b85d9ebdc66e9e29d0e2194cb70e62a1180a40)
+++ uspace/lib/usb/src/hidreq.c	(revision a91fbb153d56de5c4095bc221b0982f9fe1e89be)
@@ -56,7 +56,5 @@
  * @retval EOK if successful.
  * @retval EINVAL if no HID device is given.
- * @return Other value inherited from one of functions 
- *         usb_pipe_start_session(), usb_pipe_end_session(),
- *         usb_control_request_set().
+ * @return Other value inherited from function usb_control_request_set().
  */
 int usbhid_req_set_report(usb_pipe_t *ctrl_pipe, int iface_no,
@@ -79,12 +77,5 @@
 	 */
 	
-	int rc, sess_rc;
-	
-	sess_rc = usb_pipe_start_session(ctrl_pipe);
-	if (sess_rc != EOK) {
-		usb_log_warning("Failed to start a session: %s.\n",
-		    str_error(sess_rc));
-		return sess_rc;
-	}
+	int rc;
 	
 	uint16_t value = 0;
@@ -97,16 +88,8 @@
 	    USB_HIDREQ_SET_REPORT, value, iface_no, buffer, buf_size);
 
-	sess_rc = usb_pipe_end_session(ctrl_pipe);
-
-	if (rc != EOK) {
-		usb_log_warning("Error sending output report to the keyboard: "
-		    "%s.\n", str_error(rc));
-		return rc;
-	}
-
-	if (sess_rc != EOK) {
-		usb_log_warning("Error closing session: %s.\n",
-		    str_error(sess_rc));
-		return sess_rc;
+	if (rc != EOK) {
+		usb_log_warning("Error sending output report to the keyboard: "
+		    "%s.\n", str_error(rc));
+		return rc;
 	}
 	
@@ -123,7 +106,5 @@
  * @retval EOK if successful.
  * @retval EINVAL if no HID device is given.
- * @return Other value inherited from one of functions 
- *         usb_pipe_start_session(), usb_pipe_end_session(),
- *         usb_control_request_set().
+ * @return Other value inherited from function usb_control_request_set().
  */
 int usbhid_req_set_protocol(usb_pipe_t *ctrl_pipe, int iface_no,
@@ -146,12 +127,5 @@
 	 */
 	
-	int rc, sess_rc;
-	
-	sess_rc = usb_pipe_start_session(ctrl_pipe);
-	if (sess_rc != EOK) {
-		usb_log_warning("Failed to start a session: %s.\n",
-		    str_error(sess_rc));
-		return sess_rc;
-	}
+	int rc;
 
 	usb_log_debug("Sending Set_Protocol request to the device ("
@@ -162,16 +136,8 @@
 	    USB_HIDREQ_SET_PROTOCOL, protocol, iface_no, NULL, 0);
 
-	sess_rc = usb_pipe_end_session(ctrl_pipe);
-
-	if (rc != EOK) {
-		usb_log_warning("Error sending output report to the keyboard: "
-		    "%s.\n", str_error(rc));
-		return rc;
-	}
-
-	if (sess_rc != EOK) {
-		usb_log_warning("Error closing session: %s.\n",
-		    str_error(sess_rc));
-		return sess_rc;
+	if (rc != EOK) {
+		usb_log_warning("Error sending output report to the keyboard: "
+		    "%s.\n", str_error(rc));
+		return rc;
 	}
 	
@@ -189,7 +155,5 @@
  * @retval EOK if successful.
  * @retval EINVAL if no HID device is given.
- * @return Other value inherited from one of functions 
- *         usb_pipe_start_session(), usb_pipe_end_session(),
- *         usb_control_request_set().
+ * @return Other value inherited from function usb_control_request_set().
  */
 int usbhid_req_set_idle(usb_pipe_t *ctrl_pipe, int iface_no, uint8_t duration)
@@ -211,12 +175,5 @@
 	 */
 	
-	int rc, sess_rc;
-	
-	sess_rc = usb_pipe_start_session(ctrl_pipe);
-	if (sess_rc != EOK) {
-		usb_log_warning("Failed to start a session: %s.\n",
-		    str_error(sess_rc));
-		return sess_rc;
-	}
+	int rc;
 
 	usb_log_debug("Sending Set_Idle request to the device ("
@@ -229,16 +186,8 @@
 	    USB_HIDREQ_SET_IDLE, value, iface_no, NULL, 0);
 
-	sess_rc = usb_pipe_end_session(ctrl_pipe);
-
-	if (rc != EOK) {
-		usb_log_warning("Error sending output report to the keyboard: "
-		    "%s.\n", str_error(rc));
-		return rc;
-	}
-
-	if (sess_rc != EOK) {
-		usb_log_warning("Error closing session: %s.\n",
-		    str_error(sess_rc));
-		return sess_rc;
+	if (rc != EOK) {
+		usb_log_warning("Error sending output report to the keyboard: "
+		    "%s.\n", str_error(rc));
+		return rc;
 	}
 	
@@ -259,7 +208,5 @@
  * @retval EOK if successful.
  * @retval EINVAL if no HID device is given.
- * @return Other value inherited from one of functions 
- *         usb_pipe_start_session(), usb_pipe_end_session(),
- *         usb_control_request_set().
+ * @return Other value inherited from function usb_control_request_set().
  */
 int usbhid_req_get_report(usb_pipe_t *ctrl_pipe, int iface_no, 
@@ -283,12 +230,5 @@
 	 */
 	
-	int rc, sess_rc;
-	
-	sess_rc = usb_pipe_start_session(ctrl_pipe);
-	if (sess_rc != EOK) {
-		usb_log_warning("Failed to start a session: %s.\n",
-		    str_error(sess_rc));
-		return sess_rc;
-	}
+	int rc;
 
 	uint16_t value = 0;
@@ -302,16 +242,8 @@
 	    actual_size);
 
-	sess_rc = usb_pipe_end_session(ctrl_pipe);
-
-	if (rc != EOK) {
-		usb_log_warning("Error sending output report to the keyboard: "
-		    "%s.\n", str_error(rc));
-		return rc;
-	}
-
-	if (sess_rc != EOK) {
-		usb_log_warning("Error closing session: %s.\n",
-		    str_error(sess_rc));
-		return sess_rc;
+	if (rc != EOK) {
+		usb_log_warning("Error sending output report to the keyboard: "
+		    "%s.\n", str_error(rc));
+		return rc;
 	}
 	
@@ -328,7 +260,5 @@
  * @retval EOK if successful.
  * @retval EINVAL if no HID device is given.
- * @return Other value inherited from one of functions 
- *         usb_pipe_start_session(), usb_pipe_end_session(),
- *         usb_control_request_set().
+ * @return Other value inherited from function usb_control_request_set().
  */
 int usbhid_req_get_protocol(usb_pipe_t *ctrl_pipe, int iface_no, 
@@ -351,12 +281,5 @@
 	 */
 	
-	int rc, sess_rc;
-	
-	sess_rc = usb_pipe_start_session(ctrl_pipe);
-	if (sess_rc != EOK) {
-		usb_log_warning("Failed to start a session: %s.\n",
-		    str_error(sess_rc));
-		return sess_rc;
-	}
+	int rc;	
 
 	usb_log_debug("Sending Get_Protocol request to the device ("
@@ -370,16 +293,8 @@
 	    USB_HIDREQ_GET_PROTOCOL, 0, iface_no, buffer, 1, &actual_size);
 
-	sess_rc = usb_pipe_end_session(ctrl_pipe);
-
-	if (rc != EOK) {
-		usb_log_warning("Error sending output report to the keyboard: "
-		    "%s.\n", str_error(rc));
-		return rc;
-	}
-
-	if (sess_rc != EOK) {
-		usb_log_warning("Error closing session: %s.\n",
-		    str_error(sess_rc));
-		return sess_rc;
+	if (rc != EOK) {
+		usb_log_warning("Error sending output report to the keyboard: "
+		    "%s.\n", str_error(rc));
+		return rc;
 	}
 	
@@ -427,12 +342,5 @@
 	 */
 	
-	int rc, sess_rc;
-	
-	sess_rc = usb_pipe_start_session(ctrl_pipe);
-	if (sess_rc != EOK) {
-		usb_log_warning("Failed to start a session: %s.\n",
-		    str_error(sess_rc));
-		return sess_rc;
-	}
+	int rc;
 
 	usb_log_debug("Sending Get_Idle request to the device ("
@@ -448,16 +356,8 @@
 	    &actual_size);
 
-	sess_rc = usb_pipe_end_session(ctrl_pipe);
-
-	if (rc != EOK) {
-		usb_log_warning("Error sending output report to the keyboard: "
-		    "%s.\n", str_error(rc));
-		return rc;
-	}
-
-	if (sess_rc != EOK) {
-		usb_log_warning("Error closing session: %s.\n",
-		    str_error(sess_rc));
-		return sess_rc;
+	if (rc != EOK) {
+		usb_log_warning("Error sending output report to the keyboard: "
+		    "%s.\n", str_error(rc));
+		return rc;
 	}
 	
