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
[missing-feature] capsule: i2c_master_slave: return xfer length to userspace #3735
Comments
From a brief look over this, it's definitely the case that our documentation of this HIL is lacking. Furthermore, this userspace API, despite being part of the core capsules, does not yet have a TRD. We should rectify both eventually.
Concerning this, I believe that the HIL itself does not necessarily need to pass this information back -- the I do agree that in the userspace API, with multiple potentially concurrent operations, keeping track of this state locally in the application seems less than ideal. I'm open to returning this length back from the userspace driver (and thus keeping track of it there internally). For |
Okay sounds good.
Here do you mean from the userspace driver to return back to the caller basically the Similar to:
Alternatively, couldn't the
|
Hey all,
Looking at the Kernel HIL for I2C for a command complete, there's no way for the driver to accurately return the number of bytes transceived. For example:
tock/kernel/src/hil/i2c.rs
Line 190 in 50dd293
So returning bytes read/sent information back to userspace seems incomplete, for example, we don't actually return a length back. In
tock/capsules/core/src/i2c_master_slave_driver.rs
Line 151 in 50dd293
r.0
(i.e1
)?For more context, I'm in the process adding
libtock-rs
api support fori2c-master-slave
. I have basic communication working, but would be nice to patch up the kernel to also get the drivers to return transfer/read lengths back to userspace asr.0
. From my understanding, we need to change I2CHwMasterClient::command_complete() to have a length, then in the capsule pass this back to userspace. I suppose this also means we have to change all the drivers to do so too.What do you guys think about this? Is there a better way to get this information back to userspace? Is there a reason for this not be added etc...
Thanks!
The text was updated successfully, but these errors were encountered: