diff options
author | Stefan Fritsch <sf@cvs.openbsd.org> | 2016-07-14 12:44:54 +0000 |
---|---|---|
committer | Stefan Fritsch <sf@cvs.openbsd.org> | 2016-07-14 12:44:54 +0000 |
commit | af01d50f5d7dc6795bf64873d78f136b0d8791fe (patch) | |
tree | d599287dc8c8d38bf3a1f8ff4f72fa886b8d9fc5 /sys/dev | |
parent | a18979ab65170a9e4459b52db1249570c75cb174 (diff) |
rename virtio_ops.intr to poll_intr
This describes more accurately what it is good for.
Also introduce a virtio_poll_intr macro.
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/pci/vioblk.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/vioscsi.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/virtiovar.h | 5 |
3 files changed, 7 insertions, 6 deletions
diff --git a/sys/dev/pci/vioblk.c b/sys/dev/pci/vioblk.c index 24cd1c776bf..947f8739c12 100644 --- a/sys/dev/pci/vioblk.c +++ b/sys/dev/pci/vioblk.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vioblk.c,v 1.10 2016/07/14 12:42:00 sf Exp $ */ +/* $OpenBSD: vioblk.c,v 1.11 2016/07/14 12:44:53 sf Exp $ */ /* * Copyright (c) 2012 Stefan Fritsch. @@ -460,7 +460,7 @@ vioblk_scsi_cmd(struct scsi_xfer *xs) timeout = 1000; do { - if (vsc->sc_ops->intr(vsc) && vr->vr_len == VIOBLK_DONE) + if (virtio_poll_intr(vsc) && vr->vr_len == VIOBLK_DONE) break; delay(1000); diff --git a/sys/dev/pci/vioscsi.c b/sys/dev/pci/vioscsi.c index 2b5db4264d8..a267051b019 100644 --- a/sys/dev/pci/vioscsi.c +++ b/sys/dev/pci/vioscsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vioscsi.c,v 1.4 2016/07/14 12:42:00 sf Exp $ */ +/* $OpenBSD: vioscsi.c,v 1.5 2016/07/14 12:44:53 sf Exp $ */ /* * Copyright (c) 2013 Google Inc. * @@ -250,7 +250,7 @@ vioscsi_scsi_cmd(struct scsi_xfer *xs) DPRINTF("vioscsi_scsi_cmd: polling...\n"); int timeout = 1000; do { - vsc->sc_ops->intr(vsc); + virtio_poll_intr(vsc); if (vr->vr_xs != xs) break; delay(1000); diff --git a/sys/dev/pci/virtiovar.h b/sys/dev/pci/virtiovar.h index 4a817bc2b23..337ec6a859e 100644 --- a/sys/dev/pci/virtiovar.h +++ b/sys/dev/pci/virtiovar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: virtiovar.h,v 1.7 2016/07/14 12:42:00 sf Exp $ */ +/* $OpenBSD: virtiovar.h,v 1.8 2016/07/14 12:44:53 sf Exp $ */ /* $NetBSD: virtiovar.h,v 1.1 2011/10/30 12:12:21 hannken Exp $ */ /* @@ -148,7 +148,7 @@ struct virtio_ops { void (*setup_queue)(struct virtio_softc *, uint16_t, uint32_t); void (*set_status)(struct virtio_softc *, int); uint32_t (*neg_features)(struct virtio_softc *, uint32_t, const struct virtio_feature_name *); - int (*intr)(void *); + int (*poll_intr)(void *); }; #define VIRTIO_CHILD_ERROR ((void*)1) @@ -186,6 +186,7 @@ struct virtio_softc { #define virtio_read_queue_size(sc, i) (sc)->sc_ops->read_queue_size(sc, i) #define virtio_setup_queue(sc, i, v) (sc)->sc_ops->setup_queue(sc, i, v) #define virtio_negotiate_features(sc, f, n) (sc)->sc_ops->neg_features(sc, f, n) +#define virtio_poll_intr(sc) (sc)->sc_ops->poll_intr(sc) int virtio_alloc_vq(struct virtio_softc*, struct virtqueue*, int, int, int, const char*); |