-
Notifications
You must be signed in to change notification settings - Fork 7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
USB: check MPS depending on USB speed and endpoint type (Fix Coverity issues #14977) #15147
Conversation
Include to the callback parameters also alt_setting to be able to make right choice for ECM. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Only enable netusb for the right configuration of interface and alt_setting. Fixes zephyrproject-rtos#13560 Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Refactor code making set_endpoint() helper which check validity of input parameters. At the moment FS USB is supported, for future we also need to add HS part. Fix bug with usb_set_configuration() always returning true. Fixes zephyrproject-rtos#14954 Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Use helper set_endpoint() for endpoint configuration. Fixes zephyrproject-rtos#14957 Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
All checks are passing now. Review history of this comment for details about previous failed status. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can make simper, just
diff --git a/include/usb/usb_device.h b/include/usb/usb_device.h
index 9546bfad25..5ea2617888 100644
--- a/include/usb/usb_device.h
+++ b/include/usb/usb_device.h
@@ -74,6 +74,16 @@ extern "C" {
#define MAX_PACKET_SIZE0 64 /**< maximum packet size for EP 0 */
+#if DT_USBHS_MAXIMUM_SPEED == USB_MAXIMUM_SPEED_HIGH_SPEED
+#define USB_MAX_BULK_MPS 512
+#define USB_MAX_INT_MPS 1024
+#define USB_MAX_ISO_MPS 1024
+#else /* For every other configuartions for now */
+#define USB_MAX_BULK_MPS 64
+#define USB_MAX_INT_MPS 64
+#define USB_MAX_ISO_MPS 1023
+#endif
+
/*************************************************************************
* USB application interface
**************************************************************************/
b441bba68a64a3ba8a6f389b4845b8878d632921
That DTS a bit screwed up, I think every board reinvent its own maximum speed definition.
Add maximum packet size for different endpoint types and usb speed modes. Signed-off-by: Johann Fischer <j.fischer@phytec.de>
Check MPS depending on USB speed and endpoint type. Signed-off-by: Johann Fischer <j.fischer@phytec.de>
9657a10
to
76db184
Compare
close it, I have an other fix in mind |
Check MPS depending on USB speed and endpoint type.
This is based on #14977 and #15140, for a discussion how it could be done.
@finikorg You can cherry-pick or rebase it as you wish.