You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "zyfeier (via GitHub)" <gi...@apache.org> on 2023/08/04 09:18:06 UTC
[GitHub] [nuttx] zyfeier opened a new pull request, #10084: usb: Use composite equipment codes as universal codes for enumeration
zyfeier opened a new pull request, #10084:
URL: https://github.com/apache/nuttx/pull/10084
## Summary
The enumeration process in each class driver is similar. Extracting the common enumeration process code to composite.c can reduce redundant code. In this PR, only the adb class has been modified, and it will be applicable to all classes in the next PR.
## Impact
usb enumeration
## Testing
sim:usbdev and bes board
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] raiden00pl commented on pull request #10084: usb: Use composite equipment codes as universal codes for enumeration
Posted by "raiden00pl (via GitHub)" <gi...@apache.org>.
raiden00pl commented on PR #10084:
URL: https://github.com/apache/nuttx/pull/10084#issuecomment-1665623980
I don't think coupling USB device class logic with composite device logic is a good idea. These are two separate functionalities, and device class logic should not depend on composite logic.
Why not move the common USB device logic to a separate file, private for `drivers/usbdev` e.g. `usbdev_common.c/usbdev_common.h` ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] raiden00pl commented on pull request #10084: usb: Use composite equipment codes as universal codes for enumeration
Posted by "raiden00pl (via GitHub)" <gi...@apache.org>.
raiden00pl commented on PR #10084:
URL: https://github.com/apache/nuttx/pull/10084#issuecomment-1667172001
Then composite devices and other USB devices should use common USB device logic. Now the code gives the impression that non-composite USB device is just composite device with one supported device - which is wrong and confusing.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 commented on pull request #10084: usb: Use composite equipment codes as universal codes for enumeration
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on PR #10084:
URL: https://github.com/apache/nuttx/pull/10084#issuecomment-1669005317
Ok, let's do it in the next step.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] zyfeier commented on pull request #10084: usb: Use composite equipment codes as universal codes for enumeration
Posted by "zyfeier (via GitHub)" <gi...@apache.org>.
zyfeier commented on PR #10084:
URL: https://github.com/apache/nuttx/pull/10084#issuecomment-1667123474
> I don't think coupling USB device class logic with composite device logic is a good idea. These are two separate functionalities, and device class logic should not depend on composite logic.
>
> Why not move the common USB device logic to a separate file, private for `drivers/usbdev` e.g. `usbdev_common.c/usbdev_common.h` ?
Hi, raiden00pl:
I initially extracted the common code, but found that it was almost identical to the code in composite.c. Additionally, the main difference between composite and non-composite devices is that composite devices support multiple functions, which can be distinguished through configuration. Therefore, I felt that it was more appropriate to directly use composite.c.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] raiden00pl commented on pull request #10084: usb: Use composite equipment codes as universal codes for enumeration
Posted by "raiden00pl (via GitHub)" <gi...@apache.org>.
raiden00pl commented on PR #10084:
URL: https://github.com/apache/nuttx/pull/10084#issuecomment-1667950541
@xiaoxiang781216 it would actually make sense that way but composite specific functionality should be keep in the `composite.c` (eg. `composite_ep0submit()`)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 closed pull request #10084: usb: Use composite equipment codes as universal codes for enumeration
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 closed pull request #10084: usb: Use composite equipment codes as universal codes for enumeration
URL: https://github.com/apache/nuttx/pull/10084
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [nuttx] xiaoxiang781216 commented on pull request #10084: usb: Use composite equipment codes as universal codes for enumeration
Posted by "xiaoxiang781216 (via GitHub)" <gi...@apache.org>.
xiaoxiang781216 commented on PR #10084:
URL: https://github.com/apache/nuttx/pull/10084#issuecomment-1667812380
> Then composite devices and other USB devices should use common USB device logic. Now the code gives the impression that non-composite USB device is just composite device with one supported device - which is wrong and confusing.
so @raiden00pl do you want to rename the current composite driver to a general name and let's composite driver forward the call to these common function?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org