Index: uspace/drv/bus/usb/usbhid/main.c
===================================================================
--- uspace/drv/bus/usb/usbhid/main.c	(revision 3e23316d5f84ed5e9d6882893c001916dc58833e)
+++ uspace/drv/bus/usb/usbhid/main.c	(revision 35bc430f632555e3c97a31892fd2ec0ceb60a89a)
@@ -89,13 +89,13 @@
 	 * This will create a separate fibril that will query the device
 	 * for the data continuously. */
-       rc = usb_device_auto_poll(dev,
+	rc = usb_device_auto_poll_desc(dev,
 	   /* Index of the polling pipe. */
-	   hid_dev->poll_pipe_index,
+	   hid_dev->poll_pipe_mapping->description,
 	   /* Callback when data arrives. */
 	   usb_hid_polling_callback,
 	   /* How much data to request. */
-	   dev->pipes[hid_dev->poll_pipe_index].pipe.max_packet_size,
+	   hid_dev->poll_pipe_mapping->pipe.max_packet_size,
 	   /* Delay */
-	   0,
+	   -1,
 	   /* Callback when the polling ends. */
 	   usb_hid_polling_ended_callback,
Index: uspace/drv/bus/usb/usbhid/usbhid.c
===================================================================
--- uspace/drv/bus/usb/usbhid/usbhid.c	(revision 3e23316d5f84ed5e9d6882893c001916dc58833e)
+++ uspace/drv/bus/usb/usbhid/usbhid.c	(revision 35bc430f632555e3c97a31892fd2ec0ceb60a89a)
@@ -41,5 +41,7 @@
 #include <usb/hid/hidreport.h>
 #include <usb/hid/request.h>
+
 #include <errno.h>
+#include <macros.h>
 #include <str_error.h>
 
@@ -265,5 +267,5 @@
 }
 
-static int usb_hid_check_pipes(usb_hid_dev_t *hid_dev, const usb_device_t *dev)
+static int usb_hid_check_pipes(usb_hid_dev_t *hid_dev, usb_device_t *dev)
 {
 	assert(hid_dev);
@@ -271,19 +273,18 @@
 
 	static const struct {
-		unsigned ep_number;
+		const usb_endpoint_description_t *desc;
 		const char* description;
 	} endpoints[] = {
-		{USB_HID_KBD_POLL_EP_NO, "Keyboard endpoint"},
-		{USB_HID_MOUSE_POLL_EP_NO, "Mouse endpoint"},
-		{USB_HID_GENERIC_POLL_EP_NO, "Generic HID endpoint"},
+		{&usb_hid_kbd_poll_endpoint_description, "Keyboard endpoint"},
+		{&usb_hid_mouse_poll_endpoint_description, "Mouse endpoint"},
+		{&usb_hid_generic_poll_endpoint_description, "Generic HID endpoint"},
 	};
 
-	for (unsigned i = 0; i < sizeof(endpoints)/sizeof(endpoints[0]); ++i) {
-		if (endpoints[i].ep_number >= dev->pipes_count) {
-			return EINVAL;
-		}
-		if (dev->pipes[endpoints[i].ep_number].present) {
+	for (unsigned i = 0; i < ARRAY_SIZE(endpoints); ++i) {
+		usb_endpoint_mapping_t *epm =
+		    usb_device_get_mapped_ep_desc(dev, endpoints[i].desc);
+		if (epm && epm->present) {
 			usb_log_debug("Found: %s.\n", endpoints[i].description);
-			hid_dev->poll_pipe_index = endpoints[i].ep_number;
+			hid_dev->poll_pipe_mapping = epm;
 			return EOK;
 		}
@@ -352,5 +353,5 @@
 	/* The USB device should already be initialized, save it in structure */
 	hid_dev->usb_dev = dev;
-	hid_dev->poll_pipe_index = -1;
+	hid_dev->poll_pipe_mapping = NULL;
 
 	int rc = usb_hid_check_pipes(hid_dev, dev);
@@ -382,6 +383,6 @@
 		    "boot protocol.\n");
 
-		switch (hid_dev->poll_pipe_index) {
-		case USB_HID_KBD_POLL_EP_NO:
+		switch (hid_dev->poll_pipe_mapping->interface->interface_protocol) {
+		case USB_HID_PROTOCOL_KEYBOARD:
 			usb_log_info("Falling back to kbd boot protocol.\n");
 			rc = usb_kbd_set_boot_protocol(hid_dev);
@@ -390,5 +391,5 @@
 			}
 			break;
-		case USB_HID_MOUSE_POLL_EP_NO:
+		case USB_HID_PROTOCOL_MOUSE:
 			usb_log_info("Falling back to mouse boot protocol.\n");
 			rc = usb_mouse_set_boot_protocol(hid_dev);
@@ -398,6 +399,4 @@
 			break;
 		default:
-			assert(hid_dev->poll_pipe_index
-			    == USB_HID_GENERIC_POLL_EP_NO);
 			usb_log_info("Falling back to generic HID driver.\n");
 			usb_hid_set_generic_hid_subdriver(hid_dev);
Index: uspace/drv/bus/usb/usbhid/usbhid.h
===================================================================
--- uspace/drv/bus/usb/usbhid/usbhid.h	(revision 3e23316d5f84ed5e9d6882893c001916dc58833e)
+++ uspace/drv/bus/usb/usbhid/usbhid.h	(revision 35bc430f632555e3c97a31892fd2ec0ceb60a89a)
@@ -103,6 +103,6 @@
 	usb_device_t *usb_dev;
 
-	/** Index of the polling pipe in usb_hid_endpoints array. */
-	unsigned poll_pipe_index;
+	/** Endpont mapping of the polling pipe. */
+	usb_endpoint_mapping_t *poll_pipe_mapping;
 
 	/** Subdrivers. */
@@ -132,16 +132,5 @@
 };
 
-
-
-enum {
-	USB_HID_KBD_POLL_EP_NO = 0,
-	USB_HID_MOUSE_POLL_EP_NO = 1,
-	USB_HID_GENERIC_POLL_EP_NO = 2,
-	USB_HID_POLL_EP_COUNT = 3
-};
-
 extern const usb_endpoint_description_t *usb_hid_endpoints[];
-
-
 
 int usb_hid_init(usb_hid_dev_t *hid_dev, usb_device_t *dev);
Index: uspace/drv/bus/usb/usbhub/main.c
===================================================================
--- uspace/drv/bus/usb/usbhub/main.c	(revision 3e23316d5f84ed5e9d6882893c001916dc58833e)
+++ uspace/drv/bus/usb/usbhub/main.c	(revision 35bc430f632555e3c97a31892fd2ec0ceb60a89a)
@@ -43,17 +43,4 @@
 #include "usbhub.h"
 
-/** Hub status-change endpoint description.
- *
- * For more information see section 11.15.1 of USB 1.1 specification.
- */
-static const usb_endpoint_description_t hub_status_change_endpoint_description =
-{
-	.transfer_type = USB_TRANSFER_INTERRUPT,
-	.direction = USB_DIRECTION_IN,
-	.interface_class = USB_CLASS_HUB,
-	.interface_subclass = 0,
-	.interface_protocol = 0,
-	.flags = 0
-};
 
 /** USB hub driver operations. */
Index: uspace/drv/bus/usb/usbhub/usbhub.c
===================================================================
--- uspace/drv/bus/usb/usbhub/usbhub.c	(revision 3e23316d5f84ed5e9d6882893c001916dc58833e)
+++ uspace/drv/bus/usb/usbhub/usbhub.c	(revision 35bc430f632555e3c97a31892fd2ec0ceb60a89a)
@@ -57,4 +57,17 @@
 
 #define HUB_FNC_NAME "hub"
+/** Hub status-change endpoint description.
+ *
+ * For more information see section 11.15.1 of USB 1.1 specification.
+ */
+const usb_endpoint_description_t hub_status_change_endpoint_description =
+{
+	.transfer_type = USB_TRANSFER_INTERRUPT,
+	.direction = USB_DIRECTION_IN,
+	.interface_class = USB_CLASS_HUB,
+	.interface_subclass = 0,
+	.interface_protocol = 0,
+	.flags = 0
+};
 
 /** Standard get hub global status request */
@@ -147,8 +160,8 @@
 
 	/* Start hub operation. */
-	opResult = usb_device_auto_poll(hub_dev->usb_device, 0,
+	opResult = usb_device_auto_poll_desc(hub_dev->usb_device,
+	    &hub_status_change_endpoint_description,
 	    hub_port_changes_callback, ((hub_dev->port_count + 1 + 7) / 8),
-	    255000,
-	    usb_hub_polling_terminated_callback, hub_dev);
+	    -1, usb_hub_polling_terminated_callback, hub_dev);
 	if (opResult != EOK) {
 		usb_pipe_end_long_transfer(control_pipe);
Index: uspace/drv/bus/usb/usbhub/usbhub.h
===================================================================
--- uspace/drv/bus/usb/usbhub/usbhub.h	(revision 3e23316d5f84ed5e9d6882893c001916dc58833e)
+++ uspace/drv/bus/usb/usbhub/usbhub.h	(revision 35bc430f632555e3c97a31892fd2ec0ceb60a89a)
@@ -80,4 +80,6 @@
 };
 
+extern const usb_endpoint_description_t hub_status_change_endpoint_description;
+
 int usb_hub_device_add(usb_device_t *usb_dev);
 int usb_hub_device_remove(usb_device_t *usb_dev);
