Changeset 53a9d02 in mainline
- Timestamp:
- 2018-01-11T09:17:43Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 30fc56f
- Parents:
- 17783bf
- Location:
- uspace
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ehci/ehci_bus.c
r17783bf r53a9d02 101 101 ehci_bus_t *bus = (ehci_bus_t *) bus_base; 102 102 ehci_endpoint_t *ehci_ep = ehci_endpoint_get(ep); 103 assert(fibril_mutex_is_locked(&bus_base->guard));104 103 105 104 const int err = usb2_bus_ops.endpoint_register(ep); -
uspace/drv/bus/usb/xhci/hc.c
r17783bf r53a9d02 745 745 usb_log_debug2("Obtained USB address: %d.\n", dev->base.address); 746 746 747 /* From now on, the device is officially online, yay! */748 fibril_mutex_lock(&dev->base.guard);749 dev->base.online = true;750 fibril_mutex_unlock(&dev->base.guard);751 752 747 return EOK; 753 748 -
uspace/lib/usbhost/src/bus.c
r17783bf r53a9d02 109 109 return ENOTSUP; 110 110 111 if (dev->online) { 112 fibril_mutex_unlock(&dev->guard); 111 if (dev->online) 113 112 return EINVAL; 114 }115 113 116 114 const int r = ops->device_enumerate(dev); 117 if (!r) { 118 dev->online = true; 119 115 if (r) 116 return r; 117 118 dev->online = true; 119 120 if (dev->hub) { 120 121 fibril_mutex_lock(&dev->hub->guard); 121 122 list_append(&dev->link, &dev->hub->devices); … … 123 124 } 124 125 125 return r;126 return EOK; 126 127 } 127 128 … … 192 193 193 194 /* Remove our device from our hub's children. */ 194 fibril_mutex_lock(&dev->hub->guard); 195 list_remove(&dev->link); 196 fibril_mutex_unlock(&dev->hub->guard); 195 if (dev->hub) { 196 fibril_mutex_lock(&dev->hub->guard); 197 list_remove(&dev->link); 198 fibril_mutex_unlock(&dev->hub->guard); 199 } 197 200 198 201 /* -
uspace/lib/usbhost/src/usb2_bus.c
r17783bf r53a9d02 106 106 * 107 107 * Reserve address, configure the control EP, issue a SET_ADDRESS command. 108 * Configure the device with the new address, mark the device as online.108 * Configure the device with the new address, 109 109 */ 110 110 static int address_device(device_t *dev) … … 160 160 goto err_address; 161 161 } 162 endpoint_del_ref(default_ep);163 162 164 163 dev->address = address; … … 173 172 } 174 173 175 /* From now on, the device is officially online, yay! */176 fibril_mutex_lock(&dev->guard);177 dev->online = true;178 fibril_mutex_unlock(&dev->guard);179 180 174 return EOK; 181 175 182 176 err_default_control_ep: 183 177 bus_endpoint_remove(default_ep); 184 endpoint_del_ref(default_ep);185 178 err_address: 186 179 release_address(bus, address); … … 235 228 { 236 229 usb2_bus_t *bus = bus_to_usb2_bus(ep->device->bus); 237 assert(fibril_mutex_is_locked(& bus->base.guard));230 assert(fibril_mutex_is_locked(&ep->device->guard)); 238 231 assert(ep); 239 232
Note:
See TracChangeset
for help on using the changeset viewer.