Changeset a8ac368 in mainline for uspace/drv/uhci-hcd/transfer_list.c
- Timestamp:
- 2011-03-29T20:08:53Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- fc883bb
- Parents:
- 0d92638 (diff), 51e5608 (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
r0d92638 ra8ac368 58 58 } 59 59 instance->queue_head_pa = addr_to_phys(instance->queue_head); 60 usb_log_debug2("Transfer list %s setup with QH: %p(%p).\n", 61 name, instance->queue_head, instance->queue_head_pa); 60 62 61 63 qh_init(instance->queue_head); … … 91 93 * The batch is added to the end of the list and queue. 92 94 */ 93 void transfer_list_add_batch(transfer_list_t *instance, usb_transfer_batch_t *batch) 95 void transfer_list_add_batch( 96 transfer_list_t *instance, usb_transfer_batch_t *batch) 94 97 { 95 98 assert(instance); … … 117 120 qh_set_next_qh(last_qh, pa); 118 121 122 asm volatile ("": : :"memory"); 123 119 124 /* Add to the driver list */ 120 125 list_append(&batch->link, &instance->batch_list); … … 136 141 * this transfer list leading to the deadlock if its done inline. 137 142 */ 138 void transfer_list_remove_finished(transfer_list_t *instance) 139 { 140 assert(instance); 141 142 LIST_INITIALIZE(done); 143 void transfer_list_remove_finished(transfer_list_t *instance, link_t *done) 144 { 145 assert(instance); 146 assert(done); 143 147 144 148 fibril_mutex_lock(&instance->guard); … … 146 150 while (current != &instance->batch_list) { 147 151 link_t *next = current->next; 148 usb_transfer_batch_t *batch = list_get_instance(current, usb_transfer_batch_t, link); 152 usb_transfer_batch_t *batch = 153 list_get_instance(current, usb_transfer_batch_t, link); 149 154 150 155 if (batch_is_complete(batch)) { 151 156 /* Save for post-processing */ 152 157 transfer_list_remove_batch(instance, batch); 153 list_append(current, &done);158 list_append(current, done); 154 159 } 155 160 current = next; … … 157 162 fibril_mutex_unlock(&instance->guard); 158 163 159 while (!list_empty(&done)) {160 link_t *item = done.next;161 list_remove(item);162 usb_transfer_batch_t *batch = list_get_instance(item, usb_transfer_batch_t, link);163 batch->next_step(batch);164 }165 164 } 166 165 /*----------------------------------------------------------------------------*/ … … 174 173 while (!list_empty(&instance->batch_list)) { 175 174 link_t *current = instance->batch_list.next; 176 usb_transfer_batch_t *batch = list_get_instance(current, usb_transfer_batch_t, link); 175 usb_transfer_batch_t *batch = 176 list_get_instance(current, usb_transfer_batch_t, link); 177 177 transfer_list_remove_batch(instance, batch); 178 178 usb_transfer_batch_finish(batch, EIO); … … 189 189 * Does not lock the transfer list, caller is responsible for that. 190 190 */ 191 void transfer_list_remove_batch(transfer_list_t *instance, usb_transfer_batch_t *batch) 191 void transfer_list_remove_batch( 192 transfer_list_t *instance, usb_transfer_batch_t *batch) 192 193 { 193 194 assert(instance); … … 210 211 } else { 211 212 usb_transfer_batch_t *prev = 212 list_get_instance(batch->link.prev, usb_transfer_batch_t, link); 213 list_get_instance( 214 batch->link.prev, usb_transfer_batch_t, link); 213 215 assert((batch_qh(prev)->next & LINK_POINTER_ADDRESS_MASK) 214 216 == addr_to_phys(batch_qh(batch))); … … 216 218 qpos = "NOT FIRST"; 217 219 } 220 asm volatile ("": : :"memory"); 218 221 /* Remove from the batch list */ 219 222 list_remove(&batch->link);
Note:
See TracChangeset
for help on using the changeset viewer.