git: 9front

Download patch

ref: 5f1541a6052d2a084eeed4107e829473f7b3a206
parent: 64ac95ab9322cd7472f48c0e3d60733308f88ab0
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Fri Jan 3 04:24:18 EST 2025

nusb/ether: dont break lan78xx chip (rpi3b+)

The rpi3b+ uses different chip lan78xx.
This one does not append fcs in received frames,
so the previous change broke ethernet.

--- a/sys/src/cmd/nusb/ether/lan78xx.c
+++ b/sys/src/cmd/nusb/ether/lan78xx.c
@@ -252,11 +252,10 @@
 			break;
 		if((hd & Rxerror) == 0){
 			if(n == BLEN(b)){
-				b->wp -= 4;
 				etheriq(b);
 				return 0;
 			}
-			etheriq(copyblock(b, n - 4));
+			etheriq(copyblock(b, n));
 		}
 		b->rp = (uchar*)(((uintptr)b->rp + n + 3)&~3);
 	}
--