Changeset b8a3cda in mainline for uspace/srv/hw/bus/usb/hcd/virtual/hc.c
- Timestamp:
- 2010-10-22T14:57:03Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 7a7bfeb3
- Parents:
- 954ea70
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hw/bus/usb/hcd/virtual/hc.c
r954ea70 rb8a3cda 51 51 #define USLEEP_BASE (500 * 1000) 52 52 53 #define USLEEP_VAR 1000053 #define USLEEP_VAR 5000 54 54 55 55 #define SHORTENING_VAR 15 … … 68 68 static link_t transaction_from_device_list; 69 69 70 #define TRANSACTION_FORMAT "T[%d:%d %s %s(%d)]"70 #define TRANSACTION_FORMAT "T[%d:%d (%d)]" 71 71 #define TRANSACTION_PRINTF(t) \ 72 72 (t).target.address, (t).target.endpoint, \ 73 usb_str_transfer_type((t).type), \74 ((t).direction == USB_DIRECTION_IN ? "in" : "out"), \75 73 (int)(t).len 76 74 … … 132 130 /** Create new transaction 133 131 */ 134 static transaction_t *transaction_create(usb _transfer_type_t type, usb_target_t target,135 usb_ direction_t direction,132 static transaction_t *transaction_create(usbvirt_transaction_type_t type, 133 usb_target_t target, 136 134 void * buffer, size_t len, 137 135 hc_transaction_done_callback_t callback, void * arg) … … 142 140 transaction->type = type; 143 141 transaction->target = target; 144 transaction->direction = direction;145 142 transaction->buffer = buffer; 146 143 transaction->len = len; … … 153 150 /** Add transaction directioned towards the device. 154 151 */ 155 void hc_add_transaction_to_device( usb_transfer_type_t type, usb_target_t target,152 void hc_add_transaction_to_device(bool setup, usb_target_t target, 156 153 void * buffer, size_t len, 157 154 hc_transaction_done_callback_t callback, void * arg) 158 155 { 159 transaction_t *transaction = transaction_create(type, target, 160 USB_DIRECTION_OUT, buffer, len, callback, arg); 156 transaction_t *transaction = transaction_create( 157 setup ? USBVIRT_TRANSACTION_SETUP : USBVIRT_TRANSACTION_OUT, target, 158 buffer, len, callback, arg); 161 159 list_append(&transaction->link, &transaction_to_device_list); 162 160 } … … 164 162 /** Add transaction directioned from the device. 165 163 */ 166 void hc_add_transaction_from_device(usb_t ransfer_type_t type, usb_target_t target,164 void hc_add_transaction_from_device(usb_target_t target, 167 165 void * buffer, size_t len, 168 166 hc_transaction_done_callback_t callback, void * arg) 169 167 { 170 transaction_t *transaction = transaction_create( type, target,171 USB_DIRECTION_IN, buffer, len, callback, arg);168 transaction_t *transaction = transaction_create(USBVIRT_TRANSACTION_IN, 169 target, buffer, len, callback, arg); 172 170 list_append(&transaction->link, &transaction_from_device_list); 173 171 } … … 175 173 /** Fill data to existing transaction from device. 176 174 */ 177 int hc_fillin_transaction_from_device(usb_t ransfer_type_t type, usb_target_t target,175 int hc_fillin_transaction_from_device(usb_target_t target, 178 176 void * buffer, size_t len) 179 177 { 180 dprintf("finding transaction to fill data in..."); 178 dprintf("finding transaction to fill data in (%d:%d)...", 179 target.address, target.endpoint); 181 180 int rc; 182 181
Note:
See TracChangeset
for help on using the changeset viewer.