Changeset bad4a05 in mainline
- Timestamp:
- 2018-01-11T04:12:06Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 0892663a
- Parents:
- a6c4597
- git-author:
- Ondřej Hlavatý <aearsis@…> (2018-01-11 01:31:42)
- git-committer:
- Ondřej Hlavatý <aearsis@…> (2018-01-11 04:12:06)
- Location:
- uspace
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/ehci/ehci_bus.c
ra6c4597 rbad4a05 113 113 } 114 114 115 static intehci_unregister_ep(endpoint_t *ep)115 static void ehci_unregister_ep(endpoint_t *ep) 116 116 { 117 117 bus_t *bus_base = endpoint_get_bus(ep); … … 120 120 assert(ep); 121 121 122 const int err = usb2_bus_ops.endpoint_unregister(ep); 123 if (err) 124 return err; 125 122 usb2_bus_ops.endpoint_unregister(ep); 126 123 hc_dequeue_endpoint(bus->hc, ep); 127 return EOK;128 124 } 129 125 -
uspace/drv/bus/usb/ohci/ohci_bus.c
ra6c4597 rbad4a05 118 118 } 119 119 120 static intohci_unregister_ep(endpoint_t *ep)120 static void ohci_unregister_ep(endpoint_t *ep) 121 121 { 122 122 ohci_bus_t *bus = (ohci_bus_t *) endpoint_get_bus(ep); 123 123 assert(ep); 124 124 125 const int err = usb2_bus_ops.endpoint_unregister(ep); 126 if (err) 127 return err; 128 125 usb2_bus_ops.endpoint_unregister(ep); 129 126 hc_dequeue_endpoint(bus->hc, ep); 130 return EOK;131 127 } 132 128 -
uspace/drv/bus/usb/xhci/bus.c
ra6c4597 rbad4a05 193 193 } 194 194 195 static int endpoint_unregister(endpoint_t *);196 197 195 /** 198 196 * Remove device from XHCI bus. Transition it to the offline state, abort all … … 205 203 * @return Error code. 206 204 */ 207 static intdevice_remove(device_t *dev)205 static void device_remove(device_t *dev) 208 206 { 209 207 int err; … … 249 247 continue; 250 248 251 if ((err = endpoint_unregister(dev->endpoints[i]))) { 252 usb_log_warning("Failed to unregister endpoint " XHCI_EP_FMT ": %s", 253 XHCI_EP_ARGS(*xhci_device_get_endpoint(xhci_dev, i)), str_error(err)); 254 } 249 bus_endpoint_remove(dev->endpoints[i]); 255 250 } 256 251 … … 258 253 /* XXX: Not a good idea, this method should not destroy devices. */ 259 254 hcd_ddf_fun_destroy(dev); 260 261 return EOK;262 255 } 263 256 … … 415 408 * Bus callback. 416 409 */ 417 static intendpoint_unregister(endpoint_t *ep_base)410 static void endpoint_unregister(endpoint_t *ep_base) 418 411 { 419 412 int err; … … 433 426 " the slot has already been disabled.", XHCI_EP_ARGS(*ep)); 434 427 } 435 436 return EOK;437 428 } 438 429 -
uspace/drv/bus/usb/xhci/rh.c
ra6c4597 rbad4a05 188 188 { 189 189 assert(rh); 190 int err;191 190 192 191 /* Find XHCI device by the port. */ … … 207 206 208 207 /* Remove device from XHCI bus. */ 209 if ((err = bus_device_remove(&dev->base))) { 210 usb_log_warning("Failed to remove device " XHCI_DEV_FMT " from XHCI bus: %s", 211 XHCI_DEV_ARGS(*dev), str_error(err)); 212 } 208 bus_device_remove(&dev->base); 213 209 214 210 return EOK; -
uspace/lib/usbhost/include/usb/host/bus.h
ra6c4597 rbad4a05 103 103 /* Operations on device */ 104 104 int (*device_enumerate)(device_t *); 105 int(*device_remove)(device_t *);105 void (*device_remove)(device_t *); 106 106 int (*device_online)(device_t *); /**< Optional */ 107 107 int (*device_offline)(device_t *); /**< Optional */ … … 110 110 /* Operations on endpoint */ 111 111 int (*endpoint_register)(endpoint_t *); 112 int(*endpoint_unregister)(endpoint_t *);112 void (*endpoint_unregister)(endpoint_t *); 113 113 void (*endpoint_destroy)(endpoint_t *); /**< Optional */ 114 114 void (*endpoint_toggle_reset)(endpoint_t *); /**< Optional */ … … 117 117 118 118 /* Operations on batch */ 119 int (*batch_schedule)(usb_transfer_batch_t *); 119 120 void (*batch_destroy)(usb_transfer_batch_t *); /**< Optional */ 120 int (*batch_schedule)(usb_transfer_batch_t *);121 121 }; 122 122 … … 149 149 150 150 int bus_device_enumerate(device_t *); 151 intbus_device_remove(device_t *);151 void bus_device_remove(device_t *); 152 152 153 153 int bus_device_online(device_t *); -
uspace/lib/usbhost/src/bus.c
ra6c4597 rbad4a05 112 112 * Invoke the device_remove bus operation. 113 113 */ 114 intbus_device_remove(device_t *dev)114 void bus_device_remove(device_t *dev) 115 115 { 116 116 assert(dev); 117 117 118 118 const bus_ops_t *ops = BUS_OPS_LOOKUP(dev->bus->ops, device_remove); 119 if (!ops) 120 return ENOTSUP; 119 assert(ops); 121 120 122 121 return ops->device_remove(dev); … … 266 265 267 266 fibril_mutex_lock(&device->guard); 268 const int r = ops->endpoint_unregister(ep); 269 if (!r) 270 device->endpoints[ep->endpoint] = NULL; 267 ops->endpoint_unregister(ep); 268 device->endpoints[ep->endpoint] = NULL; 271 269 fibril_mutex_unlock(&device->guard); 272 273 if (r)274 return r;275 270 276 271 /* Abort a transfer batch, if there was any */ -
uspace/lib/usbhost/src/usb2_bus.c
ra6c4597 rbad4a05 250 250 * Release bandwidth reserved by the given endpoint. 251 251 */ 252 static intusb2_bus_unregister_ep(endpoint_t *ep)252 static void usb2_bus_unregister_ep(endpoint_t *ep) 253 253 { 254 254 usb2_bus_t *bus = bus_to_usb2_bus(ep->device->bus); … … 256 256 257 257 bus->free_bw += ep->bandwidth; 258 259 return EOK;260 258 } 261 259
Note:
See TracChangeset
for help on using the changeset viewer.