Changeset e099f26 in mainline for uspace/drv/uhci-hcd/transfer_list.c
- Timestamp:
- 2011-03-21T20:22:50Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- c56c5b5b
- Parents:
- 4fb6d9ee (diff), 31b568e (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
r4fb6d9ee re099f26 38 38 39 39 static void transfer_list_remove_batch( 40 transfer_list_t *instance, batch_t *batch);40 transfer_list_t *instance, usb_transfer_batch_t *batch); 41 41 /*----------------------------------------------------------------------------*/ 42 42 /** Initialize transfer list structures. … … 91 91 * The batch is added to the end of the list and queue. 92 92 */ 93 void transfer_list_add_batch(transfer_list_t *instance, batch_t *batch)93 void transfer_list_add_batch(transfer_list_t *instance, usb_transfer_batch_t *batch) 94 94 { 95 95 assert(instance); 96 96 assert(batch); 97 97 usb_log_debug2("Queue %s: Adding batch(%p).\n", instance->name, batch); 98 99 98 100 99 fibril_mutex_lock(&instance->guard); … … 107 106 } else { 108 107 /* There is something scheduled */ 109 batch_t *last = list_get_instance(110 instance->batch_list.prev, batch_t, link);111 last_qh = last->qh;108 usb_transfer_batch_t *last = list_get_instance( 109 instance->batch_list.prev, usb_transfer_batch_t, link); 110 last_qh = batch_qh(last); 112 111 } 113 112 const uint32_t pa = addr_to_phys(batch->qh); 114 113 assert((pa & LINK_POINTER_ADDRESS_MASK) == pa); 115 114 116 batch->qh->next = last_qh->next; 115 /* keep link */ 116 batch_qh(batch)->next = last_qh->next; 117 117 qh_set_next_qh(last_qh, pa); 118 118 … … 120 120 list_append(&batch->link, &instance->batch_list); 121 121 122 batch_t *first = list_get_instance(123 instance->batch_list.next, batch_t, link);122 usb_transfer_batch_t *first = list_get_instance( 123 instance->batch_list.next, usb_transfer_batch_t, link); 124 124 usb_log_debug("Batch(%p) added to queue %s, first is %p.\n", 125 125 batch, instance->name, first); … … 146 146 while (current != &instance->batch_list) { 147 147 link_t *next = current->next; 148 batch_t *batch = list_get_instance(current,batch_t, link);148 usb_transfer_batch_t *batch = list_get_instance(current, usb_transfer_batch_t, link); 149 149 150 150 if (batch_is_complete(batch)) { … … 160 160 link_t *item = done.next; 161 161 list_remove(item); 162 batch_t *batch = list_get_instance(item,batch_t, link);162 usb_transfer_batch_t *batch = list_get_instance(item, usb_transfer_batch_t, link); 163 163 batch->next_step(batch); 164 164 } … … 174 174 while (!list_empty(&instance->batch_list)) { 175 175 link_t *current = instance->batch_list.next; 176 batch_t *batch = list_get_instance(current,batch_t, link);176 usb_transfer_batch_t *batch = list_get_instance(current, usb_transfer_batch_t, link); 177 177 transfer_list_remove_batch(instance, batch); 178 batch_abort(batch);178 usb_transfer_batch_finish(batch, EIO); 179 179 } 180 180 fibril_mutex_unlock(&instance->guard); … … 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, batch_t *batch) 192 { 193 assert(instance); 191 void transfer_list_remove_batch(transfer_list_t *instance, usb_transfer_batch_t *batch) 192 { 193 assert(instance); 194 assert(instance->queue_head); 194 195 assert(batch); 195 assert(instance->queue_head); 196 assert(batch->qh); 196 assert(batch_qh(batch)); 197 197 assert(fibril_mutex_is_locked(&instance->guard)); 198 198 … … 205 205 /* I'm the first one here */ 206 206 assert((instance->queue_head->next & LINK_POINTER_ADDRESS_MASK) 207 == addr_to_phys(bat ch->qh));208 instance->queue_head->next = batch ->qh->next;207 == addr_to_phys(bathc_qh(batch))); 208 instance->queue_head->next = batch_qh(batch)->next; 209 209 qpos = "FIRST"; 210 210 } else { 211 batch_t *prev =212 list_get_instance(batch->link.prev, batch_t, link);213 assert(( prev->qh->next & LINK_POINTER_ADDRESS_MASK)214 == addr_to_phys(batch ->qh));215 prev->qh->next = batch->qh->next;211 usb_transfer_batch_t *prev = 212 list_get_instance(batch->link.prev, usb_transfer_batch_t, link); 213 assert((batch_qh(prev)->next & LINK_POINTER_ADDRESS_MASK) 214 == addr_to_phys(batch_qh(batch))); 215 batch_qh(prev)->next = batch_qh(batch)->next; 216 216 qpos = "NOT FIRST"; 217 217 } … … 219 219 list_remove(&batch->link); 220 220 usb_log_debug("Batch(%p) removed (%s) from %s, next %x.\n", 221 batch, qpos, instance->name, batch->qh->next);221 batch, pos, instance->name, batch_qh(batch)->next); 222 222 } 223 223 /**
Note:
See TracChangeset
for help on using the changeset viewer.