]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/src/9/pc/etheryuk.c
[9front] [PATCH] audiohda: add PCI ID for Intel C610/X99
[plan9front.git] / sys / src / 9 / pc / etheryuk.c
index a14bf6b5fb550d0bfdd9c5e82631e72f0c4a9342..fca2933299e72f8d498a7231196eb5fac16ac441 100644 (file)
@@ -8,6 +8,7 @@
 #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"
@@ -680,7 +681,7 @@ struct Ctlr {
        uchar   rev;
        uchar   nports;
        uchar   portno;
-       uintptr io;
+       uvlong  io;
        uchar   *reg8;
        ushort  *reg16;
        uint    *reg;
@@ -2129,10 +2130,12 @@ setup(Ctlr *c)
        Pcidev *p;
 
        p = c->p;
+       if(p->mem[0].bar & 1)
+               return -1;
        c->io = p->mem[0].bar&~0xf;
        mem = vmap(c->io, p->mem[0].size);
        if(mem == nil){
-               print("yuk: cant map %#p\n", c->io);
+               print("yuk: cant map %llux\n", c->io);
                return -1;
        }
        pcienable(p);