usbus: Implement USB_FEATURE_DEVICE_REMOTE_WAKEUP handling #19800
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Contribution description
While working on the
qmk_firmware
integration, a slight behavioural difference was noted in Windows 10/11 hosts.Stalling on
SET_FEATURE
/CLEAR_FEATURE
can make upstream hubs disable ports. This in turn stops the device from instantiating a remote wakeup (currently implemented with some MCU specific logic).According to the USB 2.0 spec, remote wakeup should be disabled by default, and should only be enabled if the host explicitly requests it. Handling
USB_FEATURE_DEVICE_REMOTE_WAKEUP
and storing its status allows devices to also be more compliant in its wakeup process.Testing procedure
Right now its been tested via wireshark and a heavily modified qmk_firmware branch.
Please do let me know if theres existing test cases to update.
Hardware tested was a ATSAMD51J18A MCU and USB2422 Hub, as well as ATSAMD21G18 and nrf52840.
Issues/PRs references