Index: uspace/drv/ohci/root_hub.c
===================================================================
--- uspace/drv/ohci/root_hub.c	(revision 3b543d5adc51ff1c833801fe86c7cbdfcacbfe6f)
+++ uspace/drv/ohci/root_hub.c	(revision 6c6a95d279d3b6dc66db477ee34aa127ededb6c8)
@@ -108,20 +108,20 @@
 
 static const uint32_t hub_clear_feature_valid_mask =
-    (1 << USB_HUB_FEATURE_C_HUB_LOCAL_POWER) |
+	(1 << USB_HUB_FEATURE_C_HUB_LOCAL_POWER) |
 (1 << USB_HUB_FEATURE_C_HUB_OVER_CURRENT);
 
 static const uint32_t hub_clear_feature_by_writing_one_mask =
-    1 << USB_HUB_FEATURE_C_HUB_LOCAL_POWER;
+	1 << USB_HUB_FEATURE_C_HUB_LOCAL_POWER;
 
 static const uint32_t hub_set_feature_valid_mask =
-    (1 << USB_HUB_FEATURE_C_HUB_OVER_CURRENT) |
+	(1 << USB_HUB_FEATURE_C_HUB_OVER_CURRENT) |
 (1 << USB_HUB_FEATURE_C_HUB_LOCAL_POWER);
 
 
 static const uint32_t hub_set_feature_direct_mask =
-    (1 << USB_HUB_FEATURE_C_HUB_OVER_CURRENT);
+	(1 << USB_HUB_FEATURE_C_HUB_OVER_CURRENT);
 
 static const uint32_t port_set_feature_valid_mask =
-    (1 << USB_HUB_FEATURE_PORT_ENABLE) |
+	(1 << USB_HUB_FEATURE_PORT_ENABLE) |
 (1 << USB_HUB_FEATURE_PORT_SUSPEND) |
 (1 << USB_HUB_FEATURE_PORT_RESET) |
@@ -129,5 +129,5 @@
 
 static const uint32_t port_clear_feature_valid_mask =
-    (1 << USB_HUB_FEATURE_PORT_CONNECTION) |
+	(1 << USB_HUB_FEATURE_PORT_CONNECTION) |
 (1 << USB_HUB_FEATURE_PORT_SUSPEND) |
 (1 << USB_HUB_FEATURE_PORT_OVER_CURRENT) |
@@ -142,9 +142,9 @@
 
 static const uint32_t port_status_change_mask =
-    (1 << USB_HUB_FEATURE_C_PORT_CONNECTION) |
-(1 << USB_HUB_FEATURE_C_PORT_ENABLE) |
-(1 << USB_HUB_FEATURE_C_PORT_OVER_CURRENT) |
-(1 << USB_HUB_FEATURE_C_PORT_RESET) |
-(1 << USB_HUB_FEATURE_C_PORT_SUSPEND);
+(1<< USB_HUB_FEATURE_C_PORT_CONNECTION) |
+(1<< USB_HUB_FEATURE_C_PORT_ENABLE) |
+(1<< USB_HUB_FEATURE_C_PORT_OVER_CURRENT) |
+(1<< USB_HUB_FEATURE_C_PORT_RESET) |
+(1<< USB_HUB_FEATURE_C_PORT_SUSPEND);
 
 
@@ -153,45 +153,43 @@
 static int rh_init_descriptors(rh_t *instance);
 
-static void rh_check_port_connectivity(rh_t * instance);
-
 static int process_get_port_status_request(rh_t *instance, uint16_t port,
-    usb_transfer_batch_t * request);
+	usb_transfer_batch_t * request);
 
 static int process_get_hub_status_request(rh_t *instance,
-    usb_transfer_batch_t * request);
+	usb_transfer_batch_t * request);
 
 static int process_get_status_request(rh_t *instance,
-    usb_transfer_batch_t * request);
+	usb_transfer_batch_t * request);
 
 static void create_interrupt_mask_in_instance(rh_t *instance);
 
 static int process_get_descriptor_request(rh_t *instance,
-    usb_transfer_batch_t *request);
+	usb_transfer_batch_t *request);
 
 static int process_get_configuration_request(rh_t *instance,
-    usb_transfer_batch_t *request);
+	usb_transfer_batch_t *request);
 
 static int process_hub_feature_set_request(rh_t *instance, uint16_t feature);
 
 static int process_hub_feature_clear_request(rh_t *instance,
-    uint16_t feature);
+	uint16_t feature);
 
 static int process_port_feature_set_request(rh_t *instance,
-    uint16_t feature, uint16_t port);
+	uint16_t feature, uint16_t port);
 
 static int process_port_feature_clear_request(rh_t *instance,
-    uint16_t feature, uint16_t port);
+	uint16_t feature, uint16_t port);
 
 static int process_address_set_request(rh_t *instance,
-    uint16_t address);
+	uint16_t address);
 
 static int process_request_with_output(rh_t *instance,
-    usb_transfer_batch_t *request);
+	usb_transfer_batch_t *request);
 
 static int process_request_with_input(rh_t *instance,
-    usb_transfer_batch_t *request);
+	usb_transfer_batch_t *request);
 
 static int process_request_without_data(rh_t *instance,
-    usb_transfer_batch_t *request);
+	usb_transfer_batch_t *request);
 
 static int process_ctrl_request(rh_t *instance, usb_transfer_batch_t *request);
@@ -200,4 +198,6 @@
 
 static bool is_zeros(void * buffer, size_t size);
+
+
 
 /** Root hub initialization
@@ -210,5 +210,5 @@
 	    (instance->registers->rh_desc_a >> RHDA_NDS_SHIFT) & RHDA_NDS_MASK;
 	int opResult = rh_init_descriptors(instance);
-	if (opResult != EOK) {
+	if(opResult != EOK){
 		return opResult;
 	}
@@ -216,13 +216,11 @@
 	instance->registers->rh_desc_a |= RHDA_NPS_FLAG;
 	instance->unfinished_interrupt_transfer = NULL;
-	instance->interrupt_mask_size = (instance->port_count + 8) / 8;
+	instance->interrupt_mask_size = (instance->port_count + 8)/8;
 	instance->interrupt_buffer = malloc(instance->interrupt_mask_size);
-	if (!instance->interrupt_buffer)
+	if(!instance->interrupt_buffer)
 		return ENOMEM;
-	rh_check_port_connectivity(instance);
-
+	
 
 	usb_log_info("OHCI root hub with %d ports.\n", instance->port_count);
-
 	return EOK;
 }
@@ -247,10 +245,10 @@
 		usb_log_info("Root hub got INTERRUPT packet\n");
 		create_interrupt_mask_in_instance(instance);
-		if (is_zeros(instance->interrupt_buffer,
-		    instance->interrupt_mask_size)) {
+		if(is_zeros(instance->interrupt_buffer,
+		    instance->interrupt_mask_size)){
 			usb_log_debug("no changes..\n");
 			instance->unfinished_interrupt_transfer = request;
 			//will be finished later
-		} else {
+		}else{
 			usb_log_debug("processing changes..\n");
 			process_interrupt_mask_in_instance(instance, request);
@@ -258,5 +256,4 @@
 		opResult = EOK;
 	} else {
-
 		opResult = EINVAL;
 		usb_transfer_batch_finish_error(request, opResult);
@@ -274,6 +271,5 @@
  */
 void rh_interrupt(rh_t *instance) {
-	if (!instance->unfinished_interrupt_transfer) {
-
+	if(!instance->unfinished_interrupt_transfer){
 		return;
 	}
@@ -296,8 +292,8 @@
 static int create_serialized_hub_descriptor(rh_t *instance) {
 	size_t size = 7 +
-	    ((instance->port_count + 7) / 8) * 2;
-	size_t var_size = (instance->port_count + 7) / 8;
+	    ((instance->port_count +7 )/ 8) * 2;
+	size_t var_size = (instance->port_count +7 )/ 8;
 	uint8_t * result = (uint8_t*) malloc(size);
-	if (!result) return ENOMEM;
+	if(!result) return ENOMEM;
 
 	bzero(result, size);
@@ -309,19 +305,19 @@
 	uint32_t hub_desc_reg = instance->registers->rh_desc_a;
 	result[3] =
-	    ((hub_desc_reg >> 8) % 2) +
-	    (((hub_desc_reg >> 9) % 2) << 1) +
-	    (((hub_desc_reg >> 10) % 2) << 2) +
-	    (((hub_desc_reg >> 11) % 2) << 3) +
-	    (((hub_desc_reg >> 12) % 2) << 4);
+		((hub_desc_reg >> 8) % 2) +
+		(((hub_desc_reg >> 9) % 2) << 1) +
+		(((hub_desc_reg >> 10) % 2) << 2) +
+		(((hub_desc_reg >> 11) % 2) << 3) +
+		(((hub_desc_reg >> 12) % 2) << 4);
 	result[4] = 0;
 	result[5] = /*descriptor->pwr_on_2_good_time*/ 50;
 	result[6] = 50;
 
-	size_t port;
+	int port;
 	for (port = 1; port <= instance->port_count; ++port) {
 		uint8_t is_non_removable =
-		    instance->registers->rh_desc_b >> port % 2;
+			instance->registers->rh_desc_b >> port % 2;
 		result[7 + port / 8] +=
-		    is_non_removable << (port % 8);
+			is_non_removable << (port % 8);
 	}
 	size_t i;
@@ -331,5 +327,4 @@
 	instance->hub_descriptor = result;
 	instance->descriptor_size = size;
-
 	return EOK;
 }
@@ -345,67 +340,40 @@
 static int rh_init_descriptors(rh_t *instance) {
 	memcpy(&instance->descriptors.device, &ohci_rh_device_descriptor,
-	    sizeof (ohci_rh_device_descriptor)
-	    );
+		sizeof (ohci_rh_device_descriptor)
+		);
 	usb_standard_configuration_descriptor_t descriptor;
 	memcpy(&descriptor, &ohci_rh_conf_descriptor,
-	    sizeof (ohci_rh_conf_descriptor));
+		sizeof (ohci_rh_conf_descriptor));
 
 	int opResult = create_serialized_hub_descriptor(instance);
-	if (opResult != EOK) {
+	if(opResult != EOK){
 		return opResult;
 	}
 	descriptor.total_length =
-	    sizeof (usb_standard_configuration_descriptor_t) +
-	    sizeof (usb_standard_endpoint_descriptor_t) +
-	    sizeof (usb_standard_interface_descriptor_t) +
-	    instance->descriptor_size;
+		sizeof (usb_standard_configuration_descriptor_t) +
+		sizeof (usb_standard_endpoint_descriptor_t) +
+		sizeof (usb_standard_interface_descriptor_t) +
+		instance->descriptor_size;
 
 	uint8_t * full_config_descriptor =
-	    (uint8_t*) malloc(descriptor.total_length);
-	if (!full_config_descriptor) {
+		(uint8_t*) malloc(descriptor.total_length);
+	if(!full_config_descriptor){
 		return ENOMEM;
 	}
 	memcpy(full_config_descriptor, &descriptor, sizeof (descriptor));
 	memcpy(full_config_descriptor + sizeof (descriptor),
-	    &ohci_rh_iface_descriptor, sizeof (ohci_rh_iface_descriptor));
+		&ohci_rh_iface_descriptor, sizeof (ohci_rh_iface_descriptor));
 	memcpy(full_config_descriptor + sizeof (descriptor) +
-	    sizeof (ohci_rh_iface_descriptor),
-	    &ohci_rh_ep_descriptor, sizeof (ohci_rh_ep_descriptor));
+		sizeof (ohci_rh_iface_descriptor),
+		&ohci_rh_ep_descriptor, sizeof (ohci_rh_ep_descriptor));
 	memcpy(full_config_descriptor + sizeof (descriptor) +
-	    sizeof (ohci_rh_iface_descriptor) +
-	    sizeof (ohci_rh_ep_descriptor),
-	    instance->hub_descriptor, instance->descriptor_size);
-
+		sizeof (ohci_rh_iface_descriptor) +
+		sizeof (ohci_rh_ep_descriptor),
+		instance->hub_descriptor, instance->descriptor_size);
+	
 	instance->descriptors.configuration = full_config_descriptor;
 	instance->descriptors.configuration_size = descriptor.total_length;
-
-	return EOK;
-}
-/*----------------------------------------------------------------------------*/
-
-/**
- * check whether there are connected devices on ports and if yes, indicate
- * connection change
- * 
- * @param instance
- */
-static void rh_check_port_connectivity(rh_t * instance) {
-	size_t port;
-	for (port = 1; port < instance->port_count; ++port) {
-		bool connected =
-		    ((instance->registers->rh_port_status[port - 1]) &
-		    (1 << USB_HUB_FEATURE_PORT_CONNECTION)) != 0;
-		if (connected) {
-			usb_log_debug("port %d has connected device\n", port);
-			instance->registers->rh_port_status[port - 1] =
-			    instance->registers->rh_port_status[port - 1]
-			    | (1 << USB_HUB_FEATURE_C_PORT_CONNECTION);
-			usb_log_debug("change indicated to status "
-			    "register\n");
-		}
-	}
-}
-
-
+	return EOK;
+}
 /*----------------------------------------------------------------------------*/
 
@@ -421,5 +389,5 @@
  */
 static int process_get_port_status_request(rh_t *instance, uint16_t port,
-    usb_transfer_batch_t * request) {
+	usb_transfer_batch_t * request) {
 	if (port < 1 || port > instance->port_count)
 		return EINVAL;
@@ -430,8 +398,7 @@
 	int i;
 	for (i = 0; i < instance->port_count; ++i) {
-
 		usb_log_debug("port status %d,x%x\n",
-		    instance->registers->rh_port_status[i],
-		    instance->registers->rh_port_status[i]);
+			instance->registers->rh_port_status[i],
+			instance->registers->rh_port_status[i]);
 	}
 #endif
@@ -450,5 +417,5 @@
  */
 static int process_get_hub_status_request(rh_t *instance,
-    usb_transfer_batch_t * request) {
+	usb_transfer_batch_t * request) {
 	uint32_t * uint32_buffer = (uint32_t*) request->data_buffer;
 	request->transfered_size = 4;
@@ -456,5 +423,4 @@
 	uint32_t mask = 1 | (1 << 1) | (1 << 16) | (1 << 17);
 	uint32_buffer[0] = mask & instance->registers->rh_status;
-
 	return EOK;
 }
@@ -471,9 +437,9 @@
  */
 static int process_get_status_request(rh_t *instance,
-    usb_transfer_batch_t * request) {
+	usb_transfer_batch_t * request) {
 	size_t buffer_size = request->buffer_size;
 	usb_device_request_setup_packet_t * request_packet =
-	    (usb_device_request_setup_packet_t*)
-	    request->setup_buffer;
+		(usb_device_request_setup_packet_t*)
+		request->setup_buffer;
 
 	usb_hub_bm_request_type_t request_type = request_packet->request_type;
@@ -487,7 +453,6 @@
 	if (request_type == USB_HUB_REQ_TYPE_GET_PORT_STATUS)
 		return process_get_port_status_request(instance,
-	    request_packet->index,
-	    request);
-
+		request_packet->index,
+		request);
 	return ENOTSUP;
 }
@@ -507,14 +472,13 @@
 	uint8_t * bitmap = (uint8_t*) (instance->interrupt_buffer);
 	uint32_t mask = (1 << (USB_HUB_FEATURE_C_HUB_LOCAL_POWER + 16))
-	    | (1 << (USB_HUB_FEATURE_C_HUB_OVER_CURRENT + 16));
+		| (1 << (USB_HUB_FEATURE_C_HUB_OVER_CURRENT + 16));
 	bzero(bitmap, instance->interrupt_mask_size);
 	if (instance->registers->rh_status & mask) {
 		bitmap[0] = 1;
 	}
-	size_t port;
+	int port;
 	mask = port_status_change_mask;
 	for (port = 1; port <= instance->port_count; ++port) {
 		if (mask & instance->registers->rh_port_status[port - 1]) {
-
 			bitmap[(port) / 8] += 1 << (port % 8);
 		}
@@ -533,7 +497,7 @@
  */
 static int process_get_descriptor_request(rh_t *instance,
-    usb_transfer_batch_t *request) {
+	usb_transfer_batch_t *request) {
 	usb_device_request_setup_packet_t * setup_request =
-	    (usb_device_request_setup_packet_t*) request->setup_buffer;
+		(usb_device_request_setup_packet_t*) request->setup_buffer;
 	size_t size;
 	const void * result_descriptor = NULL;
@@ -579,13 +543,13 @@
 		{
 			usb_log_debug("USB_DESCTYPE_EINVAL %d \n",
-			    setup_request->value);
+				setup_request->value);
 			usb_log_debug("\ttype %d\n\trequest %d\n\tvalue "
-			    "%d\n\tindex %d\n\tlen %d\n ",
-			    setup_request->request_type,
-			    setup_request->request,
-			    setup_request_value,
-			    setup_request->index,
-			    setup_request->length
-			    );
+				"%d\n\tindex %d\n\tlen %d\n ",
+				setup_request->request_type,
+				setup_request->request,
+				setup_request_value,
+				setup_request->index,
+				setup_request->length
+				);
 			return EINVAL;
 		}
@@ -596,5 +560,4 @@
 	request->transfered_size = size;
 	memcpy(request->data_buffer, result_descriptor, size);
-
 	return EOK;
 }
@@ -610,5 +573,5 @@
  */
 static int process_get_configuration_request(rh_t *instance,
-    usb_transfer_batch_t *request) {
+	usb_transfer_batch_t *request) {
 	//set and get configuration requests do not have any meaning, only dummy
 	//values are returned
@@ -617,5 +580,4 @@
 	request->data_buffer[0] = 1;
 	request->transfered_size = 1;
-
 	return EOK;
 }
@@ -630,13 +592,12 @@
  */
 static int process_hub_feature_set_request(rh_t *instance,
-    uint16_t feature) {
+	uint16_t feature) {
 	if (!((1 << feature) & hub_set_feature_valid_mask))
 		return EINVAL;
-	if (feature == USB_HUB_FEATURE_C_HUB_LOCAL_POWER)
+	if(feature == USB_HUB_FEATURE_C_HUB_LOCAL_POWER)
 		feature = USB_HUB_FEATURE_C_HUB_LOCAL_POWER << 16;
 	instance->registers->rh_status =
-	    (instance->registers->rh_status | (1 << feature))
-	    & (~hub_clear_feature_by_writing_one_mask);
-
+		(instance->registers->rh_status | (1 << feature))
+		& (~hub_clear_feature_by_writing_one_mask);
 	return EOK;
 }
@@ -651,5 +612,5 @@
  */
 static int process_hub_feature_clear_request(rh_t *instance,
-    uint16_t feature) {
+	uint16_t feature) {
 	if (!((1 << feature) & hub_clear_feature_valid_mask))
 		return EINVAL;
@@ -657,12 +618,11 @@
 	if ((1 << feature) & hub_set_feature_direct_mask) {
 		instance->registers->rh_status =
-		    (instance->registers->rh_status & (~(1 << feature)))
-		    & (~hub_clear_feature_by_writing_one_mask);
+			(instance->registers->rh_status & (~(1 << feature)))
+			& (~hub_clear_feature_by_writing_one_mask);
 	} else {//the feature is cleared by writing '1'
-
 		instance->registers->rh_status =
-		    (instance->registers->rh_status
-		    & (~hub_clear_feature_by_writing_one_mask))
-		    | (1 << feature);
+			(instance->registers->rh_status
+			& (~hub_clear_feature_by_writing_one_mask))
+			| (1 << feature);
 	}
 	return EOK;
@@ -680,5 +640,5 @@
  */
 static int process_port_feature_set_request(rh_t *instance,
-    uint16_t feature, uint16_t port) {
+	uint16_t feature, uint16_t port) {
 	if (!((1 << feature) & port_set_feature_valid_mask))
 		return EINVAL;
@@ -686,8 +646,7 @@
 		return EINVAL;
 	instance->registers->rh_port_status[port - 1] =
-	    (instance->registers->rh_port_status[port - 1] | (1 << feature))
-	    & (~port_clear_feature_valid_mask);
+		(instance->registers->rh_port_status[port - 1] | (1 << feature))
+		& (~port_clear_feature_valid_mask);
 	/// \TODO any error?
-
 	return EOK;
 }
@@ -704,5 +663,5 @@
  */
 static int process_port_feature_clear_request(rh_t *instance,
-    uint16_t feature, uint16_t port) {
+	uint16_t feature, uint16_t port) {
 	if (!((1 << feature) & port_clear_feature_valid_mask))
 		return EINVAL;
@@ -714,9 +673,8 @@
 		feature = USB_HUB_FEATURE_PORT_OVER_CURRENT;
 	instance->registers->rh_port_status[port - 1] =
-	    (instance->registers->rh_port_status[port - 1]
-	    & (~port_clear_feature_valid_mask))
-	    | (1 << feature);
+		(instance->registers->rh_port_status[port - 1]
+		& (~port_clear_feature_valid_mask))
+		| (1 << feature);
 	/// \TODO any error?
-
 	return EOK;
 }
@@ -731,7 +689,6 @@
  */
 static int process_address_set_request(rh_t *instance,
-    uint16_t address) {
+	uint16_t address) {
 	instance->address = address;
-
 	return EOK;
 }
@@ -748,7 +705,7 @@
  */
 static int process_request_with_output(rh_t *instance,
-    usb_transfer_batch_t *request) {
+	usb_transfer_batch_t *request) {
 	usb_device_request_setup_packet_t * setup_request =
-	    (usb_device_request_setup_packet_t*) request->setup_buffer;
+		(usb_device_request_setup_packet_t*) request->setup_buffer;
 	if (setup_request->request == USB_DEVREQ_GET_STATUS) {
 		usb_log_debug("USB_DEVREQ_GET_STATUS\n");
@@ -761,5 +718,4 @@
 	if (setup_request->request == USB_DEVREQ_GET_CONFIGURATION) {
 		usb_log_debug("USB_DEVREQ_GET_CONFIGURATION\n");
-
 		return process_get_configuration_request(instance, request);
 	}
@@ -778,7 +734,7 @@
  */
 static int process_request_with_input(rh_t *instance,
-    usb_transfer_batch_t *request) {
+	usb_transfer_batch_t *request) {
 	usb_device_request_setup_packet_t * setup_request =
-	    (usb_device_request_setup_packet_t*) request->setup_buffer;
+		(usb_device_request_setup_packet_t*) request->setup_buffer;
 	request->transfered_size = 0;
 	if (setup_request->request == USB_DEVREQ_SET_DESCRIPTOR) {
@@ -788,5 +744,4 @@
 		//set and get configuration requests do not have any meaning,
 		//only dummy values are returned
-
 		return EOK;
 	}
@@ -805,7 +760,7 @@
  */
 static int process_request_without_data(rh_t *instance,
-    usb_transfer_batch_t *request) {
+	usb_transfer_batch_t *request) {
 	usb_device_request_setup_packet_t * setup_request =
-	    (usb_device_request_setup_packet_t*) request->setup_buffer;
+		(usb_device_request_setup_packet_t*) request->setup_buffer;
 	request->transfered_size = 0;
 	if (setup_request->request == USB_DEVREQ_CLEAR_FEATURE) {
@@ -813,14 +768,14 @@
 			usb_log_debug("USB_HUB_REQ_TYPE_SET_HUB_FEATURE\n");
 			return process_hub_feature_clear_request(instance,
-			    setup_request->value);
+				setup_request->value);
 		}
 		if (setup_request->request_type == USB_HUB_REQ_TYPE_SET_PORT_FEATURE) {
 			usb_log_debug("USB_HUB_REQ_TYPE_SET_PORT_FEATURE\n");
 			return process_port_feature_clear_request(instance,
-			    setup_request->value,
-			    setup_request->index);
+				setup_request->value,
+				setup_request->index);
 		}
 		usb_log_debug("USB_HUB_REQ_TYPE_INVALID %d\n",
-		    setup_request->request_type);
+			setup_request->request_type);
 		return EINVAL;
 	}
@@ -829,14 +784,14 @@
 			usb_log_debug("USB_HUB_REQ_TYPE_SET_HUB_FEATURE\n");
 			return process_hub_feature_set_request(instance,
-			    setup_request->value);
+				setup_request->value);
 		}
 		if (setup_request->request_type == USB_HUB_REQ_TYPE_SET_PORT_FEATURE) {
 			usb_log_debug("USB_HUB_REQ_TYPE_SET_PORT_FEATURE\n");
 			return process_port_feature_set_request(instance,
-			    setup_request->value,
-			    setup_request->index);
+				setup_request->value,
+				setup_request->index);
 		}
 		usb_log_debug("USB_HUB_REQ_TYPE_INVALID %d\n",
-		    setup_request->request_type);
+			setup_request->request_type);
 		return EINVAL;
 	}
@@ -844,9 +799,8 @@
 		usb_log_debug("USB_DEVREQ_SET_ADDRESS\n");
 		return process_address_set_request(instance,
-		    setup_request->value);
+			setup_request->value);
 	}
 	usb_log_debug("USB_DEVREQ_SET_ENOTSUP %d\n",
-	    setup_request->request_type);
-
+		setup_request->request_type);
 	return ENOTSUP;
 }
@@ -882,9 +836,9 @@
 	}
 	usb_log_info("CTRL packet: %s.\n",
-	    usb_debug_str_buffer(
-	    (const uint8_t *) request->setup_buffer, 8, 8));
+		usb_debug_str_buffer(
+		(const uint8_t *) request->setup_buffer, 8, 8));
 	usb_device_request_setup_packet_t * setup_request =
-	    (usb_device_request_setup_packet_t*)
-	    request->setup_buffer;
+		(usb_device_request_setup_packet_t*)
+		request->setup_buffer;
 	switch (setup_request->request) {
 		case USB_DEVREQ_GET_STATUS:
@@ -893,5 +847,5 @@
 			usb_log_debug("processing request with output\n");
 			opResult = process_request_with_output(
-			    instance, request);
+				instance, request);
 			break;
 		case USB_DEVREQ_CLEAR_FEATURE:
@@ -899,21 +853,20 @@
 		case USB_DEVREQ_SET_ADDRESS:
 			usb_log_debug("processing request without "
-			    "additional data\n");
+				"additional data\n");
 			opResult = process_request_without_data(
-			    instance, request);
+				instance, request);
 			break;
 		case USB_DEVREQ_SET_DESCRIPTOR:
 		case USB_DEVREQ_SET_CONFIGURATION:
 			usb_log_debug("processing request with "
-			    "input\n");
+				"input\n");
 			opResult = process_request_with_input(
-			    instance, request);
-
+				instance, request);
 			break;
 		default:
 			usb_log_warning("received unsuported request: "
-			    "%d\n",
-			    setup_request->request
-			    );
+				"%d\n",
+				setup_request->request
+				);
 			opResult = ENOTSUP;
 	}
@@ -935,5 +888,5 @@
  * @return
  */
-static int process_interrupt_mask_in_instance(rh_t *instance, usb_transfer_batch_t * request) {
+static int process_interrupt_mask_in_instance(rh_t *instance, usb_transfer_batch_t * request){
 	memcpy(request->data_buffer, instance->interrupt_buffer,
 	    instance->interrupt_mask_size);
@@ -941,5 +894,4 @@
 	instance->unfinished_interrupt_transfer = NULL;
 	usb_transfer_batch_finish_error(request, EOK);
-
 	return EOK;
 }
@@ -955,10 +907,10 @@
  * @return
  */
-static bool is_zeros(void * buffer, size_t size) {
-	if (!buffer) return true;
-	if (!size) return true;
+static bool is_zeros(void * buffer, size_t size){
+	if(!buffer) return true;
+	if(!size) return true;
 	size_t i;
-	for (i = 0; i < size; ++i) {
-		if (((char*) buffer)[i])
+	for(i=0;i<size;++i){
+		if(((char*)buffer)[i])
 			return false;
 	}
Index: uspace/drv/ohci/root_hub.h
===================================================================
--- uspace/drv/ohci/root_hub.h	(revision 3b543d5adc51ff1c833801fe86c7cbdfcacbfe6f)
+++ uspace/drv/ohci/root_hub.h	(revision 6c6a95d279d3b6dc66db477ee34aa127ededb6c8)
@@ -51,5 +51,5 @@
 	usb_address_t address;
 	/** hub port count */
-	size_t port_count;
+	int port_count;
 	/** hubs descriptors */
 	usb_device_descriptors_t descriptors;
Index: uspace/drv/usbhid/main.c
===================================================================
--- uspace/drv/usbhid/main.c	(revision 3b543d5adc51ff1c833801fe86c7cbdfcacbfe6f)
+++ uspace/drv/usbhid/main.c	(revision 6c6a95d279d3b6dc66db477ee34aa127ededb6c8)
@@ -202,5 +202,5 @@
 	printf(NAME ": HelenOS USB HID driver.\n");
 
-	//usb_log_enable(USB_LOG_LEVEL_DEBUG, NAME);
+	usb_log_enable(USB_LOG_LEVEL_DEBUG, NAME);
 
 	return usb_driver_main(&usb_hid_driver);
Index: uspace/drv/usbhub/ports.c
===================================================================
--- uspace/drv/usbhub/ports.c	(revision 3b543d5adc51ff1c833801fe86c7cbdfcacbfe6f)
+++ uspace/drv/usbhub/ports.c	(revision 6c6a95d279d3b6dc66db477ee34aa127ededb6c8)
@@ -137,26 +137,8 @@
 	    &status, USB_HUB_FEATURE_C_PORT_OVER_CURRENT,false);
 	/// \TODO what about port power change?
-	unsigned int bit_idx;
-	for(bit_idx = 16;bit_idx<32;++bit_idx){
-		if(status & (1<<bit_idx)){
-			usb_log_info(
-			    "there was unsupported change on port %d: %d\n",
-			port, bit_idx);
-			int opResult = usb_hub_clear_port_feature(
-			    hub->control_pipe,
-			    port, USB_HUB_FEATURE_C_PORT_CONNECTION);
-			if (opResult != EOK) {
-				usb_log_warning(
-				    "could not clear port flag %d: %d\n",
-				    bit_idx, opResult
-				    );
-			}
-			usb_port_status_set_bit(
-			    &status, bit_idx,false);
-		}
-	}
 	if (status >> 16) {
 		usb_log_info("there was unsupported change on port %d: %X\n",
 			port, status);
+
 	}
 }
@@ -240,11 +222,4 @@
 		    "Port %zu reset complete but port not enabled.\n",
 		    (size_t) port);
-	}
-	/* Clear the port reset change. */
-	int rc = usb_hub_clear_port_feature(hub->control_pipe,
-	    port, USB_HUB_FEATURE_C_PORT_RESET);
-	if (rc != EOK) {
-		usb_log_error("Failed to clear port %d reset feature: %s.\n",
-		    port, str_error(rc));
 	}
 }
@@ -344,4 +319,13 @@
 	fibril_mutex_unlock(&my_port->reset_mutex);
 
+	/* Clear the port reset change. */
+	rc = usb_hub_clear_port_feature(hub->control_pipe,
+	    port_no, USB_HUB_FEATURE_C_PORT_RESET);
+	if (rc != EOK) {
+		usb_log_error("Failed to clear port %d reset feature: %s.\n",
+		    port_no, str_error(rc));
+		return rc;
+	}
+
 	if (my_port->reset_okay) {
 		return EOK;
