Changeset 9620a54 in mainline for uspace/drv/bus/usb/xhci/endpoint.c
- Timestamp:
- 2017-10-29T10:51:59Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- d33dc780
- Parents:
- 62f8025
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/endpoint.c
r62f8025 r9620a54 188 188 int xhci_endpoint_alloc_transfer_ds(xhci_endpoint_t *xhci_ep) 189 189 { 190 191 usb_log_debug2("Allocating main transfer ring for endpoint %u", xhci_ep->base.endpoint);190 /* Can't use XHCI_EP_FMT because the endpoint may not have device. */ 191 usb_log_debug2("Allocating main transfer ring for endpoint " XHCI_EP_FMT, XHCI_EP_ARGS(*xhci_ep)); 192 192 193 193 xhci_ep->primary_stream_ctx_array = NULL; … … 201 201 } 202 202 203 int xhci_endpoint_free_transfer_ds(xhci_endpoint_t *xhci_ep) 204 { 205 /* FIXME: For some reason (possibly memory corruption), this crashes. */ 206 return EOK; 207 203 void xhci_endpoint_free_transfer_ds(xhci_endpoint_t *xhci_ep) 204 { 208 205 if (endpoint_using_streams(xhci_ep)) { 209 usb_log_debug2("Freeing primary stream context array forendpoint " XHCI_EP_FMT, XHCI_EP_ARGS(*xhci_ep));206 usb_log_debug2("Freeing primary stream context array of endpoint " XHCI_EP_FMT, XHCI_EP_ARGS(*xhci_ep)); 210 207 211 208 // maybe check if LSA, then skip? … … 223 220 free32(xhci_ep->primary_stream_ctx_array); 224 221 } else { 225 usb_log_debug2("Freeing main transfer ring for endpoint " XHCI_EP_FMT, XHCI_EP_ARGS(*xhci_ep)); 226 227 int err; 228 if ((err = xhci_trb_ring_fini(&xhci_ep->ring))) { 229 return err; 230 } 231 } 232 233 return EOK; 222 usb_log_debug2("Freeing main transfer ring of endpoint " XHCI_EP_FMT, XHCI_EP_ARGS(*xhci_ep)); 223 224 xhci_trb_ring_fini(&xhci_ep->ring); 225 } 234 226 } 235 227 … … 344 336 endpoint_add_ref(&ep->base); 345 337 ep->base.device = &dev->base; 346 347 338 dev->endpoints[ep_num] = ep; 348 ++dev->active_endpoint_count;349 339 350 340 return EOK; … … 357 347 358 348 assert(dev->endpoints[ep->base.endpoint]); 359 360 349 dev->endpoints[ep->base.endpoint] = NULL; 361 --dev->active_endpoint_count;362 350 ep->base.device = NULL; 363 351
Note:
See TracChangeset
for help on using the changeset viewer.