Changeset b72efe8 in mainline for uspace/drv
- Timestamp:
- 2011-06-19T14:38:59Z (15 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 74464e8
- Parents:
- 1d1bb0f
- Location:
- uspace/drv
- Files:
-
- 10 edited
-
ohci/endpoint_list.c (modified) (3 diffs)
-
ohci/endpoint_list.h (modified) (1 diff)
-
ohci/hc.c (modified) (2 diffs)
-
ohci/hc.h (modified) (1 diff)
-
uhci/hc.c (modified) (1 diff)
-
uhci/transfer_list.c (modified) (5 diffs)
-
uhci/transfer_list.h (modified) (2 diffs)
-
usbmid/explore.c (modified) (3 diffs)
-
vhc/transfer.c (modified) (1 diff)
-
vhc/vhcd.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/ohci/endpoint_list.c
r1d1bb0f rb72efe8 103 103 /* There are active EDs, get the last one */ 104 104 hcd_endpoint_t *last = list_get_instance( 105 instance->endpoint_list.prev, hcd_endpoint_t, link); 106 assert(last); 105 list_last(&instance->endpoint_list), hcd_endpoint_t, link); 107 106 last_ed = last->ed; 108 107 } … … 121 120 122 121 hcd_endpoint_t *first = list_get_instance( 123 instance->endpoint_list.next, hcd_endpoint_t, link);122 list_first(&instance->endpoint_list), hcd_endpoint_t, link); 124 123 usb_log_debug("HCD EP(%p) added to list %s, first is %p(%p).\n", 125 124 hcd_ep, instance->name, first, first->ed); … … 153 152 ed_t *prev_ed; 154 153 /* Remove from the hardware queue */ 155 if ( instance->endpoint_list.next== &hcd_ep->link) {154 if (list_first(&instance->endpoint_list) == &hcd_ep->link) { 156 155 /* I'm the first one here */ 157 156 prev_ed = instance->list_head; -
uspace/drv/ohci/endpoint_list.h
r1d1bb0f rb72efe8 52 52 const char *name; 53 53 /** Sw list of all active EDs */ 54 li nk_t endpoint_list;54 list_t endpoint_list; 55 55 } endpoint_list_t; 56 56 -
uspace/drv/ohci/hc.c
r1d1bb0f rb72efe8 357 357 instance->registers->periodic_current); 358 358 359 link_t *current = instance->pending_batches. next;360 while (current != &instance->pending_batches ) {359 link_t *current = instance->pending_batches.head.next; 360 while (current != &instance->pending_batches.head) { 361 361 link_t *next = current->next; 362 362 usb_transfer_batch_t *batch = … … 367 367 usb_transfer_batch_finish(batch); 368 368 } 369 369 370 current = next; 370 371 } -
uspace/drv/ohci/hc.h
r1d1bb0f rb72efe8 68 68 endpoint_list_t lists[4]; 69 69 /** List of active transfers */ 70 li nk_t pending_batches;70 list_t pending_batches; 71 71 72 72 /** Fibril for periodic checks if interrupts can't be used */ -
uspace/drv/uhci/hc.c
r1d1bb0f rb72efe8 345 345 346 346 while (!list_empty(&done)) { 347 link_t *item = done.next;347 link_t *item = list_first(&done); 348 348 list_remove(item); 349 349 usb_transfer_batch_t *batch = -
uspace/drv/uhci/transfer_list.c
r1d1bb0f rb72efe8 121 121 } else { 122 122 /* There is something scheduled */ 123 usb_transfer_batch_t *last = 124 usb_transfer_batch_from_link(instance->batch_list.prev);123 usb_transfer_batch_t *last = usb_transfer_batch_from_link( 124 list_last(&instance->batch_list)); 125 125 last_qh = batch_qh(last); 126 126 } … … 146 146 } 147 147 /*----------------------------------------------------------------------------*/ 148 /** Add completed ba ntches to the provided list.148 /** Add completed batches to the provided list. 149 149 * 150 150 * @param[in] instance List to use. 151 151 * @param[in] done list to fill 152 152 */ 153 void transfer_list_remove_finished(transfer_list_t *instance, li nk_t *done)153 void transfer_list_remove_finished(transfer_list_t *instance, list_t *done) 154 154 { 155 155 assert(instance); … … 157 157 158 158 fibril_mutex_lock(&instance->guard); 159 link_t *current = instance->batch_list. next;160 while (current != &instance->batch_list ) {159 link_t *current = instance->batch_list.head.next; 160 while (current != &instance->batch_list.head) { 161 161 link_t * const next = current->next; 162 162 usb_transfer_batch_t *batch = … … 181 181 fibril_mutex_lock(&instance->guard); 182 182 while (!list_empty(&instance->batch_list)) { 183 link_t * const current = instance->batch_list.next;183 link_t * const current = list_first(&instance->batch_list); 184 184 usb_transfer_batch_t *batch = 185 185 usb_transfer_batch_from_link(current); … … 212 212 qh_t *prev_qh = NULL; 213 213 /* Remove from the hardware queue */ 214 if ( instance->batch_list.next== &batch->link) {214 if (list_first(&instance->batch_list) == &batch->link) { 215 215 /* I'm the first one here */ 216 216 prev_qh = instance->queue_head; -
uspace/drv/uhci/transfer_list.h
r1d1bb0f rb72efe8 51 51 const char *name; 52 52 /** List of all batches in this list */ 53 li nk_t batch_list;53 list_t batch_list; 54 54 } transfer_list_t; 55 55 … … 59 59 void transfer_list_add_batch( 60 60 transfer_list_t *instance, usb_transfer_batch_t *batch); 61 void transfer_list_remove_finished(transfer_list_t *instance, li nk_t *done);61 void transfer_list_remove_finished(transfer_list_t *instance, list_t *done); 62 62 void transfer_list_abort_all(transfer_list_t *instance); 63 63 #endif -
uspace/drv/usbmid/explore.c
r1d1bb0f rb72efe8 54 54 * @return Interface @p interface_no is already present in the list. 55 55 */ 56 static bool interface_in_list(li nk_t *list, int interface_no)56 static bool interface_in_list(list_t *list, int interface_no) 57 57 { 58 link_t *l; 59 for (l = list->next; l != list; l = l->next) { 58 list_foreach(*list, l) { 60 59 usbmid_interface_t *iface 61 60 = list_get_instance(l, usbmid_interface_t, link); … … 75 74 */ 76 75 static void create_interfaces(uint8_t *config_descriptor, 77 size_t config_descriptor_size, li nk_t *list)76 size_t config_descriptor_size, list_t *list) 78 77 { 79 78 usb_dp_parser_data_t data = { … … 181 180 182 181 /* Create interface children. */ 183 li nk_t interface_list;182 list_t interface_list; 184 183 list_initialize(&interface_list); 185 184 create_interfaces(config_descriptor_raw, config_descriptor_size, 186 185 &interface_list); 187 186 188 link_t *link; 189 for (link = interface_list.next; link != &interface_list; 190 link = link->next) { 187 list_foreach(interface_list, link) { 191 188 usbmid_interface_t *iface = list_get_instance(link, 192 189 usbmid_interface_t, link); -
uspace/drv/vhc/transfer.c
r1d1bb0f rb72efe8 189 189 assert(!list_empty(&dev->transfer_queue)); 190 190 191 vhc_transfer_t *transfer = list_get_instance( dev->transfer_queue.next,192 vhc_transfer_t, link);191 vhc_transfer_t *transfer = list_get_instance( 192 list_first(&dev->transfer_queue), vhc_transfer_t, link); 193 193 list_remove(&transfer->link); 194 194 -
uspace/drv/vhc/vhcd.h
r1d1bb0f rb72efe8 52 52 usb_address_t address; 53 53 fibril_mutex_t guard; 54 li nk_t transfer_queue;54 list_t transfer_queue; 55 55 } vhc_virtdev_t; 56 56 57 57 typedef struct { 58 58 uint32_t magic; 59 li nk_t devices;59 list_t devices; 60 60 fibril_mutex_t guard; 61 61 usb_endpoint_manager_t ep_manager;
Note:
See TracChangeset
for help on using the changeset viewer.
