Index: uspace/app/virtusbkbd/Makefile
===================================================================
--- uspace/app/virtusbkbd/Makefile	(revision 9a884ed2702826b3b497efb5d6981060e0b515a8)
+++ 	(revision )
@@ -1,43 +1,0 @@
-#
-# Copyright (c) 2010 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.
-#
-
-USPACE_PREFIX = ../..
-# acronym for virtual usb keyboard
-# (it is really annoying to write long names)
-BINARY = vuk
-
-LIBS = $(LIBUSBVIRT_PREFIX)/libusbvirt.a $(LIBUSB_PREFIX)/libusb.a
-EXTRA_CFLAGS = -I$(LIBUSB_PREFIX)/include -I$(LIBUSBVIRT_PREFIX)/include -I$(LIBDRV_PREFIX)/include
-
-SOURCES = \
-	kbdconfig.c \
-	keys.c \
-	stdreq.c \
-	virtusbkbd.c
-
-include $(USPACE_PREFIX)/Makefile.common
Index: uspace/app/virtusbkbd/descriptor.h
===================================================================
--- uspace/app/virtusbkbd/descriptor.h	(revision 9a884ed2702826b3b497efb5d6981060e0b515a8)
+++ 	(revision )
@@ -1,51 +1,0 @@
-/*
- * Copyright (c) 2010 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 usbvirtkbd
- * @{
- */
-/** @file
- * @brief USB keyboard descriptors.
- */
-#ifndef VUK_DESCRIPTOR_H_
-#define VUK_DESCRIPTOR_H_
-
-typedef struct {
-	uint8_t length;
-	uint8_t type;
-	uint16_t hid_spec_release;
-	uint8_t country_code;
-	uint8_t descriptor_count;
-	uint8_t descriptor1_type;
-	uint16_t descriptor1_length;
-} __attribute__ ((packed)) hid_descriptor_t;
-
-#endif
-/**
- * @}
- */
Index: uspace/app/virtusbkbd/items.h
===================================================================
--- uspace/app/virtusbkbd/items.h	(revision 9a884ed2702826b3b497efb5d6981060e0b515a8)
+++ 	(revision )
@@ -1,113 +1,0 @@
-/*
- * Copyright (c) 2010 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 usbvirtkbd
- * @{
- */
-/** @file
- * @brief HID Item related functions.
- */
-#ifndef VUK_ITEM_H_
-#define VUK_ITEM_H_
-
-#include <sys/types.h>
-
-typedef uint8_t report_descriptor_data_t[];
-
-/* Item types. */
-#define ITEM_MAIN 0
-#define ITEM_GLOBAL 1
-#define ITEM_LOCAL 2
-
-
-
-/* Item tags. */
-
-/* Main item tags. */
-#define TAG_INPUT 8
-#define TAG_OUTPUT 9
-#define TAG_FEATURE 11
-#define TAG_COLLECTION 10
-#define TAG_END_COLLECTION 12
-
-/* Global item tags. */
-#define TAG_USAGE_PAGE 0
-#define TAG_LOGICAL_MINIMUM 1
-#define TAG_LOGICAL_MAXIMUM 2
-#define TAG_REPORT_SIZE 7
-#define TAG_REPORT_COUNT 9
-
-/* Local item tags. */
-#define TAG_USAGE 0
-#define TAG_USAGE_MINIMUM 1
-#define TAG_USAGE_MAXIMUM 2
-
-
-/* Bits for Input, Output and Feature items. */
-#define _IOF(value, shift) ((value) << (shift))
-#define IOF_DATA _IOF(0, 0)
-#define IOF_CONSTANT _IOF(1, 0)
-#define IOF_ARRAY _IOF(0, 1)
-#define IOF_VARIABLE _IOF(1, 1)
-#define IOF_ABSOLUTE _IOF(0, 2)
-#define IOF_RELATIVE _IOF(1, 2)
-/* ... */
-
-/* Collection types. */
-#define COLLECTION_PHYSICAL 0x00
-#define COLLECTION_APPLICATION 0x01
-
-
-/** Creates item prefix.
- * @param size Item size.
- * @param type Item type.
- * @param tag Item tag.
- */
-#define BUILD_ITEM_PREFIX(size, type, tag) \
-	((size) | ((type) << 2) | ((tag) << 4))
-
-/** Create no-data item.
- * @param type Item type.
- * @param tag Item tag.
- */
-#define ITEM_CREATE0(type, tag) \
-	BUILD_ITEM_PREFIX(0, type, tag)
-
-/** Create item with 1-byte data.
- * @param type Item type.
- * @param tag Item tag.
- * @param data Item data (single byte).
- */
-#define ITEM_CREATE1(type, tag, data) \
-	BUILD_ITEM_PREFIX(1, type, tag), data
-
-
-#endif
-/**
- * @}
- */
Index: uspace/app/virtusbkbd/kbdconfig.c
===================================================================
--- uspace/app/virtusbkbd/kbdconfig.c	(revision 9a884ed2702826b3b497efb5d6981060e0b515a8)
+++ 	(revision )
@@ -1,155 +1,0 @@
-/*
- * Copyright (c) 2010 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 usbvirtkbd
- * @{
- */
-/**
- * @file
- * @brief Keyboard configuration.
- */
-#include "kbdconfig.h"
-#include "keys.h"
-#include <usb/usb.h>
-#include <usb/classes/hid.h>
-#include <usb/classes/hidut.h>
-#include <usb/classes/classes.h>
-
-/** Standard device descriptor. */
-usb_standard_device_descriptor_t std_device_descriptor = {
-	.length = sizeof(usb_standard_device_descriptor_t),
-	.descriptor_type = USB_DESCTYPE_DEVICE,
-	.usb_spec_version = 0x110,
-	.device_class = USB_CLASS_USE_INTERFACE,
-	.device_subclass = 0,
-	.device_protocol = 0,
-	.max_packet_size = 64,
-	.configuration_count = 1
-};
-
-/** Standard interface descriptor. */
-usb_standard_interface_descriptor_t std_interface_descriptor = {
-	.length = sizeof(usb_standard_interface_descriptor_t),
-	.descriptor_type = USB_DESCTYPE_INTERFACE,
-	.interface_number = 0,
-	.alternate_setting = 0,
-	.endpoint_count = 1,
-	.interface_class = USB_CLASS_HID,
-	.interface_subclass = USB_HID_SUBCLASS_BOOT,
-	.interface_protocol = USB_HID_PROTOCOL_KEYBOARD,
-	.str_interface = 0
-};
-
-/** USB keyboard report descriptor.
- * Copied from USB HID 1.11 (section E.6).
- */
-report_descriptor_data_t report_descriptor = {
-	STD_USAGE_PAGE(USB_HIDUT_PAGE_GENERIC_DESKTOP),
-	USAGE1(USB_HIDUT_USAGE_GENERIC_DESKTOP_KEYBOARD),
-	START_COLLECTION(COLLECTION_APPLICATION),
-		STD_USAGE_PAGE(USB_HIDUT_PAGE_KEYBOARD),
-		USAGE_MINIMUM1(224),
-		USAGE_MAXIMUM1(231),
-		LOGICAL_MINIMUM1(0),
-		LOGICAL_MAXIMUM1(1),
-		REPORT_SIZE1(1),
-		REPORT_COUNT1(8),
-		/* Modifiers */
-		INPUT(IOF_DATA | IOF_VARIABLE | IOF_ABSOLUTE),
-		REPORT_COUNT1(1),
-		REPORT_SIZE1(8),
-		/* Reserved */
-		INPUT(IOF_CONSTANT),
-		REPORT_COUNT1(5),
-		REPORT_SIZE1(1),
-		STD_USAGE_PAGE(USB_HIDUT_PAGE_LED),
-		USAGE_MINIMUM1(1),
-		USAGE_MAXIMUM1(5),
-		/* LED states */
-		OUTPUT(IOF_DATA | IOF_VARIABLE | IOF_ABSOLUTE),
-		REPORT_COUNT1(1),
-		REPORT_SIZE1(3),
-		/* LED states padding */
-		OUTPUT(IOF_CONSTANT),
-		REPORT_COUNT1(KB_MAX_KEYS_AT_ONCE),
-		REPORT_SIZE1(8),
-		LOGICAL_MINIMUM1(0),
-		LOGICAL_MAXIMUM1(101),
-		STD_USAGE_PAGE(USB_HIDUT_PAGE_KEYBOARD),
-		USAGE_MINIMUM1(0),
-		USAGE_MAXIMUM1(101),
-		/* Key array */
-		INPUT(IOF_DATA | IOF_ARRAY),
-	END_COLLECTION()
-};
-size_t report_descriptor_size = sizeof(report_descriptor);
-
-/** HID descriptor. */
-hid_descriptor_t hid_descriptor = {
-	.length = sizeof(hid_descriptor_t),
-	.type = 0x21, // HID descriptor
-	.hid_spec_release = 0x101,
-	.country_code = 0,
-	.descriptor_count = 1,
-	.descriptor1_type = 0x22, // Report descriptor
-	.descriptor1_length = sizeof(report_descriptor)
-};
-
-/** Endpoint descriptor. */
-usb_standard_endpoint_descriptor_t endpoint_descriptor = {
-	.length = sizeof(usb_standard_endpoint_descriptor_t),
-	.descriptor_type = USB_DESCTYPE_ENDPOINT,
-	.endpoint_address = 1 | 128,
-	.attributes = USB_TRANSFER_INTERRUPT,
-	.max_packet_size = 8,
-	.poll_interval = 10
-};
-
-/** Standard configuration descriptor. */
-usb_standard_configuration_descriptor_t std_configuration_descriptor = {
-	.length = sizeof(usb_standard_configuration_descriptor_t),
-	.descriptor_type = USB_DESCTYPE_CONFIGURATION,
-	.total_length = 
-		sizeof(usb_standard_configuration_descriptor_t)
-		+ sizeof(std_interface_descriptor)
-		+ sizeof(hid_descriptor)
-		+ sizeof(endpoint_descriptor)
-		,
-	.interface_count = 1,
-	.configuration_number = 1,
-	.str_configuration = 0,
-	.attributes = 128, /* denotes bus-powered device */
-	.max_power = 50
-};
-
-
-
-
-
-/** @}
- */
Index: uspace/app/virtusbkbd/kbdconfig.h
===================================================================
--- uspace/app/virtusbkbd/kbdconfig.h	(revision 9a884ed2702826b3b497efb5d6981060e0b515a8)
+++ 	(revision )
@@ -1,60 +1,0 @@
-/*
- * Copyright (c) 2010 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 usbvirtkbd
- * @{
- */
-/** @file
- * @brief USB keyboard configuration.
- */
-#ifndef VUK_KBDCONFIG_H_
-#define VUK_KBDCONFIG_H_
-
-#include <usb/descriptor.h>
-#include "report.h"
-#include "descriptor.h"
-
-extern usb_standard_device_descriptor_t std_device_descriptor;
-
-extern usb_standard_configuration_descriptor_t std_configuration_descriptor;
-
-extern usb_standard_interface_descriptor_t std_interface_descriptor;
-
-extern usb_standard_endpoint_descriptor_t endpoint_descriptor;
-
-
-extern hid_descriptor_t hid_descriptor;
-
-extern report_descriptor_data_t report_descriptor;
-extern size_t report_descriptor_size;
-
-
-#endif
-/**
- * @}
- */
Index: uspace/app/virtusbkbd/keys.c
===================================================================
--- uspace/app/virtusbkbd/keys.c	(revision 9a884ed2702826b3b497efb5d6981060e0b515a8)
+++ 	(revision )
@@ -1,123 +1,0 @@
-/*
- * Copyright (c) 2010 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 usbvirtkbd
- * @{
- */
-/**
- * @file
- * @brief Keyboard keys related structures.
- */
-#include "keys.h"
-
-/** Initializes keyboard status. */
-void kb_init(kb_status_t *status)
-{
-	status->modifiers = 0;
-	size_t i;
-	for (i = 0; i < KB_MAX_KEYS_AT_ONCE; i++) {
-		status->pressed_keys[i] = 0;
-	}
-}
-
-/** Change pressed modifiers. */
-void kb_change_modifier(kb_status_t *status, kb_key_action_t action,
-    kb_modifier_t modifier)
-{
-	if (action == KB_KEY_DOWN) {
-		status->modifiers = status->modifiers | modifier;
-	} else {
-		status->modifiers = status->modifiers & (~modifier);
-	}
-}
-
-/** Find index of given key in key code array.
- * @retval (size_t)-1 Key not found.
- */
-static size_t find_key_index(kb_key_code_t *keys, size_t size, kb_key_code_t key)
-{
-	size_t i;
-	for (i = 0; i < size; i++) {
-		if (keys[i] == key) {
-			return i;
-		}
-	}
-	return (size_t)-1;
-}
-
-/** Change pressed key. */
-void kb_change_key(kb_status_t *status, kb_key_action_t action,
-    kb_key_code_t key_code)
-{
-	size_t pos = find_key_index(status->pressed_keys, KB_MAX_KEYS_AT_ONCE,
-	    key_code);
-	if (action == KB_KEY_DOWN) {
-		if (pos != (size_t)-1) {
-			return;
-		}
-		/*
-		 * Find first free item in the array.
-		 */
-		size_t i;
-		for (i = 0; i < KB_MAX_KEYS_AT_ONCE; i++) {
-			if (status->pressed_keys[i] == 0) {
-				status->pressed_keys[i] = key_code;
-				return;
-			}
-		}
-		// TODO - handle buffer overflow
-	} else {
-		if (pos == (size_t)-1) {
-			return;
-		}
-		status->pressed_keys[pos] = 0;
-	}	
-}
-
-/** Process list of events. */
-void kb_process_events(kb_status_t *status,
-    kb_event_t *events, size_t count,
-    kb_on_status_change on_change)
-{
-	while (count-- > 0) {
-		if (events->normal_key) {
-			kb_change_key(status, events->action,
-			    events->key_change);
-		} else {
-			kb_change_modifier(status, events->action,
-			    events->modifier_change);
-		}
-		if (on_change) {
-			on_change(status);
-		}
-		events++;
-	}
-}
-
-/** @}
- */
Index: uspace/app/virtusbkbd/keys.h
===================================================================
--- uspace/app/virtusbkbd/keys.h	(revision 9a884ed2702826b3b497efb5d6981060e0b515a8)
+++ 	(revision )
@@ -1,121 +1,0 @@
-/*
- * Copyright (c) 2010 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 usbvirtkbd
- * @{
- */
-/** @file
- * @brief Keyboard keys related structures.
- */
-#ifndef VUK_KEYS_H_
-#define VUK_KEYS_H_
-
-#include <sys/types.h>
-#include <bool.h>
-
-/** Maximum number of keys that can be pressed simultaneously. */
-#define KB_MAX_KEYS_AT_ONCE 6
-
-/** Key code type. */
-typedef uint8_t kb_key_code_t;
-
-#define USB_HIDUT_KBD_KEY(name, usage_id, l, lc, l1, l2) \
-	KB_KEY_##name = usage_id,
-/** USB key code. */
-typedef enum {
-	#include <usb/classes/hidutkbd.h>
-} key_code_t;
-
-/** Modifier type. */
-typedef uint8_t kb_modifier_t;
-#define _KB_MOD(shift) (1 << (shift))
-#define KB_MOD_LEFT_CTRL _KB_MOD(0)
-#define KB_MOD_LEFT_SHIFT _KB_MOD(1)
-#define KB_MOD_LEFT_ALT _KB_MOD(2)
-#define KB_MOD_LEFT_GUI _KB_MOD(3)
-#define KB_MOD_RIGHT_CTRL _KB_MOD(4)
-#define KB_MOD_RIGHT_SHIFT _KB_MOD(5)
-#define KB_MOD_RIGHT_ALT _KB_MOD(6)
-#define KB_MOD_RIGHT_GUI _KB_MOD(7)
-
-/** Base key action. */
-typedef enum {
-	KB_KEY_DOWN,
-	KB_KEY_UP
-} kb_key_action_t;
-
-/** Keyboard status. */
-typedef struct {
-	/** Bitmap of pressed modifiers. */
-	kb_modifier_t modifiers;
-	/** Array of currently pressed keys. */
-	kb_key_code_t pressed_keys[KB_MAX_KEYS_AT_ONCE];
-} kb_status_t;
-
-/** Callback type for status change. */
-typedef void (*kb_on_status_change)(kb_status_t *);
-
-
-void kb_init(kb_status_t *);
-void kb_change_modifier(kb_status_t *, kb_key_action_t, kb_modifier_t);
-void kb_change_key(kb_status_t *, kb_key_action_t, kb_key_code_t);
-
-/** Keyboard event.
- * Use macros M_DOWN, M_UP, K_DOWN, K_UP, K_PRESS to generate list
- * of them.
- */
-typedef struct {
-	/** Key action. */
-	kb_key_action_t action;
-	/** Switch whether action is about modifier or normal key. */
-	bool normal_key;
-	/** Modifier change. */
-	kb_modifier_t modifier_change;
-	/** Normal key change. */
-	kb_key_code_t key_change;
-} kb_event_t;
-
-#define M_DOWN(mod) \
-	{ KB_KEY_DOWN, false, (mod), 0 }
-#define M_UP(mod) \
-	{ KB_KEY_UP, false, (mod), 0 }
-#define K_DOWN(key) \
-	{ KB_KEY_DOWN, true, 0, (key) }
-#define K_UP(key) \
-	{ KB_KEY_UP, true, 0, (key) }
-#define K_PRESS(key) \
-	K_DOWN(key), K_UP(key)
-
-
-void kb_process_events(kb_status_t *, kb_event_t *, size_t, kb_on_status_change);
-
-
-#endif
-/**
- * @}
- */
Index: uspace/app/virtusbkbd/report.h
===================================================================
--- uspace/app/virtusbkbd/report.h	(revision 9a884ed2702826b3b497efb5d6981060e0b515a8)
+++ 	(revision )
@@ -1,85 +1,0 @@
-/*
- * Copyright (c) 2010 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 usbvirtkbd
- * @{
- */
-/** @file
- * @brief HID Report Descriptor.
- */
-#ifndef VUK_REPORT_H_
-#define VUK_REPORT_H_
-
-#include "items.h"
-
-/** Use standard Usage Page. */
-#define STD_USAGE_PAGE(page) \
-	ITEM_CREATE1(ITEM_GLOBAL, TAG_USAGE_PAGE, page)
-
-/** Usage with one byte usage ID. */
-#define USAGE1(usage_id) \
-	ITEM_CREATE1(ITEM_LOCAL, TAG_USAGE, usage_id)
-
-/** Start a collection. */
-#define START_COLLECTION(collection) \
-	ITEM_CREATE1(ITEM_MAIN, TAG_COLLECTION, collection)
-
-/** End a collection. */
-#define END_COLLECTION() \
-	ITEM_CREATE0(ITEM_MAIN, TAG_END_COLLECTION)
-
-
-#define USAGE_MINIMUM1(value) \
-	ITEM_CREATE1(ITEM_LOCAL, TAG_USAGE_MINIMUM, value)
-	
-#define USAGE_MAXIMUM1(value) \
-	ITEM_CREATE1(ITEM_LOCAL, TAG_USAGE_MAXIMUM, value)
-	
-#define LOGICAL_MINIMUM1(value) \
-	ITEM_CREATE1(ITEM_GLOBAL, TAG_LOGICAL_MINIMUM, value)
-
-#define LOGICAL_MAXIMUM1(value) \
-	ITEM_CREATE1(ITEM_GLOBAL, TAG_LOGICAL_MAXIMUM, value)
-
-#define REPORT_SIZE1(size) \
-	ITEM_CREATE1(ITEM_GLOBAL, TAG_REPORT_SIZE, size)
-
-#define REPORT_COUNT1(count) \
-	ITEM_CREATE1(ITEM_GLOBAL, TAG_REPORT_COUNT, count)
-	
-#define INPUT(modifiers) \
-	ITEM_CREATE1(ITEM_MAIN, TAG_INPUT, modifiers)
-
-#define OUTPUT(modifiers) \
-	ITEM_CREATE1(ITEM_MAIN, TAG_OUTPUT, modifiers)
-
-
-#endif
-/**
- * @}
- */
Index: uspace/app/virtusbkbd/stdreq.c
===================================================================
--- uspace/app/virtusbkbd/stdreq.c	(revision 9a884ed2702826b3b497efb5d6981060e0b515a8)
+++ 	(revision )
@@ -1,64 +1,0 @@
-/*
- * Copyright (c) 2010 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 usbvirtkbd
- * @{
- */
-/**
- * @file
- * @brief Keyboard configuration.
- */
-#include <errno.h>
-#include <usb/descriptor.h>
-#include "stdreq.h"
-#include "kbdconfig.h"
-
-int req_get_descriptor(usbvirt_device_t *device,
-    const usb_device_request_setup_packet_t *setup_packet,
-    uint8_t *data, size_t *act_size)
-{
-	if (setup_packet->value_high == USB_DESCTYPE_HID_REPORT) {
-		/*
-		 * For simplicity, always return the same
-		 * report descriptor.
-		 */
-		usbvirt_control_reply_helper(setup_packet,
-		    data, act_size,
-		    report_descriptor, report_descriptor_size);
-
-		return EOK;
-	}
-	
-	/* Let the framework handle all the rest. */
-	return EFORWARD;
-}
-
-
-
-/** @}
- */
Index: uspace/app/virtusbkbd/stdreq.h
===================================================================
--- uspace/app/virtusbkbd/stdreq.h	(revision 9a884ed2702826b3b497efb5d6981060e0b515a8)
+++ 	(revision )
@@ -1,47 +1,0 @@
-/*
- * Copyright (c) 2010 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 usbvirtkbd
- * @{
- */
-/** @file
- * @brief Standard device request handlers.
- */
-#ifndef VUK_STDREQ_H_
-#define VUK_STDREQ_H_
-
-#include <usbvirt/device.h>
-
-int req_get_descriptor(usbvirt_device_t *device,
-    const usb_device_request_setup_packet_t *setup_packet,
-    uint8_t *data, size_t *act_size);
-
-#endif
-/**
- * @}
- */
Index: uspace/app/virtusbkbd/virtusbkbd.c
===================================================================
--- uspace/app/virtusbkbd/virtusbkbd.c	(revision 9a884ed2702826b3b497efb5d6981060e0b515a8)
+++ 	(revision )
@@ -1,269 +1,0 @@
-/*
- * Copyright (c) 2010 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 usbvirtkbd
- * @{
- */
-/**
- * @file
- * @brief Virtual USB keyboard.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <vfs/vfs.h>
-#include <fcntl.h>
-#include <errno.h>
-#include <str_error.h>
-#include <bool.h>
-#include <async.h>
-
-#include <usb/usb.h>
-#include <usb/descriptor.h>
-#include <usb/classes/hid.h>
-#include <usb/debug.h>
-#include <usbvirt/device.h>
-
-#include "kbdconfig.h"
-#include "keys.h"
-#include "stdreq.h"
-
-/** Pause between individual key-presses in seconds. */
-#define KEY_PRESS_DELAY 1
-#define NAME "virt-usb-kbd"
-
-
-#define __QUOTEME(x) #x
-#define _QUOTEME(x) __QUOTEME(x)
-
-#define VERBOSE_EXEC(cmd, fmt, ...) \
-	(printf("%s: %s" fmt "\n", NAME, _QUOTEME(cmd), __VA_ARGS__), cmd(__VA_ARGS__))
-
-kb_status_t status;
-
-/** Compares current and last status of pressed keys.
- *
- * @warning Has side-efect - changes status_last field.
- *
- * @param status_now Status now.
- * @param status_last Last status.
- * @param len Size of status.
- * @return Whether they are the same.
- */
-static bool keypress_check_with_last_request(uint8_t *status_now,
-    uint8_t *status_last, size_t len)
-{
-	bool same = true;
-	size_t i;
-	for (i = 0; i < len; i++) {
-		if (status_now[i] != status_last[i]) {
-			status_last[i] = status_now[i];
-			same = false;
-		}
-	}
-	return same;
-}
-
-static int on_request_for_data(usbvirt_device_t *dev,
-    usb_endpoint_t endpoint, usb_transfer_type_t transfer_type,
-    void *buffer, size_t size, size_t *actual_size)
-{
-	static uint8_t last_data[2 + KB_MAX_KEYS_AT_ONCE];
-
-	if (size < 2 + KB_MAX_KEYS_AT_ONCE) {
-		return EINVAL;
-	}
-	
-	*actual_size = 2 + KB_MAX_KEYS_AT_ONCE;
-	
-	uint8_t data[2 + KB_MAX_KEYS_AT_ONCE];
-	data[0] = status.modifiers;
-	data[1] = 0;
-	
-	size_t i;
-	for (i = 0; i < KB_MAX_KEYS_AT_ONCE; i++) {
-		data[2 + i] = status.pressed_keys[i];
-	}
-	
-	if (keypress_check_with_last_request(data, last_data,
-	    2 + KB_MAX_KEYS_AT_ONCE)) {
-		return ENAK;
-	}
-
-	memcpy(buffer, &data, *actual_size);
-	
-	return EOK;
-}
-
-static usbvirt_control_request_handler_t endpoint_zero_handlers[] = {
-	{
-		.req_direction = USB_DIRECTION_IN,
-		.req_type = USB_REQUEST_TYPE_STANDARD,
-		.req_recipient = USB_REQUEST_RECIPIENT_INTERFACE,
-		.request = USB_DEVREQ_GET_DESCRIPTOR,
-		.name = "GetDescriptor",
-		.callback = req_get_descriptor
-	},
-	{
-		.callback = NULL
-	}
-};
-
-/** Keyboard callbacks.
- * We abuse the fact that static variables are zero-filled.
- */
-static usbvirt_device_ops_t keyboard_ops = {
-	.control = endpoint_zero_handlers,
-	.data_in[1] = on_request_for_data
-};
-
-usbvirt_device_configuration_extras_t extra_descriptors[] = {
-	{
-		.data = (uint8_t *) &std_interface_descriptor,
-		.length = sizeof(std_interface_descriptor)
-	},
-	{
-		.data = (uint8_t *) &hid_descriptor,
-		.length = sizeof(hid_descriptor)
-	},
-	{
-		.data = (uint8_t *) &endpoint_descriptor,
-		.length = sizeof(endpoint_descriptor)
-	}
-};
-
-/** Keyboard configuration. */
-usbvirt_device_configuration_t configuration = {
-	.descriptor = &std_configuration_descriptor,
-	.extra = extra_descriptors,
-	.extra_count = sizeof(extra_descriptors)/sizeof(extra_descriptors[0])
-};
-
-/** Keyboard standard descriptors. */
-usbvirt_descriptors_t descriptors = {
-	.device = &std_device_descriptor,
-	.configuration = &configuration,
-	.configuration_count = 1,
-};
-
-/** Keyboard device.
- * Rest of the items will be initialized later.
- */
-static usbvirt_device_t keyboard_dev = {
-	.ops = &keyboard_ops,
-	.descriptors = &descriptors,
-	.name = "keyboard"
-};
-
-
-static void fibril_sleep(size_t sec)
-{
-	while (sec-- > 0) {
-		async_usleep(1000*1000);
-	}
-}
-
-
-/** Callback when keyboard status changed.
- *
- * @param status Current keyboard status.
- */
-static void on_keyboard_change(kb_status_t *status)
-{
-	printf("%s: Current keyboard status: %02hhx", NAME, status->modifiers);
-	size_t i;
-	for (i = 0; i < KB_MAX_KEYS_AT_ONCE; i++) {
-		printf(" 0x%02X", (int)status->pressed_keys[i]);
-	}
-	printf("\n");
-	
-	fibril_sleep(KEY_PRESS_DELAY);
-}
-
-/** Simulated keyboard events. */
-static kb_event_t keyboard_events[] = {
-	/* Switch to VT6 (Alt+F6) */
-	M_DOWN(KB_MOD_LEFT_ALT),
-	K_PRESS(KB_KEY_F6),
-	M_UP(KB_MOD_LEFT_ALT),
-	/* Type the word 'Hello' */
-	M_DOWN(KB_MOD_LEFT_SHIFT),
-	K_PRESS(KB_KEY_H),
-	M_UP(KB_MOD_LEFT_SHIFT),
-	K_PRESS(KB_KEY_E),
-	K_PRESS(KB_KEY_L),
-	K_PRESS(KB_KEY_L),
-	K_PRESS(KB_KEY_O)
-};
-static size_t keyboard_events_count =
-    sizeof(keyboard_events)/sizeof(keyboard_events[0]);
-
-
-
-int main(int argc, char * argv[])
-{
-	printf("Dump of report descriptor (%zu bytes):\n", report_descriptor_size);
-	size_t i;
-	for (i = 0; i < report_descriptor_size; i++) {
-		printf("  0x%02X", report_descriptor[i]);
-		if (((i > 0) && (((i+1) % 10) == 0))
-		    || (i + 1 == report_descriptor_size)) {
-			printf("\n");
-		}
-	}
-	
-	kb_init(&status);
-	
-	
-	int rc = usbvirt_device_plug(&keyboard_dev, "/virt/usbhc/hc");
-	if (rc != EOK) {
-		printf("%s: Unable to start communication with VHCD (%s).\n",
-		    NAME, str_error(rc));
-		return rc;
-	}
-	
-	printf("%s: Will wait for a while to allow HID driver settle in.\n", NAME);
-	fibril_sleep(15);
-	printf("%s: Simulating keyboard events...\n", NAME);
-	fibril_sleep(5);
-	//while (1) {
-		kb_process_events(&status, keyboard_events, keyboard_events_count,
-			on_keyboard_change);
-	//}
-	
-	printf("%s: Terminating...\n", NAME);
-	
-	//usbvirt_disconnect(&keyboard_dev);
-	
-	return 0;
-}
-
-
-/** @}
- */
Index: uspace/app/vuhid/hids/bootkbd.c
===================================================================
--- uspace/app/vuhid/hids/bootkbd.c	(revision 9a884ed2702826b3b497efb5d6981060e0b515a8)
+++ uspace/app/vuhid/hids/bootkbd.c	(revision a9431063c7daebc88e60dea71fc147ee9b1fda01)
@@ -39,5 +39,5 @@
 #include <usb/classes/hidut.h>
 
-#include "../../virtusbkbd/report.h"
+#include "../report.h"
 
 uint8_t report_descriptor[] = {
Index: uspace/app/vuhid/items.h
===================================================================
--- uspace/app/vuhid/items.h	(revision a9431063c7daebc88e60dea71fc147ee9b1fda01)
+++ uspace/app/vuhid/items.h	(revision a9431063c7daebc88e60dea71fc147ee9b1fda01)
@@ -0,0 +1,113 @@
+/*
+ * Copyright (c) 2010 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 usbvirtkbd
+ * @{
+ */
+/** @file
+ * @brief HID Item related functions.
+ */
+#ifndef VUK_ITEM_H_
+#define VUK_ITEM_H_
+
+#include <sys/types.h>
+
+typedef uint8_t report_descriptor_data_t[];
+
+/* Item types. */
+#define ITEM_MAIN 0
+#define ITEM_GLOBAL 1
+#define ITEM_LOCAL 2
+
+
+
+/* Item tags. */
+
+/* Main item tags. */
+#define TAG_INPUT 8
+#define TAG_OUTPUT 9
+#define TAG_FEATURE 11
+#define TAG_COLLECTION 10
+#define TAG_END_COLLECTION 12
+
+/* Global item tags. */
+#define TAG_USAGE_PAGE 0
+#define TAG_LOGICAL_MINIMUM 1
+#define TAG_LOGICAL_MAXIMUM 2
+#define TAG_REPORT_SIZE 7
+#define TAG_REPORT_COUNT 9
+
+/* Local item tags. */
+#define TAG_USAGE 0
+#define TAG_USAGE_MINIMUM 1
+#define TAG_USAGE_MAXIMUM 2
+
+
+/* Bits for Input, Output and Feature items. */
+#define _IOF(value, shift) ((value) << (shift))
+#define IOF_DATA _IOF(0, 0)
+#define IOF_CONSTANT _IOF(1, 0)
+#define IOF_ARRAY _IOF(0, 1)
+#define IOF_VARIABLE _IOF(1, 1)
+#define IOF_ABSOLUTE _IOF(0, 2)
+#define IOF_RELATIVE _IOF(1, 2)
+/* ... */
+
+/* Collection types. */
+#define COLLECTION_PHYSICAL 0x00
+#define COLLECTION_APPLICATION 0x01
+
+
+/** Creates item prefix.
+ * @param size Item size.
+ * @param type Item type.
+ * @param tag Item tag.
+ */
+#define BUILD_ITEM_PREFIX(size, type, tag) \
+	((size) | ((type) << 2) | ((tag) << 4))
+
+/** Create no-data item.
+ * @param type Item type.
+ * @param tag Item tag.
+ */
+#define ITEM_CREATE0(type, tag) \
+	BUILD_ITEM_PREFIX(0, type, tag)
+
+/** Create item with 1-byte data.
+ * @param type Item type.
+ * @param tag Item tag.
+ * @param data Item data (single byte).
+ */
+#define ITEM_CREATE1(type, tag, data) \
+	BUILD_ITEM_PREFIX(1, type, tag), data
+
+
+#endif
+/**
+ * @}
+ */
Index: uspace/app/vuhid/report.h
===================================================================
--- uspace/app/vuhid/report.h	(revision a9431063c7daebc88e60dea71fc147ee9b1fda01)
+++ uspace/app/vuhid/report.h	(revision a9431063c7daebc88e60dea71fc147ee9b1fda01)
@@ -0,0 +1,85 @@
+/*
+ * Copyright (c) 2010 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 usbvirtkbd
+ * @{
+ */
+/** @file
+ * @brief HID Report Descriptor.
+ */
+#ifndef VUK_REPORT_H_
+#define VUK_REPORT_H_
+
+#include "items.h"
+
+/** Use standard Usage Page. */
+#define STD_USAGE_PAGE(page) \
+	ITEM_CREATE1(ITEM_GLOBAL, TAG_USAGE_PAGE, page)
+
+/** Usage with one byte usage ID. */
+#define USAGE1(usage_id) \
+	ITEM_CREATE1(ITEM_LOCAL, TAG_USAGE, usage_id)
+
+/** Start a collection. */
+#define START_COLLECTION(collection) \
+	ITEM_CREATE1(ITEM_MAIN, TAG_COLLECTION, collection)
+
+/** End a collection. */
+#define END_COLLECTION() \
+	ITEM_CREATE0(ITEM_MAIN, TAG_END_COLLECTION)
+
+
+#define USAGE_MINIMUM1(value) \
+	ITEM_CREATE1(ITEM_LOCAL, TAG_USAGE_MINIMUM, value)
+	
+#define USAGE_MAXIMUM1(value) \
+	ITEM_CREATE1(ITEM_LOCAL, TAG_USAGE_MAXIMUM, value)
+	
+#define LOGICAL_MINIMUM1(value) \
+	ITEM_CREATE1(ITEM_GLOBAL, TAG_LOGICAL_MINIMUM, value)
+
+#define LOGICAL_MAXIMUM1(value) \
+	ITEM_CREATE1(ITEM_GLOBAL, TAG_LOGICAL_MAXIMUM, value)
+
+#define REPORT_SIZE1(size) \
+	ITEM_CREATE1(ITEM_GLOBAL, TAG_REPORT_SIZE, size)
+
+#define REPORT_COUNT1(count) \
+	ITEM_CREATE1(ITEM_GLOBAL, TAG_REPORT_COUNT, count)
+	
+#define INPUT(modifiers) \
+	ITEM_CREATE1(ITEM_MAIN, TAG_INPUT, modifiers)
+
+#define OUTPUT(modifiers) \
+	ITEM_CREATE1(ITEM_MAIN, TAG_OUTPUT, modifiers)
+
+
+#endif
+/**
+ * @}
+ */
