OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

virtio-dev message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Re: [virtio-comment] [PATCH v4] virtio-i2c: add the device specification

On 2020/11/12 16:54, Michael S. Tsirkin wrote:
On Thu, Nov 12, 2020 at 09:51:17AM +0800, Jie Deng wrote:
On 2020/11/10 18:59, Paolo Bonzini wrote:
On 10/11/20 11:33, Michael S. Tsirkin wrote:
Sorry I didn't reply last week, but I really would prefer if virtio-i2c
supported write-read transactions.
And I think an easier way is to allow multi-segment transactions
probably using the stop flag.
You cannot always be sure that the host would support them (with the
exception of write+read transactions, which are pretty much universal),
so you would also need to describe what the host features are.


Then I will send v5 to support write+read transactions using Paolo's
I think we may have a simple version merged first and then improve it
to the actual needs.

Thank you.
I frankly don't get it, you put read/write flags there even though they
are not needed, saying it's intended to mirror Linux, then don't want to
put STOP there even though this is exactly what Linux has ...

Personally, I intended to mirror the Linux "i2c_msg" to have following interface.

struct virtio_i2c_req {
ÂÂÂÂÂÂÂ le16 addr;
ÂÂÂÂÂÂÂ le16 flags;
ÂÂÂÂÂÂÂ le16 len;
ÂÂÂÂÂÂÂ u8 buf[];
ÂÂÂÂÂÂÂ u8 status;


I intended to implement the standard rules for I2C transactions
(no I2C_FUNC_PROTOCOL_MANGLING) for the first step. So in the
v1~v3 only the "I2C_M_RD" was used and other bits of the flags were reserved.

For me, I intend to mirror the "i2c_msg" from the Linux completely.

I learned about Michael also intends to keep above interface but want to
remove some unnecessary bit (e.g. I2C_M_RD) from the flags (Correct me if not right).

Paolo prefers following interface without flags.

struct virtio_i2c_req {
	le16 addr;
	le16 written;
	le16 read;
	u8 bufwrite[];
	u8 status;
	u8 bufread[];

So Michael and Paolo, I hope we can agree on the interface first.

Any suggestions ?


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]