]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/src/9/pc/ethervt6105m.c
[9front] [PATCH] audiohda: add PCI ID for Intel C610/X99
[plan9front.git] / sys / src / 9 / pc / ethervt6105m.c
index 10c047d5db9c11b063a3f56e994cf35159e7c145..c0f513b52ca3ec9650b3d5f1aa1b16c1d04bede5 100644 (file)
 #include "dat.h"
 #include "fns.h"
 #include "io.h"
+#include "../port/pci.h"
 #include "../port/error.h"
 #include "../port/netif.h"
 #include "../port/etherif.h"
-
-#include "ethermii.h"
+#include "../port/ethermii.h"
 
 enum {
        Par0            = 0x00,                 /* Ethernet Address */
@@ -1113,7 +1113,7 @@ vt6105Mpci(void)
 {
        Pcidev *p;
        Ctlr *ctlr;
-       int cls, port;
+       int port;
 
        p = nil;
        while(p = pcimatch(p, 0, 0)){
@@ -1127,7 +1127,7 @@ vt6105Mpci(void)
                        break;
                }
 
-               port = p->mem[0].bar & ~0x01;
+               port = p->mem[0].bar & ~3;
                if(ioalloc(port, p->mem[0].size, 0, "vt6105M") < 0){
                        print("vt6105M: port 0x%uX in use\n", port);
                        continue;
@@ -1140,10 +1140,9 @@ vt6105Mpci(void)
                }
                ctlr->port = port;
                ctlr->pcidev = p;
+               pcienable(p);
                ctlr->id = (p->did<<16)|p->vid;
-               if((cls = pcicfgr8(p, PciCLS)) == 0 || cls == 0xFF)
-                       cls = 0x10;
-               ctlr->cls = cls*4;
+               ctlr->cls = p->cls*4;
                ctlr->tft = CtftSAF;
 
                if(vt6105Mreset(ctlr)){