Changeset cc44f7e in mainline for uspace/drv/uhci-hcd/transfer_list.c
- Timestamp:
- 2011-02-28T13:04:21Z (13 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0b5644c, 494eaf7, 51b46f2
- Parents:
- 81c508c (diff), dced52a (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
r81c508c rcc44f7e 70 70 assert(instance); 71 71 assert(batch); 72 usb_log_debug2("Adding batch(%p) to queue %s.\n", batch, instance->name); 72 73 73 74 uint32_t pa = (uintptr_t)addr_to_phys(batch->qh); … … 83 84 list_append(&batch->link, &instance->batch_list); 84 85 instance->queue_head->element = pa; 85 usb_log_debug 2("Added batch(%p)to queue %s first.\n",86 usb_log_debug("Batch(%p) added to queue %s first.\n", 86 87 batch, instance->name); 87 88 fibril_mutex_unlock(&instance->guard); … … 96 97 queue_head_append_qh(last->qh, pa); 97 98 list_append(&batch->link, &instance->batch_list); 98 usb_log_debug 2("Added batch(%p)to queue %s last, first is %p.\n",99 usb_log_debug("Batch(%p) added to queue %s last, first is %p.\n", 99 100 batch, instance->name, first ); 100 101 fibril_mutex_unlock(&instance->guard); … … 108 109 assert(instance->queue_head); 109 110 assert(batch->qh); 111 usb_log_debug2("Removing batch(%p) from queue %s.\n", batch, instance->name); 110 112 111 113 /* I'm the first one here */ 112 114 if (batch->link.prev == &instance->batch_list) { 113 usb_log_debug(" Removing batch %p was first, next element %x.\n",114 batch, batch->qh->next_queue);115 usb_log_debug("Batch(%p) removed (FIRST) from queue %s, next element %x.\n", 116 batch, instance->name, batch->qh->next_queue); 115 117 instance->queue_head->element = batch->qh->next_queue; 116 118 } else { 117 usb_log_debug(" Removing batch %p was NOT first, next element %x.\n",118 batch, batch->qh->next_queue);119 usb_log_debug("Batch(%p) removed (NOT FIRST) from queue, next element %x.\n", 120 batch, instance->name, batch->qh->next_queue); 119 121 batch_t *prev = list_get_instance(batch->link.prev, batch_t, link); 120 122 prev->qh->next_queue = batch->qh->next_queue; … … 123 125 } 124 126 /*----------------------------------------------------------------------------*/ 125 void transfer_list_ check(transfer_list_t *instance)127 void transfer_list_remove_finished(transfer_list_t *instance) 126 128 { 127 129 assert(instance); 130 131 LIST_INITIALIZE(done); 132 128 133 fibril_mutex_lock(&instance->guard); 129 134 link_t *current = instance->batch_list.next; … … 134 139 if (batch_is_complete(batch)) { 135 140 transfer_list_remove_batch(instance, batch); 136 batch->next_step(batch);141 list_append(current, &done); 137 142 } 138 143 current = next; 139 144 } 140 145 fibril_mutex_unlock(&instance->guard); 146 147 while (!list_empty(&done)) { 148 link_t *item = done.next; 149 list_remove(item); 150 batch_t *batch = list_get_instance(item, batch_t, link); 151 batch->next_step(batch); 152 } 141 153 } 142 154 /**
Note:
See TracChangeset
for help on using the changeset viewer.