* Check the KBC command byte for kbd disable bit during keyboard probe and clean
it in case it was set "on". * Tracing added for the case of ignoring interrupt with not active OBF status bit. Fixes #7973 #6313 git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@42820 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -278,8 +278,11 @@ ps2_interrupt(void* cookie)
|
|||||||
ps2_dev *dev;
|
ps2_dev *dev;
|
||||||
|
|
||||||
ctrl = ps2_read_ctrl();
|
ctrl = ps2_read_ctrl();
|
||||||
if (!(ctrl & PS2_STATUS_OUTPUT_BUFFER_FULL))
|
if (!(ctrl & PS2_STATUS_OUTPUT_BUFFER_FULL)) {
|
||||||
|
TRACE("ps2: ps2_interrupt unhandled, OBF bit unset, ctrl 0x%02x (%s)\n",
|
||||||
|
ctrl, (ctrl & PS2_STATUS_AUX_DATA) ? "aux" : "keyb");
|
||||||
return B_UNHANDLED_INTERRUPT;
|
return B_UNHANDLED_INTERRUPT;
|
||||||
|
}
|
||||||
|
|
||||||
if (atomic_get(&sIgnoreInterrupts)) {
|
if (atomic_get(&sIgnoreInterrupts)) {
|
||||||
TRACE("ps2: ps2_interrupt ignoring, ctrl 0x%02x (%s)\n", ctrl,
|
TRACE("ps2: ps2_interrupt ignoring, ctrl 0x%02x (%s)\n", ctrl,
|
||||||
|
|||||||
@@ -289,6 +289,24 @@ probe_keyboard(void)
|
|||||||
// return B_ERROR;
|
// return B_ERROR;
|
||||||
// }
|
// }
|
||||||
|
|
||||||
|
// Some controllers set the disble keyboard command bit to "on" after resetting
|
||||||
|
// the keyboard device. Read #7973 #6313 for more details.
|
||||||
|
// So check the command byte now and re-enable the keyboard if it is the case.
|
||||||
|
uint8 cmdbyte = 0;
|
||||||
|
status = ps2_command(PS2_CTRL_READ_CMD, NULL, 0, &cmdbyte, 1);
|
||||||
|
|
||||||
|
if (status != B_OK) {
|
||||||
|
INFO("ps2: cannot read CMD byte on kbd probe:0x%#08lx\n", status);
|
||||||
|
} else
|
||||||
|
if ((cmdbyte & PS2_BITS_KEYBOARD_DISABLED) == PS2_BITS_KEYBOARD_DISABLED) {
|
||||||
|
cmdbyte &= ~PS2_BITS_KEYBOARD_DISABLED;
|
||||||
|
status = ps2_command(PS2_CTRL_WRITE_CMD, &cmdbyte, 1, NULL, 0);
|
||||||
|
if (status != B_OK) {
|
||||||
|
INFO("ps2: cannot write 0x%02x to CMD byte on kbd probe:0x%08lx\n",
|
||||||
|
cmdbyte, status);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user