Index: uspace/drv/ohci/root_hub.c
===================================================================
--- uspace/drv/ohci/root_hub.c	(revision cee51fd12b0e11133ad3875a2c47c602c6e3e991)
+++ uspace/drv/ohci/root_hub.c	(revision b330b30992d41a4f6eadbdc16f917a8f403439fb)
@@ -43,4 +43,7 @@
 #include <usb/classes/hub.h>
 
+/**
+ *	standart device descriptor for ohci root hub
+ */
 static const usb_standard_device_descriptor_t ohci_rh_device_descriptor =
 {
@@ -61,4 +64,8 @@
 };
 
+/**
+ * standart configuration descriptor with filled common values
+ * for ohci root hubs
+ */
 static const usb_standard_configuration_descriptor_t ohci_rh_conf_descriptor =
 {
@@ -73,4 +80,7 @@
 };
 
+/**
+ * standart ohci root hub interface descriptor
+ */
 static const usb_standard_interface_descriptor_t ohci_rh_iface_descriptor =
 {
@@ -87,4 +97,7 @@
 };
 
+/**
+ * standart ohci root hub endpoint descriptor
+ */
 static const usb_standard_endpoint_descriptor_t ohci_rh_ep_descriptor =
 {
@@ -273,31 +286,4 @@
 
 /**
- * create standard device descriptor for a hub
- * @return newly allocated descriptor
- */
-static usb_standard_device_descriptor_t *
-	usb_ohci_rh_create_standard_device_descriptor(){
-	usb_standard_device_descriptor_t * descriptor =
-				(usb_standard_device_descriptor_t*)
-				malloc(sizeof(usb_standard_device_descriptor_t));
-	descriptor->configuration_count = 1;
-	descriptor->descriptor_type = USB_DESCTYPE_DEVICE;
-	descriptor->device_class = USB_CLASS_HUB;
-	descriptor->device_protocol = 0;
-	descriptor->device_subclass = 0;
-	descriptor->device_version = 0;
-	descriptor->length = sizeof(usb_standard_device_descriptor_t);
-	/// \TODO this value is guessed
-	descriptor->max_packet_size = 8;
-	descriptor->product_id = 0x0001;
-	/// \TODO these values migt be different
-	descriptor->str_serial_number = 0;
-	descriptor->str_serial_number = 0;
-	descriptor->usb_spec_version = 0;
-	descriptor->vendor_id = 0x16db;
-	return descriptor;
-}
-
-/**
  * create standart configuration descriptor for the root hub instance
  * @param instance root hub instance
@@ -307,16 +293,9 @@
 usb_ohci_rh_create_standart_configuration_descriptor(rh_t *instance){
 	usb_standard_configuration_descriptor_t * descriptor =
-			(usb_standard_configuration_descriptor_t*)
 			malloc(sizeof(usb_standard_configuration_descriptor_t));
-	/// \TODO some values are default or guessed
-	descriptor->attributes = 1<<7;
-	descriptor->configuration_number = 1;
-	descriptor->descriptor_type = USB_DESCTYPE_CONFIGURATION;
-	descriptor->interface_count = 1;
-	descriptor->length = sizeof(usb_standard_configuration_descriptor_t);
-	descriptor->max_power = 100;
-	descriptor->str_configuration = 0;
+	memcpy(descriptor, &ohci_rh_conf_descriptor,
+		sizeof(usb_standard_configuration_descriptor_t));
 	/// \TODO should this include device descriptor?
-	size_t hub_descriptor_size = 7 +
+	const size_t hub_descriptor_size = 7 +
 			2* (instance->port_count / 8 +
 			((instance->port_count % 8 > 0) ? 1 : 0));
@@ -330,44 +309,4 @@
 
 /**
- * create standard interface descriptor for a root hub
- * @return newly allocated descriptor
- */
-static usb_standard_interface_descriptor_t *
-usb_ohci_rh_create_standard_interface_descriptor(){
-	usb_standard_interface_descriptor_t * descriptor =
-				(usb_standard_interface_descriptor_t*)
-				malloc(sizeof(usb_standard_interface_descriptor_t));
-	descriptor->alternate_setting = 0;
-	descriptor->descriptor_type = USB_DESCTYPE_INTERFACE;
-	descriptor->endpoint_count = 1;
-	descriptor->interface_class = USB_CLASS_HUB;
-	/// \TODO is this correct?
-	descriptor->interface_number = 1;
-	descriptor->interface_protocol = 0;
-	descriptor->interface_subclass = 0;
-	descriptor->length = sizeof(usb_standard_interface_descriptor_t);
-	descriptor->str_interface = 0;
-	return descriptor;
-}
-
-/**
- * create standard endpoint descriptor for a root hub
- * @return newly allocated descriptor
- */
-static usb_standard_endpoint_descriptor_t *
-usb_ohci_rh_create_standard_endpoint_descriptor(){
-	usb_standard_endpoint_descriptor_t * descriptor =
-			(usb_standard_endpoint_descriptor_t*)
-			malloc(sizeof(usb_standard_endpoint_descriptor_t));
-	descriptor->attributes = USB_TRANSFER_INTERRUPT;
-	descriptor->descriptor_type = USB_DESCTYPE_ENDPOINT;
-	descriptor->endpoint_address = 1 + (1<<7);
-	descriptor->length = sizeof(usb_standard_endpoint_descriptor_t);
-	descriptor->max_packet_size = 8;
-	descriptor->poll_interval = 255;
-	return descriptor;
-}
-
-/**
  * create answer to a descriptor request
  *
@@ -386,106 +325,54 @@
 	const uint16_t setup_request_value = setup_request->value_high;
 			//(setup_request->value_low << 8);
-#if 0
 	bool del = false;
-	//this code was merged from development and has to be reviewed
 	switch (setup_request_value)
 	{
-	case USB_DESCTYPE_HUB: {
-		uint8_t * descriptor;
-		usb_create_serialized_hub_descriptor(
-		    instance, &descriptor, &size);
-		result_descriptor = descriptor;
-		break;
-	}
-	case USB_DESCTYPE_DEVICE: {
-		usb_log_debug("USB_DESCTYPE_DEVICE\n");
-		result_descriptor = &ohci_rh_device_descriptor;
-		size = sizeof(ohci_rh_device_descriptor);
-		break;
-	}
-	case USB_DESCTYPE_CONFIGURATION: {
-		usb_log_debug("USB_DESCTYPE_CONFIGURATION\n");
-		usb_standard_configuration_descriptor_t * descriptor =
-				malloc(sizeof(usb_standard_configuration_descriptor_t));
-		memcpy(descriptor, &ohci_rh_conf_descriptor,
-		    sizeof(usb_standard_configuration_descriptor_t));
-		/// \TODO should this include device descriptor?
-		const size_t hub_descriptor_size = 7 +
-				2* (instance->port_count / 8 +
-				((instance->port_count % 8 > 0) ? 1 : 0));
-		descriptor->total_length =
-				sizeof(usb_standard_configuration_descriptor_t)+
-				sizeof(usb_standard_endpoint_descriptor_t)+
-				sizeof(usb_standard_interface_descriptor_t)+
-				hub_descriptor_size;
-		result_descriptor = descriptor;
-		size = sizeof(usb_standard_configuration_descriptor_t);
-		del = true;
-		break;
-	}
-	case USB_DESCTYPE_INTERFACE: {
-		usb_log_debug("USB_DESCTYPE_INTERFACE\n");
-		result_descriptor = &ohci_rh_iface_descriptor;
-		size = sizeof(ohci_rh_iface_descriptor);
-		break;
-	}
-	case USB_DESCTYPE_ENDPOINT: {
-		usb_log_debug("USB_DESCTYPE_ENDPOINT\n");
-		result_descriptor = &ohci_rh_ep_descriptor;
-		size = sizeof(ohci_rh_ep_descriptor);
-		break;
-	}
-	default: {
-		usb_log_debug("USB_DESCTYPE_EINVAL %d \n",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
-				);
-		return EINVAL;
-	}
-	}
-#endif
-	if(setup_request_value == USB_DESCTYPE_HUB){
-		usb_log_debug("USB_DESCTYPE_HUB\n");
-		//create hub descriptor
-		uint8_t * descriptor;
-		usb_create_serialized_hub_descriptor(instance, 
-				&descriptor, &size);
-		result_descriptor = descriptor;
-	}else if(setup_request_value == USB_DESCTYPE_DEVICE){
-		//create std device descriptor
-		usb_log_debug("USB_DESCTYPE_DEVICE\n");
-		result_descriptor =
-				usb_ohci_rh_create_standard_device_descriptor();
-		size = sizeof(usb_standard_device_descriptor_t);
-	}else if(setup_request_value == USB_DESCTYPE_CONFIGURATION){
-		usb_log_debug("USB_DESCTYPE_CONFIGURATION\n");
-		result_descriptor =
-				usb_ohci_rh_create_standart_configuration_descriptor(instance);
-		size = sizeof(usb_standard_configuration_descriptor_t);
-
-	}else if(setup_request_value == USB_DESCTYPE_INTERFACE){
-		usb_log_debug("USB_DESCTYPE_INTERFACE\n");
-		result_descriptor =
-				usb_ohci_rh_create_standard_interface_descriptor();
-		size = sizeof(usb_standard_interface_descriptor_t);
-	}else if(setup_request_value == USB_DESCTYPE_ENDPOINT){
-		usb_log_debug("USB_DESCTYPE_ENDPOINT\n");
-		result_descriptor =
-				usb_ohci_rh_create_standard_endpoint_descriptor();
-		size = sizeof(usb_standard_endpoint_descriptor_t);
-	}else{
-		usb_log_debug("USB_DESCTYPE_EINVAL %d \n",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
-				);
-		return EINVAL;
+		case USB_DESCTYPE_HUB: {
+			uint8_t * descriptor;
+			usb_create_serialized_hub_descriptor(
+				instance, &descriptor, &size);
+			result_descriptor = descriptor;
+			if(result_descriptor) del = true;
+			break;
+		}
+		case USB_DESCTYPE_DEVICE: {
+			usb_log_debug("USB_DESCTYPE_DEVICE\n");
+			result_descriptor = &ohci_rh_device_descriptor;
+			size = sizeof(ohci_rh_device_descriptor);
+			break;
+		}
+		case USB_DESCTYPE_CONFIGURATION: {
+			usb_log_debug("USB_DESCTYPE_CONFIGURATION\n");
+			usb_standard_configuration_descriptor_t * descriptor =
+					usb_ohci_rh_create_standart_configuration_descriptor(
+						instance);
+			result_descriptor = descriptor;
+			size = sizeof(usb_standard_configuration_descriptor_t);
+			del = true;
+			break;
+		}
+		case USB_DESCTYPE_INTERFACE: {
+			usb_log_debug("USB_DESCTYPE_INTERFACE\n");
+			result_descriptor = &ohci_rh_iface_descriptor;
+			size = sizeof(ohci_rh_iface_descriptor);
+			break;
+		}
+		case USB_DESCTYPE_ENDPOINT: {
+			usb_log_debug("USB_DESCTYPE_ENDPOINT\n");
+			result_descriptor = &ohci_rh_ep_descriptor;
+			size = sizeof(ohci_rh_ep_descriptor);
+			break;
+		}
+		default: {
+			usb_log_debug("USB_DESCTYPE_EINVAL %d \n",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
+					);
+			return EINVAL;
+		}
 	}
 	if(request->buffer_size < size){
@@ -494,5 +381,5 @@
 	request->transfered_size = size;
 	memcpy(request->buffer,result_descriptor,size);
-	if (result_descriptor)
+	if (del)
 		free(result_descriptor);
 	return EOK;
@@ -761,5 +648,5 @@
 void rh_interrupt(rh_t *instance)
 {
-	usb_log_info("Whoa whoa wait, I`m not supposed to receive interrupts, am I?\n");
+	usb_log_info("Whoa whoa wait, I`m not supposed to receive any interrupts, am I?\n");
 	/* TODO: implement? */
 }
Index: uspace/drv/ohci/root_hub.h
===================================================================
--- uspace/drv/ohci/root_hub.h	(revision cee51fd12b0e11133ad3875a2c47c602c6e3e991)
+++ uspace/drv/ohci/root_hub.h	(revision b330b30992d41a4f6eadbdc16f917a8f403439fb)
@@ -41,8 +41,15 @@
 #include "batch.h"
 
+/**
+ * ohci root hub representation
+ */
 typedef struct rh {
+	/** pointer to ohci driver registers */
 	ohci_regs_t *registers;
+	/** usb address of the root hub */
 	usb_address_t address;
+	/** ddf device information */
 	ddf_dev_t *device;
+	/** hub port count */
 	int port_count;
 } rh_t;
Index: uspace/drv/usbhub/port_status.h
===================================================================
--- uspace/drv/usbhub/port_status.h	(revision cee51fd12b0e11133ad3875a2c47c602c6e3e991)
+++ uspace/drv/usbhub/port_status.h	(revision b330b30992d41a4f6eadbdc16f917a8f403439fb)
@@ -79,4 +79,22 @@
 
 /**
+ * set the device request to be a port feature enable request
+ * @param request
+ * @param port
+ * @param feature_selector
+ */
+static inline void usb_hub_set_enable_port_feature_request(
+usb_device_request_setup_packet_t * request, uint16_t port,
+		uint16_t feature_selector
+){
+	request->index = port;
+	request->request_type = USB_HUB_REQ_TYPE_SET_PORT_FEATURE;
+	request->request = USB_HUB_REQUEST_SET_FEATURE;
+	request->value = feature_selector;
+	request->length = 0;
+}
+
+
+/**
  * set the device request to be a port enable request
  * @param request
@@ -191,4 +209,5 @@
 	request->length = 0;
 }
+
 
 /** get i`th bit of port status */
Index: uspace/drv/usbhub/usbhub.c
===================================================================
--- uspace/drv/usbhub/usbhub.c	(revision cee51fd12b0e11133ad3875a2c47c602c6e3e991)
+++ uspace/drv/usbhub/usbhub.c	(revision b330b30992d41a4f6eadbdc16f917a8f403439fb)
@@ -53,10 +53,20 @@
 #include "usb/classes/classes.h"
 
+
 static void usb_hub_init_add_device(usb_hub_info_t * hub, uint16_t port,
 		usb_speed_t speed);
 
-static int usb_hub_attach_non_removable_devices(usb_hub_info_t * hub,
-usb_hub_descriptor_t * descriptor);
-
+static int usb_hub_trigger_connecting_non_removable_devices(
+		usb_hub_info_t * hub, usb_hub_descriptor_t * descriptor);
+
+/**
+ * control loop running in hub`s fibril
+ *
+ * Hub`s fibril periodically asks for changes on hub and if needded calls
+ * change handling routine.
+ * @warning currently hub driver asks for changes once a second
+ * @param hub_info_param hub representation pointer
+ * @return zero
+ */
 int usb_hub_control_loop(void * hub_info_param){
 	usb_hub_info_t * hub_info = (usb_hub_info_t*)hub_info_param;
@@ -103,5 +113,5 @@
  * This function is hub-specific and should be run only after the hub is
  * configured using usb_hub_set_configuration function.
- * @param hub_info pointer to structure with usb hub data
+ * @param hub_info hub representation
  * @return error code
  */
@@ -149,5 +159,6 @@
 		hub_info->attached_devs[i].address=0;
 	}
-	usb_hub_attach_non_removable_devices(hub_info, descriptor);
+	//handle non-removable devices
+	usb_hub_trigger_connecting_non_removable_devices(hub_info, descriptor);
 	usb_log_debug2("freeing data\n");
 	free(serialized_descriptor);
@@ -161,6 +172,6 @@
  * Check whether there is at least one configuration and sets the first one.
  * This function should be run prior to running any hub-specific action.
- * @param hub_info
- * @return
+ * @param hub_info hub representation
+ * @return error code
  */
 static int usb_hub_set_configuration(usb_hub_info_t * hub_info){
@@ -270,13 +281,13 @@
 
 /**
- * Perform \a usb_hub_init_add_device on all ports with non-removable device
+ * triggers actions to connect non0removable devices
  *
  * This will trigger operations leading to activated non-removable device.
  * Control pipe of the hub must be open fo communication.
- * @param hub hub instance
+ * @param hub hub representation
  * @param descriptor usb hub descriptor
  * @return error code
  */
-static int usb_hub_attach_non_removable_devices(usb_hub_info_t * hub,
+static int usb_hub_trigger_connecting_non_removable_devices(usb_hub_info_t * hub,
 		usb_hub_descriptor_t * descriptor)
 {
@@ -287,5 +298,4 @@
 	usb_port_status_t status;
 	uint8_t * non_removable_dev_bitmap = descriptor->devices_removable;
-	//initialize all connected, non-removable devices
 	int port;
 	for(port=1;port<=descriptor->ports_count;++port){
@@ -305,7 +315,18 @@
 				return opResult;
 			}
-			//this should be true..
+			//set the status change bit, so it will be noticed in driver loop
 			if(usb_port_dev_connected(&status)){
-				usb_hub_init_add_device(hub,port,usb_port_speed(&status));
+				usb_hub_set_enable_port_feature_request(&request, port,
+						USB_HUB_FEATURE_C_PORT_CONNECTION);
+				opResult = usb_pipe_control_read(
+						hub->control_pipe,
+						&request, sizeof(usb_device_request_setup_packet_t),
+						&status, 4, &rcvd_size
+						);
+				if (opResult != EOK) {
+					usb_log_warning(
+							"could not set port change on port %d errno:%d\n",
+							port, opResult);
+				}
 			}
 		}
@@ -335,7 +356,7 @@
 /**
  * Reset the port with new device and reserve the default address.
- * @param hc
- * @param port
- * @param target
+ * @param hub hub representation
+ * @param port port number, starting from 1
+ * @param speed transfer speed of attached device, one of low, full or high
  */
 static void usb_hub_init_add_device(usb_hub_info_t * hub, uint16_t port,
@@ -370,5 +391,4 @@
 	if (opResult != EOK) {
 		usb_log_error("something went wrong when reseting a port %d\n",opResult);
-		//usb_hub_release_default_address(hc);
 		usb_hub_release_default_address(hub);
 	}
@@ -378,7 +398,9 @@
 /**
  * Finalize adding new device after port reset
- * @param hc
- * @param port
- * @param target
+ *
+ * Set device`s address and start it`s driver.
+ * @param hub hub representation
+ * @param port port number, starting from 1
+ * @param speed transfer speed of attached device, one of low, full or high
  */
 static void usb_hub_finalize_add_device( usb_hub_info_t * hub,
@@ -430,5 +452,4 @@
 	}
 
-
 	//opResult = usb_hub_release_default_address(hc);
 	opResult = usb_hub_release_default_address(hub);
@@ -465,8 +486,11 @@
 
 /**
- * Unregister device address in hc
- * @param hc
- * @param port
- * @param target
+ * routine called when a device on port has been removed
+ *
+ * If the device on port had default address, it releases default address.
+ * Otherwise does not do anything, because DDF does not allow to remove device
+ * from it`s device tree.
+ * @param hub hub representation
+ * @param port port number, starting from 1
  */
 static void usb_hub_removed_device(
@@ -507,6 +531,6 @@
  * Turn off the power on the port.
  *
- * @param hub
- * @param port
+ * @param hub hub representation
+ * @param port port number, starting from 1
  */
 static void usb_hub_over_current( usb_hub_info_t * hub,
@@ -523,7 +547,8 @@
 /**
  * Process interrupts on given hub port
- * @param hc
- * @param port
- * @param target
+ *
+ * Accepts connection, over current and port reset change.
+ * @param hub hub representation
+ * @param port port number, starting from 1
  */
 static void usb_hub_process_interrupt(usb_hub_info_t * hub, 
@@ -596,8 +621,9 @@
 
 /**
- * Check changes on particular hub
- * @param hub_info_param pointer to usb_hub_info_t structure
- * @return error code if there is problem when initializing communication with
- * hub, EOK otherwise
+ * check changes on hub
+ *
+ * Handles changes on each port with a status change.
+ * @param hub_info hub representation
+ * @return error code
  */
 int usb_hub_check_hub_changes(usb_hub_info_t * hub_info){
