From: sf Date: Thu, 14 Jul 2016 12:44:53 +0000 (+0000) Subject: rename virtio_ops.intr to poll_intr X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=dc6fa26a88f5b4c7b14bcd31aa9d10164f87a954;p=openbsd rename virtio_ops.intr to poll_intr This describes more accurately what it is good for. Also introduce a virtio_poll_intr macro. --- 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*);