merge
This commit is contained in:
commit
8214a7f84f
10 changed files with 25 additions and 244 deletions
|
@ -2268,6 +2268,7 @@ iwlpci(void)
|
|||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -666,6 +666,7 @@ static Bridge southbridges[] = {
|
|||
{ 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 */
|
||||
|
|
|
@ -2150,14 +2150,17 @@ epgettd(Qio *io, int flags, void *a, int count, int maxpkt)
|
|||
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 @@ epio(Ep *ep, Qio *io, void *a, long count, int mustlock)
|
|||
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 @@ epio(Ep *ep, Qio *io, void *a, long count, int mustlock)
|
|||
return 0; /* that's our convention */
|
||||
if(err != nil)
|
||||
error(err);
|
||||
if(tot < 0)
|
||||
error(Eio);
|
||||
return tot;
|
||||
}
|
||||
|
||||
|
@ -2725,10 +2730,11 @@ isohsinit(Ep *ep, Isoio *iso)
|
|||
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
|
||||
|
|
|
@ -39,7 +39,7 @@ void showauth(Auth*);
|
|||
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**);
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
</$objtype/mkfile
|
||||
CFLAGS=-FVw
|
||||
|
||||
TARG=nfsserver\
|
||||
portmapper\
|
||||
|
|
|
@ -1404,7 +1404,6 @@ udpquery(Query *qp, char *mntpt, int depth, int patient, int inns)
|
|||
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);
|
||||
|
|
|
@ -7,7 +7,6 @@ OFILES=bbox.$O\
|
|||
glob.$O\
|
||||
misc.$O\
|
||||
request.$O\
|
||||
rune.$O\
|
||||
tempnam.$O\
|
||||
getopt.$O\
|
||||
|
||||
|
@ -15,8 +14,7 @@ HFILES=comments.h\
|
|||
gen.h\
|
||||
ext.h\
|
||||
request.h\
|
||||
path.h\
|
||||
rune.h\
|
||||
path.h
|
||||
|
||||
</sys/src/cmd/mklib
|
||||
|
||||
|
|
|
@ -1,203 +0,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;
|
||||
}
|
||||
|
|
@ -1,20 +0,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
|
|
@ -10,7 +10,7 @@ auth_chuid(AuthInfo *ai, char *ns)
|
|||
{
|
||||
int rv, fd;
|
||||
|
||||
if(ai == nil || ai->cap == nil){
|
||||
if(ai == nil || ai->cap == nil || ai->cap[0] == 0){
|
||||
werrstr("no capability");
|
||||
return -1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue