Changeset f971e957 in mainline
- Timestamp:
- 2017-10-16T12:03:56Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- bb784ae
- Parents:
- 3afcf68
- Location:
- uspace/drv/bus/usb/xhci
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/endpoint.c
r3afcf68 rf971e957 81 81 } 82 82 83 static inlineuint8_t xhci_endpoint_ctx_offset(xhci_endpoint_t *ep)83 uint8_t xhci_endpoint_ctx_offset(xhci_endpoint_t *ep) 84 84 { 85 85 /* 0 is slot ctx, 1 is EP0, then it's EP1 out, in, EP2 out, in, etc. */ -
uspace/drv/bus/usb/xhci/endpoint.h
r3afcf68 rf971e957 97 97 void xhci_device_fini(xhci_device_t *); 98 98 99 uint8_t xhci_endpoint_ctx_offset(xhci_endpoint_t *); 100 99 101 int xhci_device_add_endpoint(xhci_device_t *, xhci_endpoint_t *); 100 102 int xhci_device_remove_endpoint(xhci_device_t *, xhci_endpoint_t *); -
uspace/drv/bus/usb/xhci/transfers.c
r3afcf68 rf971e957 167 167 return EINVAL; 168 168 } 169 if (batch->ep->t arget.endpoint != 0 || batch->ep->transfer_type != USB_TRANSFER_CONTROL) {169 if (batch->ep->transfer_type != USB_TRANSFER_CONTROL) { 170 170 /* This method only works for control transfers. */ 171 usb_log_error("Attempted to schedule control transfer to non 0endpoint.");171 usb_log_error("Attempted to schedule a control transfer to non control endpoint."); 172 172 return EINVAL; 173 173 } … … 176 176 177 177 uint8_t slot_id = xhci_ep->device->slot_id; 178 xhci_trb_ring_t* ring = hc->dcbaa_virt[slot_id].trs[ 0];178 xhci_trb_ring_t* ring = hc->dcbaa_virt[slot_id].trs[batch->ep->target.endpoint]; 179 179 180 180 usb_device_request_setup_packet_t* setup = … … 254 254 /* For control transfers, the target is always 1. */ 255 255 // FIXME: ignoring return code 256 hc_ring_doorbell(hc, slot_id, 1); 256 const uint8_t target = xhci_endpoint_ctx_offset(xhci_ep); 257 hc_ring_doorbell(hc, slot_id, target); 257 258 258 259 // Issue a Configure Endpoint command, if needed. … … 300 301 301 302 // TODO: target = endpoint | stream_id << 16 302 hc_ring_doorbell(hc, slot_id, xhci_ep->base.target.endpoint); 303 const uint8_t target = xhci_endpoint_ctx_offset(xhci_ep); 304 hc_ring_doorbell(hc, slot_id, target); 303 305 return EOK; 304 306 } … … 337 339 list_append(&transfer->link, &hc->transfers); 338 340 339 const uint8_t target = 2 * batch->ep->target.endpoint 340 + (batch->ep->direction == USB_DIRECTION_IN ? 1 : 0); 341 const uint8_t target = xhci_endpoint_ctx_offset(xhci_ep); 341 342 usb_log_debug("Ringing doorbell for slot_id = %d, target = %d", slot_id, target); 342 343 return hc_ring_doorbell(hc, slot_id, target);
Note:
See TracChangeset
for help on using the changeset viewer.