Skip to content

Commit 09e1c1d

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 d7665d2 commit 09e1c1d

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
@@ -281,14 +281,14 @@ usb_host_pipe_t *uhc_mcux_init_hal_ep(const struct device *dev, struct uhc_trans
281281
/* USB_HostHelperGetPeripheralInformation uses this value as first parameter */
282282
pipe_init.devInstance = xfer->udev;
283283
pipe_init.nakCount = USB_HOST_CONFIG_MAX_NAK;
284-
pipe_init.maxPacketSize = xfer->mps;
284+
pipe_init.maxPacketSize = USB_MPS_EP_SIZE(xfer->mps);
285285
pipe_init.endpointAddress = USB_EP_GET_IDX(xfer->ep);
286286
pipe_init.direction = USB_EP_GET_IDX(xfer->ep) == 0 ? USB_OUT :
287287
USB_EP_GET_DIR(xfer->ep) ? USB_IN : USB_OUT;
288288
/* Current Zephyr Host stack is experimental, the endpoint's interval,
289289
* 'number per uframe' and the endpoint type cannot be got yet.
290290
*/
291-
pipe_init.numberPerUframe = 0; /* TODO: need right way to implement it. */
291+
pipe_init.numberPerUframe = USB_MPS_ADDITIONAL_TRANSACTIONS(xfer->mps);
292292
pipe_init.interval = xfer->interval;
293293
pipe_init.pipeType = xfer->type;
294294

0 commit comments

Comments
 (0)