Add macros for converting between Max Packet Size and total payload
length. Allow drivers specify whether endpoint supports high-bandwidth
interrupt and high-bandwidth isochronous transfers.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
wMaxPacketSize in endpoint descriptor is stored in little-endian order,
but the mps parameter passed to functions is in host order.
Signed-off-by: Tomasz Moń <tomasz.mon@nordicsemi.no>
Add an opaque pointer to store upper layer private data and initialize
it with the USB device context during controller initialization. Use the
pointer in event processing to get the correct context.
Fixes commit 48f2a4bc1a
("usb: device_next: remove initialized state checks in event processing")
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Do not halt control endpoint, control endpoint may not be enabled when
there no host is connected. Yield after buffer is queued to allow the
driver to work.
Tweak pool size and number of buffers to pass the test with high-speed
drivers.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
This allows us to get the result of synchronous transfer without
any hacks, just from the net_buf structure.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Behavior of udc_ep_try_config() is changed by the commit e60a4efbb0
("drivers: udc: do not update MPS for isochronous endpoints"),
update test case accordingly.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Variable to get MPS supported by the controller was used
uninitialized. This caused the test to fail depending on
the memory state.
test_udc_device_get has to be called only once, at the very
beginning. This was overlooked during migration to new test API.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>
Simple test for API rules, allocation, queue, and dequeu
of the endpoint requests. USB device controller should not be
connected to the host as this state is not covered by this test.
Signed-off-by: Johann Fischer <johann.fischer@nordicsemi.no>