Index: uspace/drv/uhci-hcd/batch.c
===================================================================
--- uspace/drv/uhci-hcd/batch.c	(revision 3bd96bb951ab0413b8e57b2afd8fdb7056374fb0)
+++ uspace/drv/uhci-hcd/batch.c	(revision fcf07e64fc8a299b6672a23b7bf7182c3e22c4cb)
@@ -26,9 +26,9 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
-/** @addtogroup usb
+/** @addtogroup drvusbuhcihc
  * @{
  */
 /** @file
- * @brief UHCI driver
+ * @brief UHCI driver USB transaction structure
  */
 #include <errno.h>
@@ -54,5 +54,5 @@
 
 
-/** Allocates memory and initializes internal data structures.
+/** Allocate memory and initialize internal data structure.
  *
  * @param[in] fun DDF function to pass to callback.
@@ -69,5 +69,10 @@
  * @param[in] arg additional parameter to func_in or func_out
  * @param[in] manager Pointer to toggle management structure.
- * @return False, if there is an active TD, true otherwise.
+ * @return Valid pointer if all substructures were successfully created,
+ * NULL otherwise.
+ *
+ * Determines the number of needed packets (TDs). Prepares a transport buffer
+ * (that is accessible by the hardware). Initializes parameters needed for the
+ * transaction and callback.
  */
 batch_t * batch_get(ddf_fun_t *fun, usb_target_t target,
@@ -148,8 +153,12 @@
 }
 /*----------------------------------------------------------------------------*/
-/** Checks batch TDs for activity.
+/** Check batch TDs for activity.
  *
  * @param[in] instance Batch structure to use.
  * @return False, if there is an active TD, true otherwise.
+ *
+ * Walk all TDs. Stop with false if there is an active one (it is to be
+ * processed). Stop with true if an error is found. Return true if the last TS
+ * is reached.
  */
 bool batch_is_complete(batch_t *instance)
@@ -190,9 +199,11 @@
  *
  * @param[in] instance Batch structure to use.
+ *
+ * Uses genercir control function with pids OUT and IN.
  */
 void batch_control_write(batch_t *instance)
 {
 	assert(instance);
-	/* we are data out, we are supposed to provide data */
+	/* We are data out, we are supposed to provide data */
 	memcpy(instance->transport_buffer, instance->buffer,
 	    instance->buffer_size);
@@ -205,4 +216,6 @@
  *
  * @param[in] instance Batch structure to use.
+ *
+ * Uses generic control with pids IN and OUT.
  */
 void batch_control_read(batch_t *instance)
@@ -214,7 +227,9 @@
 }
 /*----------------------------------------------------------------------------*/
-/** Prepares interrupt in transaction.
- *
- * @param[in] instance Batch structure to use.
+/** Prepare interrupt in transaction.
+ *
+ * @param[in] instance Batch structure to use.
+ *
+ * Data transaction with PID_IN.
  */
 void batch_interrupt_in(batch_t *instance)
@@ -226,12 +241,14 @@
 }
 /*----------------------------------------------------------------------------*/
-/** Prepares interrupt out transaction.
- *
- * @param[in] instance Batch structure to use.
+/** Prepare interrupt out transaction.
+ *
+ * @param[in] instance Batch structure to use.
+ *
+ * Data transaction with PID_OUT.
  */
 void batch_interrupt_out(batch_t *instance)
 {
 	assert(instance);
-	/* we are data out, we are supposed to provide data */
+	/* We are data out, we are supposed to provide data */
 	memcpy(instance->transport_buffer, instance->buffer, instance->buffer_size);
 	batch_data(instance, USB_PID_OUT);
@@ -240,7 +257,9 @@
 }
 /*----------------------------------------------------------------------------*/
-/** Prepares bulk in transaction.
- *
- * @param[in] instance Batch structure to use.
+/** Prepare bulk in transaction.
+ *
+ * @param[in] instance Batch structure to use.
+ *
+ * Data transaction with PID_IN.
  */
 void batch_bulk_in(batch_t *instance)
@@ -252,11 +271,14 @@
 }
 /*----------------------------------------------------------------------------*/
-/** Prepares bulk out transaction.
- *
- * @param[in] instance Batch structure to use.
+/** Prepare bulk out transaction.
+ *
+ * @param[in] instance Batch structure to use.
+ *
+ * Data transaction with PID_OUT.
  */
 void batch_bulk_out(batch_t *instance)
 {
 	assert(instance);
+	/* We are data out, we are supposed to provide data */
 	memcpy(instance->transport_buffer, instance->buffer, instance->buffer_size);
 	batch_data(instance, USB_PID_OUT);
@@ -265,8 +287,11 @@
 }
 /*----------------------------------------------------------------------------*/
-/** Prepares generic data transaction
+/** Prepare generic data transaction
  *
  * @param[in] instance Batch structure to use.
  * @param[in] pid to use for data packets.
+ *
+ * Packets with alternating toggle bit and supplied pid value.
+ * The last packet is marked with IOC flag.
  */
 void batch_data(batch_t *instance, usb_packet_id pid)
@@ -309,9 +334,14 @@
 }
 /*----------------------------------------------------------------------------*/
-/** Prepares generic control transaction
+/** Prepare generic control transaction
  *
  * @param[in] instance Batch structure to use.
  * @param[in] data_stage to use for data packets.
  * @param[in] status_stage to use for data packets.
+ *
+ * Setup stage with toggle 0 and USB_PID_SETUP.
+ * Data stage with alternating toggle and pid supplied by parameter.
+ * Status stage with toggle 1 and pid supplied by parameter.
+ * The last packet is marked with IOC.
  */
 void batch_control(batch_t *instance,
@@ -362,7 +392,9 @@
 }
 /*----------------------------------------------------------------------------*/
-/** Prepares data, gets error status and calls callback in.
- *
- * @param[in] instance Batch structure to use.
+/** Prepare data, get error status and call callback in.
+ *
+ * @param[in] instance Batch structure to use.
+ * Copies data from transport buffer, and calls callback with appropriate
+ * parameters.
  */
 void batch_call_in(batch_t *instance)
@@ -371,5 +403,5 @@
 	assert(instance->callback_in);
 
-	/* we are data in, we need data */
+	/* We are data in, we need data */
 	memcpy(instance->buffer, instance->transport_buffer,
 	    instance->buffer_size);
@@ -384,5 +416,5 @@
 }
 /*----------------------------------------------------------------------------*/
-/** Gets error status and calls callback out.
+/** Get error status and call callback out.
  *
  * @param[in] instance Batch structure to use.
@@ -400,5 +432,5 @@
 }
 /*----------------------------------------------------------------------------*/
-/** Prepares data, gets error status, calls callback in and dispose.
+/** Helper function calls callback and correctly disposes of batch structure.
  *
  * @param[in] instance Batch structure to use.
@@ -411,5 +443,5 @@
 }
 /*----------------------------------------------------------------------------*/
-/** Gets error status, calls callback out and dispose.
+/** Helper function calls callback and correctly disposes of batch structure.
  *
  * @param[in] instance Batch structure to use.
@@ -422,5 +454,5 @@
 }
 /*----------------------------------------------------------------------------*/
-/** Correctly disposes all used data structures.
+/** Correctly dispose all used data structures.
  *
  * @param[in] instance Batch structure to use.
