Index: uspace/drv/usbhub/main.c
===================================================================
--- uspace/drv/usbhub/main.c	(revision 9ca001350dd87a5fbe5c002091a42f437f607c8c)
+++ uspace/drv/usbhub/main.c	(revision b5ec3473e2a5d93339149667e5df2a491a35d7dc)
@@ -30,4 +30,8 @@
 #include <errno.h>
 #include "usbhub.h"
+#include "usbhub_private.h"
+
+
+usb_general_list_t usb_hub_list;
 
 static driver_ops_t hub_driver_ops = {
@@ -42,4 +46,5 @@
 int main(int argc, char *argv[])
 {
+	usb_lst_init(&usb_hub_list);
 	return driver_main(&hub_driver);
 }
Index: uspace/drv/usbhub/port_status.h
===================================================================
--- uspace/drv/usbhub/port_status.h	(revision b5ec3473e2a5d93339149667e5df2a491a35d7dc)
+++ uspace/drv/usbhub/port_status.h	(revision b5ec3473e2a5d93339149667e5df2a491a35d7dc)
@@ -0,0 +1,233 @@
+/*
+ * Copyright (c) 2010 Matus Dekanek
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef PORT_STATUS_H
+#define	PORT_STATUS_H
+
+#include <bool.h>
+#include <sys/types.h>
+#include <usb/devreq.h>
+#include "usbhub_private.h"
+
+/**
+ * structure holding port status and changes flags.
+ * should not be accessed directly, use supplied getter/setter methods.
+ *
+ * For more information refer to table 11-15 in
+ * "Universal Serial Bus Specification Revision 1.1"
+ *
+ */
+typedef uint8_t usb_port_status_t[4];
+
+/**
+ * set values in request to be it a port status request
+ * @param request
+ * @param port
+ */
+static inline void usb_hub_set_port_status_request(
+usb_device_request_setup_packet_t * request, uint16_t port
+){
+	request->index = port;
+	request->request_type = USB_HUB_REQ_TYPE_GET_PORT_STATUS;
+	request->request = USB_HUB_REQUEST_GET_STATE;
+	request->value = 0;
+	request->length = 4;
+}
+
+
+/**
+ * create request for usb hub port status
+ * @param port
+ * @return
+ */
+static inline usb_device_request_setup_packet_t *
+usb_hub_create_port_status_request(uint16_t port){
+	usb_device_request_setup_packet_t * result =
+		usb_new(usb_device_request_setup_packet_t);
+	usb_hub_set_port_status_request(result,port);
+	return result;
+}
+
+
+/**
+ * set the device request to be a port enable request
+ * @param request
+ * @param port
+ */
+static inline void usb_hub_set_enable_port_request(
+usb_device_request_setup_packet_t * request, uint16_t port
+){
+	request->index = port;
+	request->request_type = USB_HUB_REQ_TYPE_SET_PORT_FEATURE;
+	request->request = USB_HUB_REQUEST_SET_FEATURE;
+	request->value = USB_HUB_FEATURE_C_PORT_ENABLE;
+	request->length = 0;
+}
+
+/**
+ * enable specified port
+ * @param port
+ * @return
+ */
+static inline usb_device_request_setup_packet_t *
+usb_hub_create_enable_port_request(uint16_t port){
+	usb_device_request_setup_packet_t * result =
+		usb_new(usb_device_request_setup_packet_t);
+	usb_hub_set_enable_port_request(result,port);
+	return result;
+}
+
+
+/** get i`th bit of port status */
+static inline bool usb_port_get_bit(usb_port_status_t * status, int idx)
+{
+	return (((*status)[idx/8])>>(idx%8))%2;
+}
+
+/** set i`th bit of port status */
+static inline void usb_port_set_bit(
+	usb_port_status_t * status, int idx, bool value)
+{
+	(*status)[idx/8] = value?
+		               ((*status)[idx/8]|(1<<(idx%8))):
+		               ((*status)[idx/8]&(~(1<<(idx%8))));
+}
+
+//device connnected on port
+static inline bool usb_port_dev_connected(usb_port_status_t * status){
+	return usb_port_get_bit(status,0);
+}
+
+static inline void usb_port_set_dev_connected(usb_port_status_t * status,bool connected){
+	usb_port_set_bit(status,0,connected);
+}
+
+//port enabled
+static inline bool usb_port_enabled(usb_port_status_t * status){
+	return usb_port_get_bit(status,1);
+}
+
+static inline void usb_port_set_enabled(usb_port_status_t * status,bool enabled){
+	usb_port_set_bit(status,1,enabled);
+}
+
+//port suspended
+static inline bool usb_port_suspended(usb_port_status_t * status){
+	return usb_port_get_bit(status,2);
+}
+
+static inline void usb_port_set_suspended(usb_port_status_t * status,bool suspended){
+	usb_port_set_bit(status,2,suspended);
+}
+
+//over currect
+static inline bool usb_port_over_current(usb_port_status_t * status){
+	return usb_port_get_bit(status,3);
+}
+
+static inline void usb_port_set_over_current(usb_port_status_t * status,bool value){
+	usb_port_set_bit(status,3,value);
+}
+
+//port reset
+static inline bool usb_port_reset(usb_port_status_t * status){
+	return usb_port_get_bit(status,4);
+}
+
+static inline void usb_port_set_reset(usb_port_status_t * status,bool value){
+	usb_port_set_bit(status,4,value);
+}
+
+//powered
+static inline bool usb_port_powered(usb_port_status_t * status){
+	return usb_port_get_bit(status,8);
+}
+
+static inline void usb_port_set_powered(usb_port_status_t * status,bool powered){
+	usb_port_set_bit(status,8,powered);
+}
+
+//low speed device attached
+static inline bool usb_port_low_speed(usb_port_status_t * status){
+	return usb_port_get_bit(status,9);
+}
+
+static inline void usb_port_set_low_speed(usb_port_status_t * status,bool low_speed){
+	usb_port_set_bit(status,9,low_speed);
+}
+
+
+//connect change
+static inline bool usb_port_connect_change(usb_port_status_t * status){
+	return usb_port_get_bit(status,16);
+}
+
+static inline void usb_port_set_connect_change(usb_port_status_t * status,bool change){
+	usb_port_set_bit(status,16,change);
+}
+
+//port enable change
+static inline bool usb_port_enabled_change(usb_port_status_t * status){
+	return usb_port_get_bit(status,17);
+}
+
+static inline void usb_port_set_enabled_change(usb_port_status_t * status,bool change){
+	usb_port_set_bit(status,17,change);
+}
+
+//suspend change
+static inline bool usb_port_suspend_change(usb_port_status_t * status){
+	return usb_port_get_bit(status,18);
+}
+
+static inline void usb_port_set_suspend_change(usb_port_status_t * status,bool change){
+	usb_port_set_bit(status,18,change);
+}
+
+//over current change
+static inline bool usb_port_overcurrent_change(usb_port_status_t * status){
+	return usb_port_get_bit(status,19);
+}
+
+static inline void usb_port_set_overcurrent_change(usb_port_status_t * status,bool change){
+	usb_port_set_bit(status,19,change);
+}
+
+//reset change
+static inline bool usb_port_reset_completed(usb_port_status_t * status){
+	return usb_port_get_bit(status,20);
+}
+
+static inline void usb_port_set_reset_completed(usb_port_status_t * status,bool completed){
+	usb_port_set_bit(status,20,completed);
+}
+
+
+
+#endif	/* PORT_STATUS_H */
+
Index: uspace/drv/usbhub/usbhub.h
===================================================================
--- uspace/drv/usbhub/usbhub.h	(revision 9ca001350dd87a5fbe5c002091a42f437f607c8c)
+++ uspace/drv/usbhub/usbhub.h	(revision b5ec3473e2a5d93339149667e5df2a491a35d7dc)
@@ -38,4 +38,17 @@
 #define NAME "usbhub"
 
+#include "usb/hcdhubd.h"
+
+
+
+/** Information about attached hub. */
+typedef struct {
+	/** Number of ports. */
+	int port_count;
+	/** General device info. */
+	usb_hcd_attached_device_info_t * device;
+} usb_hub_info_t;
+
+
 int usb_add_hub_device(device_t *);
 
Index: uspace/drv/usbhub/usbhub_private.h
===================================================================
--- uspace/drv/usbhub/usbhub_private.h	(revision b5ec3473e2a5d93339149667e5df2a491a35d7dc)
+++ uspace/drv/usbhub/usbhub_private.h	(revision b5ec3473e2a5d93339149667e5df2a491a35d7dc)
@@ -0,0 +1,167 @@
+/*
+ * Copyright (c) 2010 Matus Dekanek
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * - Redistributions of source code must retain the above copyright
+ *   notice, this list of conditions and the following disclaimer.
+ * - Redistributions in binary form must reproduce the above copyright
+ *   notice, this list of conditions and the following disclaimer in the
+ *   documentation and/or other materials provided with the distribution.
+ * - The name of the author may not be used to endorse or promote products
+ *   derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/** @addtogroup usb
+ * @{
+ */
+/** @file
+ * @brief Hub driver.
+ */
+
+#ifndef USBHUB_PRIVATE_H
+#define	USBHUB_PRIVATE_H
+
+#include "usbhub.h"
+#include <adt/list.h>
+#include <bool.h>
+#include <driver.h>
+#include <usb/usb.h>
+#include <usb/devreq.h>
+
+//************
+//
+// convenience define for malloc
+//
+//************
+#define usb_new(type) (type*)malloc(sizeof(type))
+
+
+//************
+//
+// My private list implementation; I did not like the original helenos list
+//
+// This one does not depend on the structure of stored data
+//
+//************
+
+/** general list structure */
+
+
+typedef struct usb_general_list{
+	void * data;
+	struct usb_general_list * prev, * next;
+} usb_general_list_t;
+
+/** create head of usb general list */
+usb_general_list_t * usb_lst_create(void);
+
+/** initialize head of usb general list */
+void usb_lst_init(usb_general_list_t * lst);
+
+
+/** is the list empty? */
+static inline bool usb_lst_empty(usb_general_list_t * lst){
+	return lst?(lst->next==lst):true;
+}
+
+/** append data behind item */
+void usb_lst_append(usb_general_list_t * lst, void * data);
+
+/** prepend data beore item */
+void usb_lst_prepend(usb_general_list_t * lst, void * data);
+
+/** remove list item from list */
+void usb_lst_remove(usb_general_list_t * item);
+
+/** get data o specified type from list item */
+#define usb_lst_get_data(item, type)  (type *) (item->data)
+
+/** get usb_hub_info_t data from list item */
+static inline usb_hub_info_t * usb_hub_lst_get_data(usb_general_list_t * item) {
+	return usb_lst_get_data(item,usb_hub_info_t);
+}
+
+/**
+ * @brief create hub structure instance
+ *
+ * @param device
+ * @return
+ */
+usb_hub_info_t * usb_create_hub_info(device_t * device);
+
+/** list of hubs maanged by this driver */
+extern usb_general_list_t usb_hub_list;
+
+
+/**
+ * @brief perform complete control read transaction
+ *
+ * manages all three steps of transaction: setup, read and finalize
+ * @param phone
+ * @param target
+ * @param request request for data
+ * @param rcvd_buffer received data
+ * @param rcvd_size
+ * @param actual_size actual size of received data
+ * @return error code
+ */
+int usb_drv_sync_control_read(
+    int phone, usb_target_t target,
+    usb_device_request_setup_packet_t * request,
+    void * rcvd_buffer, size_t rcvd_size, size_t * actual_size
+);
+
+/**
+ * @brief perform complete control write transaction
+ *
+ * maanges all three steps of transaction: setup, write and finalize
+ * @param phone
+ * @param target
+ * @param request request to send data
+ * @param sent_buffer
+ * @param sent_size
+ * @return error code
+ */
+int usb_drv_sync_control_write(
+    int phone, usb_target_t target,
+    usb_device_request_setup_packet_t * request,
+    void * sent_buffer, size_t sent_size
+);
+
+
+/**
+ * set the device requsst to be a set address request
+ * @param request
+ * @param addr
+ */
+static inline void usb_hub_set_set_address_request(
+usb_device_request_setup_packet_t * request, uint16_t addr
+){
+	request->index = 0;
+	request->request_type = 0;/// \TODO this is not very nice sollution
+	request->request = USB_DEVREQ_SET_ADDRESS;
+	request->value = addr;
+	request->length = 0;
+}
+
+
+#endif	/* USBHUB_PRIVATE_H */
+
+/**
+ * @}
+ */
Index: uspace/drv/usbhub/utils.c
===================================================================
--- uspace/drv/usbhub/utils.c	(revision 9ca001350dd87a5fbe5c002091a42f437f607c8c)
+++ uspace/drv/usbhub/utils.c	(revision b5ec3473e2a5d93339149667e5df2a491a35d7dc)
@@ -43,4 +43,7 @@
 #include <usb/classes/hub.h>
 #include "usbhub.h"
+#include "usbhub_private.h"
+#include "port_status.h"
+#include <usb/devreq.h>
 
 static void check_hub_changes(void);
@@ -54,4 +57,5 @@
 //*********************************************
 
+//hub descriptor utils
 void * usb_serialize_hub_descriptor(usb_hub_descriptor_t * descriptor) {
 	//base size
@@ -85,5 +89,5 @@
 	uint8_t * sdescriptor = (uint8_t*) serialized_descriptor;
 	if (sdescriptor[1] != USB_DESCTYPE_HUB) return NULL;
-	usb_hub_descriptor_t * result = (usb_hub_descriptor_t*) malloc(sizeof (usb_hub_descriptor_t));
+	usb_hub_descriptor_t * result = usb_new(usb_hub_descriptor_t);
 	//uint8_t size = sdescriptor[0];
 	result->ports_count = sdescriptor[2];
@@ -102,4 +106,129 @@
 }
 
+//control transactions
+int usb_drv_sync_control_read(
+    int phone, usb_target_t target,
+    usb_device_request_setup_packet_t * request,
+    void * rcvd_buffer, size_t rcvd_size, size_t * actual_size
+){
+	usb_handle_t handle;
+	int opResult;
+	//setup
+	opResult = usb_drv_async_control_read_setup(phone, target,
+        request, sizeof(usb_device_request_setup_packet_t),
+        &handle);
+	if(opResult!=EOK){
+		return opResult;
+	}
+	opResult = usb_drv_async_wait_for(handle);
+	if(opResult!=EOK){
+		return opResult;
+	}
+	//read
+	opResult = usb_drv_async_control_read_data(phone, target,
+	    rcvd_buffer,  rcvd_size, actual_size,
+	    &handle);
+	if(opResult!=EOK){
+		return opResult;
+	}
+	opResult = usb_drv_async_wait_for(handle);
+	if(opResult!=EOK){
+		return opResult;
+	}
+	//finalize
+	opResult = usb_drv_async_control_read_status(phone, target,
+	    &handle);
+	if(opResult!=EOK){
+		return opResult;
+	}
+	opResult = usb_drv_async_wait_for(handle);
+	if(opResult!=EOK){
+		return opResult;
+	}
+	return EOK;
+}
+
+
+int usb_drv_sync_control_write(
+    int phone, usb_target_t target,
+    usb_device_request_setup_packet_t * request,
+    void * sent_buffer, size_t sent_size
+){
+	usb_handle_t handle;
+	int opResult;
+	//setup
+	opResult = usb_drv_async_control_write_setup(phone, target,
+        request, sizeof(usb_device_request_setup_packet_t),
+        &handle);
+	if(opResult!=EOK){
+		return opResult;
+	}
+	opResult = usb_drv_async_wait_for(handle);
+	if(opResult!=EOK){
+		return opResult;
+	}
+	//write
+	opResult = usb_drv_async_control_write_data(phone, target,
+        sent_buffer, sent_size,
+        &handle);
+	if(opResult!=EOK){
+		return opResult;
+	}
+	opResult = usb_drv_async_wait_for(handle);
+	if(opResult!=EOK){
+		return opResult;
+	}
+	//finalize
+	opResult = usb_drv_async_control_write_status(phone, target,
+        &handle);
+	if(opResult!=EOK){
+		return opResult;
+	}
+	opResult = usb_drv_async_wait_for(handle);
+	if(opResult!=EOK){
+		return opResult;
+	}
+	return EOK;
+}
+
+//list implementation
+
+usb_general_list_t * usb_lst_create(void){
+	usb_general_list_t* result = usb_new(usb_general_list_t);
+	usb_lst_init(result);
+	return result;
+}
+
+void usb_lst_init(usb_general_list_t * lst){
+	lst->prev = lst;
+	lst->next = lst;
+	lst->data = NULL;
+}
+
+void usb_lst_prepend(usb_general_list_t* item, void* data){
+	usb_general_list_t* appended = usb_new(usb_general_list_t);
+	appended->data=data;
+	appended->next=item;
+	appended->prev=item->prev;
+	item->prev->next = appended;
+	item->prev = appended;
+}
+
+void usb_lst_append(usb_general_list_t* item, void* data){
+	usb_general_list_t* appended =usb_new(usb_general_list_t);
+	appended->data=data;
+	appended->next=item->next;
+	appended->prev=item;
+	item->next->prev = appended;
+	item->next = appended;
+}
+
+
+void usb_lst_remove(usb_general_list_t* item){
+	item->next->prev = item->prev;
+	item->prev->next = item->next;
+}
+
+
 
 //*********************************************
@@ -109,7 +238,30 @@
 //*********************************************
 
-usb_hcd_hub_info_t * usb_create_hub_info(device_t * device) {
-	usb_hcd_hub_info_t* result = (usb_hcd_hub_info_t*) malloc(sizeof (usb_hcd_hub_info_t));
-
+usb_hub_info_t * usb_create_hub_info(device_t * device) {
+	usb_hub_info_t* result = usb_new(usb_hub_info_t);
+	//result->device = device;
+	result->port_count = -1;
+
+	//get hc connection
+	int hc = usb_drv_hc_connect(NULL, 0);
+	printf("[usb_hub] phone to hc = %d\n",hc);
+	if (hc < 0) {
+		return result;
+	}
+	//get some hub info
+
+	usb_address_t addr = usb_drv_get_my_address(hc,device);
+	printf("[usb_hub] addres of newly created hub = %d\n",addr);
+	/*if(addr<0){
+		//return result;
+		
+	}*/
+	result->device = usb_new(usb_hcd_attached_device_info_t);
+	result->device->address=addr;
+	//hub configuration?
+	printf("[usb_hub] hub info created\n");
+
+	
+	
 	return result;
 }
@@ -122,6 +274,5 @@
 int usb_add_hub_device(device_t *dev) {
 	printf(NAME ": add_hub_device(handle=%d)\n", (int) dev->handle);
-
-	check_hub_changes();
+	printf("[usb_hub] hub device\n");
 
 	/*
@@ -132,10 +283,17 @@
 
 	//create the hub structure
-	usb_hcd_hub_info_t * hub_info = usb_create_hub_info(dev);
-	(void)hub_info;
+	usb_hub_info_t * hub_info = usb_create_hub_info(dev);
+	usb_lst_append(&usb_hub_list, hub_info);
+	printf("[usb_hub] hub info added to list\n");
+	//(void)hub_info;
+	check_hub_changes();
+	printf("[usb_hub] hub dev added\n");
+	//test port status type...
 
 	return EOK;
 	//return ENOTSUP;
 }
+
+
 
 
@@ -146,12 +304,19 @@
 	 * Iterate through all hubs.
 	 */
-	for (; false; ) {
+	usb_general_list_t * lst_item;
+	for (lst_item = usb_hub_list.next;
+	     lst_item != &usb_hub_list;
+	     lst_item = lst_item->next) {
+		printf("[usb_hub] checking hub changes\n");
 		/*
 		 * Check status change pipe of this hub.
 		 */
+		
 		usb_target_t target = {
 			.address = 5,
 			.endpoint = 1
 		};
+		/// \TODO uncomment once it works correctly
+		//target.address = usb_create_hub_info(lst_item)->device->address;
 
 		size_t port_count = 7;
@@ -160,4 +325,6 @@
 		 * Connect to respective HC.
 		 */
+		/// \FIXME this is incorrect code: here
+		/// must be used particular device instead of NULL
 		int hc = usb_drv_hc_connect(NULL, 0);
 		if (hc < 0) {
@@ -174,11 +341,86 @@
 		/*
 		 * Send the request.
-		 * FIXME: check returned value for possible errors
-		 */
-		usb_drv_async_interrupt_in(hc, target,
+		 */
+		int opResult = usb_drv_async_interrupt_in(hc, target,
 				change_bitmap, byte_length, &actual_size,
 				&handle);
 
 		usb_drv_async_wait_for(handle);
+
+		if(opResult!=EOK){
+			printf("[usb_hub] something went wrong while getting status of hub\n");
+			continue;
+		}
+		unsigned int port;
+		for(port=0;port<port_count;++port){
+			bool interrupt = (((uint8_t*)change_bitmap)[port/8]>>(port%8))%2;
+			if(interrupt){
+				printf("[usb_hub] interrupt at port %d\n",port);
+				//determine type of change
+				usb_port_status_t status;
+				size_t rcvd_size;
+				usb_device_request_setup_packet_t request;
+				usb_hub_set_port_status_request(&request,port);
+
+				opResult = usb_drv_sync_control_read(
+				    hc, target,
+				    &request,
+				    &status, 4, &rcvd_size
+				);
+				if(opResult!=EOK){
+					continue;
+				}
+				if(rcvd_size!=sizeof(usb_port_status_t)){
+					continue;
+				}
+				
+				if(usb_port_connect_change(&status)){
+					printf("[usb_hub] some connectionchanged\n");
+					usb_drv_reserve_default_address(hc);
+					//enable port
+					usb_hub_set_enable_port_request(&request,port);
+					opResult = usb_drv_sync_control_write(
+						hc, target,
+						&request,
+						NULL, 0
+					);
+					if(opResult!=EOK){
+						continue;
+					}
+					//set address
+					usb_address_t new_device_address =
+							usb_drv_request_address(hc);
+					usb_hub_set_set_address_request
+							(&request,new_device_address);
+					opResult = usb_drv_sync_control_write(
+						hc, target,
+						&request,
+						NULL, 0
+					);
+					//some other work with drivers
+					/// \TODO do the work with drivers
+
+
+					usb_drv_release_default_address(hc);
+				}else{
+					printf("[usb_hub] no supported event occured\n");
+				}
+				/// \TODO handle other changes
+				/// \TODO debug log for various situations
+
+
+
+				/*
+				//configure device
+				usb_drv_reserve_default_address(hc);
+
+				usb_address_t new_device_address = usb_drv_request_address(hc);
+
+
+				usb_drv_release_default_address(hc);
+				 * */
+			}
+		}
+
 
 		/*
