Ignore:
File:
1 edited

Legend:

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

    r4ca18ae r20a1e76  
    4949        td_t *tds;
    5050        size_t transfers;
     51        usb_device_keeper_t *manager;
    5152} uhci_batch_t;
    5253
     
    7273 * @param[in] func_out function to call on outbound transaction completion
    7374 * @param[in] arg additional parameter to func_in or func_out
    74  * @param[in] ep Pointer to endpoint toggle management structure.
     75 * @param[in] manager Pointer to toggle management structure.
    7576 * @return Valid pointer if all substructures were successfully created,
    7677 * NULL otherwise.
     
    8586    char* setup_buffer, size_t setup_size,
    8687    usbhc_iface_transfer_in_callback_t func_in,
    87     usbhc_iface_transfer_out_callback_t func_out, void *arg, endpoint_t *ep
     88    usbhc_iface_transfer_out_callback_t func_out, void *arg,
     89    usb_device_keeper_t *manager
    8890    )
    8991{
     
    103105        CHECK_NULL_DISPOSE_RETURN(instance,
    104106            "Failed to allocate batch instance.\n");
    105         usb_transfer_batch_init(instance, target,
    106             transfer_type, speed, max_packet_size,
     107        usb_transfer_batch_init(instance, target, transfer_type, speed, max_packet_size,
    107108            buffer, NULL, buffer_size, NULL, setup_size, func_in,
    108             func_out, arg, fun, ep, NULL);
     109            func_out, arg, fun, NULL);
    109110
    110111
     
    113114            "Failed to allocate batch instance.\n");
    114115        bzero(data, sizeof(uhci_batch_t));
     116        data->manager = manager;
    115117        instance->private_data = data;
    116118
     
    178180                            instance, i, data->tds[i].status);
    179181                        td_print_status(&data->tds[i]);
    180                         if (instance->ep != NULL)
    181                                 endpoint_toggle_set(instance->ep,
    182                                     td_toggle(&data->tds[i]));
     182
     183                        usb_device_keeper_set_toggle(data->manager,
     184                            instance->target, instance->direction,
     185                            td_toggle(&data->tds[i]));
    183186                        if (i > 0)
    184187                                goto substract_ret;
     
    307310
    308311        const bool low_speed = instance->speed == USB_SPEED_LOW;
    309         int toggle = endpoint_toggle_get(instance->ep);
     312        int toggle = usb_device_keeper_get_toggle(
     313            data->manager, instance->target, instance->direction);
    310314        assert(toggle == 0 || toggle == 1);
    311315
     
    338342        }
    339343        td_set_ioc(&data->tds[transfer - 1]);
    340         endpoint_toggle_set(instance->ep, toggle);
     344        usb_device_keeper_set_toggle(data->manager, instance->target,
     345            instance->direction, toggle);
    341346}
    342347/*----------------------------------------------------------------------------*/
Note: See TracChangeset for help on using the changeset viewer.