Index: uspace/lib/usb/include/usb/classes/hub.h
===================================================================
--- uspace/lib/usb/include/usb/classes/hub.h	(revision 28f8f1707abf5bd47a47210ade9902a498f8a797)
+++ uspace/lib/usb/include/usb/classes/hub.h	(revision 89128f37525649ee8a7c2d6155cdc0a5b27244e9)
@@ -84,7 +84,8 @@
 
 /**
- *	@brief usb hub descriptor
- *
- *	For more information see Universal Serial Bus Specification Revision 1.1 chapter 11.16.2
+ * @brief usb hub descriptor
+ *
+ * For more information see Universal Serial Bus Specification Revision 1.1
+ * chapter 11.16.2
  */
 typedef struct usb_hub_descriptor_type {
Index: uspace/lib/usb/src/usb.c
===================================================================
--- uspace/lib/usb/src/usb.c	(revision 28f8f1707abf5bd47a47210ade9902a498f8a797)
+++ uspace/lib/usb/src/usb.c	(revision 89128f37525649ee8a7c2d6155cdc0a5b27244e9)
@@ -39,27 +39,27 @@
 
 static const char *str_speed[] = {
-	"low",
-	"full",
-	"high"
+	[USB_SPEED_LOW] = "low",
+	[USB_SPEED_FULL] = "full",
+	[USB_SPEED_HIGH] = "high",
 };
 
 static const char *str_transfer_type[] = {
-	"control",
-	"isochronous",
-	"bulk",
-	"interrupt"
+	[USB_TRANSFER_CONTROL] = "control",
+	[USB_TRANSFER_ISOCHRONOUS] = "isochronous",
+	[USB_TRANSFER_BULK] = "bulk",
+	[USB_TRANSFER_INTERRUPT] = "interrupt",
 };
 
 static const char *str_transfer_type_short[] = {
-	"ctrl",
-	"iso",
-	"bulk",
-	"intr"
+	[USB_TRANSFER_CONTROL] = "ctrl",
+	[USB_TRANSFER_ISOCHRONOUS] = "iso",
+	[USB_TRANSFER_BULK] = "bulk",
+	[USB_TRANSFER_INTERRUPT] = "intr",
 };
 
 static const char *str_direction[] = {
-	"in",
-	"out",
-	"both"
+	[USB_DIRECTION_IN] = "in",
+	[USB_DIRECTION_OUT] = "out",
+	[USB_DIRECTION_BOTH] = "both",
 };
 
Index: uspace/lib/usbdev/include/usb/dev/request.h
===================================================================
--- uspace/lib/usbdev/include/usb/dev/request.h	(revision 28f8f1707abf5bd47a47210ade9902a498f8a797)
+++ uspace/lib/usbdev/include/usb/dev/request.h	(revision 89128f37525649ee8a7c2d6155cdc0a5b27244e9)
@@ -83,4 +83,10 @@
 	uint8_t request_type;
 #define SETUP_REQUEST_TYPE_DEVICE_TO_HOST (1 << 7)
+#define SETUP_REQUEST_TYPE_GET_TYPE(rt) ((rt >> 5) & 0x3)
+#define SETUP_REQUEST_TYPE_GET_RECIPIENT(rec) (rec & 0x1f)
+#define SETUP_REQUEST_TO_HOST(type, recipient) \
+    (uint8_t)((1 << 7) | ((type & 0x3) << 5) | (recipient & 0x1f))
+#define SETUP_REQUEST_TO_DEVICE(type, recipient) \
+    (uint8_t)(((type & 0x3) << 5) | (recipient & 0x1f))
 
 	/** Request identification. */
Index: uspace/lib/usbhost/include/usb/host/usb_transfer_batch.h
===================================================================
--- uspace/lib/usbhost/include/usb/host/usb_transfer_batch.h	(revision 28f8f1707abf5bd47a47210ade9902a498f8a797)
+++ uspace/lib/usbhost/include/usb/host/usb_transfer_batch.h	(revision 89128f37525649ee8a7c2d6155cdc0a5b27244e9)
@@ -106,20 +106,19 @@
 void usb_transfer_batch_destroy(const usb_transfer_batch_t *instance);
 
-void usb_transfer_batch_finish(const usb_transfer_batch_t *instance,
-    const void* data, size_t size);
+void usb_transfer_batch_finish_error(const usb_transfer_batch_t *instance,
+    const void* data, size_t size, int error);
 /*----------------------------------------------------------------------------*/
-/** Override error value and finishes transfer.
+/** Finish batch using stored error value.
  *
  * @param[in] instance Batch structure to use.
  * @param[in] data Data to copy to the output buffer.
  * @param[in] size Size of @p data.
- * @param[in] error Set batch status to this error value.
  */
-static inline void usb_transfer_batch_finish_error(
-    usb_transfer_batch_t *instance, const void* data, size_t size, int error)
+static inline void usb_transfer_batch_finish(
+    const usb_transfer_batch_t *instance, const void* data)
 {
 	assert(instance);
-	instance->error = error;
-	usb_transfer_batch_finish(instance, data, size);
+	usb_transfer_batch_finish_error(
+	    instance, data, instance->transfered_size, instance->error);
 }
 /*----------------------------------------------------------------------------*/
Index: uspace/lib/usbhost/src/usb_transfer_batch.c
===================================================================
--- uspace/lib/usbhost/src/usb_transfer_batch.c	(revision 28f8f1707abf5bd47a47210ade9902a498f8a797)
+++ uspace/lib/usbhost/src/usb_transfer_batch.c	(revision 89128f37525649ee8a7c2d6155cdc0a5b27244e9)
@@ -33,5 +33,5 @@
  */
 #include <errno.h>
-#include <str_error.h>
+#include <macros.h>
 
 #include <usb/usb.h>
@@ -121,7 +121,8 @@
  * @param[in] data Data to copy to the output buffer.
  * @param[in] size Size of @p data.
+ * @param[in] error Error value to use.
  */
-void usb_transfer_batch_finish(
-    const usb_transfer_batch_t *instance, const void *data, size_t size)
+void usb_transfer_batch_finish_error(const usb_transfer_batch_t *instance,
+    const void *data, size_t size, int error)
 {
 	assert(instance);
@@ -133,5 +134,5 @@
 		/* Check for commands that reset toggle bit */
 		if (instance->ep->transfer_type == USB_TRANSFER_CONTROL
-		    && instance->error == EOK) {
+		    && error == EOK) {
 			const usb_target_t target =
 			    {{ instance->ep->address, instance->ep->endpoint }};
@@ -139,17 +140,15 @@
 			    instance->setup_buffer);
 		}
-		instance->callback_out(instance->fun,
-		    instance->error, instance->arg);
+		instance->callback_out(instance->fun, error, instance->arg);
 	}
 
         if (instance->callback_in) {
 		/* We care about the data and there are some to copy */
+		const size_t safe_size = min(size, instance->buffer_size);
 		if (data) {
-			const size_t min_size = size < instance->buffer_size
-			    ? size : instance->buffer_size;
-	                memcpy(instance->buffer, data, min_size);
+	                memcpy(instance->buffer, data, safe_size);
 		}
-		instance->callback_in(instance->fun, instance->error,
-		    instance->transfered_size, instance->arg);
+		instance->callback_in(instance->fun, error,
+		    safe_size, instance->arg);
 	}
 }
