Changeset 0f803831 in mainline
- Timestamp:
- 2018-01-17T10:52:53Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 5dab9ef0
- Parents:
- 740dafc
- git-author:
- Salmelu <salmelu@…> (2018-01-17 10:50:57)
- git-committer:
- Salmelu <salmelu@…> (2018-01-17 10:52:53)
- Location:
- uspace
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/drv/bus/usb/xhci/streams.c
r740dafc r0f803831 193 193 * @param[in] ctx Endpoint context to configure. 194 194 * @param[in] pstreams The value of MaxPStreams. 195 * @param[in] lsa Specifies if the stream IDs point to primary stream array. 195 196 */ 196 197 static void setup_stream_context(xhci_endpoint_t *xhci_ep, xhci_ep_ctx_t *ctx, unsigned pstreams, unsigned lsa) … … 203 204 XHCI_EP_MAX_P_STREAMS_SET(*ctx, pstreams); 204 205 XHCI_EP_TR_DPTR_SET(*ctx, xhci_ep->primary_stream_ctx_dma.phys); 205 // TODO: set HID?206 206 XHCI_EP_LSA_SET(*ctx, lsa); 207 207 } … … 216 216 } 217 217 218 if (xhci_ep->max_streams == 1) {218 if (xhci_ep->max_streams <= 1) { 219 219 usb_log_error("Streams are not supported by endpoint " XHCI_EP_FMT, XHCI_EP_ARGS(*xhci_ep)); 220 return EINVAL; 221 } 222 223 if (count < 2) { 224 usb_log_error("The minumum amount of primary streams is 2."); 220 225 return EINVAL; 221 226 } … … 295 300 xhci_endpoint_t *xhci_ep, unsigned *sizes, unsigned count) 296 301 { 302 /* Check if HC supports secondary indexing */ 303 if (XHCI_REG_RD(hc->cap_regs, XHCI_CAP_NSS)) { 304 usb_log_error("The host controller doesn't support secondary streams."); 305 return ENOTSUP; 306 } 307 297 308 int err = verify_stream_conditions(hc, dev, xhci_ep, count); 298 309 if (err) { … … 300 311 } 301 312 302 // TODO: determine if count * secondary streams <= max_streams 303 if (count > xhci_ep->max_streams) { 313 if (count > 256) { 314 usb_log_error("The amount of primary streams cannot be higher than 256."); 315 return EINVAL; 316 } 317 318 /* 319 * Find the largest requested secondary stream size, 320 * that one is the maximum ID that device can receive. 321 * We need to make sure the device can handle that ID. 322 */ 323 unsigned max = 0; 324 for (size_t index = 0; index < count; ++index) { 325 if (sizes[count] > max) { 326 max = sizes[count]; 327 } 328 } 329 330 if (max * count > xhci_ep->max_streams) { 304 331 usb_log_error("Endpoint " XHCI_EP_FMT " supports only %" PRIu32 " streams.", 305 332 XHCI_EP_ARGS(*xhci_ep), xhci_ep->max_streams); -
uspace/lib/drv/generic/remote_usbhc.c
r740dafc r0f803831 558 558 /* .address is initialized by write itself */ 559 559 .endpoint = ep, 560 /* streams are not given by the API call yet */ 561 .stream = 0, 560 562 }}; 561 563
Note:
See TracChangeset
for help on using the changeset viewer.