Index: uspace/drv/usbhub/main.c
===================================================================
--- uspace/drv/usbhub/main.c	(revision 6336b6ed30c5d3025044acbae3db2d8893acd20c)
+++ uspace/drv/usbhub/main.c	(revision 7c169cef1c068093084d1828dec3a4b96960c749)
@@ -52,5 +52,5 @@
 	while(true){
 		usb_hub_check_hub_changes();
-		async_usleep(1000 * 1000);
+		async_usleep(1000 * 1000 );/// \TODO proper number once
 	}
 	return 0;
Index: uspace/drv/usbhub/usbhub.c
===================================================================
--- uspace/drv/usbhub/usbhub.c	(revision 6336b6ed30c5d3025044acbae3db2d8893acd20c)
+++ uspace/drv/usbhub/usbhub.c	(revision 7c169cef1c068093084d1828dec3a4b96960c749)
@@ -46,4 +46,5 @@
 #include "usbhub_private.h"
 #include "port_status.h"
+#include "usb/usb.h"
 
 static usb_iface_t hub_usb_iface = {
@@ -85,10 +86,4 @@
 
 	// get hub descriptor
-	usb_target_t target;
-	target.address = addr;
-	target.endpoint = 0;
-	usb_device_request_setup_packet_t request;
-	//printf("[usb_hub] creating descriptor request\n");
-	usb_hub_set_descriptor_request(&request);
 
 	//printf("[usb_hub] creating serialized descriptor\n");
@@ -98,7 +93,10 @@
 	int opResult;
 	//printf("[usb_hub] starting control transaction\n");
-	opResult = usb_drv_sync_control_read(
-			hc, target, &request, serialized_descriptor,
+	
+	opResult = usb_drv_req_get_descriptor(hc, addr,
+			USB_REQUEST_TYPE_CLASS,
+			USB_DESCTYPE_HUB, 0, 0, serialized_descriptor,
 			USB_HUB_MAX_DESCRIPTOR_SIZE, &received_size);
+
 	if (opResult != EOK) {
 		dprintf(1,"[usb_hub] failed when receiving hub descriptor, badcode = %d",opResult);
@@ -155,5 +153,4 @@
 	int port;
 	int opResult;
-	usb_device_request_setup_packet_t request;
 	usb_target_t target;
 	target.address = hub_info->usb_device->address;
@@ -173,4 +170,5 @@
 	if(std_descriptor.configuration_count<1){
 		dprintf(1,"[usb_hub] THERE ARE NO CONFIGURATIONS AVAILABLE");
+		//shouldn`t I return?
 	}
 	/// \TODO check other configurations
@@ -184,15 +182,12 @@
 	}
 	//set configuration
-	request.request_type = 0;
-	request.request = USB_DEVREQ_SET_CONFIGURATION;
-	request.index=0;
-	request.length=0;
-	request.value_high=0;
-	request.value_low = config_descriptor.configuration_number;
-	opResult = usb_drv_sync_control_write(hc, target, &request, NULL, 0);
+	opResult = usb_drv_req_set_configuration(hc, target.address,
+    config_descriptor.configuration_number);
+
 	if (opResult != EOK) {
 		dprintf(1,"[usb_hub]something went wrong when setting hub`s configuration, %d", opResult);
 	}
 
+	usb_device_request_setup_packet_t request;
 	for (port = 1; port < hub_info->port_count+1; ++port) {
 		usb_hub_set_power_port_request(&request, port);
@@ -229,5 +224,4 @@
 
 
-
 //*********************************************
 //
@@ -237,6 +231,6 @@
 
 /**
- * convenience function for releasing default address and writing debug info
- * (these few lines are used too often to be written again and again)
+ * Convenience function for releasing default address and writing debug info
+ * (these few lines are used too often to be written again and again).
  * @param hc
  * @return
@@ -253,5 +247,5 @@
 
 /**
- * reset the port with new device and reserve the default address
+ * Reset the port with new device and reserve the default address.
  * @param hc
  * @param port
@@ -282,5 +276,5 @@
 
 /**
- * finalize adding new device after port reset
+ * Finalize adding new device after port reset
  * @param hc
  * @param port
@@ -345,5 +339,5 @@
 
 /**
- * unregister device address in hc
+ * Unregister device address in hc
  * @param hc
  * @param port
@@ -355,5 +349,7 @@
 	int opResult;
 	
-	/// \TODO remove device
+	/** \TODO remove device from device manager - not yet implemented in
+	 * devide manager
+	 */
 
 	hub->attached_devs[port].devman_handle=0;
@@ -376,5 +372,5 @@
 
 /**
- * process interrupts on given hub port
+ * Process interrupts on given hub port
  * @param hc
  * @param port
@@ -434,6 +430,7 @@
 	usb_port_set_reset_completed(&status, false);
 	usb_port_set_dev_connected(&status, false);
-	if (status) {
-		dprintf(1,"[usb_hub]there was some unsupported change on port %d",port);
+	if (status>>16) {
+		dprintf(1,"[usb_hub]there was some unsupported change on port %d: %X",port,status);
+
 	}
 	/// \TODO handle other changes
@@ -442,5 +439,6 @@
 }
 
-/* Check changes on all known hubs.
+/**
+ * Check changes on all known hubs.
  */
 void usb_hub_check_hub_changes(void) {
Index: uspace/drv/usbhub/usbhub_private.h
===================================================================
--- uspace/drv/usbhub/usbhub_private.h	(revision 6336b6ed30c5d3025044acbae3db2d8893acd20c)
+++ uspace/drv/usbhub/usbhub_private.h	(revision 7c169cef1c068093084d1828dec3a4b96960c749)
@@ -31,5 +31,5 @@
  */
 /** @file
- * @brief Hub driver.
+ * @brief Hub driver private definitions
  */
 
@@ -68,5 +68,5 @@
 
 /**
- * create hub structure instance
+ * Create hub structure instance
  *
  * Set the address and port count information most importantly.
@@ -78,21 +78,21 @@
 usb_hub_info_t * usb_create_hub_info(device_t * device, int hc);
 
-/** list of hubs maanged by this driver */
+/** List of hubs maanged by this driver */
 extern usb_general_list_t usb_hub_list;
 
-/** lock for hub list*/
+/** Lock for hub list*/
 extern futex_t usb_hub_list_lock;
 
 
 /**
- * perform complete control read transaction
+ * Perform complete control read transaction
  *
- * manages all three steps of transaction: setup, read and finalize
+ * Manages all three steps of transaction: setup, read and finalize
  * @param phone
  * @param target
- * @param request request for data
- * @param rcvd_buffer received data
+ * @param request Request packet
+ * @param rcvd_buffer Received data
  * @param rcvd_size
- * @param actual_size actual size of received data
+ * @param actual_size Actual size of received data
  * @return error code
  */
@@ -104,10 +104,10 @@
 
 /**
- * perform complete control write transaction
+ * Perform complete control write transaction
  *
- * manages all three steps of transaction: setup, write and finalize
+ * Manages all three steps of transaction: setup, write and finalize
  * @param phone
  * @param target
- * @param request request to send data
+ * @param request Request packet to send data
  * @param sent_buffer
  * @param sent_size
@@ -121,5 +121,5 @@
 
 /**
- * set the device request to be a get hub descriptor request.
+ * Set the device request to be a get hub descriptor request.
  * @warning the size is allways set to USB_HUB_MAX_DESCRIPTOR_SIZE
  * @param request
@@ -137,4 +137,13 @@
 }
 
+/**
+ * Clear feature on hub port.
+ *
+ * @param hc Host controller telephone
+ * @param address Hub address
+ * @param port_index Port
+ * @param feature Feature selector
+ * @return Operation result
+ */
 static inline int usb_hub_clear_port_feature(int hc, usb_address_t address,
     int port_index,
Index: uspace/drv/usbkbd/Makefile
===================================================================
--- uspace/drv/usbkbd/Makefile	(revision 6336b6ed30c5d3025044acbae3db2d8893acd20c)
+++ uspace/drv/usbkbd/Makefile	(revision 7c169cef1c068093084d1828dec3a4b96960c749)
@@ -36,5 +36,6 @@
 	descparser.c \
 	descdump.c \
-	conv.c
+	conv.c \
+	us_qwerty.c
 
 include $(USPACE_PREFIX)/Makefile.common
Index: uspace/drv/usbkbd/descparser.c
===================================================================
--- uspace/drv/usbkbd/descparser.c	(revision 6336b6ed30c5d3025044acbae3db2d8893acd20c)
+++ uspace/drv/usbkbd/descparser.c	(revision 7c169cef1c068093084d1828dec3a4b96960c749)
@@ -187,5 +187,5 @@
 		case USB_DESCTYPE_HID:
 			if (desc_size < sizeof(usb_standard_hid_descriptor_t)) {
-				printf("Wrong size of descriptor: %d (should be %d)\n",
+				printf("Wrong size of descriptor: %d (should be %zu)\n",
 				    desc_size, sizeof(usb_standard_hid_descriptor_t));
 				ret = EINVAL;
Index: uspace/drv/usbkbd/main.c
===================================================================
--- uspace/drv/usbkbd/main.c	(revision 6336b6ed30c5d3025044acbae3db2d8893acd20c)
+++ uspace/drv/usbkbd/main.c	(revision 7c169cef1c068093084d1828dec3a4b96960c749)
@@ -42,4 +42,5 @@
 #include "descdump.h"
 #include "conv.h"
+#include "layout.h"
 
 #define BUFFER_SIZE 32
@@ -125,6 +126,14 @@
 static unsigned lock_keys;
 
+#define NUM_LAYOUTS 3
+
+static layout_op_t *layout[NUM_LAYOUTS] = {
+	&us_qwerty_op,
+	&us_dvorak_op,
+	&cz_op
+};
+
 // TODO: put to device?
-//static int active_layout = 0;
+static int active_layout = 0;
 
 static void kbd_push_ev(int type, unsigned int key)
@@ -206,9 +215,9 @@
 	ev.mods = mods;
 
-	//ev.c = layout[active_layout]->parse_ev(&ev);
+	ev.c = layout[active_layout]->parse_ev(&ev);
 
 	printf("Sending key %d to the console\n", ev.key);
 	assert(console_callback_phone != -1);
-	async_msg_4(console_callback_phone, KBD_EVENT, ev.type, ev.key, ev.mods, 0);
+	async_msg_4(console_callback_phone, KBD_EVENT, ev.type, ev.key, ev.mods, ev.c);
 }
 /*
@@ -405,7 +414,7 @@
 	//usb_hid_parse_report(kbd_dev->parser, buffer, actual_size, callbacks, 
 	//    NULL);
-//	printf("Calling usb_hid_boot_keyboard_input_report() with size %d\n",
-//	    actual_size);
-//	dump_buffer("bufffer: ", buffer, actual_size);
+	printf("Calling usb_hid_boot_keyboard_input_report() with size %d\n",
+	    actual_size);
+	//dump_buffer("bufffer: ", buffer, actual_size);
 	int rc = usb_hid_boot_keyboard_input_report(buffer, actual_size, callbacks, 
 	    NULL);
@@ -457,5 +466,5 @@
 		 */
 		if (actual_size == 0) {
-			printf("Keyboar returned NAK\n");
+			printf("Keyboard returned NAK\n");
 			continue;
 		}
@@ -465,6 +474,5 @@
 		 */
 		printf("Calling usbkbd_process_interrupt_in()\n");
-		// actual_size is not set, workaround...
-		usbkbd_process_interrupt_in(kbd_dev, buffer, /*actual_size*/8);
+		usbkbd_process_interrupt_in(kbd_dev, buffer, actual_size);
 	}
 
Index: uspace/drv/vhc/devices.c
===================================================================
--- uspace/drv/vhc/devices.c	(revision 6336b6ed30c5d3025044acbae3db2d8893acd20c)
+++ uspace/drv/vhc/devices.c	(revision 7c169cef1c068093084d1828dec3a4b96960c749)
@@ -138,4 +138,5 @@
 		} else {
 			async_wait_for(req, &answer_rc);
+			transaction->actual_len = IPC_GET_ARG1(answer_data);
 			rc = (int)answer_rc;
 		}
Index: uspace/drv/vhc/hc.c
===================================================================
--- uspace/drv/vhc/hc.c	(revision 6336b6ed30c5d3025044acbae3db2d8893acd20c)
+++ uspace/drv/vhc/hc.c	(revision 7c169cef1c068093084d1828dec3a4b96960c749)
@@ -96,6 +96,6 @@
 	    usb_str_transaction_outcome(outcome));
 	
-	transaction->callback(transaction->buffer, transaction->len, outcome,
-	    transaction->callback_arg);
+	transaction->callback(transaction->buffer, transaction->actual_len,
+	    outcome, transaction->callback_arg);
 }
 
@@ -169,4 +169,5 @@
 	transaction->buffer = buffer;
 	transaction->len = len;
+	transaction->actual_len = len;
 	transaction->callback = callback;
 	transaction->callback_arg = arg;
Index: uspace/drv/vhc/hc.h
===================================================================
--- uspace/drv/vhc/hc.h	(revision 6336b6ed30c5d3025044acbae3db2d8893acd20c)
+++ uspace/drv/vhc/hc.h	(revision 7c169cef1c068093084d1828dec3a4b96960c749)
@@ -65,4 +65,6 @@
 	/** Transaction data length. */
 	size_t len;
+	/** Data length actually transfered. */
+	size_t actual_len;
 	/** Callback after transaction is done. */
 	hc_transaction_done_callback_t callback;
