]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/src/9/pc/ethervirtio10.c
virtio: set FeaturesOk flag after feature negotiation, and enable queues before Drive...
[plan9front.git] / sys / src / 9 / pc / ethervirtio10.c
index 03108cad92d9d5559c1300e1f28a30d935192070..2f38f860520902cd9175729f37810de2674ed602 100644 (file)
@@ -40,7 +40,7 @@ enum {
        Sacknowledge = 1,
        Sdriver = 2,
        Sdriverok = 4,
-       Sfeatureok = 8,
+       Sfeaturesok = 8,
        Sfailed = 128,
 
        /* flags in Qnetstatus */
@@ -466,14 +466,15 @@ attach(Ether* edev)
        }
        ctlr->attached = 1;
 
-       /* driver is ready */
-       ctlr->cfg->status |= Sdriverok;
-
        /* enable the queues */
        for(i = 0; i < ctlr->nqueue; i++){
                ctlr->cfg->queuesel = i;
                ctlr->cfg->queueenable = 1;
        }
+
+       /* driver is ready */
+       ctlr->cfg->status |= Sdriverok;
+
        iunlock(ctlr);
 
        /* start kprocs */
@@ -692,6 +693,8 @@ pciprobe(void)
                cfg->drvfeatsel = 0;
                cfg->drvfeat = c->feat[0] & (Fmac|Fctrlvq|Fctrlrx);
 
+               cfg->status |= Sfeaturesok;
+
                for(i=0; i<nelem(c->queue); i++){
                        cfg->queuesel = i;
                        n = cfg->queuesize;