Changeset 5d4193c in mainline for uspace/drv/uhci-hcd/transfer_list.c
- Timestamp:
- 2011-02-11T12:06:05Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 03197ffc, fe1776c2
- Parents:
- 960ff451 (diff), f96aefc (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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/transfer_list.c
r960ff451 r5d4193c 41 41 { 42 42 assert(instance); 43 instance->first = NULL;44 instance->last = NULL;45 43 instance->next = NULL; 46 44 instance->name = name; … … 66 64 } 67 65 /*----------------------------------------------------------------------------*/ 68 int transfer_list_append( 69 transfer_list_t *instance, transfer_descriptor_t *transfer) 66 void transfer_list_add_tracker(transfer_list_t *instance, tracker_t *tracker) 70 67 { 71 68 assert(instance); 72 assert(tra nsfer);69 assert(tracker); 73 70 74 uint32_t pa = (uintptr_t)addr_to_phys(tra nsfer);71 uint32_t pa = (uintptr_t)addr_to_phys(tracker->td); 75 72 assert((pa & LINK_POINTER_ADDRESS_MASK) == pa); 76 73 77 /* empty list */78 if (instance->first == NULL) {79 assert(instance->last == NULL);80 instance->first = instance->last = transfer;81 } else {82 assert(instance->last);83 instance->last->next_va = transfer;84 74 85 assert(instance->last->next & LINK_POINTER_TERMINATE_FLAG); 86 instance->last->next = (pa & LINK_POINTER_ADDRESS_MASK); 87 instance->last = transfer; 75 if (instance->queue_head->element & LINK_POINTER_TERMINATE_FLAG) { 76 usb_log_debug2("Adding td(%X:%X) to queue %s first.\n", 77 tracker->td->status, tracker->td->device, instance->name); 78 /* there is nothing scheduled */ 79 instance->last_tracker = tracker; 80 instance->queue_head->element = pa; 81 usb_log_debug2("Added td(%X:%X) to queue %s first.\n", 82 tracker->td->status, tracker->td->device, instance->name); 83 return; 88 84 } 85 usb_log_debug2("Adding td(%X:%X) to queue %s last.%p\n", 86 tracker->td->status, tracker->td->device, instance->name, 87 instance->last_tracker); 88 /* now we can be sure that last_tracker is a valid pointer */ 89 instance->last_tracker->td->next = pa; 90 instance->last_tracker = tracker; 89 91 90 assert(instance->queue_head); 92 usb_log_debug2("Added td(%X:%X) to queue %s last.\n", 93 tracker->td->status, tracker->td->device, instance->name); 94 95 /* check again, may be use atomic compare and swap */ 91 96 if (instance->queue_head->element & LINK_POINTER_TERMINATE_FLAG) { 92 instance->queue_head->element = (pa & LINK_POINTER_ADDRESS_MASK); 97 instance->queue_head->element = pa; 98 usb_log_debug2("Added td(%X:%X) to queue first2 %s.\n", 99 tracker->td->status, tracker->td->device, instance->name); 93 100 } 94 usb_log_debug("Successfully added transfer to the hc queue %s.\n",95 instance->name);96 return EOK;97 101 } 98 102 /**
Note:
See TracChangeset
for help on using the changeset viewer.