Changeset 3cc5ccda in mainline
- Timestamp:
- 2011-02-09T08:26:36Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 61bb85d
- Parents:
- ad29045
- Location:
- uspace/drv/uhci-hcd
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/uhci-hcd/uhci.c
rad29045 r3cc5ccda 33 33 */ 34 34 #include <errno.h> 35 #include <adt/list.h> 35 36 36 37 #include <usb/debug.h> … … 89 90 90 91 list_initialize(&instance->tracker_list); 92 fibril_mutex_initialize(&instance->tracker_list_mutex); 91 93 92 94 instance->cleaner = fibril_create(uhci_clean_finished, instance); … … 164 166 /* TODO: check available bandwith here */ 165 167 168 usb_log_debug2("Scheduler(%d) acquiring tracker list mutex.\n", 169 fibril_get_id()); 170 fibril_mutex_lock(&instance->tracker_list_mutex); 171 usb_log_debug2("Scheduler(%d) acquired tracker list mutex.\n", 172 fibril_get_id()); 173 166 174 transfer_list_t *list = 167 175 instance->transfers[low_speed][tracker->transfer_type]; … … 170 178 list_append(&tracker->link, &instance->tracker_list); 171 179 180 usb_log_debug2("Scheduler(%d) releasing tracker list mutex.\n", 181 fibril_get_id()); 182 fibril_mutex_unlock(&instance->tracker_list_mutex); 183 usb_log_debug2("Scheduler(%d) released tracker list mutex.\n", 184 fibril_get_id()); 185 172 186 return EOK; 173 187 } … … 180 194 181 195 while(1) { 196 LIST_INITIALIZE(done_trackers); 182 197 /* tracker iteration */ 198 199 usb_log_debug2("Cleaner(%d) acquiring tracker list mutex.\n", 200 fibril_get_id()); 201 fibril_mutex_lock(&instance->tracker_list_mutex); 202 usb_log_debug2("Cleaner(%d) acquired tracker list mutex.\n", 203 fibril_get_id()); 204 183 205 link_t *current = instance->tracker_list.next; 184 206 while (current != &instance->tracker_list) 185 207 { 208 186 209 link_t *next = current->next; 187 210 tracker_t *tracker = list_get_instance(current, tracker_t, link); … … 196 219 tracker->td->status, tracker->td->device); 197 220 list_remove(current); 198 tracker->next_step(tracker);221 list_append(current, &done_trackers); 199 222 } 200 223 current = next; 224 } 225 226 usb_log_debug2("Cleaner(%d) releasing tracker list mutex.\n", 227 fibril_get_id()); 228 fibril_mutex_unlock(&instance->tracker_list_mutex); 229 usb_log_debug2("Cleaner(%d) released tracker list mutex.\n", 230 fibril_get_id()); 231 232 while (!list_empty(&done_trackers)) { 233 tracker_t *tracker = list_get_instance( 234 done_trackers.next, tracker_t, link); 235 list_remove(&tracker->link); 236 tracker->next_step(tracker); 201 237 } 202 238 async_usleep(UHCI_CLEANER_TIMEOUT); -
uspace/drv/uhci-hcd/uhci.h
rad29045 r3cc5ccda 37 37 38 38 #include <fibril.h> 39 #include <fibril_synch.h> 39 40 #include <adt/list.h> 40 41 … … 81 82 82 83 link_t tracker_list; 84 fibril_mutex_t tracker_list_mutex; 83 85 84 86 transfer_list_t transfers_bulk_full; -
uspace/drv/uhci-hcd/uhci_struct/queue_head.h
rad29045 r3cc5ccda 43 43 44 44 typedef struct queue_head { 45 link_pointer_t next_queue;46 link_pointer_t element;45 volatile link_pointer_t next_queue; 46 volatile link_pointer_t element; 47 47 } __attribute__((packed)) queue_head_t; 48 48
Note:
See TracChangeset
for help on using the changeset viewer.