-
Notifications
You must be signed in to change notification settings - Fork 8.3k
USB: netusb: Cleanup and switch to USB transfer API #13985
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #13985 +/- ##
==========================================
+ Coverage 51.97% 51.97% +<.01%
==========================================
Files 308 308
Lines 45512 45512
Branches 10546 10546
==========================================
+ Hits 23656 23657 +1
Misses 17055 17055
+ Partials 4801 4800 -1
Continue to review full report at Codecov.
|
Use helper to make code cleaner. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Make code more readable. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Remove unnecessary line breaks. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
aurel32
left a comment
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.
Beside the issue with the TX buffer size, it looks good to me. It's a nice cleanup and I have tested it fixes the issue reported in #14127.
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.
This array holds the Ethernet packet, but also the RNDIS header. I guess its size should therefore be 1500 + sizeof(struct rndis_payload_packet) or even better `NETUSB_MTU + sizeof(struct rndis_payload_packet).
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.
Fixed
Use USB transfer API for data transfer. Simplify notification count, removing delayed work, use usb_transfer() logic instead. Fixes zephyrproject-rtos#14127 Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
Remove try_write() which is not used anymore and general cleanup. Signed-off-by: Andrei Emeltchenko <andrei.emeltchenko@intel.com>
aurel32
left a comment
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.
Thanks for the quick update, LGTM now.
|
@finikorg Nope I only tested it on Linux (4.19 kernel), with a SAM E70 Xplained board. I can try with an STM32 board in the next days. |
Cleanup and fixes.
Fixes #14127
Fixes #14416