Displaying 2 results from an estimated 2 matches for "virtio_data_read".
2007 Dec 21
0
[kvm-devel] [Virtio-for-kvm] [PATCH 2/13] [Mostly resend] virtio additions
...eof(random_data));
+ /* There should always be room for one buffer. */
+ if (vq->vq_ops->add_buf(vq, &sg, 0, 1, &random_data) != 0)
+ BUG();
+ vq->vq_ops->kick(vq);
+}
+
+static int virtio_data_present(struct hwrng *rng)
+{
+ return have_data;
+}
+
+static int virtio_data_read(struct hwrng *rng, u32 *data)
+{
+ BUG_ON(!have_data);
+ *data = random_data;
+
+ have_data = false;
+ register_buffer();
+ return sizeof(*data);
+}
+
+static struct hwrng virtio_hwrng = {
+ .name = "virtio",
+ .data_present = virtio_data_present,
+ .data_read = vi...
2007 Dec 21
0
[kvm-devel] [Virtio-for-kvm] [PATCH 2/13] [Mostly resend] virtio additions
...eof(random_data));
+ /* There should always be room for one buffer. */
+ if (vq->vq_ops->add_buf(vq, &sg, 0, 1, &random_data) != 0)
+ BUG();
+ vq->vq_ops->kick(vq);
+}
+
+static int virtio_data_present(struct hwrng *rng)
+{
+ return have_data;
+}
+
+static int virtio_data_read(struct hwrng *rng, u32 *data)
+{
+ BUG_ON(!have_data);
+ *data = random_data;
+
+ have_data = false;
+ register_buffer();
+ return sizeof(*data);
+}
+
+static struct hwrng virtio_hwrng = {
+ .name = "virtio",
+ .data_present = virtio_data_present,
+ .data_read = vi...