Index: uspace/drv/bus/usb/ehci/ehci_batch.h
===================================================================
--- uspace/drv/bus/usb/ehci/ehci_batch.h	(revision 55958412df6b000da41325bf219018aabc44bde9)
+++ uspace/drv/bus/usb/ehci/ehci_batch.h	(revision 3b60ea0ab63232b82cbb39069c74d417545a98e6)
@@ -39,5 +39,5 @@
 #include <stdbool.h>
 #include <usb/host/usb_transfer_batch.h>
-#include <usb/host/dma_buffer.h>
+#include <usb/dma_buffer.h>
 
 #include "hw_struct/queue_head.h"
Index: uspace/drv/bus/usb/ehci/ehci_bus.h
===================================================================
--- uspace/drv/bus/usb/ehci/ehci_bus.h	(revision 55958412df6b000da41325bf219018aabc44bde9)
+++ uspace/drv/bus/usb/ehci/ehci_bus.h	(revision 3b60ea0ab63232b82cbb39069c74d417545a98e6)
@@ -40,5 +40,5 @@
 #include <usb/host/usb2_bus.h>
 #include <usb/host/endpoint.h>
-#include <usb/host/dma_buffer.h>
+#include <usb/dma_buffer.h>
 
 #include "hw_struct/queue_head.h"
Index: uspace/drv/bus/usb/xhci/commands.h
===================================================================
--- uspace/drv/bus/usb/xhci/commands.h	(revision 55958412df6b000da41325bf219018aabc44bde9)
+++ uspace/drv/bus/usb/xhci/commands.h	(revision 3b60ea0ab63232b82cbb39069c74d417545a98e6)
@@ -40,5 +40,5 @@
 #include <stdbool.h>
 #include <fibril_synch.h>
-#include <usb/host/dma_buffer.h>
+#include <usb/dma_buffer.h>
 #include "hw_struct/trb.h"
 #include "trb_ring.h"
Index: uspace/drv/bus/usb/xhci/device.h
===================================================================
--- uspace/drv/bus/usb/xhci/device.h	(revision 55958412df6b000da41325bf219018aabc44bde9)
+++ uspace/drv/bus/usb/xhci/device.h	(revision 3b60ea0ab63232b82cbb39069c74d417545a98e6)
@@ -36,5 +36,5 @@
 
 #include <usb/host/bus.h>
-#include <usb/host/dma_buffer.h>
+#include <usb/dma_buffer.h>
 
 typedef struct xhci_slot_ctx xhci_slot_ctx_t;
Index: uspace/drv/bus/usb/xhci/endpoint.h
===================================================================
--- uspace/drv/bus/usb/xhci/endpoint.h	(revision 55958412df6b000da41325bf219018aabc44bde9)
+++ uspace/drv/bus/usb/xhci/endpoint.h	(revision 3b60ea0ab63232b82cbb39069c74d417545a98e6)
@@ -40,5 +40,5 @@
 
 #include <usb/debug.h>
-#include <usb/host/dma_buffer.h>
+#include <usb/dma_buffer.h>
 #include <usb/host/endpoint.h>
 #include <usb/host/hcd.h>
Index: uspace/drv/bus/usb/xhci/isoch.h
===================================================================
--- uspace/drv/bus/usb/xhci/isoch.h	(revision 55958412df6b000da41325bf219018aabc44bde9)
+++ uspace/drv/bus/usb/xhci/isoch.h	(revision 3b60ea0ab63232b82cbb39069c74d417545a98e6)
@@ -37,5 +37,5 @@
 #define XHCI_ISOCH_H
 
-#include <usb/host/dma_buffer.h>
+#include <usb/dma_buffer.h>
 
 #include "trb_ring.h"
Index: uspace/drv/bus/usb/xhci/rh.c
===================================================================
--- uspace/drv/bus/usb/xhci/rh.c	(revision 55958412df6b000da41325bf219018aabc44bde9)
+++ uspace/drv/bus/usb/xhci/rh.c	(revision 3b60ea0ab63232b82cbb39069c74d417545a98e6)
@@ -40,5 +40,5 @@
 #include <usb/host/bus.h>
 #include <usb/host/ddf_helpers.h>
-#include <usb/host/dma_buffer.h>
+#include <usb/dma_buffer.h>
 #include <usb/host/hcd.h>
 #include <usb/port.h>
Index: uspace/drv/bus/usb/xhci/scratchpad.h
===================================================================
--- uspace/drv/bus/usb/xhci/scratchpad.h	(revision 55958412df6b000da41325bf219018aabc44bde9)
+++ uspace/drv/bus/usb/xhci/scratchpad.h	(revision 3b60ea0ab63232b82cbb39069c74d417545a98e6)
@@ -41,5 +41,5 @@
 #define XHCI_SCRATCHPAD_H
 
-#include <usb/host/dma_buffer.h>
+#include <usb/dma_buffer.h>
 
 typedef struct xhci_hc xhci_hc_t;
Index: uspace/drv/bus/usb/xhci/trb_ring.h
===================================================================
--- uspace/drv/bus/usb/xhci/trb_ring.h	(revision 55958412df6b000da41325bf219018aabc44bde9)
+++ uspace/drv/bus/usb/xhci/trb_ring.h	(revision 3b60ea0ab63232b82cbb39069c74d417545a98e6)
@@ -46,5 +46,5 @@
 #include <fibril_synch.h>
 #include <libarch/config.h>
-#include <usb/host/dma_buffer.h>
+#include <usb/dma_buffer.h>
 
 typedef struct trb_segment trb_segment_t;
Index: uspace/lib/usb/Makefile
===================================================================
--- uspace/lib/usb/Makefile	(revision 55958412df6b000da41325bf219018aabc44bde9)
+++ uspace/lib/usb/Makefile	(revision 3b60ea0ab63232b82cbb39069c74d417545a98e6)
@@ -35,4 +35,5 @@
 	src/dev.c \
 	src/debug.c \
+	src/dma_buffer.c \
 	src/dump.c \
 	src/port.c \
Index: uspace/lib/usb/include/usb/dma_buffer.h
===================================================================
--- uspace/lib/usb/include/usb/dma_buffer.h	(revision 3b60ea0ab63232b82cbb39069c74d417545a98e6)
+++ uspace/lib/usb/include/usb/dma_buffer.h	(revision 3b60ea0ab63232b82cbb39069c74d417545a98e6)
@@ -0,0 +1,72 @@
+/*
+ * Copyright (c) 2017 Ondrej Hlavaty <aearsis@eideo.cz>
+ * 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 libusb
+ * @{
+ */
+/** @file
+ * @brief USB host controller library: DMA buffer helpers
+ *
+ * Simplifies usage of bounce buffers.
+ *
+ * Currently the minimum size allocated is a page, which is wasteful. Could be
+ * extended to support memory pools, which will enable smaller units of
+ * allocation.
+ */
+#ifndef LIB_USB_DMA_BUFFER
+#define LIB_USB_DMA_BUFFER
+
+#include <stdint.h>
+#include <stdlib.h>
+#include <errno.h>
+
+typedef const struct dma_policy {
+	bool use64;		/**< Whether to use more than initial 4GiB of memory */
+	size_t alignment;	/**< What alignment is needed. At most PAGE_SIZE. */
+} dma_policy_t;
+
+typedef struct dma_buffer {
+	void *virt;
+	uintptr_t phys;
+} dma_buffer_t;
+
+extern dma_policy_t dma_policy_default;
+
+extern int dma_buffer_alloc(dma_buffer_t *db, size_t size);
+extern int dma_buffer_alloc_policy(dma_buffer_t *, size_t, dma_policy_t);
+extern void dma_buffer_free(dma_buffer_t *);
+extern uintptr_t dma_buffer_phys(const dma_buffer_t *, void *);
+
+static inline int dma_buffer_is_set(dma_buffer_t *db)
+{
+	return !!db->virt;
+}
+
+#endif
+/**
+ * @}
+ */
Index: uspace/lib/usb/src/dma_buffer.c
===================================================================
--- uspace/lib/usb/src/dma_buffer.c	(revision 3b60ea0ab63232b82cbb39069c74d417545a98e6)
+++ uspace/lib/usb/src/dma_buffer.c	(revision 3b60ea0ab63232b82cbb39069c74d417545a98e6)
@@ -0,0 +1,122 @@
+/*
+ * Copyright (c) 2017 Ondrej Hlavaty <aearsis@eideo.cz>
+ * 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 libusb
+ * @{
+ */
+/** @file
+ */
+
+#include <align.h>
+#include <as.h>
+#include <ddi.h>
+#include <stddef.h>
+
+#include "usb/dma_buffer.h"
+
+dma_policy_t dma_policy_default = {
+	.use64 = false,
+	.alignment = PAGE_SIZE,
+};
+
+/**
+ * Allocate a DMA buffer.
+ *
+ * @param[in] db dma_buffer_t structure to fill
+ * @param[in] policy dma_policy_t structure to guide
+ * @param[in] size Size of the required memory space
+ * @return Error code.
+ */
+int dma_buffer_alloc_policy(dma_buffer_t *db, size_t size, dma_policy_t policy)
+{
+	assert(db);
+
+	if (policy.alignment > PAGE_SIZE)
+		return EINVAL;
+
+	const size_t aligned_size = ALIGN_UP(size, policy.alignment);
+	const size_t real_size = ALIGN_UP(aligned_size, PAGE_SIZE);
+	const uintptr_t flags = policy.use64 ? 0 : DMAMEM_4GiB;
+
+	uintptr_t phys;
+	void *address = AS_AREA_ANY;
+
+	const int ret = dmamem_map_anonymous(real_size,
+	    flags, AS_AREA_READ | AS_AREA_WRITE, 0,
+	    &phys, &address);
+
+	if (ret == EOK) {
+		/* Poison, accessing it should be enough to make sure
+		 * the location is mapped, but poison works better */
+		memset(address, 0x5, real_size);
+		db->virt = address;
+		db->phys = phys;
+	}
+	return ret;
+}
+
+/**
+ * Allocate a DMA buffer using the default policy.
+ *
+ * @param[in] db dma_buffer_t structure to fill
+ * @param[in] size Size of the required memory space
+ * @return Error code.
+ */
+int dma_buffer_alloc(dma_buffer_t *db, size_t size)
+{
+	return dma_buffer_alloc_policy(db, size, dma_policy_default);
+}
+
+
+/**
+ * Free a DMA buffer.
+ *
+ * @param[in] db dma_buffer_t structure buffer of which will be freed
+ */
+void dma_buffer_free(dma_buffer_t *db)
+{
+	if (db->virt) {
+		dmamem_unmap_anonymous(db->virt);
+		db->virt = NULL;
+		db->phys = 0;
+	}
+}
+
+/**
+ * Convert a pointer inside a buffer to physical address.
+ *
+ * @param[in] db Buffer at which virt is pointing
+ * @param[in] virt Pointer somewhere inside db
+ */
+uintptr_t dma_buffer_phys(const dma_buffer_t *db, void *virt)
+{
+	return db->phys + (virt - db->virt);
+}
+
+/**
+ * @}
+ */
Index: uspace/lib/usbhost/Makefile
===================================================================
--- uspace/lib/usbhost/Makefile	(revision 55958412df6b000da41325bf219018aabc44bde9)
+++ uspace/lib/usbhost/Makefile	(revision 3b60ea0ab63232b82cbb39069c74d417545a98e6)
@@ -40,5 +40,4 @@
 	src/usb2_bus.c \
 	src/bandwidth.c \
-	src/dma_buffer.c \
 	src/utility.c \
 	src/usb_transfer_batch.c
Index: uspace/lib/usbhost/include/usb/host/dma_buffer.h
===================================================================
--- uspace/lib/usbhost/include/usb/host/dma_buffer.h	(revision 55958412df6b000da41325bf219018aabc44bde9)
+++ 	(revision )
@@ -1,72 +1,0 @@
-/*
- * Copyright (c) 2017 Ondrej Hlavaty <aearsis@eideo.cz>
- * 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 drvusbehci
- * @{
- */
-/** @file
- * @brief USB host controller library: DMA buffer helpers
- *
- * Simplifies usage of bounce buffers.
- *
- * Currently the minimum size allocated is a page, which is wasteful. Could be
- * extended to support memory pools, which will enable smaller units of
- * allocation.
- */
-#ifndef LIB_USBHOST_DMA_BUFFER
-#define LIB_USBHOST_DMA_BUFFER
-
-#include <stdint.h>
-#include <stdlib.h>
-#include <errno.h>
-
-typedef const struct dma_policy {
-	bool use64;		/**< Whether to use more than initial 4GiB of memory */
-	size_t alignment;	/**< What alignment is needed. At most PAGE_SIZE. */
-} dma_policy_t;
-
-typedef struct dma_buffer {
-	void *virt;
-	uintptr_t phys;
-} dma_buffer_t;
-
-extern dma_policy_t dma_policy_default;
-
-extern int dma_buffer_alloc(dma_buffer_t *db, size_t size);
-extern int dma_buffer_alloc_policy(dma_buffer_t *, size_t, dma_policy_t);
-extern void dma_buffer_free(dma_buffer_t *);
-extern uintptr_t dma_buffer_phys(const dma_buffer_t *, void *);
-
-static inline int dma_buffer_is_set(dma_buffer_t *db)
-{
-	return !!db->virt;
-}
-
-#endif
-/**
- * @}
- */
Index: uspace/lib/usbhost/src/dma_buffer.c
===================================================================
--- uspace/lib/usbhost/src/dma_buffer.c	(revision 55958412df6b000da41325bf219018aabc44bde9)
+++ 	(revision )
@@ -1,123 +1,0 @@
-/*
- * Copyright (c) 2013 Jan Vesely
- * Copyright (c) 2017 Ondrej Hlavaty <aearsis@eideo.cz>
- * 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 libusbhost
- * @{
- */
-/** @file
- */
-
-#include <align.h>
-#include <as.h>
-#include <ddi.h>
-#include <stddef.h>
-
-#include "dma_buffer.h"
-
-dma_policy_t dma_policy_default = {
-	.use64 = false,
-	.alignment = PAGE_SIZE,
-};
-
-/**
- * Allocate a DMA buffer.
- *
- * @param[in] db dma_buffer_t structure to fill
- * @param[in] policy dma_policy_t structure to guide
- * @param[in] size Size of the required memory space
- * @return Error code.
- */
-int dma_buffer_alloc_policy(dma_buffer_t *db, size_t size, dma_policy_t policy)
-{
-	assert(db);
-
-	if (policy.alignment > PAGE_SIZE)
-		return EINVAL;
-
-	const size_t aligned_size = ALIGN_UP(size, policy.alignment);
-	const size_t real_size = ALIGN_UP(aligned_size, PAGE_SIZE);
-	const uintptr_t flags = policy.use64 ? 0 : DMAMEM_4GiB;
-
-	uintptr_t phys;
-	void *address = AS_AREA_ANY;
-
-	const int ret = dmamem_map_anonymous(real_size,
-	    flags, AS_AREA_READ | AS_AREA_WRITE, 0,
-	    &phys, &address);
-
-	if (ret == EOK) {
-		/* Poison, accessing it should be enough to make sure
-		 * the location is mapped, but poison works better */
-		memset(address, 0x5, real_size);
-		db->virt = address;
-		db->phys = phys;
-	}
-	return ret;
-}
-
-/**
- * Allocate a DMA buffer using the default policy.
- *
- * @param[in] db dma_buffer_t structure to fill
- * @param[in] size Size of the required memory space
- * @return Error code.
- */
-int dma_buffer_alloc(dma_buffer_t *db, size_t size)
-{
-	return dma_buffer_alloc_policy(db, size, dma_policy_default);
-}
-
-
-/**
- * Free a DMA buffer.
- *
- * @param[in] db dma_buffer_t structure buffer of which will be freed
- */
-void dma_buffer_free(dma_buffer_t *db)
-{
-	if (db->virt) {
-		dmamem_unmap_anonymous(db->virt);
-		db->virt = NULL;
-		db->phys = 0;
-	}
-}
-
-/**
- * Convert a pointer inside a buffer to physical address.
- *
- * @param[in] db Buffer at which virt is pointing
- * @param[in] virt Pointer somewhere inside db
- */
-uintptr_t dma_buffer_phys(const dma_buffer_t *db, void *virt)
-{
-	return db->phys + (virt - db->virt);
-}
-
-/**
- * @}
- */
