Index: uspace/drv/bus/usb/usbhub/port.c
===================================================================
--- uspace/drv/bus/usb/usbhub/port.c	(revision a590a234e3fa09134a796e63cb81d99174e458dd)
+++ uspace/drv/bus/usb/usbhub/port.c	(revision c0587d90d69ac91b4844e40a41481db1c0ed24ac)
@@ -73,15 +73,16 @@
  * @return Operation result
  */
-int usb_hub_clear_port_feature(usb_pipe_t *pipe,
-    int port_index, usb_hub_class_feature_t feature)
-{
+int usb_hub_clear_port_feature(
+    usb_hub_port_t *port, usb_hub_class_feature_t feature)
+{
+	assert(port);
 	usb_device_request_setup_packet_t clear_request = {
 		.request_type = USB_HUB_REQ_TYPE_CLEAR_PORT_FEATURE,
 		.request = USB_DEVREQ_CLEAR_FEATURE,
 		.value = feature,
-		.index = port_index,
+		.index = port->port_number,
 		.length = 0,
 	};
-	return usb_pipe_control_write(pipe, &clear_request,
+	return usb_pipe_control_write(port->control_pipe, &clear_request,
 	    sizeof(clear_request), NULL, 0);
 }
@@ -96,16 +97,16 @@
  * @return Operation result
  */
-int usb_hub_set_port_feature(usb_pipe_t *pipe,
-    int port_index, usb_hub_class_feature_t feature)
-{
-
+int usb_hub_set_port_feature(
+    usb_hub_port_t *port, usb_hub_class_feature_t feature)
+{
+	assert(port);
 	usb_device_request_setup_packet_t clear_request = {
 		.request_type = USB_HUB_REQ_TYPE_SET_PORT_FEATURE,
 		.request = USB_DEVREQ_SET_FEATURE,
-		.index = port_index,
+		.index = port->port_number,
 		.value = feature,
 		.length = 0,
 	};
-	return usb_pipe_control_write(pipe, &clear_request,
+	return usb_pipe_control_write(port->control_pipe, &clear_request,
 	    sizeof(clear_request), NULL, 0);
 }
@@ -139,6 +140,6 @@
 		/* ACK the change */
 		const int opResult =
-		    usb_hub_clear_port_feature(hub->control_pipe,
-		    port, USB_HUB_FEATURE_C_PORT_CONNECTION);
+		    usb_hub_clear_port_feature(&hub->ports[port],
+		        USB_HUB_FEATURE_C_PORT_CONNECTION);
 		if (opResult != EOK) {
 			usb_log_warning("Failed to clear "
@@ -266,6 +267,6 @@
 
 	/* Clear the port reset change. */
-	int rc = usb_hub_clear_port_feature(hub->control_pipe,
-	    port, USB_HUB_FEATURE_C_PORT_RESET);
+	int rc = usb_hub_clear_port_feature(&hub->ports[port],
+	    USB_HUB_FEATURE_C_PORT_RESET);
 	if (rc != EOK) {
 		usb_log_error("Failed to clear port %d reset feature: %s.\n",
@@ -326,9 +327,7 @@
 static int enable_port_callback(int port_no, void *arg)
 {
-	usb_hub_info_t *hub = arg;
-	assert(hub);
-	usb_hub_port_t *my_port = hub->ports + port_no;
-	const int rc = usb_hub_set_port_feature(hub->control_pipe,
-		port_no, USB_HUB_FEATURE_PORT_RESET);
+	usb_hub_port_t *port = arg;
+	const int rc =
+	    usb_hub_set_port_feature(port, USB_HUB_FEATURE_PORT_RESET);
 	if (rc != EOK) {
 		usb_log_warning("Port reset failed: %s.\n", str_error(rc));
@@ -339,11 +338,11 @@
 	 * Wait until reset completes.
 	 */
-	fibril_mutex_lock(&my_port->reset_mutex);
-	while (!my_port->reset_completed) {
-		fibril_condvar_wait(&my_port->reset_cv, &my_port->reset_mutex);
-	}
-	fibril_mutex_unlock(&my_port->reset_mutex);
-
-	if (my_port->reset_okay) {
+	fibril_mutex_lock(&port->reset_mutex);
+	while (!port->reset_completed) {
+		fibril_condvar_wait(&port->reset_cv, &port->reset_mutex);
+	}
+	fibril_mutex_unlock(&port->reset_mutex);
+
+	if (port->reset_okay) {
 		return EOK;
 	} else {
@@ -370,5 +369,6 @@
 	const int rc = usb_hc_new_device_wrapper(data->hub->usb_device->ddf_dev,
 	    &data->hub->connection, data->speed,
-	    enable_port_callback, (int) data->port, data->hub,
+	    enable_port_callback, (int) data->port,
+	    &data->hub->ports[data->port],
 	    &new_address, &child_handle,
 	    NULL, NULL, NULL);
Index: uspace/drv/bus/usb/usbhub/port.h
===================================================================
--- uspace/drv/bus/usb/usbhub/port.h	(revision a590a234e3fa09134a796e63cb81d99174e458dd)
+++ uspace/drv/bus/usb/usbhub/port.h	(revision c0587d90d69ac91b4844e40a41481db1c0ed24ac)
@@ -44,4 +44,6 @@
 /** Information about single port on a hub. */
 typedef struct {
+	size_t port_number;
+	usb_pipe_t *control_pipe;
 	/** Mutex needed by CV for checking port reset. */
 	fibril_mutex_t reset_mutex;
@@ -63,9 +65,12 @@
  * @param port Port to be initialized.
  */
-static inline void usb_hub_port_init(usb_hub_port_t *port)
+static inline void usb_hub_port_init(usb_hub_port_t *port, size_t port_number,
+    usb_pipe_t *control_pipe)
 {
 	assert(port);
 	port->attached_device.address = -1;
 	port->attached_device.handle = 0;
+	port->port_number = port_number;
+	port->control_pipe = control_pipe;
 	fibril_mutex_initialize(&port->reset_mutex);
 	fibril_condvar_initialize(&port->reset_cv);
@@ -74,8 +79,8 @@
 
 void usb_hub_process_port_interrupt(usb_hub_info_t *hub, size_t port);
-int usb_hub_clear_port_feature(usb_pipe_t *pipe,
-    int port_index, usb_hub_class_feature_t feature);
-int usb_hub_set_port_feature(usb_pipe_t *pipe,
-    int port_index, usb_hub_class_feature_t feature);
+int usb_hub_clear_port_feature(
+    usb_hub_port_t *port, usb_hub_class_feature_t feature);
+int usb_hub_set_port_feature(
+    usb_hub_port_t *port, usb_hub_class_feature_t feature);
 
 
Index: uspace/drv/bus/usb/usbhub/usbhub.c
===================================================================
--- uspace/drv/bus/usb/usbhub/usbhub.c	(revision a590a234e3fa09134a796e63cb81d99174e458dd)
+++ uspace/drv/bus/usb/usbhub/usbhub.c	(revision c0587d90d69ac91b4844e40a41481db1c0ed24ac)
@@ -277,5 +277,5 @@
 	size_t port;
 	for (port = 0; port < hub_info->port_count + 1; ++port) {
-		usb_hub_port_init(&hub_info->ports[port]);
+		usb_hub_port_init(&hub_info->ports[port], port, control_pipe);
 	}
 
@@ -290,5 +290,5 @@
 			usb_log_debug("Powering port %zu.\n", port);
 			opResult = usb_hub_set_port_feature(
-			    control_pipe, port, USB_HUB_FEATURE_PORT_POWER);
+			    &hub_info->ports[port], USB_HUB_FEATURE_PORT_POWER);
 			if (opResult != EOK) {
 				usb_log_error("Cannot power on port %zu: %s.\n",
@@ -361,5 +361,4 @@
     usb_hub_status_t status)
 {
-	usb_pipe_t *control_pipe = &hub_info->usb_device->ctrl_pipe;
 	if (status & USB_HUB_STATUS_OVER_CURRENT) {
 		/* Over-current detected on one or all ports,
@@ -369,5 +368,5 @@
 		for (port = 1; port <= hub_info->port_count; ++port) {
 			const int opResult = usb_hub_clear_port_feature(
-			    control_pipe, port, USB_HUB_FEATURE_PORT_POWER);
+			    &hub_info->ports[port], USB_HUB_FEATURE_PORT_POWER);
 			if (opResult != EOK) {
 				usb_log_warning(
@@ -383,5 +382,5 @@
 		for (port = 1; port <= hub_info->port_count; ++port) {
 			const int opResult = usb_hub_set_port_feature(
-			    control_pipe, port, USB_HUB_FEATURE_PORT_POWER);
+			    &hub_info->ports[port], USB_HUB_FEATURE_PORT_POWER);
 			if (opResult != EOK) {
 				usb_log_warning(
