Index: uspace/doc/doxygroups.h
===================================================================
--- uspace/doc/doxygroups.h	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/doc/doxygroups.h	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -176,2 +176,10 @@
 	 * @brief Library for creating USB devices drivers.
 	 */
+
+	 /**
+	  * @defgroup usbhub USB hub driver
+	  * @ingroup usb
+	  * @brief USB hub driver.
+	  */
+	  */
+
Index: uspace/drv/usbhub/main.c
===================================================================
--- uspace/drv/usbhub/main.c	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/drv/usbhub/main.c	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -60,12 +60,14 @@
 int main(int argc, char *argv[])
 {
-	usb_dprintf_enable(NAME,1);
+	usb_dprintf_enable(NAME, 0);
+
 	futex_initialize(&usb_hub_list_lock, 0);
 	usb_lst_init(&usb_hub_list);
 	futex_up(&usb_hub_list_lock);
+
 	fid_t fid = fibril_create(usb_hub_control_loop, NULL);
 	if (fid == 0) {
-		dprintf(1, "failed to start fibril for HUB devices");
-		//printf("%s: failed to start fibril for HUB devices\n", NAME);
+		fprintf(stderr, NAME ": failed to start monitoring fibril," \
+		    " driver aborting.\n");
 		return ENOMEM;
 	}
Index: uspace/drv/usbhub/usbhub.c
===================================================================
--- uspace/drv/usbhub/usbhub.c	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/drv/usbhub/usbhub.c	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -26,5 +26,5 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-/** @addtogroup usb hub driver
+/** @addtogroup usbhub
  * @{
  */
@@ -76,5 +76,5 @@
 	//get some hub info
 	usb_address_t addr = usb_drv_get_my_address(hc, device);
-	dprintf(1,"[usb_hub] address of newly created hub = %d", addr);
+	dprintf(1, "address of newly created hub = %d", addr);
 	/*if(addr<0){
 		//return result;
@@ -100,5 +100,5 @@
 
 	if (opResult != EOK) {
-		dprintf(1,"[usb_hub] failed when receiving hub descriptor, badcode = %d",opResult);
+		dprintf(1, "failed when receiving hub descriptor, badcode = %d",opResult);
 		free(serialized_descriptor);
 		return result;
@@ -107,5 +107,5 @@
 	descriptor = usb_deserialize_hub_desriptor(serialized_descriptor);
 	if(descriptor==NULL){
-		dprintf(1,"[usb_hub] could not deserialize descriptor ");
+		dprintf(1, "could not deserialize descriptor ");
 		result->port_count = 1;///\TODO this code is only for debug!!!
 		return result;
@@ -127,5 +127,5 @@
 	//finish
 
-	dprintf(1,"[usb_hub] hub info created");
+	dprintf(1, "hub info created");
 
 	return result;
@@ -134,5 +134,5 @@
 int usb_add_hub_device(device_t *dev) {
 	dprintf(1, "add_hub_device(handle=%d)", (int) dev->handle);
-	dprintf(1,"[usb_hub] hub device");
+	dprintf(1, "hub device");
 
 	/*
@@ -162,12 +162,12 @@
 	usb_standard_device_descriptor_t std_descriptor;
 	opResult = usb_drv_req_get_device_descriptor(hc, target.address,
-    &std_descriptor);
+	    &std_descriptor);
 	if(opResult!=EOK){
-		dprintf(1,"[usb_hub] could not get device descriptor, %d",opResult);
+		dprintf(1, "could not get device descriptor, %d",opResult);
 		return opResult;
 	}
-	dprintf(1,"[usb_hub] hub has %d configurations",std_descriptor.configuration_count);
+	dprintf(1, "hub has %d configurations",std_descriptor.configuration_count);
 	if(std_descriptor.configuration_count<1){
-		dprintf(1,"[usb_hub] THERE ARE NO CONFIGURATIONS AVAILABLE");
+		dprintf(1, "THERE ARE NO CONFIGURATIONS AVAILABLE");
 		//shouldn`t I return?
 	}
@@ -178,5 +178,5 @@
         &config_descriptor);
 	if(opResult!=EOK){
-		dprintf(1,"[usb_hub] could not get configuration descriptor, %d",opResult);
+		dprintf(1, "could not get configuration descriptor, %d",opResult);
 		return opResult;
 	}
@@ -186,5 +186,5 @@
 
 	if (opResult != EOK) {
-		dprintf(1,"[usb_hub]something went wrong when setting hub`s configuration, %d", opResult);
+		dprintf(1, "something went wrong when setting hub`s configuration, %d", opResult);
 	}
 
@@ -193,7 +193,7 @@
 		usb_hub_set_power_port_request(&request, port);
 		opResult = usb_drv_sync_control_write(hc, target, &request, NULL, 0);
-		dprintf(1,"[usb_hub] powering port %d",port);
+		dprintf(1, "powering port %d",port);
 		if (opResult != EOK) {
-			dprintf(1,"[usb_hub]something went wrong when setting hub`s %dth port", port);
+			dprintf(1, "something went wrong when setting hub`s %dth port", port);
 		}
 	}
@@ -207,5 +207,5 @@
 	futex_up(&usb_hub_list_lock);
 
-	dprintf(1,"[usb_hub] hub info added to list");
+	dprintf(1, "hub info added to list");
 	//(void)hub_info;
 	usb_hub_check_hub_changes();
@@ -213,9 +213,9 @@
 	
 
-	dprintf(1,"[usb_hub] hub dev added");
-	dprintf(1,"\taddress %d, has %d ports ",
+	dprintf(1, "hub dev added");
+	dprintf(1, "\taddress %d, has %d ports ",
 			hub_info->usb_device->address,
 			hub_info->port_count);
-	dprintf(1,"\tused configuration %d",config_descriptor.configuration_number);
+	dprintf(1, "\tused configuration %d",config_descriptor.configuration_number);
 
 	return EOK;
@@ -238,8 +238,8 @@
 inline static int usb_hub_release_default_address(int hc){
 	int opResult;
-	dprintf(1,"[usb_hub] releasing default address");
+	dprintf(1, "releasing default address");
 	opResult = usb_drv_release_default_address(hc);
 	if (opResult != EOK) {
-		dprintf(1,"[usb_hub] failed to release default address");
+		dprintf(1, "failed to release default address");
 	}
 	return opResult;
@@ -255,9 +255,9 @@
 	usb_device_request_setup_packet_t request;
 	int opResult;
-	dprintf(1,"[usb_hub] some connection changed");
+	dprintf(1, "some connection changed");
 	//get default address
 	opResult = usb_drv_reserve_default_address(hc);
 	if (opResult != EOK) {
-		dprintf(1,"[usb_hub] cannot assign default address, it is probably used");
+		dprintf(1, "cannot assign default address, it is probably used");
 		return;
 	}
@@ -270,5 +270,5 @@
 			);
 	if (opResult != EOK) {
-		dprintf(1,"[usb_hub] something went wrong when reseting a port");
+		dprintf(1, "something went wrong when reseting a port");
 		usb_hub_release_default_address(hc);
 	}
@@ -285,9 +285,9 @@
 
 	int opResult;
-	dprintf(1,"[usb_hub] finalizing add device");
+	dprintf(1, "finalizing add device");
 	opResult = usb_hub_clear_port_feature(hc, target.address,
 	    port, USB_HUB_FEATURE_C_PORT_RESET);
 	if (opResult != EOK) {
-		dprintf(1,"[usb_hub] failed to clear port reset feature");
+		dprintf(1, "failed to clear port reset feature");
 		usb_hub_release_default_address(hc);
 		return;
@@ -297,15 +297,15 @@
 	usb_address_t new_device_address = usb_drv_request_address(hc);
 	if (new_device_address < 0) {
-		dprintf(1,"[usb_hub] failed to get free USB address");
+		dprintf(1, "failed to get free USB address");
 		opResult = new_device_address;
 		usb_hub_release_default_address(hc);
 		return;
 	}
-	dprintf(1,"[usb_hub] setting new address");
+	dprintf(1, "setting new address");
 	opResult = usb_drv_req_set_address(hc, USB_ADDRESS_DEFAULT,
 	    new_device_address);
 
 	if (opResult != EOK) {
-		dprintf(1,"[usb_hub] could not set address for new device");
+		dprintf(1, "could not set address for new device");
 		usb_hub_release_default_address(hc);
 		return;
@@ -322,5 +322,5 @@
             new_device_address, &child_handle);
 	if (opResult != EOK) {
-		dprintf(1,"[usb_hub] could not start driver for new device");
+		dprintf(1, "could not start driver for new device");
 		return;
 	}
@@ -330,8 +330,8 @@
 	opResult = usb_drv_bind_address(hc, new_device_address, child_handle);
 	if (opResult != EOK) {
-		dprintf(1,"[usb_hub] could not assign address of device in hcd");
-		return;
-	}
-	dprintf(1,"[usb_hub] new device address %d, handle %zu",
+		dprintf(1, "could not assign address of device in hcd");
+		return;
+	}
+	dprintf(1, "new device address %d, handle %zu",
 	    new_device_address, child_handle);
 
@@ -358,12 +358,10 @@
 		opResult = usb_drv_release_address(hc,hub->attached_devs[port].address);
 		if(opResult != EOK) {
-			dprintf(1,
-					"[usb_hub] could not release address of removed device: %d"
-					,opResult);
+			dprintf(1, "could not release address of " \
+			    "removed device: %d", opResult);
 		}
 		hub->attached_devs[port].address = 0;
 	}else{
-		dprintf(1,
-				"[usb_hub] this is strange, disconnected device had no address");
+		dprintf(1, "this is strange, disconnected device had no address");
 		//device was disconnected before it`s port was reset - return default address
 		usb_drv_release_default_address(hc);
@@ -379,5 +377,5 @@
 static void usb_hub_process_interrupt(usb_hub_info_t * hub, int hc,
         uint16_t port, usb_address_t address) {
-	dprintf(1,"[usb_hub] interrupt at port %d", port);
+	dprintf(1, "interrupt at port %d", port);
 	//determine type of change
 	usb_target_t target;
@@ -397,9 +395,9 @@
 			);
 	if (opResult != EOK) {
-		dprintf(1,"[usb_hub] ERROR: could not get port status");
+		dprintf(1, "ERROR: could not get port status");
 		return;
 	}
 	if (rcvd_size != sizeof (usb_port_status_t)) {
-		dprintf(1,"[usb_hub] ERROR: received status has incorrect size");
+		dprintf(1, "ERROR: received status has incorrect size");
 		return;
 	}
@@ -410,5 +408,5 @@
 		// TODO: check opResult
 		if (usb_port_dev_connected(&status)) {
-			dprintf(1,"[usb_hub] some connection changed");
+			dprintf(1, "some connection changed");
 			usb_hub_init_add_device(hc, port, target);
 		} else {
@@ -418,9 +416,9 @@
 	//port reset
 	if (usb_port_reset_completed(&status)) {
-		dprintf(1,"[usb_hub] port reset complete");
+		dprintf(1, "port reset complete");
 		if (usb_port_enabled(&status)) {
 			usb_hub_finalize_add_device(hub, hc, port, target);
 		} else {
-			dprintf(1,"[usb_hub] ERROR: port reset, but port still not enabled");
+			dprintf(1, "ERROR: port reset, but port still not enabled");
 		}
 	}
@@ -431,5 +429,5 @@
 	usb_port_set_dev_connected(&status, false);
 	if (status>>16) {
-		dprintf(1,"[usb_hub]there was some unsupported change on port %d: %X",port,status);
+		dprintf(1, "there was some unsupported change on port %d: %X",port,status);
 
 	}
@@ -460,6 +458,6 @@
 		target.address = hub_info->usb_device->address;
 		target.endpoint = 1;/// \TODO get from endpoint descriptor
-		/*dprintf(1,"[usb_hub] checking changes for hub at addr %d",
-		    target.address);*/
+		dprintf(1, "checking changes for hub at addr %d",
+		    target.address);
 
 		size_t port_count = hub_info->port_count;
@@ -490,5 +488,5 @@
 
 		if (opResult != EOK) {
-			dprintf(1,"[usb_hub] something went wrong while getting status of hub");
+			dprintf(1, "something went wrong while getting status of hub");
 			continue;
 		}
Index: uspace/drv/usbhub/usblist.c
===================================================================
--- uspace/drv/usbhub/usblist.c	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/drv/usbhub/usblist.c	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -26,5 +26,5 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-/** @addtogroup usb hub driver
+/** @addtogroup usbhub
  * @{
  */
Index: uspace/drv/usbhub/usblist.h
===================================================================
--- uspace/drv/usbhub/usblist.h	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/drv/usbhub/usblist.h	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -27,8 +27,5 @@
  */
 
-
-#ifndef USBLIST_H
-#define	USBLIST_H
-/** @addtogroup usb hub driver
+/** @addtogroup usbhub
  * @{
  */
@@ -40,4 +37,6 @@
  * much simpler and more straight-forward semantics.
  */
+#ifndef USBLIST_H
+#define	USBLIST_H
 
 /**
@@ -78,11 +77,6 @@
 }
 
-
+#endif	/* USBLIST_H */
 /**
  * @}
  */
-
-
-
-#endif	/* USBLIST_H */
-
Index: uspace/drv/usbhub/utils.c
===================================================================
--- uspace/drv/usbhub/utils.c	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/drv/usbhub/utils.c	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libusb usb
+/** @addtogroup usbhub
  * @{
  */
Index: uspace/drv/vhc/conn.h
===================================================================
--- uspace/drv/vhc/conn.h	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/drv/vhc/conn.h	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -51,4 +51,5 @@
 
 void default_connection_handler(device_t *, ipc_callid_t, ipc_call_t *);
+void on_client_close(device_t *);
 
 
Index: uspace/drv/vhc/conndev.c
===================================================================
--- uspace/drv/vhc/conndev.c	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/drv/vhc/conndev.c	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -88,5 +88,5 @@
 		int callback = IPC_GET_ARG5(*icall);
 		virtdev_connection_t *dev
-		    = virtdev_add_device(callback);
+		    = virtdev_add_device(callback, (sysarg_t)fibril_get_id());
 		if (!dev) {
 			ipc_answer_0(icallid, EEXISTS);
@@ -99,8 +99,6 @@
 		int rc = get_device_name(callback, devname, DEVICE_NAME_MAXLENGTH);
 
-		dprintf(0, "virtual device connected (name: %s)",
-		    rc == EOK ? devname : "<unknown>");
-
-		/* FIXME: destroy the device when the client disconnects. */
+		dprintf(0, "virtual device connected (name: %s, id: %x)",
+		    rc == EOK ? devname : "<unknown>", dev->id);
 
 		return;
@@ -110,4 +108,22 @@
 }
 
+/** Callback for DDF when client disconnects.
+ *
+ * @param d Device the client was connected to.
+ */
+void on_client_close(device_t *d)
+{
+	/*
+	 * Maybe a virtual device is being unplugged.
+	 */
+	virtdev_connection_t *dev = virtdev_find((sysarg_t)fibril_get_id());
+	if (dev == NULL) {
+		return;
+	}
+
+	dprintf(0, "virtual device disconnected (id: %x)", dev->id);
+	virtdev_destroy_device(dev);
+}
+
 
 /**
Index: uspace/drv/vhc/devices.c
===================================================================
--- uspace/drv/vhc/devices.c	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/drv/vhc/devices.c	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -58,14 +58,19 @@
 /** Create virtual device.
  *
- * @param address USB address.
  * @param phone Callback phone.
+ * @param id Device id.
  * @return New device.
- * @retval NULL Out of memory or address already occupied.
- */
-virtdev_connection_t *virtdev_add_device(int phone)
+ * @retval NULL Out of memory.
+ */
+virtdev_connection_t *virtdev_add_device(int phone, sysarg_t id)
 {
 	virtdev_connection_t *dev = (virtdev_connection_t *)
 	    malloc(sizeof(virtdev_connection_t));
+	if (dev == NULL) {
+		return NULL;
+	}
+
 	dev->phone = phone;
+	dev->id = id;
 	list_append(&dev->link, &devices);
 	
@@ -73,4 +78,24 @@
 	
 	return dev;
+}
+
+/** Find virtual device by id.
+ *
+ * @param id Device id.
+ * @return Device with given id.
+ * @retval NULL No such device.
+ */
+virtdev_connection_t *virtdev_find(sysarg_t id)
+{
+	link_t *pos;
+	list_foreach(pos, &devices) {
+		virtdev_connection_t *dev
+		    = list_get_instance(pos, virtdev_connection_t, link);
+		if (dev->id == id) {
+			return dev;
+		}
+	}
+
+	return NULL;
 }
 
@@ -90,4 +115,18 @@
 usb_transaction_outcome_t virtdev_send_to_all(transaction_t *transaction)
 {
+	/* For easier debugging. */
+	switch (transaction->type) {
+		case USBVIRT_TRANSACTION_SETUP:
+		case USBVIRT_TRANSACTION_OUT:
+			transaction->actual_len = transaction->len;
+			break;
+		case USBVIRT_TRANSACTION_IN:
+			transaction->actual_len = 0;
+			break;
+		default:
+			assert(false && "unreachable branch in switch()");
+	}
+	usb_transaction_outcome_t outcome = USB_OUTCOME_BABBLE;
+
 	link_t *pos;
 	list_foreach(pos, &devices) {
@@ -140,4 +179,12 @@
 			transaction->actual_len = IPC_GET_ARG1(answer_data);
 			rc = (int)answer_rc;
+		}
+
+		/*
+		 * If at least one device was able to accept this
+		 * transaction and process it, we can announce success.
+		 */
+		if (rc == EOK) {
+			outcome = USB_OUTCOME_OK;
 		}
 	}
@@ -165,7 +212,5 @@
 				    transaction->buffer, transaction->len,
 				    &tmp);
-				if (tmp < transaction->len) {
-					transaction->len = tmp;
-				}
+				transaction->actual_len = tmp;
 				break;
 				
@@ -178,4 +223,5 @@
 		}
 		dprintf(4, "transaction on hub processed...");
+		outcome = USB_OUTCOME_OK;
 	}
 	
@@ -184,5 +230,5 @@
 	 * real-life image.
 	 */
-	return USB_OUTCOME_OK;
+	return outcome;
 }
 
Index: uspace/drv/vhc/devices.h
===================================================================
--- uspace/drv/vhc/devices.h	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/drv/vhc/devices.h	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -45,10 +45,12 @@
 	/** Phone used when sending data to device. */
 	int phone;
+	/** Unique identification. */
+	sysarg_t id;
 	/** Linked-list handle. */
 	link_t link;
 } virtdev_connection_t;
 
-virtdev_connection_t *virtdev_add_device(int);
-virtdev_connection_t *virtdev_get_mine(void);
+virtdev_connection_t *virtdev_add_device(int, sysarg_t);
+virtdev_connection_t *virtdev_find(sysarg_t);
 void virtdev_destroy_device(virtdev_connection_t *);
 usb_transaction_outcome_t virtdev_send_to_all(transaction_t *);
Index: uspace/drv/vhc/hcd.c
===================================================================
--- uspace/drv/vhc/hcd.c	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/drv/vhc/hcd.c	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -69,4 +69,5 @@
 	.interfaces[USBHC_DEV_IFACE] = &vhc_iface,
 	.interfaces[USB_DEV_IFACE] = &hc_usb_iface,
+	.close = on_client_close,
 	.default_handler = default_connection_handler
 };
Index: uspace/drv/vhc/hub/hub.c
===================================================================
--- uspace/drv/vhc/hub/hub.c	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/drv/vhc/hub/hub.c	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -155,4 +155,26 @@
 }
 
+/** Disconnects a device from a hub.
+ *
+ * @param hub Hub the device was connected to.
+ * @param device Device to be disconnected.
+ * @return Error code.
+ */
+int hub_disconnect_device(hub_t *hub, void *device)
+{
+	size_t index = hub_find_device(hub, device);
+	if (index == (size_t) -1) {
+		return ENOENT;
+	}
+
+	hub_port_t *port = &hub->ports[index];
+
+	port->connected_device = NULL;
+	port->state = HUB_PORT_STATE_DISCONNECTED;
+	set_port_status_change(port, HUB_STATUS_C_PORT_CONNECTION);
+
+	return EOK;
+}
+
 /** Find port device is connected to.
  *
@@ -173,5 +195,5 @@
 	}
 
-	return 0;
+	return -1;
 }
 
Index: uspace/drv/vhc/hub/hub.h
===================================================================
--- uspace/drv/vhc/hub/hub.h	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/drv/vhc/hub/hub.h	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -94,4 +94,5 @@
 void hub_init(hub_t *);
 size_t hub_connect_device(hub_t *, void *);
+int hub_disconnect_device(hub_t *, void *);
 size_t hub_find_device(hub_t *, void *);
 void hub_acquire(hub_t *);
Index: uspace/drv/vhc/hub/virthub.c
===================================================================
--- uspace/drv/vhc/hub/virthub.c	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/drv/vhc/hub/virthub.c	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -203,5 +203,5 @@
 
 	hub_acquire(hub);
-	/* TODO: implement. */
+	hub_disconnect_device(hub, conn);
 	hub_release(hub);
 
Index: uspace/lib/drv/generic/remote_usbhc.c
===================================================================
--- uspace/lib/drv/generic/remote_usbhc.c	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/lib/drv/generic/remote_usbhc.c	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -243,5 +243,5 @@
 
 	// FIXME - answer according to outcome
-	ipc_answer_0(trans->caller, EOK);
+	ipc_answer_0(trans->caller, outcome);
 
 	free(trans);
@@ -254,5 +254,5 @@
 
 	// FIXME - answer according to outcome
-	ipc_answer_1(trans->caller, EOK, (sysarg_t)trans);
+	ipc_answer_1(trans->caller, outcome, (sysarg_t)trans);
 
 	trans->size = actual_size;
Index: uspace/lib/drv/include/usb_iface.h
===================================================================
--- uspace/lib/drv/include/usb_iface.h	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/lib/drv/include/usb_iface.h	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -27,5 +27,6 @@
  */
 
-/** @addtogroup libdrv usb
+/** @addtogroup libdrv
+ * @addtogroup usb
  * @{
  */
Index: uspace/lib/drv/include/usbhc_iface.h
===================================================================
--- uspace/lib/drv/include/usbhc_iface.h	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/lib/drv/include/usbhc_iface.h	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -27,5 +27,6 @@
  */
 
-/** @addtogroup libdrv usb
+/** @addtogroup libdrv
+ * @addtogroup usb
  * @{
  */
Index: uspace/lib/usb/include/usb/classes/classes.h
===================================================================
--- uspace/lib/usb/include/usb/classes/classes.h	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/lib/usb/include/usb/classes/classes.h	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libusb usb
+/** @addtogroup libusb
  * @{
  */
Index: uspace/lib/usb/include/usb/classes/hid.h
===================================================================
--- uspace/lib/usb/include/usb/classes/hid.h	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/lib/usb/include/usb/classes/hid.h	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libusb usb
+/** @addtogroup libusb
  * @{
  */
Index: uspace/lib/usb/include/usb/classes/hidparser.h
===================================================================
--- uspace/lib/usb/include/usb/classes/hidparser.h	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/lib/usb/include/usb/classes/hidparser.h	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libusb usb
+/** @addtogroup libusb
  * @{
  */
Index: uspace/lib/usb/include/usb/classes/hidut.h
===================================================================
--- uspace/lib/usb/include/usb/classes/hidut.h	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/lib/usb/include/usb/classes/hidut.h	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libusb usb
+/** @addtogroup libusb
  * @{
  */
Index: uspace/lib/usb/include/usb/classes/hidutkbd.h
===================================================================
--- uspace/lib/usb/include/usb/classes/hidutkbd.h	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/lib/usb/include/usb/classes/hidutkbd.h	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libusb usb
+/** @addtogroup libusb
  * @{
  */
Index: uspace/lib/usb/include/usb/classes/hub.h
===================================================================
--- uspace/lib/usb/include/usb/classes/hub.h	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/lib/usb/include/usb/classes/hub.h	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libusb usb
+/** @addtogroup libusb
  * @{
  */
@@ -68,5 +68,5 @@
  *	For more information see Universal Serial Bus Specification Revision 1.1 chapter 11.16.2
  */
-typedef struct hub_descriptor_type{
+typedef struct usb_hub_descriptor_type {
     /** Number of bytes in this descriptor, including this byte */
     //uint8_t bDescLength;
Index: uspace/lib/usb/include/usb/debug.h
===================================================================
--- uspace/lib/usb/include/usb/debug.h	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/lib/usb/include/usb/debug.h	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libusb usb
+/** @addtogroup libusb
  * @{
  */
@@ -45,2 +45,6 @@
 
 #endif
+/**
+ * @}
+ */
+
Index: uspace/lib/usb/include/usb/descriptor.h
===================================================================
--- uspace/lib/usb/include/usb/descriptor.h	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/lib/usb/include/usb/descriptor.h	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libusb usb
+/** @addtogroup libusb
  * @{
  */
Index: uspace/lib/usb/include/usb/devreq.h
===================================================================
--- uspace/lib/usb/include/usb/devreq.h	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/lib/usb/include/usb/devreq.h	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libusb usb
+/** @addtogroup libusb
  * @{
  */
Index: uspace/lib/usb/include/usb/hcd.h
===================================================================
--- uspace/lib/usb/include/usb/hcd.h	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/lib/usb/include/usb/hcd.h	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libusb usb
+/** @addtogroup libusb
  * @{
  */
@@ -81,4 +81,6 @@
     devman_handle_t);
 
-
 #endif
+/**
+ * @}
+ */
Index: uspace/lib/usb/include/usb/hcdhubd.h
===================================================================
--- uspace/lib/usb/include/usb/hcdhubd.h	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/lib/usb/include/usb/hcdhubd.h	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libusb usb
+/** @addtogroup libusb
  * @{
  */
Index: uspace/lib/usb/include/usb/usb.h
===================================================================
--- uspace/lib/usb/include/usb/usb.h	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/lib/usb/include/usb/usb.h	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libusb usb
+/** @addtogroup libusb
  * @{
  */
Index: uspace/lib/usb/include/usb/usbdrv.h
===================================================================
--- uspace/lib/usb/include/usb/usbdrv.h	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/lib/usb/include/usb/usbdrv.h	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libusb usb
+/** @addtogroup libusb
  * @{
  */
Index: uspace/lib/usb/src/addrkeep.c
===================================================================
--- uspace/lib/usb/src/addrkeep.c	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/lib/usb/src/addrkeep.c	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libusb usb
+/** @addtogroup libusb
  * @{
  */
Index: uspace/lib/usb/src/class.c
===================================================================
--- uspace/lib/usb/src/class.c	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/lib/usb/src/class.c	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libusb usb
+/** @addtogroup libusb
  * @{
  */
Index: uspace/lib/usb/src/debug.c
===================================================================
--- uspace/lib/usb/src/debug.c	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/lib/usb/src/debug.c	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libusb usb
+/** @addtogroup libusb
  * @{
  */
Index: uspace/lib/usb/src/dp.c
===================================================================
--- uspace/lib/usb/src/dp.c	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/lib/usb/src/dp.c	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -45,5 +45,5 @@
  * @param data Parser data.
  * @param ptr Pointer to be verified.
- * @return Whether @ptr points inside <code>data->data</code> field.
+ * @return Whether @p ptr points inside <code>data->data</code> field.
  */
 static bool is_valid_descriptor_pointer(usb_dp_parser_data_t *data,
Index: uspace/lib/usb/src/drvpsync.c
===================================================================
--- uspace/lib/usb/src/drvpsync.c	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/lib/usb/src/drvpsync.c	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libusb usb
+/** @addtogroup libusb
  * @{
  */
Index: uspace/lib/usb/src/hcdhubd.c
===================================================================
--- uspace/lib/usb/src/hcdhubd.c	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/lib/usb/src/hcdhubd.c	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libusb usb
+/** @addtogroup libusb
  * @{
  */
Index: uspace/lib/usb/src/hcdhubd_private.h
===================================================================
--- uspace/lib/usb/src/hcdhubd_private.h	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/lib/usb/src/hcdhubd_private.h	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libusb usb
+/** @addtogroup libusb
  * @{
  */
Index: uspace/lib/usb/src/hcdrv.c
===================================================================
--- uspace/lib/usb/src/hcdrv.c	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/lib/usb/src/hcdrv.c	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libusb usb
+/** @addtogroup libusb
  * @{
  */
Index: uspace/lib/usb/src/hidparser.c
===================================================================
--- uspace/lib/usb/src/hidparser.c	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/lib/usb/src/hidparser.c	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libusb usb
+/** @addtogroup libusb
  * @{
  */
Index: uspace/lib/usb/src/localdrv.c
===================================================================
--- uspace/lib/usb/src/localdrv.c	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/lib/usb/src/localdrv.c	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libusb usb
+/** @addtogroup libusb
  * @{
  */
Index: uspace/lib/usb/src/recognise.c
===================================================================
--- uspace/lib/usb/src/recognise.c	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/lib/usb/src/recognise.c	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libusb usb
+/** @addtogroup libusb
  * @{
  */
@@ -39,4 +39,10 @@
 #include <errno.h>
 
+/** Callback for getting host controller handle.
+ *
+ * @param dev Device in question.
+ * @param[out] handle Devman handle of the host controller.
+ * @return Error code.
+ */
 static int usb_iface_get_hc_handle(device_t *dev, devman_handle_t *handle)
 {
@@ -237,4 +243,5 @@
  * @param matches Match ids list to add matches to.
  * @param address USB address of the attached device.
+ * @param config_count Number of configurations the device has.
  * @return Error code.
  */
@@ -342,7 +349,8 @@
 /** Probe for device kind and register it in devman.
  *
- * @param hc Open phone to the host controller.
- * @param parent Parent device.
- * @param address Address of the (unknown) attached device.
+ * @param[in] hc Open phone to the host controller.
+ * @param[in] parent Parent device.
+ * @param[in] address Address of the (unknown) attached device.
+ * @param[out] child_handle Handle of the child device.
  * @return Error code.
  */
Index: uspace/lib/usb/src/remotedrv.c
===================================================================
--- uspace/lib/usb/src/remotedrv.c	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/lib/usb/src/remotedrv.c	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libusb usb
+/** @addtogroup libusb
  * @{
  */
Index: uspace/lib/usb/src/usb.c
===================================================================
--- uspace/lib/usb/src/usb.c	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/lib/usb/src/usb.c	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libusb usb
+/** @addtogroup libusb
  * @{
  */
Index: uspace/lib/usb/src/usbdrv.c
===================================================================
--- uspace/lib/usb/src/usbdrv.c	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/lib/usb/src/usbdrv.c	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libusb usb
+/** @addtogroup libusb
  * @{
  */
Index: uspace/lib/usb/src/usbdrvreq.c
===================================================================
--- uspace/lib/usb/src/usbdrvreq.c	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/lib/usb/src/usbdrvreq.c	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -27,5 +27,5 @@
  */
 
-/** @addtogroup libusb usb
+/** @addtogroup libusb
  * @{
  */
@@ -188,5 +188,5 @@
  * @param[in] phone Open phone to HC driver.
  * @param[in] old_address Current address.
- * @param[in] address Address to be set.
+ * @param[in] new_address Address to be set.
  * @return Error code.
  */
Index: uspace/lib/usbvirt/src/main.c
===================================================================
--- uspace/lib/usbvirt/src/main.c	(revision a088d15824d475d07739d0fdadc0cf26612c8268)
+++ uspace/lib/usbvirt/src/main.c	(revision e0ba26baffd607ec49b265ed69bf2ca065e113c0)
@@ -183,5 +183,5 @@
 /** Create necessary phones for communication with virtual HCD.
  * This function wraps following calls:
- * -# open <code>/dev/devices/\\virt\\usbhc for reading
+ * -# open <code>/dev/devices/\\virt\\usbhc</code> for reading
  * -# access phone of file opened in previous step
  * -# create callback through just opened phone
