Changeset 9efad54 in mainline for uspace/drv/bus/usb/xhci/endpoint.c
- Timestamp:
- 2018-01-06T21:15:48Z (6 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 56257ba
- Parents:
- c901632
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/endpoint.c
rc901632 r9efad54 52 52 * @return Error code. 53 53 */ 54 int xhci_endpoint_init(xhci_endpoint_t *xhci_ep, device_t *dev, const usb_endpoint_desc _t *desc)54 int xhci_endpoint_init(xhci_endpoint_t *xhci_ep, device_t *dev, const usb_endpoint_descriptors_t *desc) 55 55 { 56 56 assert(xhci_ep); … … 60 60 endpoint_init(ep, dev, desc); 61 61 62 xhci_ep->max_streams = desc->usb3.max_streams; 63 xhci_ep->max_burst = desc->usb3.max_burst; 64 xhci_ep->mult = desc->usb3.mult; 65 66 // TODO: process according to 6.2.3.6 of XHCI specification; hardcoded for HS/SS EPs 67 xhci_ep->interval = desc->interval - 1; 62 xhci_ep->max_streams = USB_SSC_MAX_STREAMS(desc->companion); 63 xhci_ep->max_burst = desc->companion.max_burst + 1; 64 xhci_ep->mult = USB_SSC_MULT(desc->companion) + 1; 65 66 /* In USB 3, the semantics of wMaxPacketSize changed. Now the number of 67 * packets per service interval is determined from max_burst and mult. 68 */ 69 if (dev->speed >= USB_SPEED_SUPER) { 70 ep->packets_per_uframe = xhci_ep->max_burst * xhci_ep->mult; 71 ep->max_transfer_size = ep->max_packet_size * ep->packets_per_uframe; 72 } 73 74 xhci_ep->interval = desc->endpoint.poll_interval; 75 /* Only Low/Full speed interrupt endpoints have interval set directly, 76 * others have 2-based log of it. 77 */ 78 if (dev->speed >= USB_SPEED_HIGH || ep->transfer_type != USB_TRANSFER_INTERRUPT) { 79 xhci_ep->interval = 1 << (xhci_ep->interval - 1); 80 } 68 81 69 82 if (xhci_ep->base.transfer_type == USB_TRANSFER_ISOCHRONOUS) { 70 xhci_ep->isoch_max_size = desc-> usb3.bytes_per_interval71 ? desc-> usb3.bytes_per_interval72 : desc->max_packet_size * (desc->packets + 1);83 xhci_ep->isoch_max_size = desc->companion.bytes_per_interval 84 ? desc->companion.bytes_per_interval 85 : ep->max_transfer_size; 73 86 /* Technically there could be superspeed plus too. */ 74 87 … … 497 510 dev->endpoints[ep->base.endpoint] = NULL; 498 511 ep->base.device = NULL; 499 500 endpoint_del_ref(&ep->base);501 512 } 502 513
Note:
See TracChangeset
for help on using the changeset viewer.