On 2020/10/29 4:10, Paolo Bonzini wrote:
On 27/10/20 07:00, Jie Deng wrote:
+The driver queues requests to the virtqueue, and they are used by the
+device. The request is the representation of one segment of an I2C
+transaction. Each request is of form:
+
+\begin{lstlisting}
+struct virtio_i2c_req {
+ le16 addr;
+ le16 flags;
+ le16 len;
+ u8 buf[];
+ u8 status;
+};
+\end{lstlisting}
Hi,
one extremely common two-segment I2C transaction is not reproducible
with virtio-i2c. This is when a write is followed by a read: the master
starts off the transmission with a write, then sends a second START,
then continues with a read from the same address.
Would it make sense to define the request like
struct virtio_i2c_req {
le16 addr;
le16 written;
le16 read;
u8 bufwrite[];
u8 status;
u8 bufread[];
};
instead?
Thanks,
Paolo
Hi Paolo,
I'm not sure why this two-segment I2C transaction is not reproducible ?
my understanding is that we don't need to care about the
START/STOP/RESTART conditions
between virtio-i2c frontend and backend. These conditions only make
sense when data
is exchanged between master and slave devices, rather than virtio
frontend and backend.
Only the backend may need to consider these conditions when doing device
emulation and
exchanging data with its slave devices. It has nothing to do with the
frontend.
Is my understanding correct ?
Thanks
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]