Permalink
Browse files

vioif: Implement quiesce

Signed-off-by: Alexey Zaytsev <alexey.zaytsev@gmail.com>
  • Loading branch information...
xl0 committed Aug 19, 2011
1 parent 6f2fed2 commit 73fdce5a126a75b0202a0c507d724e782ac5df2c
Showing with 14 additions and 1 deletion.
  1. +14 −1 virtio_net/vioif.c
View
@@ -176,6 +176,7 @@ struct virtio_net_ctrl_vlan {
uint16_t id;
} __packed;
+static int vioif_quiesce(dev_info_t *);
static int vioif_attach(dev_info_t *, ddi_attach_cmd_t);
static int vioif_detach(dev_info_t *, ddi_detach_cmd_t);
@@ -188,7 +189,7 @@ DDI_DEFINE_STREAM_OPS(vioif_ops,
NULL, /* cb_ops */
D_MP, /* bus_ops */
NULL, /* power */
- ddi_quiesce_not_supported /* quiesce */
+ vioif_quiesce /* quiesce */
);
static char vioif_ident[] = "VirtIO ethernet driver";
@@ -1503,6 +1504,18 @@ vioif_detach(dev_info_t *devinfo, ddi_detach_cmd_t cmd)
return (DDI_SUCCESS);
}
+static int
+vioif_quiesce(dev_info_t *devinfo)
+{
+ struct vioif_softc *sc = ddi_get_driver_private(devinfo);
+
+ virtio_stop_vq_intr(sc->sc_rx_vq);
+ virtio_stop_vq_intr(sc->sc_tx_vq);
+ virtio_device_reset(&sc->sc_virtio);
+
+ return (DDI_SUCCESS);
+}
+
int
_init(void)
{

0 comments on commit 73fdce5

Please sign in to comment.