Changeset 960bee9 in mainline for uspace/drv/uhci-hcd/iface.c


Ignore:
Timestamp:
2011-03-07T16:51:59Z (14 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
97ff14d
Parents:
a6add7a (diff), d4beec3 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge development/ changes

File:
1 edited

Legend:

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

    ra6add7a r960bee9  
    114114
    115115        batch_t *batch = batch_get(fun, target, USB_TRANSFER_INTERRUPT,
    116             max_packet_size, speed, data, size, NULL, 0, NULL, callback, arg);
     116            max_packet_size, speed, data, size, NULL, 0, NULL, callback, arg,
     117            &hc->device_manager);
    117118        if (!batch)
    118119                return ENOMEM;
     
    133134
    134135        batch_t *batch = batch_get(fun, target, USB_TRANSFER_INTERRUPT,
    135             max_packet_size, speed, data, size, NULL, 0, callback, NULL, arg);
     136            max_packet_size, speed, data, size, NULL, 0, callback, NULL, arg,
     137                        &hc->device_manager);
    136138        if (!batch)
    137139                return ENOMEM;
    138140        batch_interrupt_in(batch);
     141        return EOK;
     142}
     143/*----------------------------------------------------------------------------*/
     144static int bulk_out(ddf_fun_t *fun, usb_target_t target,
     145    size_t max_packet_size, void *data, size_t size,
     146    usbhc_iface_transfer_out_callback_t callback, void *arg)
     147{
     148        assert(fun);
     149        uhci_t *hc = fun_to_uhci(fun);
     150        assert(hc);
     151        usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address);
     152
     153        usb_log_debug("Bulk OUT %d:%d %zu(%zu).\n",
     154            target.address, target.endpoint, size, max_packet_size);
     155
     156        batch_t *batch = batch_get(fun, target, USB_TRANSFER_BULK,
     157            max_packet_size, speed, data, size, NULL, 0, NULL, callback, arg,
     158            &hc->device_manager);
     159        if (!batch)
     160                return ENOMEM;
     161        batch_bulk_out(batch);
     162        return EOK;
     163}
     164/*----------------------------------------------------------------------------*/
     165static int bulk_in(ddf_fun_t *fun, usb_target_t target,
     166    size_t max_packet_size, void *data, size_t size,
     167    usbhc_iface_transfer_in_callback_t callback, void *arg)
     168{
     169        assert(fun);
     170        uhci_t *hc = fun_to_uhci(fun);
     171        assert(hc);
     172        usb_speed_t speed = device_keeper_speed(&hc->device_manager, target.address);
     173        usb_log_debug("Bulk IN %d:%d %zu(%zu).\n",
     174            target.address, target.endpoint, size, max_packet_size);
     175
     176        batch_t *batch = batch_get(fun, target, USB_TRANSFER_BULK,
     177            max_packet_size, speed, data, size, NULL, 0, callback, NULL, arg,
     178            &hc->device_manager);
     179        if (!batch)
     180                return ENOMEM;
     181        batch_bulk_in(batch);
    139182        return EOK;
    140183}
     
    152195            target.address, target.endpoint, size, max_packet_size);
    153196
     197        if (setup_size != 8)
     198                return EINVAL;
     199
    154200        batch_t *batch = batch_get(fun, target, USB_TRANSFER_CONTROL,
    155201            max_packet_size, speed, data, size, setup_data, setup_size,
    156             NULL, callback, arg);
    157         if (!batch)
    158                 return ENOMEM;
     202            NULL, callback, arg, &hc->device_manager);
     203        if (!batch)
     204                return ENOMEM;
     205        device_keeper_reset_if_need(&hc->device_manager, target, setup_data);
    159206        batch_control_write(batch);
    160207        return EOK;
     
    175222        batch_t *batch = batch_get(fun, target, USB_TRANSFER_CONTROL,
    176223            max_packet_size, speed, data, size, setup_data, setup_size, callback,
    177             NULL, arg);
     224            NULL, arg, &hc->device_manager);
    178225        if (!batch)
    179226                return ENOMEM;
     
    181228        return EOK;
    182229}
    183 
    184 
    185230/*----------------------------------------------------------------------------*/
    186231usbhc_iface_t uhci_iface = {
     
    194239        .interrupt_in = interrupt_in,
    195240
     241        .bulk_in = bulk_in,
     242        .bulk_out = bulk_out,
     243
    196244        .control_read = control_read,
    197245        .control_write = control_write,
Note: See TracChangeset for help on using the changeset viewer.