#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"
{
Pcidev *p;
Ctlr *ctlr;
- int cls, port;
+ int port;
p = nil;
while(p = pcimatch(p, 0, 0)){
break;
}
- port = p->mem[0].bar & ~0x01;
+ port = p->mem[0].bar & ~3;
if(ioalloc(port, p->mem[0].size, 0, "vt6102") < 0){
print("vt6102: port 0x%uX in use\n", port);
continue;
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 = Ctft64;
if(vt6102reset(ctlr)){