~jsvoboda/helenos/dnsr

« back to all changes in this revision

Viewing changes to uspace/drv/bus/usb/uhci/uhci_batch.c

  • Committer: Jiri Svoboda
  • Date: 2012-11-11 21:31:03 UTC
  • mfrom: (1527.1.178 mainline)
  • Revision ID: jiri@wiwaxia-20121111213103-314bmkettwvlwj97
MergeĀ mainlineĀ changes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
57
57
                free(uhci_batch);
58
58
        }
59
59
}
60
 
/*----------------------------------------------------------------------------*/
 
60
 
61
61
/** Finishes usb_transfer_batch and destroys the structure.
62
62
 *
63
63
 * @param[in] uhci_batch Instance to finish and destroy.
70
70
            uhci_transfer_batch_data_buffer(uhci_batch));
71
71
        uhci_transfer_batch_dispose(uhci_batch);
72
72
}
73
 
/*----------------------------------------------------------------------------*/
 
73
 
74
74
/** Transfer batch setup table. */
75
75
static void (*const batch_setup[])(uhci_transfer_batch_t*, usb_direction_t);
76
 
/*----------------------------------------------------------------------------*/
 
76
 
77
77
/** Allocate memory and initialize internal data structure.
78
78
 *
79
79
 * @param[in] usb_batch Pointer to generic USB batch structure.
142
142
 
143
143
        return uhci_batch;
144
144
}
145
 
/*----------------------------------------------------------------------------*/
 
145
 
146
146
/** Check batch TDs for activity.
147
147
 *
148
148
 * @param[in] uhci_batch Batch structure to use.
195
195
            -= uhci_batch->usb_batch->setup_size;
196
196
        return true;
197
197
}
198
 
/*----------------------------------------------------------------------------*/
 
198
 
199
199
/** Direction to pid conversion table */
200
200
static const usb_packet_id direction_pids[] = {
201
201
        [USB_DIRECTION_IN] = USB_PID_IN,
202
202
        [USB_DIRECTION_OUT] = USB_PID_OUT,
203
203
};
204
 
/*----------------------------------------------------------------------------*/
 
204
 
205
205
/** Prepare generic data transfer
206
206
 *
207
207
 * @param[in] uhci_batch Batch structure to use.
258
258
            usb_str_direction(uhci_batch->usb_batch->ep->direction),
259
259
            USB_TRANSFER_BATCH_ARGS(*uhci_batch->usb_batch));
260
260
}
261
 
/*----------------------------------------------------------------------------*/
 
261
 
262
262
/** Prepare generic control transfer
263
263
 *
264
264
 * @param[in] uhci_batch Batch structure to use.
330
330
        usb_log_debug2("Control last TD status: %x.\n",
331
331
            uhci_batch->tds[td].status);
332
332
}
333
 
/*----------------------------------------------------------------------------*/
 
333
 
334
334
static void (*const batch_setup[])(uhci_transfer_batch_t*, usb_direction_t) =
335
335
{
336
336
        [USB_TRANSFER_CONTROL] = batch_control,