~kris/9p

9hist

efd425b3c80a87c71d38abcc0f08332ec86cfa45 — David du Colombier 31 years ago 3df7ddf
Plan 9 from Bell Labs 1995-01-14
2 files changed, 19 insertions(+), 18 deletions(-)

M carrera/devether.c
M pc/devi82365.c
M carrera/devether.c => carrera/devether.c +7 -4
@@ 703,14 703,15 @@ etherloop(Etherpkt *p, long n)
	int s, different;
	ushort t;
	Netfile *f, **fp;
	Ether *ctlr = ether[0];

	different = memcmp(p->d, p->s, sizeof(p->s));
	if(different && memcmp(p->d, ether[0]->bcast, sizeof(p->d)))
	different = memcmp(p->d, ctlr->ea, sizeof(ctlr->ea));
	if(different && memcmp(p->d, ctlr->bcast, sizeof(p->d)))
		return 0;

	s = splhi();
	t = (p->type[0]<<8) | p->type[1];
	for(fp = ether[0]->f; fp < &ether[0]->f[Ntypes]; fp++) {
	for(fp = ctlr->f; fp < &ctlr->f[Ntypes]; fp++) {
		f = *fp;
		if(f == 0)
			continue;


@@ 745,6 746,9 @@ etherwrite(Chan *c, void *buf, long n, ulong offset)
	if(n > ETHERMAXTU)
		error(Ebadarg);

	p = buf;
	memmove(p->s, ctlr->ea, sizeof(ctlr->ea));

	/* we handle data */
	if(etherloop(buf, n))
		return n;


@@ 767,7 771,6 @@ etherwrite(Chan *c, void *buf, long n, ulong offset)
			memset(p->d+n, 0, 60-n);
			n = 60;
		}
		memmove(p->s, ctlr->ea, sizeof(ctlr->ea));
		sonicswap(p, n);

		txpkt = &ctlr->tda[ctlr->th];

M pc/devi82365.c => pc/devi82365.c +12 -14
@@ 1059,23 1059,21 @@ iospaces(Slot *pp)
	int i;
	ulong address, len;

	for(;;){
		if(readc(pp, &c) != 1)
			break;
	if(readc(pp, &c) != 1)
		return;

		pp->nioregs = 1<<(c&0x1f);
		pp->bit16 = ((c>>5)&3) >= 2;
		if((c & 0x80) == 0)
			break;
	pp->nioregs = 1<<(c&0x1f);
	pp->bit16 = ((c>>5)&3) >= 2;
	if((c & 0x80) == 0)
		return;

		if(readc(pp, &c) != 1)
			break;
	if(readc(pp, &c) != 1)
		return;

		for(i = (c&0xf)+1; i; i--){
			address = getlong(pp, (c>>4)&0x3);
			len = getlong(pp, (c>>6)&0x3);
			USED(address, len);
		}
	for(i = (c&0xf)+1; i; i--){
		address = getlong(pp, (c>>4)&0x3);
		len = getlong(pp, (c>>6)&0x3);
		USED(address, len);
	}
}