Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/uhci-hcd/batch.c

    rc15070c r1387692  
    5050        td_t *tds;
    5151        size_t packets;
    52         device_keeper_t *manager;
     52        usb_device_keeper_t *manager;
    5353} uhci_batch_t;
    5454
    55 static void batch_control(batch_t *instance,
     55static void batch_control(usb_transfer_batch_t *instance,
    5656    usb_packet_id data_stage, usb_packet_id status_stage);
    57 static void batch_data(batch_t *instance, usb_packet_id pid);
    58 static void batch_call_in_and_dispose(batch_t *instance);
    59 static void batch_call_out_and_dispose(batch_t *instance);
     57static void batch_data(usb_transfer_batch_t *instance, usb_packet_id pid);
     58static void batch_call_in_and_dispose(usb_transfer_batch_t *instance);
     59static void batch_call_out_and_dispose(usb_transfer_batch_t *instance);
    6060
    6161
     
    8282 * transaction and callback.
    8383 */
    84 batch_t * batch_get(ddf_fun_t *fun, usb_target_t target,
     84usb_transfer_batch_t * batch_get(ddf_fun_t *fun, usb_target_t target,
    8585    usb_transfer_type_t transfer_type, size_t max_packet_size,
    8686    usb_speed_t speed, char *buffer, size_t buffer_size,
     
    8888    usbhc_iface_transfer_in_callback_t func_in,
    8989    usbhc_iface_transfer_out_callback_t func_out, void *arg,
    90     device_keeper_t *manager
     90    usb_device_keeper_t *manager
    9191    )
    9292{
     
    103103        } else (void)0
    104104
    105         batch_t *instance = malloc(sizeof(batch_t));
     105        usb_transfer_batch_t *instance = malloc(sizeof(usb_transfer_batch_t));
    106106        CHECK_NULL_DISPOSE_RETURN(instance,
    107107            "Failed to allocate batch instance.\n");
    108         batch_init(instance, target, transfer_type, speed, max_packet_size,
     108        usb_transfer_batch_init(instance, target, transfer_type, speed, max_packet_size,
    109109            buffer, NULL, buffer_size, NULL, setup_size, func_in,
    110110            func_out, arg, fun, NULL);
     
    161161 * is reached.
    162162 */
    163 bool batch_is_complete(batch_t *instance)
     163bool batch_is_complete(usb_transfer_batch_t *instance)
    164164{
    165165        assert(instance);
     
    182182                        td_print_status(&data->tds[i]);
    183183
    184                         device_keeper_set_toggle(data->manager,
     184                        usb_device_keeper_set_toggle(data->manager,
    185185                            instance->target, instance->direction,
    186186                            td_toggle(&data->tds[i]));
     
    205205 * Uses genercir control function with pids OUT and IN.
    206206 */
    207 void batch_control_write(batch_t *instance)
     207void batch_control_write(usb_transfer_batch_t *instance)
    208208{
    209209        assert(instance);
     
    222222 * Uses generic control with pids IN and OUT.
    223223 */
    224 void batch_control_read(batch_t *instance)
     224void batch_control_read(usb_transfer_batch_t *instance)
    225225{
    226226        assert(instance);
     
    236236 * Data transaction with PID_IN.
    237237 */
    238 void batch_interrupt_in(batch_t *instance)
     238void batch_interrupt_in(usb_transfer_batch_t *instance)
    239239{
    240240        assert(instance);
     
    251251 * Data transaction with PID_OUT.
    252252 */
    253 void batch_interrupt_out(batch_t *instance)
     253void batch_interrupt_out(usb_transfer_batch_t *instance)
    254254{
    255255        assert(instance);
     
    269269 * Data transaction with PID_IN.
    270270 */
    271 void batch_bulk_in(batch_t *instance)
     271void batch_bulk_in(usb_transfer_batch_t *instance)
    272272{
    273273        assert(instance);
     
    284284 * Data transaction with PID_OUT.
    285285 */
    286 void batch_bulk_out(batch_t *instance)
     286void batch_bulk_out(usb_transfer_batch_t *instance)
    287287{
    288288        assert(instance);
     
    304304 * The last packet is marked with IOC flag.
    305305 */
    306 void batch_data(batch_t *instance, usb_packet_id pid)
     306void batch_data(usb_transfer_batch_t *instance, usb_packet_id pid)
    307307{
    308308        assert(instance);
     
    311311
    312312        const bool low_speed = instance->speed == USB_SPEED_LOW;
    313         int toggle = device_keeper_get_toggle(
     313        int toggle = usb_device_keeper_get_toggle(
    314314            data->manager, instance->target, instance->direction);
    315315        assert(toggle == 0 || toggle == 1);
     
    343343        }
    344344        td_set_ioc(&data->tds[packet - 1]);
    345         device_keeper_set_toggle(data->manager, instance->target,
     345        usb_device_keeper_set_toggle(data->manager, instance->target,
    346346            instance->direction, toggle);
    347347}
     
    358358 * The last packet is marked with IOC.
    359359 */
    360 void batch_control(batch_t *instance,
     360void batch_control(usb_transfer_batch_t *instance,
    361361   usb_packet_id data_stage, usb_packet_id status_stage)
    362362{
     
    411411}
    412412/*----------------------------------------------------------------------------*/
    413 qh_t * batch_qh(batch_t *instance)
     413qh_t * batch_qh(usb_transfer_batch_t *instance)
    414414{
    415415        assert(instance);
     
    423423 * @param[in] instance Batch structure to use.
    424424 */
    425 void batch_call_in_and_dispose(batch_t *instance)
    426 {
    427         assert(instance);
    428         batch_call_in(instance);
     425void batch_call_in_and_dispose(usb_transfer_batch_t *instance)
     426{
     427        assert(instance);
     428        usb_transfer_batch_call_in(instance);
    429429        batch_dispose(instance);
    430430}
     
    434434 * @param[in] instance Batch structure to use.
    435435 */
    436 void batch_call_out_and_dispose(batch_t *instance)
    437 {
    438         assert(instance);
    439         batch_call_out(instance);
     436void batch_call_out_and_dispose(usb_transfer_batch_t *instance)
     437{
     438        assert(instance);
     439        usb_transfer_batch_call_out(instance);
    440440        batch_dispose(instance);
    441441}
     
    445445 * @param[in] instance Batch structure to use.
    446446 */
    447 void batch_dispose(batch_t *instance)
     447void batch_dispose(usb_transfer_batch_t *instance)
    448448{
    449449        assert(instance);
Note: See TracChangeset for help on using the changeset viewer.