ref: ceb77cedf2f3b72df2b5e7aedbf460252d1b0dcb
parent: 2a9c92cbbe25a74042713d9d48c73c69b3e723dc
parent: 43c17be65ab86b88d8e17a0bf2bffa9c253f86f2
author: ppatience0 <ppatience0@gmail.com>
date: Fri Apr 12 14:39:12 EDT 2013
merge
--- a/sys/src/9/pc/etheriwl.c
+++ b/sys/src/9/pc/etheriwl.c
@@ -2268,6 +2268,7 @@
case 0x4237: /* Wifi Link 5100 AGN */
case 0x0085: /* Centrino Advanced-N 6205 */
case 0x422b: /* Centrino Ultimate-N 6300 */
+ case 0x08ae: /* Centrino Wireless-N 100 */
break;
}
--- a/sys/src/9/pc/pci.c
+++ b/sys/src/9/pc/pci.c
@@ -666,6 +666,7 @@
{ 0x8086, 0x3a48, pIIxget, pIIxset }, /* Intel 82801JI */ { 0x8086, 0x2916, pIIxget, pIIxset }, /* Intel 82801? */ { 0x8086, 0x1c02, pIIxget, pIIxset }, /* Intel 6 Series/C200 */+ { 0x8086, 0x1e53, pIIxget, pIIxset }, /* Intel 7 Series/C216 */ { 0x8086, 0x2810, pIIxget, pIIxset }, /* Intel 82801HB/HR (ich8/r) */ { 0x8086, 0x2812, pIIxget, pIIxset }, /* Intel 82801HH (ich8dh) */ { 0x8086, 0x2912, pIIxget, pIIxset }, /* Intel 82801ih ich9dh */--- a/sys/src/9/port/usbehci.c
+++ b/sys/src/9/port/usbehci.c
@@ -2150,14 +2150,17 @@
if(count <= Align - sizeof(Td)){td->data = td->sbuff;
td->buff = nil;
- }else
- td->data = td->buff = smalloc(Tdmaxpkt);
+ } else if(count <= 0x4000){+ td->buff = td->data = smalloc(count);
+ } else {+ td->buff = smalloc(count + 0x1000);
+ td->data = (uchar*)ROUND((uintptr)td->buff, 0x1000);
+ }
pa = PADDR(td->data);
for(i = 0; i < nelem(td->buffer); i++){td->buffer[i] = pa;
- if(i > 0)
- td->buffer[i] &= ~0xFFF;
+ pa &= ~0xFFF;
pa += 0x1000;
}
td->ndata = count;
@@ -2435,10 +2438,14 @@
io->toggle = td->csw & Tddata1;
coherence();
}
- tot += td->ndata;
- if(c != nil && (td->csw & Tdtok) == Tdtokin && td->ndata > 0){- memmove(c, td->data, td->ndata);
- c += td->ndata;
+ if((n = td->ndata) > 0 && tot < count){+ if((tot + n) > count)
+ n = count - tot;
+ if(c != nil && (td->csw & Tdtok) == Tdtokin){+ memmove(c, td->data, n);
+ c += n;
+ }
+ tot += n;
}
}
ntd = td->next;
@@ -2455,8 +2462,6 @@
return 0; /* that's our convention */
if(err != nil)
error(err);
- if(tot < 0)
- error(Eio);
return tot;
}
@@ -2725,10 +2730,11 @@
td = itdalloc();
td->data = iso->data + i * 8 * iso->maxsize;
pa = PADDR(td->data) & ~0xFFF;
- for(p = 0; p < 8; p++)
- td->buffer[i] = pa + p * 0x1000;
- td->buffer[0] = PADDR(iso->data) & ~0xFFF |
- ep->nb << Itdepshift | ep->dev->nb << Itddevshift;
+ for(p = 0; p < nelem(td->buffer); p++){+ td->buffer[p] = pa;
+ pa += 0x1000;
+ }
+ td->buffer[0] |= ep->nb << Itdepshift | ep->dev->nb << Itddevshift;
if(ep->mode == OREAD)
td->buffer[1] |= Itdin;
else
--- a/sys/src/cmd/9nfs/fns.h
+++ b/sys/src/cmd/9nfs/fns.h
@@ -39,7 +39,7 @@
void srvinit(int, char*, char*);
char* strfind(char*);
int string2S(void*, String*);
-int strparse(void*, int, char**);
+int strparse(char*, int, char**);
void strprint(int);
char* strstore(char*);
Waitmsg *system(char*, char**);
--- a/sys/src/cmd/9nfs/mkfile
+++ b/sys/src/cmd/9nfs/mkfile
@@ -1,5 +1,4 @@
</$objtype/mkfile
-CFLAGS=-FVw
TARG=nfsserver\
portmapper\
--- a/sys/src/cmd/ndb/dnresolve.c
+++ b/sys/src/cmd/ndb/dnresolve.c
@@ -1404,7 +1404,6 @@
pcntprob = likely[qp->type];
reqtm = (patient? 2 * Maxreqtm: Maxreqtm);
wait = weight(reqtm / 3, pcntprob); /* time for one udp query */
- qp->req->aborttime = timems() + 3*wait; /* for all udp queries */
qp->udpfd = fd;
rv = queryns(qp, depth, ibuf, obuf, wait, inns);
--- a/sys/src/cmd/postscript/common/mkfile
+++ b/sys/src/cmd/postscript/common/mkfile
@@ -7,7 +7,6 @@
glob.$O\
misc.$O\
request.$O\
- rune.$O\
tempnam.$O\
getopt.$O\
@@ -15,8 +14,7 @@
gen.h\
ext.h\
request.h\
- path.h\
- rune.h\
+ path.h
</sys/src/cmd/mklib
--- a/sys/src/cmd/postscript/common/rune.c
+++ /dev/null
@@ -1,203 +1,0 @@
-#include "rune.h"
-
-enum
-{- Bit1 = 7,
- Bitx = 6,
- Bit2 = 5,
- Bit3 = 4,
- Bit4 = 3,
- Bit5 = 2,
-
- T1 = ((1<<(Bit1+1))-1) ^ 0xFF, /* 0000 0000 */
- Tx = ((1<<(Bitx+1))-1) ^ 0xFF, /* 1000 0000 */
- T2 = ((1<<(Bit2+1))-1) ^ 0xFF, /* 1100 0000 */
- T3 = ((1<<(Bit3+1))-1) ^ 0xFF, /* 1110 0000 */
- T4 = ((1<<(Bit4+1))-1) ^ 0xFF, /* 1111 0000 */
- T5 = ((1<<(Bit5+1))-1) ^ 0xFF, /* 1111 1000 */
-
- Rune1 = (1<<(Bit1+0*Bitx))-1, /* 0000 0000 0000 0000 0111 1111 */
- Rune2 = (1<<(Bit2+1*Bitx))-1, /* 0000 0000 0000 0111 1111 1111 */
- Rune3 = (1<<(Bit3+2*Bitx))-1, /* 0000 0000 1111 1111 1111 1111 */
- Rune4 = (1<<(Bit4+3*Bitx))-1, /* 0011 1111 1111 1111 1111 1111 */
-
- Maskx = (1<<Bitx)-1, /* 0011 1111 */
- Testx = Maskx ^ 0xFF, /* 1100 0000 */
-
- Bad = Runeerror,
-};
-
-int
-chartorune(Rune *rune, char *str)
-{- int c, c1, c2, c3;
- long l;
-
- /*
- * one character sequence
- * 00000-0007F => T1
- */
- c = *(unsigned char*)str;
- if(c < Tx) {- *rune = c;
- return 1;
- }
-
- /*
- * two character sequence
- * 0080-07FF => T2 Tx
- */
- c1 = *(unsigned char*)(str+1) ^ Tx;
- if(c1 & Testx)
- goto bad;
- if(c < T3) {- if(c < T2)
- goto bad;
- l = ((c << Bitx) | c1) & Rune2;
- if(l <= Rune1)
- goto bad;
- *rune = l;
- return 2;
- }
-
- /*
- * three character sequence
- * 0800-FFFF => T3 Tx Tx
- */
- c2 = *(unsigned char*)(str+2) ^ Tx;
- if(c2 & Testx)
- goto bad;
- if(c < T4) {- l = ((((c << Bitx) | c1) << Bitx) | c2) & Rune3;
- if(l <= Rune2)
- goto bad;
- *rune = l;
- return 3;
- }
-
- /*
- * four character sequence
- * 10000-10FFFF => T4 Tx Tx Tx
- */
- if(UTFmax >= 4) {- c3 = *(unsigned char*)(str+3) ^ Tx;
- if(c3 & Testx)
- goto bad;
- if(c < T5) {- l = ((((((c << Bitx) | c1) << Bitx) | c2) << Bitx) | c3) & Rune4;
- if(l <= Rune3)
- goto bad;
- if(l > Runemax)
- goto bad;
- *rune = l;
- return 4;
- }
- }
-
- /*
- * bad decoding
- */
-bad:
- *rune = Bad;
- return 1;
-}
-
-int
-runetochar(char *str, Rune *rune)
-{- long c;
-
- c = *rune;
- if(c > Runemax)
- c = Runeerror;
-
- /*
- * one character sequence
- * 00000-0007F => 00-7F
- */
- if(c <= Rune1) {- str[0] = c;
- return 1;
- }
-
- /*
- * two character sequence
- * 0080-07FF => T2 Tx
- */
- if(c <= Rune2) {- str[0] = T2 | (c >> 1*Bitx);
- str[1] = Tx | (c & Maskx);
- return 2;
- }
-
- /*
- * three character sequence
- * 0800-FFFF => T3 Tx Tx
- */
- if(c <= Rune3) {- str[0] = T3 | (c >> 2*Bitx);
- str[1] = Tx | ((c >> 1*Bitx) & Maskx);
- str[2] = Tx | (c & Maskx);
- return 3;
- }
-
- /*
- * four character sequence
- * 10000-1FFFFF => T4 Tx Tx Tx
- */
- str[0] = T4 | (c >> 3*Bitx);
- str[1] = Tx | ((c >> 2*Bitx) & Maskx);
- str[2] = Tx | ((c >> 1*Bitx) & Maskx);
- str[3] = Tx | (c & Maskx);
- return 4;
-}
-
-int
-runelen(long c)
-{- Rune rune;
- char str[UTFmax];
-
- rune = c;
- return runetochar(str, &rune);
-}
-
-int
-runenlen(Rune *r, int nrune)
-{- int nb, c;
-
- nb = 0;
- while(nrune--) {- c = *r++;
- if(c <= Rune1)
- nb++;
- else
- if(c <= Rune2)
- nb += 2;
- else
- if(c <= Rune3 || c > Runemax)
- nb += 3;
- else
- nb += 4;
- }
- return nb;
-}
-
-int
-fullrune(char *str, int n)
-{- int c;
-
- if(n <= 0)
- return 0;
- c = *(unsigned char*)str;
- if(c < Tx)
- return 1;
- if(c < T3)
- return n >= 2;
- if(UTFmax == 3 || c < T4)
- return n >= 3;
- return n >= 4;
-}
-
--- a/sys/src/cmd/postscript/common/rune.h
+++ /dev/null
@@ -1,20 +1,0 @@
-/*
- *
- * Rune declarations - for supporting UTF encoding.
- *
- */
-
-#define RUNELIB 1
-
-#ifdef RUNELIB
-typedef unsigned short Rune;
-
-enum
-{- UTFmax = 3, /* maximum bytes per rune */
- Runesync = 0x80, /* cannot represent part of a utf sequence (<) */
- Runeself = 0x80, /* rune and utf sequences are the same (<) */
- Runeerror = 0xFFFD, /* decoding error in utf */
- Runemax = 0xFFFF, /* 16 bit rune */
-};
-#endif
--- a/sys/src/libauth/auth_chuid.c
+++ b/sys/src/libauth/auth_chuid.c
@@ -10,7 +10,7 @@
{int rv, fd;
- if(ai == nil || ai->cap == nil){+ if(ai == nil || ai->cap == nil || ai->cap[0] == 0){ werrstr("no capability");return -1;
}
--
⑨