Index: uspace/drv/usbhub/port_status.h
===================================================================
--- uspace/drv/usbhub/port_status.h	(revision 3bb6b35352b122f169c283b0739bc01844c8aafc)
+++ uspace/drv/usbhub/port_status.h	(revision 040ab0220b9935686bedba04b3968406ec8879ed)
@@ -49,4 +49,14 @@
 
 /**
+ * structure holding hub status and changes flags.
+ * should not be accessed directly, use supplied getter/setter methods.
+ *
+ * For more information refer to table 11.16.2.5 in
+ * "Universal Serial Bus Specification Revision 1.1"
+ *
+ */
+typedef uint32_t usb_hub_status_t;
+
+/**
  * set values in request to be it a port status request
  * @param request
@@ -58,4 +68,19 @@
 	request->index = port;
 	request->request_type = USB_HUB_REQ_TYPE_GET_PORT_STATUS;
+	request->request = USB_HUB_REQUEST_GET_STATUS;
+	request->value = 0;
+	request->length = 4;
+}
+
+/**
+ * set values in request to be it a port status request
+ * @param request
+ * @param port
+ */
+static inline void usb_hub_set_hub_status_request(
+usb_device_request_setup_packet_t * request
+){
+	request->index = 0;
+	request->request_type = USB_HUB_REQ_TYPE_GET_HUB_STATUS;
 	request->request = USB_HUB_REQUEST_GET_STATUS;
 	request->value = 0;
@@ -242,4 +267,20 @@
 }
 
+/** get i`th bit of hub status */
+static inline bool usb_hub_get_bit(usb_hub_status_t * status, int idx)
+{
+	return (((*status)>>(idx))%2);
+}
+
+/** set i`th bit of hub status */
+static inline void usb_hub_set_bit(
+	usb_hub_status_t * status, int idx, bool value)
+{
+	(*status) = value?
+		               ((*status)|(1<<(idx))):
+		               ((*status)&(~(1<<(idx))));
+}
+
+
 //device connnected on port
 static inline bool usb_port_dev_connected(usb_port_status_t * status){
@@ -368,4 +409,43 @@
 }
 
+//local power status
+static inline bool usb_hub_local_power_lost(usb_hub_status_t * status){
+	return usb_hub_get_bit(status,0);
+}
+
+static inline void usb_hub_set_local_power_lost(usb_port_status_t * status,
+	bool power_lost){
+	usb_hub_set_bit(status,0,power_lost);
+}
+
+//over current ocndition
+static inline bool usb_hub_over_current(usb_hub_status_t * status){
+	return usb_hub_get_bit(status,1);
+}
+
+static inline void usb_hub_set_over_current(usb_port_status_t * status,
+	bool over_current){
+	usb_hub_set_bit(status,1,over_current);
+}
+
+//local power change
+static inline bool usb_hub_local_power_change(usb_hub_status_t * status){
+	return usb_hub_get_bit(status,16);
+}
+
+static inline void usb_hub_set_local_power_change(usb_port_status_t * status,
+	bool change){
+	usb_hub_set_bit(status,16,change);
+}
+
+//local power status
+static inline bool usb_hub_over_current_change(usb_hub_status_t * status){
+	return usb_hub_get_bit(status,17);
+}
+
+static inline void usb_hub_set_over_current_change(usb_port_status_t * status,
+	bool change){
+	usb_hub_set_bit(status,17,change);
+}
 
 
Index: uspace/drv/usbhub/usbhub.c
===================================================================
--- uspace/drv/usbhub/usbhub.c	(revision 3bb6b35352b122f169c283b0739bc01844c8aafc)
+++ uspace/drv/usbhub/usbhub.c	(revision 040ab0220b9935686bedba04b3968406ec8879ed)
@@ -84,4 +84,5 @@
 }
 
+/// \TODO set_port_feature use
 
 //*********************************************
@@ -123,10 +124,11 @@
 	void * serialized_descriptor = malloc(USB_HUB_MAX_DESCRIPTOR_SIZE);
 	usb_hub_descriptor_t * descriptor;
+	int opResult;
 
 	/* this was one fix of some bug, should not be needed anymore
 	 * these lines allow to reset hub once more, it can be used as
 	 * brute-force initialization for non-removable devices
-	 */
-	int opResult = usb_request_set_configuration(hub_info->control_pipe,
+	 *
+	opResult = usb_request_set_configuration(hub_info->control_pipe,
 		1);
 	if (opResult != EOK) {
@@ -134,5 +136,5 @@
 			opResult);
 		return opResult;
-	}
+	}*/
 
 
@@ -662,12 +664,27 @@
  * @param port port number, starting from 1
  */
-static void usb_hub_over_current(usb_hub_info_t * hub,
-	uint16_t port) {
+static void usb_hub_port_over_current(usb_hub_info_t * hub,
+	uint16_t port, uint32_t status) {
+	/// \todo no, this is not proper sollution
+	/// get affected ports
+	/// power them off
+	/// wait until there over-current is cleared
+	/// power them on
+
 	int opResult;
-	opResult = usb_hub_clear_port_feature(hub->control_pipe,
-		port, USB_HUB_FEATURE_PORT_POWER);
-	if (opResult != EOK) {
-		usb_log_error("cannot power off port %d;  %d\n",
-			port, opResult);
+	if(usb_port_over_current(&status)){
+		opResult = usb_hub_clear_port_feature(hub->control_pipe,
+			port, USB_HUB_FEATURE_PORT_POWER);
+		if (opResult != EOK) {
+			usb_log_error("cannot power off port %d;  %d\n",
+				port, opResult);
+		}
+	}else{
+		opResult = usb_hub_set_port_feature(hub->control_pipe,
+			port, USB_HUB_FEATURE_PORT_POWER);
+		if (opResult != EOK) {
+			usb_log_error("cannot power on port %d;  %d\n",
+				port, opResult);
+		}
 	}
 }
@@ -723,11 +740,5 @@
 		//check if it was not auto-resolved
 		usb_log_debug("overcurrent change on port\n");
-		if (usb_port_over_current(&status)) {
-			usb_hub_over_current(hub, port);
-		} else {
-			usb_log_debug("over current condition was "
-				"auto-resolved on port %d\n",
-				port);
-		}
+		usb_hub_port_over_current(hub, port, status);
 	}
 	//port reset
@@ -752,4 +763,88 @@
 			port, status);
 
+	}
+}
+
+static int usb_process_hub_over_current(usb_hub_info_t * hub_info,
+	usb_hub_status_t status)
+{
+	int opResult;
+	if(usb_hub_over_current(&status)){
+		opResult = usb_hub_clear_feature(hub_info->control_pipe,
+			USB_HUB_FEATURE_PORT_POWER);
+		if (opResult != EOK) {
+			usb_log_error("cannot power off hub: %d\n",
+				opResult);
+		}
+	}else{
+		opResult = usb_hub_set_feature(hub_info->control_pipe,
+			USB_HUB_FEATURE_PORT_POWER);
+		if (opResult != EOK) {
+			usb_log_error("cannot power on hub: %d\n",
+				opResult);
+		}
+	}
+	return opResult;
+}
+
+static int usb_process_hub_power_change(usb_hub_info_t * hub_info,
+	usb_hub_status_t status)
+{
+	int opResult;
+	if(usb_hub_local_power_lost(&status)){
+		//restart power on hub
+		opResult = usb_hub_set_feature(hub_info->control_pipe,
+			USB_HUB_FEATURE_PORT_POWER);
+		if (opResult != EOK) {
+			usb_log_error("cannot power on hub: %d\n",
+				opResult);
+		}
+	}else{//power reestablished on hub- restart ports
+		int port;
+		for(port=0;port<hub_info->port_count;++port){
+			opResult = usb_hub_set_port_feature(
+				hub_info->control_pipe,
+				port, USB_HUB_FEATURE_PORT_POWER);
+			if (opResult != EOK) {
+				usb_log_error("cannot power on port %d;  %d\n",
+					port, opResult);
+			}
+		}
+	}
+	return opResult;
+}
+
+
+static void usb_hub_process_global_interrupt(usb_hub_info_t * hub_info){
+	usb_log_debug("global interrupt on a hub\n");
+	usb_pipe_t *pipe = hub_info->control_pipe;
+	int opResult;
+
+	usb_port_status_t status;
+	size_t rcvd_size;
+	usb_device_request_setup_packet_t request;
+	//int opResult;
+	usb_hub_set_hub_status_request(&request);
+	//endpoint 0
+
+	opResult = usb_pipe_control_read(
+		pipe,
+		&request, sizeof (usb_device_request_setup_packet_t),
+		&status, 4, &rcvd_size
+		);
+	if (opResult != EOK) {
+		usb_log_error("could not get hub status\n");
+		return;
+	}
+	if (rcvd_size != sizeof (usb_port_status_t)) {
+		usb_log_error("received status has incorrect size\n");
+		return;
+	}
+	//port reset
+	if (usb_hub_over_current_change(&status)) {
+		usb_process_hub_over_current(hub_info,status);
+	}
+	if (usb_hub_local_power_change(&status)) {
+		usb_process_hub_power_change(hub_info,status);
 	}
 }
@@ -866,7 +961,12 @@
 
 	///todo, opresult check, pre obe konekce
+	bool interrupt;
+	interrupt = ((uint8_t*)change_bitmap)[0] & 1;
+	if(interrupt){
+		usb_hub_process_global_interrupt(hub_info);
+	}
 	for (port = 1; port < port_count + 1; ++port) {
-		bool interrupt =
-			(((uint8_t*) change_bitmap)[port / 8] >> (port % 8)) % 2;
+		interrupt =
+			((uint8_t*) change_bitmap)[port / 8] & (1<<(port % 8));
 		if (interrupt) {
 			usb_hub_process_interrupt(
@@ -874,4 +974,5 @@
 		}
 	}
+	/// \todo check hub status
 	usb_hc_connection_close(&hub_info->connection);
 	usb_pipe_end_session(hub_info->control_pipe);
Index: uspace/drv/usbhub/usbhub.h
===================================================================
--- uspace/drv/usbhub/usbhub.h	(revision 3bb6b35352b122f169c283b0739bc01844c8aafc)
+++ uspace/drv/usbhub/usbhub.h	(revision 040ab0220b9935686bedba04b3968406ec8879ed)
@@ -90,5 +90,5 @@
 	/** not yet initialized non-removable devices */
 	uint8_t * not_initialized_non_removables;
-
+	
 } usb_hub_info_t;
 
Index: uspace/drv/usbhub/usbhub_private.h
===================================================================
--- uspace/drv/usbhub/usbhub_private.h	(revision 3bb6b35352b122f169c283b0739bc01844c8aafc)
+++ uspace/drv/usbhub/usbhub_private.h	(revision 040ab0220b9935686bedba04b3968406ec8879ed)
@@ -111,4 +111,71 @@
 
 /**
+ * Clear feature on hub port.
+ *
+ * @param hc Host controller telephone
+ * @param address Hub address
+ * @param port_index Port
+ * @param feature Feature selector
+ * @return Operation result
+ */
+static inline int usb_hub_set_port_feature(usb_pipe_t *pipe,
+    int port_index,
+    usb_hub_class_feature_t feature) {
+
+	usb_device_request_setup_packet_t clear_request = {
+		.request_type = USB_HUB_REQ_TYPE_CLEAR_PORT_FEATURE,
+		.request = USB_DEVREQ_SET_FEATURE,
+		.length = 0,
+		.index = port_index
+	};
+	clear_request.value = feature;
+	return usb_pipe_control_write(pipe, &clear_request,
+	    sizeof(clear_request), NULL, 0);
+}
+
+
+/**
+ * Clear feature on hub port.
+ *
+ * @param pipe pipe to hub control endpoint
+ * @param feature Feature selector
+ * @return Operation result
+ */
+static inline int usb_hub_clear_feature(usb_pipe_t *pipe,
+    usb_hub_class_feature_t feature) {
+
+	usb_device_request_setup_packet_t clear_request = {
+		.request_type = USB_HUB_REQ_TYPE_CLEAR_HUB_FEATURE,
+		.request = USB_DEVREQ_CLEAR_FEATURE,
+		.length = 0,
+		.index = 0
+	};
+	clear_request.value = feature;
+	return usb_pipe_control_write(pipe, &clear_request,
+	    sizeof(clear_request), NULL, 0);
+}
+
+/**
+ * Clear feature on hub port.
+ *
+ * @param pipe pipe to hub control endpoint
+ * @param feature Feature selector
+ * @return Operation result
+ */
+static inline int usb_hub_set_feature(usb_pipe_t *pipe,
+    usb_hub_class_feature_t feature) {
+
+	usb_device_request_setup_packet_t clear_request = {
+		.request_type = USB_HUB_REQ_TYPE_CLEAR_HUB_FEATURE,
+		.request = USB_DEVREQ_SET_FEATURE,
+		.length = 0,
+		.index = 0
+	};
+	clear_request.value = feature;
+	return usb_pipe_control_write(pipe, &clear_request,
+	    sizeof(clear_request), NULL, 0);
+}
+
+/**
  * create uint8_t array with serialized descriptor
  *
