@@ -111,20 +111,37 @@ static uint32_t rproc_virtio_negotiate_features(struct virtio_device *vdev,
111111static void rproc_virtio_read_config (struct virtio_device * vdev ,
112112 uint32_t offset , void * dst , int length )
113113{
114- (void )vdev ;
115- (void )offset ;
116- (void )dst ;
117- (void )length ;
114+ struct remoteproc_virtio * rpvdev ;
115+ struct fw_rsc_vdev * vdev_rsc ;
116+ struct metal_io_region * io ;
117+ char * config ;
118+
119+ rpvdev = metal_container_of (vdev , struct remoteproc_virtio , vdev );
120+ vdev_rsc = rpvdev -> vdev_rsc ;
121+ config = (char * )(& vdev_rsc -> vring [vdev -> vrings_num ]);
122+ io = rpvdev -> vdev_rsc_io ;
123+ metal_io_block_read (io ,
124+ metal_io_virt_to_offset (io , config + offset ),
125+ dst , length );
118126}
119127
120128#ifndef VIRTIO_SLAVE_ONLY
121129static void rproc_virtio_write_config (struct virtio_device * vdev ,
122130 uint32_t offset , void * src , int length )
123131{
124- (void )vdev ;
125- (void )offset ;
126- (void )src ;
127- (void )length ;
132+ struct remoteproc_virtio * rpvdev ;
133+ struct fw_rsc_vdev * vdev_rsc ;
134+ struct metal_io_region * io ;
135+ char * config ;
136+
137+ rpvdev = metal_container_of (vdev , struct remoteproc_virtio , vdev );
138+ vdev_rsc = rpvdev -> vdev_rsc ;
139+ config = (char * )(& vdev_rsc -> vring [vdev -> vrings_num ]);
140+ io = rpvdev -> vdev_rsc_io ;
141+ metal_io_block_write (io ,
142+ metal_io_virt_to_offset (io , config + offset ),
143+ src , length );
144+ rpvdev -> notify (rpvdev -> priv , vdev -> notifyid );
128145}
129146
130147static void rproc_virtio_reset_device (struct virtio_device * vdev )
0 commit comments