Changes in uspace/drv/uhci-hcd/uhci_struct/transfer_descriptor.c [eae83aa:4abc304] in mainline
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/uhci_struct/transfer_descriptor.c
reae83aa r4abc304 38 38 #include "utils/malloc32.h" 39 39 40 void td_init(td_t *instance, int err_count, size_t size, bool toggle, bool iso, 41 bool low_speed, usb_target_t target, usb_packet_id pid, void *buffer, td_t *next) 40 void transfer_descriptor_init(transfer_descriptor_t *instance, 41 int error_count, size_t size, bool toggle, bool isochronous, bool low_speed, 42 usb_target_t target, int pid, void *buffer, transfer_descriptor_t *next) 42 43 { 43 44 assert(instance); 44 assert(size < 1024);45 assert((pid == USB_PID_SETUP) || (pid == USB_PID_IN) || (pid == USB_PID_OUT));46 45 47 46 instance->next = 0 … … 50 49 51 50 instance->status = 0 52 | ((err_count & TD_STATUS_ERROR_COUNT_MASK) << TD_STATUS_ERROR_COUNT_POS) 53 | (low_speed ? TD_STATUS_LOW_SPEED_FLAG : 0) 54 | (iso ? TD_STATUS_ISOCHRONOUS_FLAG : 0) 55 | TD_STATUS_ERROR_ACTIVE; 51 | ((error_count & TD_STATUS_ERROR_COUNT_MASK) << TD_STATUS_ERROR_COUNT_POS) 52 | (low_speed ? TD_STATUS_LOW_SPEED_FLAG : 0) 53 | TD_STATUS_ERROR_ACTIVE; 56 54 57 if (pid == USB_PID_IN && !iso) { 58 instance->status |= TD_STATUS_SPD_FLAG; 59 } 60 55 assert(size < 1024); 61 56 instance->device = 0 62 63 64 65 66 57 | (((size - 1) & TD_DEVICE_MAXLEN_MASK) << TD_DEVICE_MAXLEN_POS) 58 | (toggle ? TD_DEVICE_DATA_TOGGLE_ONE_FLAG : 0) 59 | ((target.address & TD_DEVICE_ADDRESS_MASK) << TD_DEVICE_ADDRESS_POS) 60 | ((target.endpoint & TD_DEVICE_ENDPOINT_MASK) << TD_DEVICE_ENDPOINT_POS) 61 | ((pid & TD_DEVICE_PID_MASK) << TD_DEVICE_PID_POS); 67 62 68 63 instance->buffer_ptr = 0; … … 73 68 74 69 usb_log_debug2("Created TD: %X:%X:%X:%X(%p).\n", 75 76 70 instance->next, instance->status, instance->device, 71 instance->buffer_ptr, buffer); 77 72 } 78 73 /*----------------------------------------------------------------------------*/ 79 int t d_status(td_t *instance)74 int transfer_descriptor_status(transfer_descriptor_t *instance) 80 75 { 81 76 assert(instance);
Note:
See TracChangeset
for help on using the changeset viewer.