#include "io.h"
#include "../port/error.h"
#include "../port/netif.h"
-#include "etherif.h"
+#include "../port/etherif.h"
enum {
IoSize = 0x10, /* port pool size */
bp->wp++;
}
- etheriq(ether, bp, 1);
+ etheriq(ether, bp);
ether->inpackets++;
outs(port + MmuCmd, McRelease);
}
return 0;
ctlr = ether->ctlr;
- p = malloc(READSTR);
s = 0;
if (ctlr->rev > 0) {
}
}
+ p = smalloc(READSTR);
len = snprint(p, READSTR, "rev: 91c%s\n", (s) ? s : "???");
len += snprint(p + len, READSTR - len, "rxovrn: %uld\n", ctlr->rovrn);
len += snprint(p + len, READSTR - len, "lcar: %uld\n", ctlr->lcar);
return -1;
}
- ether->ctlr = malloc(sizeof(Smc91xx));
- ctlr = ether->ctlr;
+ ctlr = malloc(sizeof(Smc91xx));
if (ctlr == 0) {
+ print("smc: can't allocate memory\n");
iofree(ether->port);
pcmspecialclose(slot);
return -1;
}
+ ether->ctlr = ctlr;
ilock(ctlr);
ctlr->rev = 0;
ether->attach = attach;
ether->transmit = transmit;
- ether->interrupt = interrupt;
ether->ifstat = ifstat;
ether->promiscuous = promiscuous;
ether->multicast = multicast;
ether->arg = ether;
+
iunlock(ctlr);
+
+ intrenable(ether->irq, interrupt, ether, ether->tbdf, ether->name);
+
return 0;
}