Changeset df6ded8 in mainline for uspace/drv/bus/usb/ohci/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/ohci/endpoint_list.c
rf5e5f73 rdf6ded8 1 1 /* 2 2 * Copyright (c) 2011 Jan Vesely 3 * Copyright (c) 2018 Ondrej Hlavaty 3 4 * All rights reserved. 4 5 * … … 57 58 instance->list_head = malloc32(sizeof(ed_t)); 58 59 if (!instance->list_head) { 59 usb_log_error("Failed to allocate list head. \n");60 usb_log_error("Failed to allocate list head."); 60 61 return ENOMEM; 61 62 } 62 63 instance->list_head_pa = addr_to_phys(instance->list_head); 63 usb_log_debug2("Transfer list %s setup with ED: %p(0x%0" PRIx32 ")). \n",64 usb_log_debug2("Transfer list %s setup with ED: %p(0x%0" PRIx32 ")).", 64 65 name, instance->list_head, instance->list_head_pa); 65 66 … … 96 97 assert(instance); 97 98 assert(ep); 98 usb_log_debug2("Queue %s: Adding endpoint(%p). \n", instance->name, ep);99 usb_log_debug2("Queue %s: Adding endpoint(%p).", instance->name, ep); 99 100 100 101 fibril_mutex_lock(&instance->guard); … … 108 109 /* There are active EDs, get the last one */ 109 110 ohci_endpoint_t *last = list_get_instance( 110 list_last(&instance->endpoint_list), ohci_endpoint_t, link);111 list_last(&instance->endpoint_list), ohci_endpoint_t, eplist_link); 111 112 last_ed = last->ed; 112 113 } … … 122 123 123 124 /* Add to the sw list */ 124 list_append(&ep-> link, &instance->endpoint_list);125 list_append(&ep->eplist_link, &instance->endpoint_list); 125 126 126 127 ohci_endpoint_t *first = list_get_instance( 127 list_first(&instance->endpoint_list), ohci_endpoint_t, link);128 usb_log_debug("HCD EP(%p) added to list %s, first is %p(%p). \n",128 list_first(&instance->endpoint_list), ohci_endpoint_t, eplist_link); 129 usb_log_debug("HCD EP(%p) added to list %s, first is %p(%p).", 129 130 ep, instance->name, first, first->ed); 130 131 if (last_ed == instance->list_head) { 131 usb_log_debug2("%s head ED(%p-0x%0" PRIx32 "): %x:%x:%x:%x. \n",132 usb_log_debug2("%s head ED(%p-0x%0" PRIx32 "): %x:%x:%x:%x.", 132 133 instance->name, last_ed, instance->list_head_pa, 133 134 last_ed->status, last_ed->td_tail, last_ed->td_head, … … 151 152 fibril_mutex_lock(&instance->guard); 152 153 153 usb_log_debug2("Queue %s: removing endpoint(%p). \n", instance->name, ep);154 usb_log_debug2("Queue %s: removing endpoint(%p).", instance->name, ep); 154 155 155 156 const char *qpos = NULL; 156 157 ed_t *prev_ed; 157 158 /* Remove from the hardware queue */ 158 if (list_first(&instance->endpoint_list) == &ep-> link) {159 if (list_first(&instance->endpoint_list) == &ep->eplist_link) { 159 160 /* I'm the first one here */ 160 161 prev_ed = instance->list_head; … … 162 163 } else { 163 164 ohci_endpoint_t *prev = 164 list_get_instance(ep-> link.prev, ohci_endpoint_t,link);165 list_get_instance(ep->eplist_link.prev, ohci_endpoint_t, eplist_link); 165 166 prev_ed = prev->ed; 166 167 qpos = "NOT FIRST"; … … 171 172 write_barrier(); 172 173 173 usb_log_debug("HCD EP(%p) removed (%s) from %s, next %x. \n",174 usb_log_debug("HCD EP(%p) removed (%s) from %s, next %x.", 174 175 ep, qpos, instance->name, ep->ed->next); 175 176 176 177 /* Remove from the endpoint list */ 177 list_remove(&ep-> link);178 list_remove(&ep->eplist_link); 178 179 fibril_mutex_unlock(&instance->guard); 179 180 }
Note:
See TracChangeset
for help on using the changeset viewer.