Replies: 1 comment 1 reply
-
|
I would seriously prefer to not abuse net_buf I consider the USB stack merging requests into one to be a design flaw. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
@tmon-nordic, @jfischer-no hoping to start a quick discussion with you guys about the subject. From my reading the code, in case when an EP is disabled we call
udc_ep_dequeue()which will pop all of the outstandingnet_bufs from the EP's FIFO and put them into a singlenet_bufwith a bunch or fragments. So when that buffer is passed on toinput_report_done()is the expectation that the user of the API know that they need to inspectfragfield and potentially walk a linked list and to free all of the user-provided buffers?Maybe it is too late to change that API in particular, but what do you think of an idea to instead:
pool_inbe allocated with the space for data and havehid_dev_submit_report()do amemcpy()of a passed buffer (I have a patch for that, FWIW)hid_dev_submit_report()that would accept a user allocatedstruct net_buf, so that we can let the users avoid allocating a net_buf and a user-provided data bufferThoughts?
Thank you!
Beta Was this translation helpful? Give feedback.
All reactions