-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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: rework usb transfer #21350
usb: rework usb transfer #21350
Conversation
All checks passed. Tip: The bot edits this comment instead of posting a new one, so you can check the comment's history to see earlier messages. |
Tested OK with usb_dc_stm32/disco_l475_iot1. |
I will take a look in this PR after Christmas. |
As discussed, I will unblock it and move two last commits to a special (experimental) PR. |
91ff04d
to
ebcfd3a
Compare
ebcfd3a
to
de8147a
Compare
@emob-nordic and @finikorg could you please review? We'd like to have this in for 2.2. |
* | ||
* @return 0 on success, negative errno code on fail. | ||
*/ | ||
int usb_transfer_init(void); |
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.
So we have this header only for usb_transfer_init()
and other header for usb_transfer{,_sync}()
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.
Yes, this is internal for device stack, include/usb/usb_device.h is public API for users.
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.
Probably usb_transfer.h
can be merged with os_desc.h
and usb_descriptor.h
to a usb_device_internal.h
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 it would be better to first merge this PR and then think about merge you mentioned in order to resolve this #20236
@@ -101,10 +101,6 @@ LOG_MODULE_REGISTER(usb_device); | |||
#define MAX_NUM_REQ_HANDLERS 4 | |||
#define MAX_STD_REQ_MSG_SIZE 8 | |||
|
|||
/* Default USB control EP, always 0 and 0x80 */ | |||
#define USB_CONTROL_OUT_EP0 0 | |||
#define USB_CONTROL_IN_EP0 0x80 |
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 should not move this to header until actually usage.
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.
It is left over from original PR, will drop it now but we have to cleanup it.
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.
Move USB transfer functions to appropriate file. Signed-off-by: Johann Fischer <j.fischer@phytec.de>
Rework USB transfer logging. Signed-off-by: Johann Fischer <j.fischer@phytec.de>
de8147a
to
728a11b
Compare
Rework usb transfers
and use for control requests.This is attempt to unify the endpoint transfers and improvement of the control request handling.Step forward to unify/rework endpoint transfers.