Skip to content

Commit 823b5db

Browse files
AidenHuJosuah Demangeon
authored andcommitted
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 f77374d commit 823b5db

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

0 commit comments

Comments
 (0)