Commit Graph

9 Commits

Author SHA1 Message Date
Tomasz Moń
b7664f27c8 usb: device_next: Make stack High-Bandwidth aware
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>
2024-08-21 18:25:30 +01:00
Tomasz Moń
60835aa393 usb: Add missing wMaxPacketSize endian conversions
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>
2024-08-21 18:25:30 +01:00
Johann Fischer
5ddaa3b1a1 drivers: udc: add opaque pointer to store upper layer private data
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>
2024-08-06 17:17:41 -04:00
Johann Fischer
ef512305fb tests: drivers: udc: updates to pass testing on supported platforms
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>
2024-06-28 20:56:47 -04:00
Benedikt Schmidt
aa25e212d1 tests: fix thread function signatures
Fix thread function signatures to avoid stack corruption on thread exit.

Signed-off-by: Benedikt Schmidt <benedikt.schmidt@embedded-solutions.at>
2023-10-30 12:24:34 +01:00
Johann Fischer
ad81b3b797 drivers: udc: move transfer status to buffer info structure
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>
2023-03-23 10:08:03 +01:00
Johann Fischer
18a03ced93 tests: drivers: udc: fix udc_ep_try_config() test
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>
2023-02-13 10:11:52 +01:00
Johann Fischer
33a8635008 tests: drivers: udc: fix uninitialized variable and thread
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>
2022-12-14 12:06:03 +01:00
Johann Fischer
db1fb82c18 tests: drivers: add simple UDC driver test
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>
2022-12-02 12:55:18 +01:00