shithub: riscv

Download patch

ref: 5a460a150b60697933209f9196cbf9550b50d0eb
parent: ef5a8a7337a579a5247aaad83cbce55cf57e590a
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);
 	}
--