summaryrefslogtreecommitdiff
path: root/sys/src/9/pc/ether8139.c
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@felloff.net>2018-10-07 22:28:21 +0200
committercinap_lenrek <cinap_lenrek@felloff.net>2018-10-07 22:28:21 +0200
commit9fec0e736081cd155afb6a413b7641b93faed519 (patch)
treea91f5bb3e967e97ddd00c727e0d2bfd65669f93d /sys/src/9/pc/ether8139.c
parent4d7c195804991b9c762f9a859679282c7014bbbb (diff)
pc drivers: use pcienable() to handle device power up and missing initialization
Diffstat (limited to 'sys/src/9/pc/ether8139.c')
-rw-r--r--sys/src/9/pc/ether8139.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/sys/src/9/pc/ether8139.c b/sys/src/9/pc/ether8139.c
index d62028ee0..21a1cad39 100644
--- a/sys/src/9/pc/ether8139.c
+++ b/sys/src/9/pc/ether8139.c
@@ -681,7 +681,7 @@ rtl8139match(Ether* edev, int id)
{
Pcidev *p;
Ctlr *ctlr;
- int i, port;
+ int port;
/*
* Any adapter matches if no edev->port is supplied,
@@ -701,20 +701,10 @@ rtl8139match(Ether* edev, int id)
print("rtl8139: port %#ux in use\n", port);
continue;
}
-
- if(pcigetpms(p) > 0){
- pcisetpms(p, 0);
-
- for(i = 0; i < 6; i++)
- pcicfgw32(p, PciBAR0+i*4, p->mem[i].bar);
- pcicfgw8(p, PciINTL, p->intl);
- pcicfgw8(p, PciLTR, p->ltr);
- pcicfgw8(p, PciCLS, p->cls);
- pcicfgw16(p, PciPCR, p->pcr);
- }
-
+ pcienable(p);
ctlr->port = port;
if(rtl8139reset(ctlr)) {
+ pcidisable(p);
iofree(port);
continue;
}