summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcinap_lenrek <cinap_lenrek@gmx.de>2013-06-18 02:00:05 +0200
committercinap_lenrek <cinap_lenrek@gmx.de>2013-06-18 02:00:05 +0200
commit1a6d523d266b7c8d97d8557874f4571c6e4465f4 (patch)
tree6ebe0a3e6d6914fe3dab4f437b88585d0464cbde
parentb5659c09770b0bb617a9797e27cc6893a8eb6660 (diff)
nusb/ether: fix asixwrite()
invert/shift in wrong order causing low 16 bits to be all ffff...
-rw-r--r--sys/src/cmd/nusb/ether/asix.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/src/cmd/nusb/ether/asix.c b/sys/src/cmd/nusb/ether/asix.c
index 2b8f507ea..4bef7121e 100644
--- a/sys/src/cmd/nusb/ether/asix.c
+++ b/sys/src/cmd/nusb/ether/asix.c
@@ -242,9 +242,12 @@ asixread(Dev *ep, uchar *p, int plen)
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){