This commit is contained in:
ppatience0 2013-04-12 18:39:12 -04:00
commit 8214a7f84f
10 changed files with 25 additions and 244 deletions

View file

@ -2268,6 +2268,7 @@ iwlpci(void)
case 0x4237: /* Wifi Link 5100 AGN */ case 0x4237: /* Wifi Link 5100 AGN */
case 0x0085: /* Centrino Advanced-N 6205 */ case 0x0085: /* Centrino Advanced-N 6205 */
case 0x422b: /* Centrino Ultimate-N 6300 */ case 0x422b: /* Centrino Ultimate-N 6300 */
case 0x08ae: /* Centrino Wireless-N 100 */
break; break;
} }

View file

@ -666,6 +666,7 @@ static Bridge southbridges[] = {
{ 0x8086, 0x3a48, pIIxget, pIIxset }, /* Intel 82801JI */ { 0x8086, 0x3a48, pIIxget, pIIxset }, /* Intel 82801JI */
{ 0x8086, 0x2916, pIIxget, pIIxset }, /* Intel 82801? */ { 0x8086, 0x2916, pIIxget, pIIxset }, /* Intel 82801? */
{ 0x8086, 0x1c02, pIIxget, pIIxset }, /* Intel 6 Series/C200 */ { 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, 0x2810, pIIxget, pIIxset }, /* Intel 82801HB/HR (ich8/r) */
{ 0x8086, 0x2812, pIIxget, pIIxset }, /* Intel 82801HH (ich8dh) */ { 0x8086, 0x2812, pIIxget, pIIxset }, /* Intel 82801HH (ich8dh) */
{ 0x8086, 0x2912, pIIxget, pIIxset }, /* Intel 82801ih ich9dh */ { 0x8086, 0x2912, pIIxget, pIIxset }, /* Intel 82801ih ich9dh */

View file

@ -2150,14 +2150,17 @@ epgettd(Qio *io, int flags, void *a, int count, int maxpkt)
if(count <= Align - sizeof(Td)){ if(count <= Align - sizeof(Td)){
td->data = td->sbuff; td->data = td->sbuff;
td->buff = nil; td->buff = nil;
}else } else if(count <= 0x4000){
td->data = td->buff = smalloc(Tdmaxpkt); td->buff = td->data = smalloc(count);
} else {
td->buff = smalloc(count + 0x1000);
td->data = (uchar*)ROUND((uintptr)td->buff, 0x1000);
}
pa = PADDR(td->data); pa = PADDR(td->data);
for(i = 0; i < nelem(td->buffer); i++){ for(i = 0; i < nelem(td->buffer); i++){
td->buffer[i] = pa; td->buffer[i] = pa;
if(i > 0) pa &= ~0xFFF;
td->buffer[i] &= ~0xFFF;
pa += 0x1000; pa += 0x1000;
} }
td->ndata = count; td->ndata = count;
@ -2435,10 +2438,14 @@ epio(Ep *ep, Qio *io, void *a, long count, int mustlock)
io->toggle = td->csw & Tddata1; io->toggle = td->csw & Tddata1;
coherence(); coherence();
} }
tot += td->ndata; if((n = td->ndata) > 0 && tot < count){
if(c != nil && (td->csw & Tdtok) == Tdtokin && td->ndata > 0){ if((tot + n) > count)
memmove(c, td->data, td->ndata); n = count - tot;
c += td->ndata; if(c != nil && (td->csw & Tdtok) == Tdtokin){
memmove(c, td->data, n);
c += n;
}
tot += n;
} }
} }
ntd = td->next; ntd = td->next;
@ -2455,8 +2462,6 @@ epio(Ep *ep, Qio *io, void *a, long count, int mustlock)
return 0; /* that's our convention */ return 0; /* that's our convention */
if(err != nil) if(err != nil)
error(err); error(err);
if(tot < 0)
error(Eio);
return tot; return tot;
} }
@ -2725,10 +2730,11 @@ isohsinit(Ep *ep, Isoio *iso)
td = itdalloc(); td = itdalloc();
td->data = iso->data + i * 8 * iso->maxsize; td->data = iso->data + i * 8 * iso->maxsize;
pa = PADDR(td->data) & ~0xFFF; pa = PADDR(td->data) & ~0xFFF;
for(p = 0; p < 8; p++) for(p = 0; p < nelem(td->buffer); p++){
td->buffer[i] = pa + p * 0x1000; td->buffer[p] = pa;
td->buffer[0] = PADDR(iso->data) & ~0xFFF | pa += 0x1000;
ep->nb << Itdepshift | ep->dev->nb << Itddevshift; }
td->buffer[0] |= ep->nb << Itdepshift | ep->dev->nb << Itddevshift;
if(ep->mode == OREAD) if(ep->mode == OREAD)
td->buffer[1] |= Itdin; td->buffer[1] |= Itdin;
else else

View file

@ -39,7 +39,7 @@ void showauth(Auth*);
void srvinit(int, char*, char*); void srvinit(int, char*, char*);
char* strfind(char*); char* strfind(char*);
int string2S(void*, String*); int string2S(void*, String*);
int strparse(void*, int, char**); int strparse(char*, int, char**);
void strprint(int); void strprint(int);
char* strstore(char*); char* strstore(char*);
Waitmsg *system(char*, char**); Waitmsg *system(char*, char**);

View file

@ -1,5 +1,4 @@
</$objtype/mkfile </$objtype/mkfile
CFLAGS=-FVw
TARG=nfsserver\ TARG=nfsserver\
portmapper\ portmapper\

View file

@ -1404,7 +1404,6 @@ udpquery(Query *qp, char *mntpt, int depth, int patient, int inns)
pcntprob = likely[qp->type]; pcntprob = likely[qp->type];
reqtm = (patient? 2 * Maxreqtm: Maxreqtm); reqtm = (patient? 2 * Maxreqtm: Maxreqtm);
wait = weight(reqtm / 3, pcntprob); /* time for one udp query */ wait = weight(reqtm / 3, pcntprob); /* time for one udp query */
qp->req->aborttime = timems() + 3*wait; /* for all udp queries */
qp->udpfd = fd; qp->udpfd = fd;
rv = queryns(qp, depth, ibuf, obuf, wait, inns); rv = queryns(qp, depth, ibuf, obuf, wait, inns);

View file

@ -7,7 +7,6 @@ OFILES=bbox.$O\
glob.$O\ glob.$O\
misc.$O\ misc.$O\
request.$O\ request.$O\
rune.$O\
tempnam.$O\ tempnam.$O\
getopt.$O\ getopt.$O\
@ -15,8 +14,7 @@ HFILES=comments.h\
gen.h\ gen.h\
ext.h\ ext.h\
request.h\ request.h\
path.h\ path.h
rune.h\
</sys/src/cmd/mklib </sys/src/cmd/mklib

View file

@ -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;
}

View file

@ -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

View file

@ -10,7 +10,7 @@ auth_chuid(AuthInfo *ai, char *ns)
{ {
int rv, fd; int rv, fd;
if(ai == nil || ai->cap == nil){ if(ai == nil || ai->cap == nil || ai->cap[0] == 0){
werrstr("no capability"); werrstr("no capability");
return -1; return -1;
} }