From b7e5bbedc1cbd6aedd99c189afdb7931371853da Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Sat, 2 Jul 1994 00:00:00 +0000 Subject: [PATCH] Plan 9 from Bell Labs 1994-07-02 --- pc/devether.c | 17 +++++++++-------- pc/devvga.c | 8 ++++---- pc/etherif.h | 2 +- 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/pc/devether.c b/pc/devether.c index f7ac3e9bf45f7dff8200961cf7ba4f5c02fb4f30..72c7fc4aed2a266c2a22e99ee663fdcb31074d85 100644 --- a/pc/devether.c +++ b/pc/devether.c @@ -95,7 +95,7 @@ etherwstat(Chan *c, char *dp) } void -etherrloop(Ether *ctlr, Etherpkt *pkt, long len) +etherrloop(Ether *ctlr, Etherpkt *pkt, long len, int tome) { ushort type; Netfile *f, **fp, **ep; @@ -103,7 +103,7 @@ etherrloop(Ether *ctlr, Etherpkt *pkt, long len) type = (pkt->type[0]<<8)|pkt->type[1]; ep = &ctlr->f[Ntypes]; for(fp = ctlr->f; fp < ep; fp++){ - if((f = *fp) && (f->type == type || f->type < 0)) + if((f = *fp) && ((tome && f->type==type) || f->type < 0)) qproduce(f->in, pkt->d, len); } } @@ -111,17 +111,18 @@ etherrloop(Ether *ctlr, Etherpkt *pkt, long len) static int etherwloop(Ether *ctlr, Etherpkt *pkt, long len) { - int s, different; + int s, tome, bcast; - different = memcmp(pkt->d, pkt->s, sizeof(pkt->s)); - if(different && memcmp(pkt->d, ctlr->bcast, sizeof(pkt->d)) - && ctlr->prom==0 && ctlr->all==0) + tome = memcmp(pkt->d, ctlr->ea, sizeof(pkt->d)) == 0; + bcast = memcmp(pkt->d, ctlr->bcast, sizeof(pkt->d)) == 0; + if(!tome && !bcast && ctlr->prom==0 && ctlr->all==0) return 0; s = splhi(); - etherrloop(ctlr, pkt, len); + etherrloop(ctlr, pkt, len, tome||bcast); splx(s); - return !different; + + return tome; } long diff --git a/pc/devvga.c b/pc/devvga.c index 33f6a81be04253475e3f227d1ccf23c900ae452d..c555edc49df5f82adacc6090cb161bab928f21a8 100644 --- a/pc/devvga.c +++ b/pc/devvga.c @@ -217,8 +217,8 @@ vgaread(Chan *c, void *buf, long n, ulong offset) return readstr(offset, buf, n, cbuf); case Qvgaiob: port = offset; - if(checkvgaport(port, n)) - error(Eperm); + /*if(checkvgaport(port, n)) + error(Eperm);*/ for(cp = buf; port < offset+n; port++) *cp++ = vgai(port); return n; @@ -330,8 +330,8 @@ vgawrite(Chan *c, void *buf, long n, ulong offset) return n; case Qvgaiob: port = offset; - if(checkvgaport(port, n)) - error(Eperm); + /*if(checkvgaport(port, n)) + error(Eperm);*/ for(cp = buf; port < offset+n; port++) vgao(port, *cp++); return n; diff --git a/pc/etherif.h b/pc/etherif.h index 05fe578bb45a23df776536771fd9ee07296b9f65..0e59ba96fd6f34d0027614e53dbc372ed75b7523 100644 --- a/pc/etherif.h +++ b/pc/etherif.h @@ -22,7 +22,7 @@ struct Ether { Netif; }; -extern void etherrloop(Ether*, Etherpkt*, long); +extern void etherrloop(Ether*, Etherpkt*, long, int); extern void addethercard(char*, int(*)(Ether*)); /*