Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove the now unneeded virtio_init

Just call virtio_register_ints before accessging the device-specific registers
  • Loading branch information...
commit 942fe5354d4d5fc1cda0b9dfe594e3bc576028ba 1 parent 1d2fd2d
@xl0 authored
View
6 virtio/virtio.c
@@ -76,12 +76,6 @@
#define MINSEG_INDIRECT 2 /* use indirect if nsegs >= this value */
void
-virtio_init(struct virtio_softc *sc)
-{
- sc->sc_config_offset = VIRTIO_CONFIG_DEVICE_CONFIG_NOMSI;
-}
-
-void
virtio_set_status(struct virtio_softc *sc, int status)
{
int old = 0;
View
1  virtio/virtiovar.h
@@ -155,7 +155,6 @@ struct virtio_int_handler {
/* public interface */
-void virtio_init(struct virtio_softc *sc);
uint32_t virtio_negotiate_features(struct virtio_softc *, uint32_t);
size_t virtio_show_features(uint32_t features, char *buffer, size_t len);
boolean_t virtio_has_feature(struct virtio_softc *sc, uint32_t feature);
View
13 virtio_blk/vioblk.c
@@ -900,7 +900,6 @@ vioblk_attach(dev_info_t *devinfo, ddi_attach_cmd_t cmd)
ddi_set_driver_private(devinfo, sc);
vsc = &sc->sc_virtio;
- virtio_init(vsc);
/* Duplicate for faster access / less typing */
sc->sc_dev = devinfo;
@@ -971,6 +970,11 @@ vioblk_attach(dev_info_t *devinfo, ddi_attach_cmd_t cmd)
virtio_set_status(&sc->sc_virtio, VIRTIO_CONFIG_DEVICE_STATUS_ACK);
virtio_set_status(&sc->sc_virtio, VIRTIO_CONFIG_DEVICE_STATUS_DRIVER);
+ if (vioblk_register_ints(sc)) {
+ dev_err(devinfo, CE_WARN, "Unable to add interrupt");
+ goto exit_int;
+ }
+
ret = vioblk_dev_features(sc);
if (ret)
goto exit_features;
@@ -1057,13 +1061,6 @@ vioblk_attach(dev_info_t *devinfo, ddi_attach_cmd_t cmd)
sc->sc_nblks, sc->sc_blk_size, sc->sc_size_max,
vioblk_bd_dma_attr.dma_attr_sgllen);
- /*
- * Establish interrupt handler.
- */
- if (vioblk_register_ints(sc)) {
- dev_err(devinfo, CE_WARN, "Unable to add interrupt");
- goto exit_int;
- }
sc->sc_vq = virtio_alloc_vq(&sc->sc_virtio, 0, 0,
sc->sc_seg_max, "I/O request");
View
2  virtio_net/vioif.c
@@ -1298,8 +1298,6 @@ vioif_attach(dev_info_t *devinfo, ddi_attach_cmd_t cmd)
vsc = &sc->sc_virtio;
- virtio_init(vsc);
-
/* Duplicate for faster access / less typing */
sc->sc_dev = devinfo;
vsc->sc_dev = devinfo;
Please sign in to comment.
Something went wrong with that request. Please try again.