Displaying 1 result from an estimated 1 matches for "virtio_buf_show".
2019 Apr 29
1
[RFC-PATCH] Introducing virtio-example.
...p;sg_out;
+ request[1] = &sg_in;
+
+ /* add the request to the queue, in_buf is sent as the buffer idetifier */
+ virtqueue_add_sgs(vi->vq, request, 1, 1, &vi->in, GFP_KERNEL);
+
+ /* notify the device */
+ virtqueue_kick(vi->vq);
+
+ return count;
+}
+
+static ssize_t
+virtio_buf_show(struct device *dev, struct device_attribute *attr, char *buf)
+{
+ /* cast dev into a virtio_device */
+ struct virtio_device *vdev = dev_to_virtio(dev);
+ struct virtexample_info *vi = vdev->priv;
+
+ return sprintf(buf, "%d\n", vi->in);
+}
+
+/*
+ * struct device_attribut...