Changeset df6ded8 in mainline for uspace/drv/bus/usb/ehci/endpoint_list.c
- Timestamp:
- 2018-02-28T16:37:50Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 1b20da0
- Parents:
- f5e5f73 (diff), b2dca8de (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. - git-author:
- Jakub Jermar <jakub@…> (2018-02-28 16:06:42)
- git-committer:
- Jakub Jermar <jakub@…> (2018-02-28 16:37:50)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ehci/endpoint_list.c
rf5e5f73 rdf6ded8 1 1 /* 2 2 * Copyright (c) 2014 Jan Vesely 3 * Copyright (c) 2018 Ondrej Hlavaty 3 4 * All rights reserved. 4 5 * … … 54 55 assert(instance); 55 56 instance->name = name; 56 instance->list_head = malloc32(sizeof(qh_t)); 57 if (!instance->list_head) { 57 if (dma_buffer_alloc(&instance->dma_buffer, sizeof(qh_t))) { 58 58 usb_log_error("EPL(%p-%s): Failed to allocate list head.", 59 59 instance, name); 60 60 return ENOMEM; 61 61 } 62 instance->list_head = instance->dma_buffer.virt; 62 63 qh_init(instance->list_head, NULL); 63 64 … … 95 96 { 96 97 assert(instance); 98 assert(instance->list_head); 97 99 assert(ep); 98 100 assert(ep->qh); 99 usb_log_debug2("EPL(%p-%s): Append endpoint(%p). \n",101 usb_log_debug2("EPL(%p-%s): Append endpoint(%p).", 100 102 instance, instance->name, ep); 101 103 … … 124 126 write_barrier(); 125 127 /* Add to the sw list */ 126 list_append(&ep-> link, &instance->endpoint_list);128 list_append(&ep->eplist_link, &instance->endpoint_list); 127 129 128 130 ehci_endpoint_t *first = ehci_endpoint_list_instance( 129 131 list_first(&instance->endpoint_list)); 130 usb_log_debug("EPL(%p-%s): EP(%p) added to list, first is %p(%p). \n",132 usb_log_debug("EPL(%p-%s): EP(%p) added to list, first is %p(%p).", 131 133 instance, instance->name, ep, first, first->qh); 132 134 if (last_qh == instance->list_head) { 133 usb_log_debug2("EPL(%p-%s): head EP(%p-%"PRIxn"): %x:%x. \n",135 usb_log_debug2("EPL(%p-%s): head EP(%p-%"PRIxn"): %x:%x.", 134 136 instance, instance->name, last_qh, 135 137 addr_to_phys(instance->list_head), … … 153 155 fibril_mutex_lock(&instance->guard); 154 156 155 usb_log_debug2("EPL(%p-%s): removing EP(%p). \n",157 usb_log_debug2("EPL(%p-%s): removing EP(%p).", 156 158 instance, instance->name, ep); 157 159 … … 159 161 qh_t *prev_qh; 160 162 /* Remove from the hardware queue */ 161 if (list_first(&instance->endpoint_list) == &ep-> link) {163 if (list_first(&instance->endpoint_list) == &ep->eplist_link) { 162 164 /* I'm the first one here */ 163 165 prev_qh = instance->list_head; 164 166 qpos = "FIRST"; 165 167 } else { 166 prev_qh = ehci_endpoint_list_instance(ep-> link.prev)->qh;168 prev_qh = ehci_endpoint_list_instance(ep->eplist_link.prev)->qh; 167 169 qpos = "NOT FIRST"; 168 170 } … … 172 174 write_barrier(); 173 175 174 usb_log_debug("EPL(%p-%s): EP(%p) removed (%s), horizontal %x. \n",176 usb_log_debug("EPL(%p-%s): EP(%p) removed (%s), horizontal %x.", 175 177 instance, instance->name, ep, qpos, ep->qh->horizontal); 176 178 177 179 /* Remove from the endpoint list */ 178 list_remove(&ep-> link);180 list_remove(&ep->eplist_link); 179 181 fibril_mutex_unlock(&instance->guard); 180 182 }
Note:
See TracChangeset
for help on using the changeset viewer.