ps2mouse: retry disable packet streaming command 0xf5
disabling mouse packet streaming command 0xf5 can fail when a packet is currently transmitted. this can be seen when one moves the mouse while running: while(){echo accelerated >/dev/mousectl; sleep 0.5}
This commit is contained in:
parent
e56affb840
commit
d1be5e163c
1 changed files with 11 additions and 1 deletions
|
@ -260,9 +260,19 @@ resetmouse(void)
|
|||
static void
|
||||
setstream(int on)
|
||||
{
|
||||
int i;
|
||||
|
||||
switch(mousetype){
|
||||
case MousePS2:
|
||||
i8042auxcmd(on ? 0xF4 : 0xF5);
|
||||
/*
|
||||
* disabling streaming can fail when
|
||||
* a packet is currently transmitted.
|
||||
*/
|
||||
for(i=0; i<4; i++){
|
||||
if(i8042auxcmd(on ? 0xF4 : 0xF5) != -1)
|
||||
break;
|
||||
delay(50);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue