Index: uspace/drv/uhci/callback.h
===================================================================
--- uspace/drv/uhci/callback.h	(revision 96005163d202072b0cdf54f68060b64c90325f7f)
+++ uspace/drv/uhci/callback.h	(revision 96005163d202072b0cdf54f68060b64c90325f7f)
@@ -0,0 +1,51 @@
+/*
+ * Copyright (c) 2010 Jan Vesely
+ * 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 usb
+ * @{
+ */
+/** @file
+ * @brief UHCI driver
+ */
+#ifndef DRV_UHCI_CALLBACK_H
+#define DRV_UHCI_CALLBACK_H
+
+#include <usbhc_iface.h>
+
+typedef struct callback
+{
+	union {
+		usbhc_iface_transfer_in_callback_t callback_in;
+		usbhc_iface_transfer_out_callback_t callback_out;
+	};
+	void* buffer;
+} callback_t;
+
+#endif
+/**
+ * @}
+ */
Index: pace/drv/uhci/link_ptr.h
===================================================================
--- uspace/drv/uhci/link_ptr.h	(revision 1062c8d6193b5d3f1278c896f7795e458c5aea4b)
+++ 	(revision )
@@ -1,45 +1,0 @@
-/*
- * Copyright (c) 2010 Jan Vesely
- * 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 usb
- * @{
- */
-/** @file
- * @brief UHCI driver
- */
-#ifndef DRV_UHCI_LINK_PTR_H
-#define DRV_UHCI_LINK_PTR_H
-
-#include "td_ptr.h"
-
-/** Links in Frame List */
-typedef td_ptr_t link_ptr_t;
-
-#endif
-/**
- * @}
- */
Index: pace/drv/uhci/qh.h
===================================================================
--- uspace/drv/uhci/qh.h	(revision 1062c8d6193b5d3f1278c896f7795e458c5aea4b)
+++ 	(revision )
@@ -1,47 +1,0 @@
-
-/*
- * Copyright (c) 2010 Jan Vesely
- * 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 usb
- * @{
- */
-/** @file
- * @brief UHCI driver
- */
-#ifndef DRV_UHCI_QH_H
-#define DRV_UHCI_QH_H
-
-#include "link_ptr.h"
-
-typedef struct qh {
-	link_ptr_t
-} __attribute__(("packed")) link_ptr_t;
-
-#endif
-/**
- * @}
- */
Index: pace/drv/uhci/td_ptr.h
===================================================================
--- uspace/drv/uhci/td_ptr.h	(revision 1062c8d6193b5d3f1278c896f7795e458c5aea4b)
+++ 	(revision )
@@ -1,48 +1,0 @@
-/*
- * Copyright (c) 2010 Jan Vesely
- * 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 usb
- * @{
- */
-/** @file
- * @brief UHCI driver
- */
-#ifndef DRV_UHCI_TD_PTR_H
-#define DRV_UHCI_TD_PTR_H
-
-/** UHCI Transfer Descriptor pointer */
-typedef struct td_ptr {
-	uint32_t fpl:28;
-	char :2;
-	uint8_t qh:1;
-	uint8_t terminate:1;
-} __attribute__(("packed")) td_ptr_t;
-
-#endif
-/**
- * @}
- */
Index: pace/drv/uhci/transfer.h
===================================================================
--- uspace/drv/uhci/transfer.h	(revision 1062c8d6193b5d3f1278c896f7795e458c5aea4b)
+++ 	(revision )
@@ -1,81 +1,0 @@
-/*
- * Copyright (c) 2010 Jan Vesely
- * 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 usb
- * @{
- */
-/** @file
- * @brief UHCI driver
- */
-#ifndef DRV_UHCI_TRANSFER_H
-#define DRV_UHCI_TRANSFER_H
-
-/** Status field in UHCI Transfer Descriptor (TD) */
-typedef struct status {
-	uint8_t active:1;
-	uint8_t stalled:1;
-	uint8_t data_buffer_error:1;
-	uint8_t babble:1;
-	uint8_t nak:1;
-	uint8_t crc:1;
-	uint8_t bitstuff:1;
-	uint8_t :1; /* reserved */
-} status_t
-
-/** UHCI Transfer Descriptor */
-typedef struct td {
-	uint32_t fpl:28;
-	char :1; /* reserved */
-	uint8_t depth:1;
-	uint8_t qh:1;
-	uint8_t terminate:1;
-
-	char :2; /* reserved */
-	uint8_t spd:1;
-	uint8_t error_count:2;
-	uint8_t low_speed:1;
-	uint8_t isochronous:1;
-	uint8_t ioc:1;
-	status_t status;
-	char :5; /* reserved */
-	uint16_t act_len:10;
-
-	uint16_t maxlen:11;
-	char :1; /* reserved */
-	uint8_t toggle:1;
-	uint8_t end_point:4;
-	uint8_t address:7;
-	uint8_t pid;
-
-	uint32_t buffer_ptr;
-} __attribute__(("packed")) td_t;
-
-
-#endif
-/**
- * @}
- */
Index: uspace/drv/uhci/transfer_list.h
===================================================================
--- uspace/drv/uhci/transfer_list.h	(revision 96005163d202072b0cdf54f68060b64c90325f7f)
+++ uspace/drv/uhci/transfer_list.h	(revision 96005163d202072b0cdf54f68060b64c90325f7f)
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2010 Jan Vesely
+ * 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 usb
+ * @{
+ */
+/** @file
+ * @brief UHCI driver
+ */
+#ifndef DRV_UHCI_TRANSFER_LIST_H
+#define DRV_UHCI_TRANSFER_LIST_H
+
+#include "debug.h"
+#include "translating_malloc.h"
+#include "uhci_struct/queue_head.h"
+#include "uhci_struct/transfer_descriptor.h"
+
+typedef struct transfer_list
+{
+	transfer_descriptor_t *first;
+	transfer_descriptor_t *last;
+	queue_head_t *queue_head;
+	uint32_t queue_head_pa;
+} transfer_list_t;
+
+static inline int transfer_list_init(
+  transfer_list_t *instance, transfer_list_t *next)
+{
+	assert(instance);
+	instance->first = NULL;
+	instance->last = NULL;
+	instance->queue_head = trans_malloc(sizeof(queue_head_t));
+	if (!instance->queue_head) {
+		uhci_print_error("Failed to allocate queue head.\n");
+		return ENOMEM;
+	}
+	instance->queue_head_pa = (uintptr_t)addr_to_phys(instance->queue_head);
+
+	uint32_t next_pa = next ? next->queue_head_pa : 0;
+	queue_head_init(instance->queue_head, next_pa);
+	return EOK;
+}
+
+static inline void transfer_list_fini(transfer_list_t *instance)
+{
+	assert(instance);
+	if (instance->queue_head)
+		free(instance->queue_head);
+}
+
+#endif
+/**
+ * @}
+ */
Index: uspace/drv/uhci/translating_malloc.h
===================================================================
--- uspace/drv/uhci/translating_malloc.h	(revision 96005163d202072b0cdf54f68060b64c90325f7f)
+++ uspace/drv/uhci/translating_malloc.h	(revision 96005163d202072b0cdf54f68060b64c90325f7f)
@@ -0,0 +1,54 @@
+/*
+ * Copyright (c) 2010 Jan Vesely
+ * 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 usb
+ * @{
+ */
+/** @file
+ * @brief UHCI driver
+ */
+#ifndef DRV_UHCI_TRANSLATOR_H
+#define DRV_UHCI_TRANSLATOR_H
+
+#include <malloc.h>
+
+static inline void * addr_to_phys( void *addr )
+	{ return addr; }
+
+static inline void * addr_to_virt( void *addr )
+	{ return addr; }
+
+static inline void * trans_malloc( size_t size )
+	{ return malloc( size ); }
+
+static inline void trans_free( void * addr )
+	{ free( addr ); }
+
+#endif
+/**
+ * @}
+ */
Index: uspace/drv/uhci/uhci.c
===================================================================
--- uspace/drv/uhci/uhci.c	(revision 1062c8d6193b5d3f1278c896f7795e458c5aea4b)
+++ uspace/drv/uhci/uhci.c	(revision 96005163d202072b0cdf54f68060b64c90325f7f)
@@ -3,7 +3,11 @@
 #include <usb/usb.h>
 
+#include "translating_malloc.h"
+
 #include "debug.h"
 #include "name.h"
 #include "uhci.h"
+
+static int init_tranfer_lists(transfer_list_t list[]);
 
 int uhci_init(device_t *device, void *regs)
@@ -26,5 +30,5 @@
 	if (ret < 0) {
 		free( instance );
-		printf(NAME": Failed to gain access to registers at %p\n", io);
+		uhci_print_error("Failed to gain access to registers at %p\n", io);
 		return ret;
 	}
@@ -32,13 +36,63 @@
 
 	/* init root hub */
-	ret = uhci_root_hub_init( &instance->root_hub, device,
-	  (char*)regs + UHCI_ROOT_HUB_PORT_REGISTERS_OFFSET );
+	ret = uhci_root_hub_init(&instance->root_hub, device,
+	  (char*)regs + UHCI_ROOT_HUB_PORT_REGISTERS_OFFSET);
 	if (ret < 0) {
-		free( instance );
-		printf(NAME": Failed to initialize root hub driver.\n");
+		free(instance);
+		uhci_print_error("Failed to initialize root hub driver.\n");
+		return ret;
+	}
+
+	instance->frame_list = trans_malloc(sizeof(frame_list_t));
+	if (instance->frame_list == NULL) {
+		uhci_print_error("Failed to allocate frame list pointer.\n");
+		uhci_root_hub_fini(&instance->root_hub);
+		free(instance);
+		return ENOMEM;
+	}
+
+	const uintptr_t pa = (uintptr_t)addr_to_phys(instance->frame_list);
+
+	pio_write_32(&instance->registers->flbaseadd, (uint32_t)pa);
+
+	ret = init_tranfer_lists(instance->transfers);
+	if (ret != EOK) {
+		uhci_print_error("Transfer list initialization failed.\n");
+		uhci_root_hub_fini(&instance->root_hub);
+		free(instance);
 		return ret;
 	}
 
 	device->driver_data = instance;
+	return EOK;
+}
+/*----------------------------------------------------------------------------*/
+int init_tranfer_lists(transfer_list_t transfers[])
+{
+	//TODO:refactor
+	int ret;
+	ret = transfer_list_init(&transfers[USB_TRANSFER_BULK], NULL);
+	if (ret != EOK) {
+		uhci_print_error("Failed to inititalize bulk queue.\n");
+		return ret;
+	}
+
+	ret = transfer_list_init(
+	  &transfers[USB_TRANSFER_CONTROL], &transfers[USB_TRANSFER_BULK]);
+	if (ret != EOK) {
+		uhci_print_error("Failed to inititalize control queue.\n");
+		transfer_list_fini(&transfers[USB_TRANSFER_BULK]);
+		return ret;
+	}
+
+	ret = transfer_list_init(
+	  &transfers[USB_TRANSFER_INTERRUPT], &transfers[USB_TRANSFER_CONTROL]);
+	if (ret != EOK) {
+		uhci_print_error("Failed to interrupt control queue.\n");
+		transfer_list_fini(&transfers[USB_TRANSFER_CONTROL]);
+		transfer_list_fini(&transfers[USB_TRANSFER_BULK]);
+		return ret;
+	}
+
 	return EOK;
 }
Index: uspace/drv/uhci/uhci.h
===================================================================
--- uspace/drv/uhci/uhci.h	(revision 1062c8d6193b5d3f1278c896f7795e458c5aea4b)
+++ uspace/drv/uhci/uhci.h	(revision 96005163d202072b0cdf54f68060b64c90325f7f)
@@ -42,4 +42,7 @@
 
 #include "root_hub/root_hub.h"
+#include "uhci_struct/frame_list.h"
+#include "transfer_list.h"
+
 
 typedef struct uhci_regs {
@@ -52,9 +55,15 @@
 } regs_t;
 
+#define TRANSFER_QUEUES 4
+
 typedef struct uhci {
 	usb_address_keeping_t address_manager;
 	uhci_root_hub_t root_hub;
-	volatile regs_t* registers;
-} uhci_t ;
+	volatile regs_t *registers;
+
+	frame_list_t *frame_list;
+
+	transfer_list_t transfers[TRANSFER_QUEUES];
+} uhci_t;
 
 /* init uhci specifics in device.driver_data */
Index: uspace/drv/uhci/uhci_struct/frame_list.h
===================================================================
--- uspace/drv/uhci/uhci_struct/frame_list.h	(revision 96005163d202072b0cdf54f68060b64c90325f7f)
+++ uspace/drv/uhci/uhci_struct/frame_list.h	(revision 96005163d202072b0cdf54f68060b64c90325f7f)
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2010 Jan Vesely
+ * 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 usb
+ * @{
+ */
+/** @file
+ * @brief UHCI driver
+ */
+#ifndef DRV_UHCI_FRAME_LIST_H
+#define DRV_UHCI_FRAME_LIST_H
+
+#include "link_pointer.h"
+
+#define UHCI_FRAME_LIST_COUNT 1024
+
+typedef link_pointer_t frame_list_t[UHCI_FRAME_LIST_COUNT];
+#endif
+/**
+ * @}
+ */
Index: uspace/drv/uhci/uhci_struct/link_pointer.h
===================================================================
--- uspace/drv/uhci/uhci_struct/link_pointer.h	(revision 96005163d202072b0cdf54f68060b64c90325f7f)
+++ uspace/drv/uhci/uhci_struct/link_pointer.h	(revision 96005163d202072b0cdf54f68060b64c90325f7f)
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2010 Jan Vesely
+ * 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 usb
+ * @{
+ */
+/** @file
+ * @brief UHCI driver
+ */
+#ifndef DRV_UHCI_LINK_POINTER_H
+#define DRV_UHCI_LINK_POINTER_H
+
+/* UHCI link pointer, used by many data structures */
+typedef struct link_pointer {
+	uint32_t addr:28;
+	uint8_t zero:1;
+	uint8_t reserved:1;
+	uint8_t qh:1;
+	uint8_t terminate:1;
+} __attribute__((packed)) link_pointer_t;
+
+#endif
+/**
+ * @}
+ */
+
Index: uspace/drv/uhci/uhci_struct/queue_head.h
===================================================================
--- uspace/drv/uhci/uhci_struct/queue_head.h	(revision 96005163d202072b0cdf54f68060b64c90325f7f)
+++ uspace/drv/uhci/uhci_struct/queue_head.h	(revision 96005163d202072b0cdf54f68060b64c90325f7f)
@@ -0,0 +1,66 @@
+
+/*
+ * Copyright (c) 2010 Jan Vesely
+ * 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 usb
+ * @{
+ */
+/** @file
+ * @brief UHCI driver
+ */
+#ifndef DRV_UHCI_QH_H
+#define DRV_UHCI_QH_H
+
+#include <assert.h>
+
+#include "translating_malloc.h"
+#include "link_pointer.h"
+
+typedef struct queue_head {
+	link_pointer_t next_queue;
+	link_pointer_t element;
+} __attribute__((packed)) queue_head_t;
+
+static inline void queue_head_init(queue_head_t *instance, uint32_t next_pa)
+{
+	assert(instance);
+	assert((next_pa & 0xf) == 0);
+
+	memset(instance, 0, sizeof(*instance));
+	instance->element.terminate = 1;
+	if (next_pa) {
+		instance->next_queue.terminate = 0;
+		instance->next_queue.addr = next_pa >> 4;
+	} else {
+		instance->element.terminate = 1;
+	}
+}
+
+#endif
+/**
+ * @}
+ */
Index: uspace/drv/uhci/uhci_struct/transfer_descriptor.h
===================================================================
--- uspace/drv/uhci/uhci_struct/transfer_descriptor.h	(revision 96005163d202072b0cdf54f68060b64c90325f7f)
+++ uspace/drv/uhci/uhci_struct/transfer_descriptor.h	(revision 96005163d202072b0cdf54f68060b64c90325f7f)
@@ -0,0 +1,90 @@
+/*
+ * Copyright (c) 2010 Jan Vesely
+ * 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 usb
+ * @{
+ */
+/** @file
+ * @brief UHCI driver
+ */
+#ifndef DRV_UHCI_TRANSFER_DESCRIPTOR_H
+#define DRV_UHCI_TRANSFER_DESCRIPTOR_H
+
+#include "callback.h"
+
+/** Status field in UHCI Transfer Descriptor (TD) */
+typedef struct status {
+	uint8_t active:1;
+	uint8_t stalled:1;
+	uint8_t data_buffer_error:1;
+	uint8_t babble:1;
+	uint8_t nak:1;
+	uint8_t crc:1;
+	uint8_t bitstuff:1;
+	uint8_t :1; /* reserved */
+} status_t;
+
+/** UHCI Transfer Descriptor */
+typedef struct transfer_descriptor {
+	uint32_t fpl:28;
+	char :1; /* reserved */
+	uint8_t depth:1;
+	uint8_t qh:1;
+	uint8_t terminate:1;
+
+	char :2; /* reserved */
+	uint8_t spd:1;
+	uint8_t error_count:2;
+	uint8_t low_speed:1;
+	uint8_t isochronous:1;
+	uint8_t ioc:1;
+	status_t status;
+	char :5; /* reserved */
+	uint16_t act_len:10;
+
+	uint16_t maxlen:11;
+	char :1; /* reserved */
+	uint8_t toggle:1;
+	uint8_t end_point:4;
+	uint8_t address:7;
+	uint8_t pid;
+
+	uint32_t buffer_ptr;
+
+	/* there is 16 byte of data available here
+	 * those are used to store callback pointer
+	 * and next pointer. Thus there is some free space
+	 * on 32bits systems.
+	 */
+	struct transfer_descriptor *next;
+	callback_t *callback;
+} __attribute__((packed)) transfer_descriptor_t;
+
+#endif
+/**
+ * @}
+ */
