-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tests: drivers: udc: Fixed behavior on devices that has 16 endpoints
In the current test, ``` #define FALSE_EP_ADDR 0x0FU ``` is to check non-existent EP, but if there are 16 EPs, i.e., the USB standard is fully implemented, this becomes a valid EP. In that case, the test item that checks the operation of a non-existent EP will fail. Even if this value is set to a larger value, the EP value is rounded by the following macro, so it cannot point to a non-existent EP. ``` #define USB_EP_LUT_IDX(ep) (USB_EP_DIR_IS_IN(ep) ? (ep & BIT_MASK(4)) + 16 : \ ep & BIT_MASK(4)) ``` Essentially, I think it would be more appropriate to implement `udc_get_ep_cfg()` to return NULL when a non-existent EP is specified, but a major design change is required. Here, I will refer to the value in the device tree to find the number of EPs, and if 16 or more EPs are available, we will change it so that the test for non-existent EPs is not performed. Signed-off-by: TOKITA Hiroshi <[email protected]>
- Loading branch information
Showing
1 changed file
with
43 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters