Index: uspace/drv/bus/usb/ohci/ohci_batch.c
===================================================================
--- uspace/drv/bus/usb/ohci/ohci_batch.c	(revision 9a790ad19636b20469894d9c50e2f4fb707373d7)
+++ uspace/drv/bus/usb/ohci/ohci_batch.c	(revision 7bce1fc3e846c46d5a050f12e56dd9383ae5addc)
@@ -42,33 +42,5 @@
 #include "utils/malloc32.h"
 
-static void control_write(ohci_transfer_batch_t *instance);
-static void control_read(ohci_transfer_batch_t *instance);
-
-static void interrupt_in(ohci_transfer_batch_t *instance);
-static void interrupt_out(ohci_transfer_batch_t *instance);
-
-static void bulk_in(ohci_transfer_batch_t *instance);
-static void bulk_out(ohci_transfer_batch_t *instance);
-
-static void setup_control(ohci_transfer_batch_t *ohci_batch)
-{
-        // TODO Find a better way to do this
-        if (ohci_batch->device_buffer[0] & (1 << 7))
-                control_read(ohci_batch);
-        else
-                control_write(ohci_batch);
-}
-/*----------------------------------------------------------------------------*/
-static void batch_control(ohci_transfer_batch_t *instance,
-    usb_direction_t data_dir, usb_direction_t status_dir);
-static void batch_data(ohci_transfer_batch_t *instance);
-/*----------------------------------------------------------------------------*/
-void (*batch_setup[4][3])(ohci_transfer_batch_t*) =
-{
-        { NULL, NULL, setup_control },
-        { NULL, NULL, NULL },
-        { bulk_in, bulk_out, NULL },
-        { interrupt_in, interrupt_out, NULL },
-};
+void (*const batch_setup[4][3])(ohci_transfer_batch_t*);
 /*----------------------------------------------------------------------------*/
 /** Safely destructs ohci_transfer_batch_t structure
@@ -117,5 +89,5 @@
 	CHECK_NULL_DISPOSE_RET(ohci_batch,
 	    "Failed to allocate OHCI batch data.\n");
-
+	link_initialize(&ohci_batch->link);
 	ohci_batch->td_count =
 	    (usb_batch->buffer_size + OHCI_TD_MAX_TRANSFER - 1)
@@ -249,84 +221,4 @@
 }
 /*----------------------------------------------------------------------------*/
-/** Prepares control write transfer.
- *
- * @param[in] instance Batch structure to use.
- *
- * Uses generic control transfer using direction OUT(data stage) and
- * IN(status stage).
- */
-void control_write(ohci_transfer_batch_t *ohci_batch)
-{
-	assert(ohci_batch);
-	batch_control(ohci_batch, USB_DIRECTION_OUT, USB_DIRECTION_IN);
-	usb_log_debug("Batch %p CONTROL WRITE initialized.\n", ohci_batch);
-}
-/*----------------------------------------------------------------------------*/
-/** Prepares control read transfer.
- *
- * @param[in] instance Batch structure to use.
- *
- * Uses generic control transfer using direction IN(data stage) and
- * OUT(status stage).
- */
-void control_read(ohci_transfer_batch_t *ohci_batch)
-{
-	assert(ohci_batch);
-	batch_control(ohci_batch, USB_DIRECTION_IN, USB_DIRECTION_OUT);
-	usb_log_debug("Batch %p CONTROL READ initialized.\n", ohci_batch);
-}
-/*----------------------------------------------------------------------------*/
-/** Prepare interrupt in transfer.
- *
- * @param[in] instance Batch structure to use.
- *
- * Data transfer.
- */
-void interrupt_in(ohci_transfer_batch_t *ohci_batch)
-{
-	assert(ohci_batch);
-	batch_data(ohci_batch);
-	usb_log_debug("Batch %p INTERRUPT IN initialized.\n", ohci_batch);
-}
-/*----------------------------------------------------------------------------*/
-/** Prepare interrupt out transfer.
- *
- * @param[in] instance Batch structure to use.
- *
- * Data transfer.
- */
-void interrupt_out(ohci_transfer_batch_t *ohci_batch)
-{
-	assert(ohci_batch);
-	batch_data(ohci_batch);
-	usb_log_debug("Batch %p INTERRUPT OUT initialized.\n", ohci_batch);
-}
-/*----------------------------------------------------------------------------*/
-/** Prepare bulk in transfer.
- *
- * @param[in] instance Batch structure to use.
- *
- * Data transfer.
- */
-void bulk_in(ohci_transfer_batch_t *ohci_batch)
-{
-	assert(ohci_batch);
-	batch_data(ohci_batch);
-	usb_log_debug("Batch %p BULK IN initialized.\n", ohci_batch);
-}
-/*----------------------------------------------------------------------------*/
-/** Prepare bulk out transfer.
- *
- * @param[in] instance Batch structure to use.
- *
- * Data transfer.
- */
-void bulk_out(ohci_transfer_batch_t *ohci_batch)
-{
-	assert(ohci_batch);
-	batch_data(ohci_batch);
-	usb_log_debug("Batch %p BULK OUT initialized.\n", ohci_batch);
-}
-/*----------------------------------------------------------------------------*/
 /** Prepare generic control transfer
  *
@@ -339,5 +231,5 @@
  * Status stage with toggle 1 and direction supplied by parameter.
  */
-void batch_control(ohci_transfer_batch_t *ohci_batch,
+static void batch_control(ohci_transfer_batch_t *ohci_batch,
     usb_direction_t data_dir, usb_direction_t status_dir)
 {
@@ -397,4 +289,8 @@
 }
 /*----------------------------------------------------------------------------*/
+#define LOG_BATCH_INITIALIZED(batch, name, dir) \
+	usb_log_debug2("Batch %p %s %s " USB_TRANSFER_BATCH_FMT " initialized.\n", \
+	    (batch), (name), (dir), USB_TRANSFER_BATCH_ARGS(*(batch)))
+
 /** Prepare generic data transfer
  *
@@ -404,5 +300,5 @@
  * OHCI hw in ED.
  */
-void batch_data(ohci_transfer_batch_t *ohci_batch)
+static void batch_data(ohci_transfer_batch_t *ohci_batch)
 {
 	assert(ohci_batch);
@@ -434,5 +330,28 @@
 		++td_current;
 	}
-}
+	LOG_BATCH_INITIALIZED(ohci_batch->usb_batch,
+	    usb_str_transfer_type(ohci_batch->usb_batch->ep->transfer_type),
+	    usb_str_direction(ohci_batch->usb_batch->ep->direction));
+}
+/*----------------------------------------------------------------------------*/
+static void setup_control(ohci_transfer_batch_t *ohci_batch)
+{
+        // TODO Find a better way to do this
+        if (ohci_batch->device_buffer[0] & (1 << 7)) {
+		batch_control(ohci_batch, USB_DIRECTION_IN, USB_DIRECTION_OUT);
+		LOG_BATCH_INITIALIZED(ohci_batch->usb_batch, "control", "write");
+        } else {
+		batch_control(ohci_batch, USB_DIRECTION_OUT, USB_DIRECTION_IN);
+		LOG_BATCH_INITIALIZED(ohci_batch->usb_batch, "control", "write");
+	}
+}
+/*----------------------------------------------------------------------------*/
+void (*const batch_setup[4][3])(ohci_transfer_batch_t*) =
+{
+        { NULL, NULL, setup_control },
+        { NULL, NULL, NULL },
+        { batch_data, batch_data, NULL },
+        { batch_data, batch_data, NULL },
+};
 /**
  * @}
