devkbd: bits bad! revert repeat/delay, better patches welcome
This commit is contained in:
parent
d3512f60df
commit
4756cf549a
1 changed files with 4 additions and 30 deletions
|
@ -40,14 +40,12 @@ enum {
|
||||||
Qdir,
|
Qdir,
|
||||||
Qscancode,
|
Qscancode,
|
||||||
Qleds,
|
Qleds,
|
||||||
Qrepeat,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static Dirtab kbdtab[] = {
|
static Dirtab kbdtab[] = {
|
||||||
".", {Qdir, 0, QTDIR}, 0, 0555,
|
".", {Qdir, 0, QTDIR}, 0, 0555,
|
||||||
"scancode", {Qscancode, 0}, 0, 0440,
|
"scancode", {Qscancode, 0}, 0, 0440,
|
||||||
"leds", {Qleds, 0}, 0, 0220,
|
"leds", {Qleds, 0}, 0, 0220,
|
||||||
"repeat", {Qrepeat, 0}, 0, 0220,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
static Lock i8042lock;
|
static Lock i8042lock;
|
||||||
|
@ -195,28 +193,6 @@ setleds(int leds)
|
||||||
iunlock(&i8042lock);
|
iunlock(&i8042lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
setrepeat(int repeat)
|
|
||||||
{
|
|
||||||
if(nokbd)
|
|
||||||
return;
|
|
||||||
|
|
||||||
repeat &= 0x7f;
|
|
||||||
ilock(&i8042lock);
|
|
||||||
for(;;){
|
|
||||||
if(outready() < 0)
|
|
||||||
break;
|
|
||||||
outb(Data, 0xf3); /* `set typematic rate and delay' */
|
|
||||||
if(outready() < 0)
|
|
||||||
break;
|
|
||||||
outb(Data, repeat);
|
|
||||||
if(outready() < 0)
|
|
||||||
break;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
iunlock(&i8042lock);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* keyboard interrupt
|
* keyboard interrupt
|
||||||
*/
|
*/
|
||||||
|
@ -381,18 +357,16 @@ kbdwrite(Chan *c, void *a, long n, vlong)
|
||||||
{
|
{
|
||||||
char tmp[8+1], *p;
|
char tmp[8+1], *p;
|
||||||
|
|
||||||
|
if(c->qid.path != Qleds)
|
||||||
|
error(Egreg);
|
||||||
|
|
||||||
p = tmp + n;
|
p = tmp + n;
|
||||||
if(n >= sizeof(tmp))
|
if(n >= sizeof(tmp))
|
||||||
p = tmp + sizeof(tmp)-1;
|
p = tmp + sizeof(tmp)-1;
|
||||||
memmove(tmp, a, p - tmp);
|
memmove(tmp, a, p - tmp);
|
||||||
*p = 0;
|
*p = 0;
|
||||||
|
|
||||||
if(c->qid.path == Qleds)
|
setleds(atoi(tmp));
|
||||||
setleds(atoi(tmp));
|
|
||||||
else if(c->qid.path == Qrepeat)
|
|
||||||
setrepeat(atoi(tmp));
|
|
||||||
else
|
|
||||||
error(Egreg);
|
|
||||||
|
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue