Skip to content

Commit 1492868

Browse files
committed
drivers: uhc: set right value for pipe by xfer's mps
maxPacketSize and numberPerUframe of pipe should be set considering additional transactions. Signed-off-by: Aiden Hu <[email protected]>
1 parent d63d05a commit 1492868

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/usb/uhc/uhc_mcux_common.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -332,14 +332,14 @@ usb_host_pipe_t *uhc_mcux_init_hal_ep(const struct device *dev, struct uhc_trans
332332
/* USB_HostHelperGetPeripheralInformation uses this value as first parameter */
333333
pipe_init.devInstance = xfer->udev;
334334
pipe_init.nakCount = USB_HOST_CONFIG_MAX_NAK;
335-
pipe_init.maxPacketSize = xfer->mps;
335+
pipe_init.maxPacketSize = USB_MPS_EP_SIZE(xfer->mps);
336336
pipe_init.endpointAddress = USB_EP_GET_IDX(xfer->ep);
337337
pipe_init.direction = USB_EP_GET_IDX(xfer->ep) == 0 ? USB_OUT :
338338
USB_EP_GET_DIR(xfer->ep) ? USB_IN : USB_OUT;
339339
/* Current Zephyr Host stack is experimental, the endpoint's interval,
340340
* 'number per uframe' and the endpoint type cannot be got yet.
341341
*/
342-
pipe_init.numberPerUframe = 0; /* TODO: need right way to implement it. */
342+
pipe_init.numberPerUframe = USB_MPS_ADDITIONAL_TRANSACTIONS(xfer->mps);
343343
pipe_init.interval = xfer->interval;
344344
pipe_init.pipeType = xfer->type;
345345

0 commit comments

Comments
 (0)