shithub: riscv

Download patch

ref: 1a6d523d266b7c8d97d8557874f4571c6e4465f4
parent: b5659c09770b0bb617a9797e27cc6893a8eb6660
author: cinap_lenrek <[email protected]>
date: Mon Jun 17 22:00:05 EDT 2013

nusb/ether: fix asixwrite()

invert/shift in wrong order causing low 16 bits to be all ffff...

--- a/sys/src/cmd/nusb/ether/asix.c
+++ b/sys/src/cmd/nusb/ether/asix.c
@@ -242,9 +242,12 @@
 static void
 asixwrite(Dev *ep, uchar *p, int n)
 {
+	uint hd;
+
 	if(n > sizeof(bout)-8)
 		n = sizeof(bout)-8;
-	PUT4(bout, n | ~(n<<16));
+	hd = n | (n<<16)^0xFFFF0000;
+	PUT4(bout, hd);
 	memmove(bout+4, p, n);
 	n += 4;
 	if((n % ep->maxpkt) == 0){