Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 76daaf9f in mainline


Ignore:
Timestamp:
2010-12-13T14:33:23Z (11 years ago)
Author:
Vojtech Horky <vojtechhorky@…>
Branches:
lfn, master
Children:
d5e7668
Parents:
7feeb84
Message:

Virtual HC remembers transfer type as well

Location:
uspace/drv/vhc
Files:
3 edited

Legend:

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

    r7feeb84 r76daaf9f  
    102102        transfer->out_callback = callback;
    103103
    104         hc_add_transaction_to_device(false, target, buffer, size,
     104        hc_add_transaction_to_device(false, target, transfer_type, buffer, size,
    105105            universal_callback, transfer);
    106106
     
    122122        transfer->out_callback = callback;
    123123
    124         hc_add_transaction_to_device(true, target, buffer, size,
     124        hc_add_transaction_to_device(true, target, transfer_type, buffer, size,
    125125            universal_callback, transfer);
    126126
     
    142142        transfer->in_callback = callback;
    143143
    144         hc_add_transaction_from_device(target, buffer, size,
     144        hc_add_transaction_from_device(target, transfer_type, buffer, size,
    145145            universal_callback, transfer);
    146146
  • 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}
  • uspace/drv/vhc/hc.h

    r7feeb84 r76daaf9f  
    5555        /** Transaction type. */
    5656        usbvirt_transaction_type_t type;
     57        /** Transfer type. */
     58        usb_transfer_type_t transfer_type;
    5759        /** Device address. */
    5860        usb_target_t target;
     
    7173void hc_manager(void);
    7274
    73 void hc_add_transaction_to_device(bool setup, usb_target_t target,
     75void hc_add_transaction_to_device(bool setup,
     76    usb_target_t target, usb_transfer_type_t transfer_type,
    7477    void * buffer, size_t len,
    7578    hc_transaction_done_callback_t callback, void * arg);
    7679
    77 void hc_add_transaction_from_device(usb_target_t target,
     80void hc_add_transaction_from_device(
     81    usb_target_t target, usb_transfer_type_t transfer_type,
    7882    void * buffer, size_t len,
    7983    hc_transaction_done_callback_t callback, void * arg);
Note: See TracChangeset for help on using the changeset viewer.