Index: uspace/drv/usbhub/usbhub.c
===================================================================
--- uspace/drv/usbhub/usbhub.c	(revision e622323991c976fe47ba883e7dd809b8d5f3bcc4)
+++ uspace/drv/usbhub/usbhub.c	(revision 9bc276bc317bd87d4320847c42015b0aced099d4)
@@ -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){
