Index: uspace/lib/usbhost/include/usb/host/endpoint.h
===================================================================
--- uspace/lib/usbhost/include/usb/host/endpoint.h	(revision 549ff23eeccbe3fe8e6eb34fffc58415a5e01252)
+++ uspace/lib/usbhost/include/usb/host/endpoint.h	(revision 9871bca9f00dfd31e49b96d793d88a519edb95fb)
@@ -41,20 +41,37 @@
 #include <usb/usb.h>
 
+/** Host controller side endpoint structure. */
 typedef struct endpoint {
+	/** Part of linked list. */
 	link_t link;
+	/** USB address. */
 	usb_address_t address;
+	/** USB endpoint number. */
 	usb_endpoint_t endpoint;
+	/** Communication direction. */
 	usb_direction_t direction;
+	/** USB transfer type. */
 	usb_transfer_type_t transfer_type;
+	/** Communication speed. */
 	usb_speed_t speed;
+	/** Maximum size of data packets. */
 	size_t max_packet_size;
+	/** Necessary bandwidth. */
 	size_t bandwidth;
+	/** Value of the toggle bit. */
 	unsigned toggle:1;
+	/** True if there is a batch using this scheduled for this endpoint. */
+	volatile bool active;
+	/** Protects resources and active status changes. */
 	fibril_mutex_t guard;
+	/** Signals change of active status. */
 	fibril_condvar_t avail;
-	volatile bool active;
+	/** Optional device specific data. */
 	struct {
+		/** Device specific data. */
 		void *data;
+		/** Callback to get the value of toggle bit. */
 		int (*toggle_get)(void *);
+		/** Callback to set the value of toggle bit. */
 		void (*toggle_set)(void *, int);
 	} hc_data;
@@ -76,4 +93,8 @@
 void endpoint_toggle_set(endpoint_t *instance, int toggle);
 
+/** list_get_instance wrapper.
+ * @param item Pointer to link member.
+ * @return Pointer to enpoint_t structure.
+ */
 static inline endpoint_t * endpoint_get_instance(link_t *item)
 {
Index: uspace/lib/usbhost/src/endpoint.c
===================================================================
--- uspace/lib/usbhost/src/endpoint.c	(revision 549ff23eeccbe3fe8e6eb34fffc58415a5e01252)
+++ uspace/lib/usbhost/src/endpoint.c	(revision 9871bca9f00dfd31e49b96d793d88a519edb95fb)
@@ -26,6 +26,5 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-
-/** @addtogroup drvusbuhcihc
+/** @addtogroup libusbhost
  * @{
  */
@@ -39,4 +38,14 @@
 #include <usb/host/endpoint.h>
 
+/** Allocate ad initialize endpoint_t structure.
+ * @param address USB address.
+ * @param endpoint USB endpoint number.
+ * @param direction Communication direction.
+ * @param type USB transfer type.
+ * @param speed Communication speed.
+ * @param max_packet_size Maximum size of data packets.
+ * @param bw Required bandwidth.
+ * @return Pointer to initialized endpoint_t structure, NULL on failure.
+ */
 endpoint_t * endpoint_create(usb_address_t address, usb_endpoint_t endpoint,
     usb_direction_t direction, usb_transfer_type_t type, usb_speed_t speed,
@@ -60,12 +69,15 @@
 		fibril_mutex_initialize(&instance->guard);
 		fibril_condvar_initialize(&instance->avail);
-		endpoint_clear_hc_data(instance);
 	}
 	return instance;
 }
 /*----------------------------------------------------------------------------*/
+/** Properly dispose of endpoint_t structure.
+ * @param instance endpoint_t structure.
+ */
 void endpoint_destroy(endpoint_t *instance)
 {
 	assert(instance);
+	//TODO: Do something about waiting fibrils.
 	assert(!instance->active);
 	assert(instance->hc_data.data == NULL);
@@ -73,21 +85,38 @@
 }
 /*----------------------------------------------------------------------------*/
+/** Set device specific data and hooks.
+ * @param instance endpoint_t structure.
+ * @param data device specific data.
+ * @param toggle_get Hook to call when retrieving value of toggle bit.
+ * @param toggle_set Hook to call when setting the value of toggle bit.
+ */
 void endpoint_set_hc_data(endpoint_t *instance,
     void *data, int (*toggle_get)(void *), void (*toggle_set)(void *, int))
 {
 	assert(instance);
+	fibril_mutex_lock(&instance->guard);
 	instance->hc_data.data = data;
 	instance->hc_data.toggle_get = toggle_get;
 	instance->hc_data.toggle_set = toggle_set;
+	fibril_mutex_unlock(&instance->guard);
 }
 /*----------------------------------------------------------------------------*/
+/** Clear device specific data and hooks.
+ * @param instance endpoint_t structure.
+ * @note This function does not free memory pointed to by data pointer.
+ */
 void endpoint_clear_hc_data(endpoint_t *instance)
 {
 	assert(instance);
+	fibril_mutex_lock(&instance->guard);
 	instance->hc_data.data = NULL;
 	instance->hc_data.toggle_get = NULL;
 	instance->hc_data.toggle_set = NULL;
+	fibril_mutex_unlock(&instance->guard);
 }
 /*----------------------------------------------------------------------------*/
+/** Mark the endpoint as active and block access for further fibrils.
+ * @param instance endpoint_t structure.
+ */
 void endpoint_use(endpoint_t *instance)
 {
@@ -100,4 +129,7 @@
 }
 /*----------------------------------------------------------------------------*/
+/** Mark the endpoint as inactive and allow access for further fibrils.
+ * @param instance endpoint_t structure.
+ */
 void endpoint_release(endpoint_t *instance)
 {
@@ -109,20 +141,33 @@
 }
 /*----------------------------------------------------------------------------*/
+/** Get the value of toggle bit.
+ * @param instance endpoint_t structure.
+ * @note Will use provided hook.
+ */
 int endpoint_toggle_get(endpoint_t *instance)
 {
 	assert(instance);
+	fibril_mutex_lock(&instance->guard);
 	if (instance->hc_data.toggle_get)
 		instance->toggle =
 		    instance->hc_data.toggle_get(instance->hc_data.data);
-	return (int)instance->toggle;
+	const int ret = instance->toggle;
+	fibril_mutex_unlock(&instance->guard);
+	return ret;
 }
 /*----------------------------------------------------------------------------*/
+/** Set the value of toggle bit.
+ * @param instance endpoint_t structure.
+ * @note Will use provided hook.
+ */
 void endpoint_toggle_set(endpoint_t *instance, int toggle)
 {
 	assert(instance);
 	assert(toggle == 0 || toggle == 1);
+	fibril_mutex_lock(&instance->guard);
+	instance->toggle = toggle;
 	if (instance->hc_data.toggle_set)
 		instance->hc_data.toggle_set(instance->hc_data.data, toggle);
-	instance->toggle = toggle;
+	fibril_mutex_unlock(&instance->guard);
 }
 /**
