Changeset 13b9cb5 in mainline
- Timestamp:
- 2011-03-19T09:32:04Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 4fb6d9ee
- Parents:
- ebf59e4
- Location:
- uspace/drv/uhci-hcd
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/transfer_list.c
rebf59e4 r13b9cb5 79 79 if (!instance->queue_head) 80 80 return; 81 /* Set both next and element to point to the same QH*/81 /* Set both queue_head.next to point to the follower */ 82 82 qh_set_next_qh(instance->queue_head, next->queue_head_pa); 83 qh_set_element_qh(instance->queue_head, next->queue_head_pa);84 83 } 85 84 /*----------------------------------------------------------------------------*/ … … 98 97 usb_log_debug2("Queue %s: Adding batch(%p).\n", instance->name, batch); 99 98 100 const uint32_t pa = addr_to_phys(batch->qh);101 assert((pa & LINK_POINTER_ADDRESS_MASK) == pa);102 103 /* New batch will be added to the end of the current list104 * so set the link accordingly */105 qh_set_next_qh(batch->qh, instance->queue_head->next);106 99 107 100 fibril_mutex_lock(&instance->guard); 108 101 102 qh_t *last_qh = NULL; 109 103 /* Add to the hardware queue. */ 110 104 if (list_empty(&instance->batch_list)) { 111 105 /* There is nothing scheduled */ 112 qh_t *qh = instance->queue_head; 113 assert(qh->element == qh->next); 114 qh_set_element_qh(qh, pa); 106 last_qh = instance->queue_head; 115 107 } else { 116 108 /* There is something scheduled */ 117 109 batch_t *last = list_get_instance( 118 110 instance->batch_list.prev, batch_t, link); 119 qh_set_next_qh(last->qh, pa); 120 } 111 last_qh = last->qh; 112 } 113 const uint32_t pa = addr_to_phys(batch->qh); 114 assert((pa & LINK_POINTER_ADDRESS_MASK) == pa); 115 116 batch->qh->next = last_qh->next; 117 qh_set_next_qh(last_qh, pa); 118 121 119 /* Add to the driver list */ 122 120 list_append(&batch->link, &instance->batch_list); … … 174 172 { 175 173 fibril_mutex_lock(&instance->guard); 176 while ( list_empty(&instance->batch_list)) {174 while (!list_empty(&instance->batch_list)) { 177 175 link_t *current = instance->batch_list.next; 178 176 batch_t *batch = list_get_instance(current, batch_t, link); … … 204 202 if (batch->link.prev == &instance->batch_list) { 205 203 /* I'm the first one here */ 206 qh_set_element_qh(instance->queue_head, batch->qh->next);204 instance->queue_head->next = batch->qh->next; 207 205 pos = "FIRST"; 208 206 } else { 209 207 batch_t *prev = 210 208 list_get_instance(batch->link.prev, batch_t, link); 211 qh_set_next_qh(prev->qh, batch->qh->next);209 prev->qh->next = batch->qh->next; 212 210 pos = "NOT FIRST"; 213 211 } -
uspace/drv/uhci-hcd/uhci_hc.c
rebf59e4 r13b9cb5 123 123 } 124 124 125 instance->debug_checker = fibril_create(uhci_hc_debug_checker, instance); 126 fibril_add_ready(instance->debug_checker); 125 instance->debug_checker = 126 fibril_create(uhci_hc_debug_checker, instance); 127 // fibril_add_ready(instance->debug_checker); 127 128 128 129 usb_log_info("Started UHCI driver.\n");
Note:
See TracChangeset
for help on using the changeset viewer.