Changeset 76daaf9f in mainline for uspace/drv/vhc/hc.c


Ignore:
Timestamp:
2010-12-13T14:33:23Z (14 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d5e7668
Parents:
7feeb84
Message:

Virtual HC remembers transfer type as well

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/drv/vhc/hc.c

    r7feeb84 r76daaf9f  
    6868static link_t transaction_list;
    6969
    70 #define TRANSACTION_FORMAT "T[%d:%d %s (%d)]"
     70#define TRANSACTION_FORMAT "T[%d.%d %s/%s (%d)]"
    7171#define TRANSACTION_PRINTF(t) \
    7272        (t).target.address, (t).target.endpoint, \
     73        usb_str_transfer_type((t).transfer_type), \
    7374        usbvirt_str_transaction_type((t).type), \
    7475        (int)(t).len
     
    143144 */
    144145static transaction_t *transaction_create(usbvirt_transaction_type_t type,
    145     usb_target_t target,
     146    usb_target_t target, usb_transfer_type_t transfer_type,
    146147    void * buffer, size_t len,
    147148    hc_transaction_done_callback_t callback, void * arg)
     
    151152        list_initialize(&transaction->link);
    152153        transaction->type = type;
     154        transaction->transfer_type = transfer_type;
    153155        transaction->target = target;
    154156        transaction->buffer = buffer;
     
    166168 */
    167169void hc_add_transaction_to_device(bool setup, usb_target_t target,
     170    usb_transfer_type_t transfer_type,
    168171    void * buffer, size_t len,
    169172    hc_transaction_done_callback_t callback, void * arg)
    170173{
    171174        transaction_t *transaction = transaction_create(
    172             setup ? USBVIRT_TRANSACTION_SETUP : USBVIRT_TRANSACTION_OUT, target,
     175            setup ? USBVIRT_TRANSACTION_SETUP : USBVIRT_TRANSACTION_OUT,
     176            target, transfer_type,
    173177            buffer, len, callback, arg);
    174178        list_append(&transaction->link, &transaction_list);
     
    178182 */
    179183void hc_add_transaction_from_device(usb_target_t target,
     184    usb_transfer_type_t transfer_type,
    180185    void * buffer, size_t len,
    181186    hc_transaction_done_callback_t callback, void * arg)
    182187{
    183188        transaction_t *transaction = transaction_create(USBVIRT_TRANSACTION_IN,
    184             target, buffer, len, callback, arg);
     189            target, transfer_type,
     190            buffer, len, callback, arg);
    185191        list_append(&transaction->link, &transaction_list);
    186192}
Note: See TracChangeset for help on using the changeset viewer.