On 13-10-21, 12:07, Jie Deng wrote:
The "VIRTIO_I2C_FLAGS_M_RD" is consistent with the permissions of the buffer.
Yes.
When this flag is set, the buffer is also marked as device write -only with VIRTQ_DESC_F_WRITE set.
Yes.
So if this feature isn't available we can use the the latter. We only need this flag when there is no buffer.
Which means that we need to carry extra piece of code for the same work (with no benefit as it will never happen, everyone will support this flag as all the implementations are new currently). This is exactly what we are trying to avoid by making this feature mandatory, drivers will be expected to set/clear this flag all the time.
We don't want to have code like this anywhere:
if (feature) read flag... else read permissions...