Index: uspace/drv/ohci/root_hub.c
===================================================================
--- uspace/drv/ohci/root_hub.c	(revision 5c2c4596881c9f90793bcd0a64b9007ca954fee8)
+++ uspace/drv/ohci/root_hub.c	(revision c28b3a5cc209bc3eb3a6329eed7c416e085beef7)
@@ -61,5 +61,4 @@
 	.vendor_id = 0x16db,
 	.product_id = 0x0001,
-	/// \TODO these values migt be different
 	.str_serial_number = 0,
 	.usb_spec_version = 0x110,
@@ -119,5 +118,4 @@
 static const uint32_t hub_clear_feature_by_writing_one_mask =
    RHS_CLEAR_PORT_POWER;
-   // 1 << USB_HUB_FEATURE_C_HUB_LOCAL_POWER;
 
 /**
@@ -127,6 +125,4 @@
     RHS_LPSC_FLAG |
     RHS_OCIC_FLAG;
-    //(1 << USB_HUB_FEATURE_C_HUB_OVER_CURRENT) |
-    //(1 << USB_HUB_FEATURE_C_HUB_LOCAL_POWER);
 
 /**
@@ -135,5 +131,4 @@
 static const uint32_t hub_set_feature_direct_mask =
     RHS_SET_PORT_POWER;
-    //(1 << USB_HUB_FEATURE_C_HUB_OVER_CURRENT);
 
 /**
@@ -160,16 +155,4 @@
     RHPS_PRSC_FLAG;
 
-/*
-
-    (1 << USB_HUB_FEATURE_PORT_CONNECTION) |
-    (1 << USB_HUB_FEATURE_PORT_SUSPEND) |
-    (1 << USB_HUB_FEATURE_PORT_OVER_CURRENT) |
-    (1 << USB_HUB_FEATURE_PORT_POWER) |
-    (1 << USB_HUB_FEATURE_C_PORT_CONNECTION) |
-    (1 << USB_HUB_FEATURE_C_PORT_ENABLE) |
-    (1 << USB_HUB_FEATURE_C_PORT_SUSPEND) |
-    (1 << USB_HUB_FEATURE_C_PORT_OVER_CURRENT) |
-    (1 << USB_HUB_FEATURE_C_PORT_RESET);
- */
 //note that USB_HUB_FEATURE_PORT_POWER bit is translated into
 //USB_HUB_FEATURE_PORT_LOW_SPEED for port set feature request
@@ -179,10 +162,4 @@
  */
 static const uint32_t port_status_change_mask = RHPS_CHANGE_WC_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);
-*/
 
 static int create_serialized_hub_descriptor(rh_t *instance);
@@ -420,5 +397,7 @@
  * create answer to port status_request
  *
- * Copy content of corresponding port status register to answer buffer.
+ * Copy content of corresponding port status register to answer buffer. The
+ * format of the port status register and port status data is the same (
+ * see OHCI root hub and USB hub documentation).
  *
  * @param instance root hub instance
@@ -431,7 +410,7 @@
 	if (port < 1 || port > instance->port_count)
 		return EINVAL;
-	uint32_t * uint32_buffer = (uint32_t*) request->data_buffer;
 	request->transfered_size = 4;
-	uint32_buffer[0] = instance->registers->rh_port_status[port - 1];
+	uint32_t data = instance->registers->rh_port_status[port - 1];
+	memcpy(request->data_buffer,&data,4);
 #if 0
 	int i;
@@ -450,5 +429,7 @@
  * create answer to port status_request
  *
- * Copy content of hub status register to answer buffer.
+ * This copies flags in hub status register into the buffer. The format of the
+ * status register and status message is the same, according to USB hub
+ * specification and OHCI root hub specification.
  *
  * @param instance root hub instance
@@ -458,9 +439,11 @@
 static int process_get_hub_status_request(rh_t *instance,
     usb_transfer_batch_t * request) {
-	uint32_t * uint32_buffer = (uint32_t*) request->data_buffer;
+	//uint32_t * uint32_buffer = (uint32_t*) request->data_buffer;
 	request->transfered_size = 4;
 	//bits, 0,1,16,17
 	uint32_t mask = 1 | (1 << 1) | (1 << 16) | (1 << 17);
-	uint32_buffer[0] = mask & instance->registers->rh_status;
+	uint32_t data = mask & instance->registers->rh_status;
+	//uint32_buffer[0] = mask & instance->registers->rh_status;
+	memcpy(request->data_buffer,&data,4);
 
 	return EOK;
@@ -516,5 +499,5 @@
 	    | (1 << (USB_HUB_FEATURE_C_HUB_OVER_CURRENT + 16));
 	bzero(bitmap, instance->interrupt_mask_size);
-	if (instance->registers->rh_status & mask) {
+	if ((instance->registers->rh_status & mask) !=0 ) {
 		bitmap[0] = 1;
 	}
@@ -522,5 +505,5 @@
 	mask = port_status_change_mask;
 	for (port = 1; port <= instance->port_count; ++port) {
-		if (mask & instance->registers->rh_port_status[port - 1]) {
+		if ((mask & instance->registers->rh_port_status[port - 1]) != 0) {
 
 			bitmap[(port) / 8] += 1 << (port % 8);
Index: uspace/drv/usbhub/usbhub.c
===================================================================
--- uspace/drv/usbhub/usbhub.c	(revision 5c2c4596881c9f90793bcd0a64b9007ca954fee8)
+++ uspace/drv/usbhub/usbhub.c	(revision c28b3a5cc209bc3eb3a6329eed7c416e085beef7)
@@ -67,5 +67,5 @@
     usb_hub_status_t status);
 
-static int usb_process_hub_power_change(usb_hub_info_t * hub_info,
+static int usb_process_hub_local_power_change(usb_hub_info_t * hub_info,
     usb_hub_status_t status);
 
@@ -386,16 +386,28 @@
 	int opResult;
 	if (usb_hub_is_status(status,USB_HUB_FEATURE_HUB_OVER_CURRENT)){
-		opResult = usb_hub_clear_feature(hub_info->control_pipe,
-		    USB_HUB_FEATURE_HUB_LOCAL_POWER);
-		if (opResult != EOK) {
-			usb_log_error("cannot power off hub: %d\n",
-			    opResult);
+		//poweroff all ports
+		unsigned int port;
+		for(port = 1;port <= hub_info->port_count;++port){
+			opResult = usb_hub_clear_port_feature(
+			    hub_info->control_pipe,port,
+			    USB_HUB_FEATURE_PORT_POWER);
+			if (opResult != EOK) {
+				usb_log_warning(
+				    "cannot power off port %d;  %d\n",
+				    port, opResult);
+			}
 		}
 	} else {
-		opResult = usb_hub_set_feature(hub_info->control_pipe,
-		    USB_HUB_FEATURE_HUB_LOCAL_POWER);
-		if (opResult != EOK) {
-			usb_log_error("cannot power on hub: %d\n",
-			    opResult);
+		//power all ports
+		unsigned int port;
+		for(port = 1;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_warning(
+				    "cannot power off port %d;  %d\n",
+				    port, opResult);
+			}
 		}
 	}
@@ -404,38 +416,14 @@
 
 /**
- * process hub power change
- *
- * If the power has been lost, reestablish it.
- * If it was reestablished, re-power all ports.
+ * process hub local power change
+ *
+ * This change is ignored.
  * @param hub_info hub instance
  * @param status hub status bitmask
  * @return error code
  */
-static int usb_process_hub_power_change(usb_hub_info_t * hub_info,
+static int usb_process_hub_local_power_change(usb_hub_info_t * hub_info,
     usb_hub_status_t status) {
 	int opResult = EOK;
-	if (!usb_hub_is_status(status,USB_HUB_FEATURE_HUB_LOCAL_POWER)) {
-		//restart power on hub
-		opResult = usb_hub_set_feature(hub_info->control_pipe,
-		    USB_HUB_FEATURE_HUB_LOCAL_POWER);
-		if (opResult != EOK) {
-			usb_log_error("cannot power on hub: %d\n",
-			    opResult);
-		}
-	} else {//power reestablished on hub- restart ports
-		size_t port;
-		for (port = 1; 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 %zu: %s.\n",
-				    port, str_error(opResult));
-			}
-		}
-	}
-	if(opResult!=EOK){
-		return opResult;//no feature clearing
-	}
 	opResult = usb_hub_clear_feature(hub_info->control_pipe,
 	    USB_HUB_FEATURE_C_HUB_LOCAL_POWER);
@@ -452,5 +440,5 @@
  *
  * The change can be either in the over-current condition or
- * local-power lost condition.
+ * local-power change.
  * @param hub_info hub instance
  */
@@ -487,5 +475,5 @@
 	if (
 	    usb_hub_is_status(status,16+USB_HUB_FEATURE_C_HUB_LOCAL_POWER)) {
-		usb_process_hub_power_change(hub_info, status);
+		usb_process_hub_local_power_change(hub_info, status);
 	}
 }
Index: uspace/lib/drv/include/remote_pci.h
===================================================================
--- uspace/lib/drv/include/remote_pci.h	(revision 5c2c4596881c9f90793bcd0a64b9007ca954fee8)
+++ uspace/lib/drv/include/remote_pci.h	(revision c28b3a5cc209bc3eb3a6329eed7c416e085beef7)
@@ -36,5 +36,5 @@
 #define LIBDRV_REMOTE_PCI_H_
 
-remote_iface_t remote_pci_iface;
+extern remote_iface_t remote_pci_iface;
 
 #endif
Index: uspace/lib/drv/include/remote_usb.h
===================================================================
--- uspace/lib/drv/include/remote_usb.h	(revision 5c2c4596881c9f90793bcd0a64b9007ca954fee8)
+++ uspace/lib/drv/include/remote_usb.h	(revision c28b3a5cc209bc3eb3a6329eed7c416e085beef7)
@@ -36,5 +36,5 @@
 #define LIBDRV_REMOTE_USB_H_
 
-remote_iface_t remote_usb_iface;
+extern remote_iface_t remote_usb_iface;
 
 #endif
Index: uspace/lib/drv/include/remote_usbhc.h
===================================================================
--- uspace/lib/drv/include/remote_usbhc.h	(revision 5c2c4596881c9f90793bcd0a64b9007ca954fee8)
+++ uspace/lib/drv/include/remote_usbhc.h	(revision c28b3a5cc209bc3eb3a6329eed7c416e085beef7)
@@ -36,5 +36,5 @@
 #define LIBDRV_REMOTE_USBHC_H_
 
-remote_iface_t remote_usbhc_iface;
+extern remote_iface_t remote_usbhc_iface;
 
 #endif
