From e9d8560cf71d71fe59524ad78143d41632230838 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Tue, 1 Aug 1995 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1995-08-01 --- pc/devether.c | 12 +++++++----- pc/ether509.c | 6 +++++- pc/ether8390.c | 4 ++++ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/pc/devether.c b/pc/devether.c index 914a34f90b37cc14b867ab539ff518ce080c37e1..6a2632866c25fa390e15095e19edc81e30a5ac02 100644 --- a/pc/devether.c +++ b/pc/devether.c @@ -104,7 +104,7 @@ etherrloop(Ether *ctlr, Etherpkt *pkt, long len) { Block *bp; ushort type; - int i; + int i, n; Netfile *f, **fp, **ep; type = (pkt->type[0]<<8)|pkt->type[1]; @@ -117,12 +117,14 @@ etherrloop(Ether *ctlr, Etherpkt *pkt, long len) } else { if(qwindow(f->in) <= 0) continue; - if(len > 60) - len = 60; - bp = iallocb(len); + if(len > 64) + n = 64; + else + n = len; + bp = iallocb(n); if(bp == 0) continue; - memmove(bp->wp, pkt->d, len); + memmove(bp->wp, pkt->d, n); i = TK2MS(m->ticks); bp->wp[58] = len>>8; bp->wp[59] = len; diff --git a/pc/ether509.c b/pc/ether509.c index 16c4a8417c46ba610301dea1d7b94c6a85c07329..891beb2ac3444e353f09aeb6df617ca2cb7515ed 100644 --- a/pc/ether509.c +++ b/pc/ether509.c @@ -113,6 +113,7 @@ static void attach(Ether *ether) { ulong port; + int x; port = ether->port; /* @@ -124,7 +125,10 @@ attach(Ether *ether) * we will also see TxAvailable interrupts. * Disable Update interrupts for now. */ - COMMAND(port, SetRxFilter, Broadcast|MyEtherAddr); + x = Broadcast|MyEtherAddr; + if(ether->prom) + x |= Promiscuous; + COMMAND(port, SetRxFilter, x); COMMAND(port, SetReadZeroMask, (AllIntr|Latch) & ~Update); COMMAND(port, SetIntrMask, (AllIntr|Latch) & ~Update); COMMAND(port, RxEnable, 0); diff --git a/pc/ether8390.c b/pc/ether8390.c index ec0b8e0893c6b384ad36c4cc4f71850ed44d8279..5afd89b09a32a9ad471aaa3405ad0451b883e850 100644 --- a/pc/ether8390.c +++ b/pc/ether8390.c @@ -646,6 +646,7 @@ static void attach(Ether *ether) { Dp8390 *dp8390 = ether->ctlr; + int x; /* * Enable the chip for transmit/receive. @@ -653,6 +654,9 @@ attach(Ether *ether) * mode. Clear the missed-packet counter, it * increments while in monitor mode. */ + x = Ab; + if(ether->prom) + x |= Pro; slowoutb(dp8390->dp8390+Rcr, Ab); slowinb(dp8390->dp8390+Cntr2); }