Index: uspace/drv/ohci/ohci.c
===================================================================
--- uspace/drv/ohci/ohci.c	(revision 66a54cca9f5cd9c1ecc9a96ea5ec1ab1c05590e5)
+++ uspace/drv/ohci/ohci.c	(revision 03eea27e5bfa0d60aac6efd50da401413bc6b24d)
@@ -31,5 +31,5 @@
  */
 /** @file
- * @brief UHCI driver
+ * @brief OHCI driver
  */
 #include <errno.h>
@@ -117,10 +117,10 @@
 /** Initialize hc and rh ddf structures and their respective drivers.
  *
- * @param[in] instance UHCI structure to use.
+ * @param[in] instance OHCI structure to use.
  * @param[in] device DDF instance of the device to use.
  *
  * This function does all the preparatory work for hc and rh drivers:
  *  - gets device hw resources
- *  - disables UHCI legacy support
+ *  - disables OHCI legacy support
  *  - asks for interrupt
  *  - registers interrupt handler
@@ -185,5 +185,5 @@
 	ret = ddf_fun_bind(instance->hc_fun);
 	CHECK_RET_DEST_FUN_RETURN(ret,
-	    "Failed(%d) to bind UHCI device function: %s.\n",
+	    "Failed(%d) to bind OHCI device function: %s.\n",
 	    ret, str_error(ret));
 #undef CHECK_RET_HC_RETURN
@@ -216,5 +216,5 @@
 	ret = ddf_fun_bind(instance->rh_fun);
 	CHECK_RET_FINI_RETURN(ret,
-	    "Failed(%d) to register UHCI root hub.\n", ret);
+	    "Failed(%d) to register OHCI root hub.\n", ret);
 
 	return EOK;
Index: uspace/drv/usbkbd/kbddev.c
===================================================================
--- uspace/drv/usbkbd/kbddev.c	(revision 66a54cca9f5cd9c1ecc9a96ea5ec1ab1c05590e5)
+++ uspace/drv/usbkbd/kbddev.c	(revision 03eea27e5bfa0d60aac6efd50da401413bc6b24d)
@@ -56,4 +56,5 @@
 #include <usb/classes/hidreq.h>
 #include <usb/classes/hidreport.h>
+#include <usb/classes/hid/utled.h>
 
 #include <usb/devdrv.h>
@@ -69,15 +70,16 @@
 static const unsigned DEFAULT_ACTIVE_MODS = KM_NUM_LOCK;
 
-/** Boot protocol report size (key part). */
-static const size_t BOOTP_REPORT_SIZE = 6;
-
-/** Boot protocol total report size. */
-static const size_t BOOTP_BUFFER_SIZE = 8;
-
-/** Boot protocol output report size. */
-static const size_t BOOTP_BUFFER_OUT_SIZE = 1;
-
-/** Boot protocol error key code. */
-static const uint8_t BOOTP_ERROR_ROLLOVER = 1;
+///** Boot protocol report size (key part). */
+//static const size_t BOOTP_REPORT_SIZE = 6;
+
+///** Boot protocol total report size. */
+//static const size_t BOOTP_BUFFER_SIZE = 8;
+
+///** Boot protocol output report size. */
+//static const size_t BOOTP_BUFFER_OUT_SIZE = 1;
+
+///** Boot protocol error key code. */
+//static const uint8_t BOOTP_ERROR_ROLLOVER = 1;
+static const uint8_t ERROR_ROLLOVER = 1;
 
 /** Default idle rate for keyboards. */
@@ -263,20 +265,20 @@
 static void usb_kbd_set_led(usb_kbd_t *kbd_dev) 
 {
-	uint8_t buffer[BOOTP_BUFFER_OUT_SIZE];
-	int rc= 0;
-	
-	memset(buffer, 0, BOOTP_BUFFER_OUT_SIZE);
-	uint8_t leds = 0;
-
-	if (kbd_dev->mods & KM_NUM_LOCK) {
-		leds |= USB_HID_LED_NUM_LOCK;
-	}
-	
-	if (kbd_dev->mods & KM_CAPS_LOCK) {
-		leds |= USB_HID_LED_CAPS_LOCK;
-	}
-	
-	if (kbd_dev->mods & KM_SCROLL_LOCK) {
-		leds |= USB_HID_LED_SCROLL_LOCK;
+	unsigned i = 0;
+	
+	/* Reset the LED data. */
+	memset(kbd_dev->led_data, 0, kbd_dev->led_output_size * sizeof(int32_t));
+	
+	if ((kbd_dev->mods & KM_NUM_LOCK) && (i < kbd_dev->led_output_size)) {
+		kbd_dev->led_data[i++] = USB_HID_LED_NUM_LOCK;
+	}
+	
+	if ((kbd_dev->mods & KM_CAPS_LOCK) && (i < kbd_dev->led_output_size)) {
+		kbd_dev->led_data[i++] = USB_HID_LED_CAPS_LOCK;
+	}
+	
+	if ((kbd_dev->mods & KM_SCROLL_LOCK) 
+	    && (i < kbd_dev->led_output_size)) {
+		kbd_dev->led_data[i++] = USB_HID_LED_SCROLL_LOCK;
 	}
 
@@ -284,20 +286,22 @@
 	
 	usb_log_debug("Creating output report.\n");
-	usb_log_debug("Leds: 0x%x\n", leds);
-	if ((rc = usb_hid_boot_keyboard_output_report(
-	    leds, buffer, BOOTP_BUFFER_OUT_SIZE)) != EOK) {
-		usb_log_warning("Error composing output report to the keyboard:"
-		    "%s.\n", str_error(rc));
+	
+	int rc = usb_hid_report_output_translate(kbd_dev->parser, 
+	    kbd_dev->led_path, USB_HID_PATH_COMPARE_END, kbd_dev->output_buffer, 
+	    kbd_dev->output_size, kbd_dev->led_data, kbd_dev->led_output_size);
+	
+	if (rc != EOK) {
+		usb_log_warning("Error translating LED output to output report"
+		    ".\n");
 		return;
 	}
 	
 	usb_log_debug("Output report buffer: %s\n", 
-	    usb_debug_str_buffer(buffer, BOOTP_BUFFER_OUT_SIZE, 0));
-	
-	assert(kbd_dev->usb_dev != NULL);
+	    usb_debug_str_buffer(kbd_dev->output_buffer, kbd_dev->output_size, 
+	        0));
 	
 	usbhid_req_set_report(&kbd_dev->usb_dev->ctrl_pipe, 
 	    kbd_dev->usb_dev->interface_no, USB_HID_REPORT_TYPE_OUTPUT, 
-	    buffer, BOOTP_BUFFER_OUT_SIZE);
+	    kbd_dev->output_buffer, kbd_dev->output_size);
 }
 
@@ -450,14 +454,14 @@
 	 * First of all, check if the kbd have reported phantom state.
 	 *
-	 *  this must be changed as we don't know which keys are modifiers
-	 *       and which are regular keys.
+	 * As there is no way to distinguish keys from modifiers, we do not have
+	 * a way to check that 'all keys report Error Rollover'. We thus check
+	 * if there is at least one such error and in such case we ignore the
+	 * whole input report.
 	 */
 	i = 0;
-	// all fields should report Error Rollover
-	while (i < count &&
-	    key_codes[i] == BOOTP_ERROR_ROLLOVER) {
+	while (i < count && key_codes[i] != ERROR_ROLLOVER) {
 		++i;
 	}
-	if (i == count) {
+	if (i != count) {
 		usb_log_debug("Phantom state occured.\n");
 		// phantom state, do nothing
@@ -586,5 +590,5 @@
  */
 static void usb_kbd_process_data(usb_kbd_t *kbd_dev,
-                                    uint8_t *buffer, size_t actual_size)
+                                 uint8_t *buffer, size_t actual_size)
 {
 	assert(kbd_dev->initialized == USB_KBD_STATUS_INITIALIZED);
@@ -760,6 +764,5 @@
 	usb_log_debug("Size of the input report: %zu\n", kbd_dev->key_count);
 	
-	kbd_dev->keys = (uint8_t *)calloc(
-	    kbd_dev->key_count, sizeof(uint8_t));
+	kbd_dev->keys = (uint8_t *)calloc(kbd_dev->key_count, sizeof(uint8_t));
 	
 	if (kbd_dev->keys == NULL) {
@@ -768,8 +771,49 @@
 	}
 	
+	/*
+	 * Output report
+	 */
+	kbd_dev->output_size = 0;
+	kbd_dev->output_buffer = usb_hid_report_output(kbd_dev->parser, 
+	    &kbd_dev->output_size);
+	if (kbd_dev->output_buffer == NULL) {
+		usb_log_warning("Error creating output report buffer.\n");
+		free(kbd_dev->keys);
+		return ENOMEM;  /* TODO: other error code */
+	}
+	
+	usb_log_debug("Output buffer size: %zu\n", kbd_dev->output_size);
+	
+	kbd_dev->led_path = usb_hid_report_path();
+	usb_hid_report_path_append_item(
+	    kbd_dev->led_path, USB_HIDUT_PAGE_LED, 0);
+	
+	kbd_dev->led_output_size = usb_hid_report_output_size(kbd_dev->parser, 
+	    kbd_dev->led_path, USB_HID_PATH_COMPARE_END);
+	
+	usb_log_debug("Output report size (in items): %zu\n", 
+	    kbd_dev->led_output_size);
+	
+	kbd_dev->led_data = (int32_t *)calloc(
+	    kbd_dev->led_output_size, sizeof(int32_t));
+	
+	if (kbd_dev->led_data == NULL) {
+		usb_log_warning("Error creating buffer for LED output report."
+		    "\n");
+		free(kbd_dev->keys);
+		usb_hid_report_output_free(kbd_dev->output_buffer);
+		return ENOMEM;
+	}
+	
+	/*
+	 * Modifiers and locks
+	 */	
 	kbd_dev->modifiers = 0;
 	kbd_dev->mods = DEFAULT_ACTIVE_MODS;
 	kbd_dev->lock_keys = 0;
 	
+	/*
+	 * Autorepeat
+	 */	
 	kbd_dev->repeat.key_new = 0;
 	kbd_dev->repeat.key_repeated = 0;
@@ -879,4 +923,7 @@
 	}
 	
+	// free the output buffer
+	usb_hid_report_output_free((*kbd_dev)->output_buffer);
+	
 	/* TODO: what about the USB device structure?? */
 
Index: uspace/drv/usbkbd/kbddev.h
===================================================================
--- uspace/drv/usbkbd/kbddev.h	(revision 66a54cca9f5cd9c1ecc9a96ea5ec1ab1c05590e5)
+++ uspace/drv/usbkbd/kbddev.h	(revision 03eea27e5bfa0d60aac6efd50da401413bc6b24d)
@@ -94,4 +94,14 @@
 	/** Report descriptor size. */
 	size_t report_desc_size;
+	
+	uint8_t *output_buffer;
+	
+	size_t output_size;
+	
+	size_t led_output_size;
+	
+	usb_hid_report_path_t *led_path;
+	
+	int32_t *led_data;
 
 	/** HID Report parser. */
