git: 9front

Download patch

ref: 39739554b2c955d897cccb9cfbe9c355ef0f81c3
parent: aba471da9b56ca4573a4cde49797dbbe5768b1e0
author: cinap_lenrek <cinap_lenrek@gmx.de>
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){
--