summaryrefslogtreecommitdiff
path: root/sys/src/9/pc/ethervirtio.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2018-10-07 23:38:41 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2018-10-07 23:38:41 +0200
commitc458216121d622858916387071cd9c13df31820a (patch)
tree13eb82ccfd7a9ad61b527a585a117ed5f86989b3 /sys/src/9/pc/ethervirtio.c
parent9fec0e736081cd155afb6a413b7641b93faed519 (diff)
pc drivers: more pci cleanup
Diffstat (limited to 'sys/src/9/pc/ethervirtio.c')
-rw-r--r--sys/src/9/pc/ethervirtio.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/src/9/pc/ethervirtio.c b/sys/src/9/pc/ethervirtio.c
index 99241f28e..eb1fa98c1 100644
--- a/sys/src/9/pc/ethervirtio.c
+++ b/sys/src/9/pc/ethervirtio.c
@@ -470,6 +470,7 @@ shutdown(Ether* edev)
{
Ctlr *ctlr = edev->ctlr;
outb(ctlr->port+Qstatus, 0);
+ pciclrbme(ctlr->pcidev);
}
static void
@@ -577,6 +578,7 @@ pciprobe(int typ)
c->typ = typ;
c->pcidev = p;
+ pcienable(p);
c->id = (p->did<<16)|p->vid;
/* ยง3.1.2 Legacy Device Initialization */
@@ -603,6 +605,7 @@ pciprobe(int typ)
}
if(i < 2){
print("ethervirtio: no queues\n");
+ pcidisable(p);
free(c);
continue;
}
@@ -626,9 +629,8 @@ reset(Ether* edev)
Ctlr *ctlr;
int i;
- if(ctlrhead == nil) {
+ if(ctlrhead == nil)
ctlrhead = pciprobe(1);
- }
for(ctlr = ctlrhead; ctlr != nil; ctlr = ctlr->next){
if(ctlr->active)
@@ -668,6 +670,7 @@ reset(Ether* edev)
edev->promiscuous = promiscuous;
}
+ pcisetbme(ctlr->pcidev);
intrenable(edev->irq, interrupt, edev, edev->tbdf, edev->name);
return 0;