diff options
author | joerg <joerg@FreeBSD.org> | 1996-05-11 23:16:23 +0000 |
---|---|---|
committer | joerg <joerg@FreeBSD.org> | 1996-05-11 23:16:23 +0000 |
commit | 439981bb46ed6ddca9124f5e1ea8f24453732972 (patch) | |
tree | 461c63f060b0e7a70bb48bb99abc9c97680b5083 /sys/isa | |
parent | 324cb686d3d54b8549afe3d7b81a3727b677b86f (diff) | |
download | FreeBSD-src-439981bb46ed6ddca9124f5e1ea8f24453732972.zip FreeBSD-src-439981bb46ed6ddca9124f5e1ea8f24453732972.tar.gz |
Give up waiting for a successful keyboard reset after some
unreasonable time. I've got a PCI mainboard that simply doesn't grok
it, so continuing with a warning (and a keyboard that's working
nevertheless :) seems to be better than spin-looping forever.
Diffstat (limited to 'sys/isa')
-rw-r--r-- | sys/isa/syscons.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/sys/isa/syscons.c b/sys/isa/syscons.c index d95ec3d..b968da5 100644 --- a/sys/isa/syscons.c +++ b/sys/isa/syscons.c @@ -25,7 +25,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: syscons.c,v 1.146 1996/05/01 03:58:21 bde Exp $ + * $Id: syscons.c,v 1.147 1996/05/02 21:47:50 ache Exp $ */ #include "sc.h" @@ -204,7 +204,7 @@ mask2attr(struct term_stat *term) static int scprobe(struct isa_device *dev) { - int i, retries = 5; + int i, j, retries = 5; unsigned char val; /* Enable interrupts and keyboard controller */ @@ -236,15 +236,17 @@ gotres: if (!retries) printf("scprobe: keyboard won't accept RESET command\n"); else { + i = 10; /* At most 10 retries. */ gotack: DELAY(10); - while ((inb(KB_STAT) & KB_BUF_FULL) == 0) DELAY(10); + j = 1000; /* Wait at most 10 ms (supposedly). */ + while ((inb(KB_STAT) & KB_BUF_FULL) == 0 && --j > 0) DELAY(10); DELAY(10); val = inb(KB_DATA); - if (val == KB_ACK) + if (val == KB_ACK && --i > 0) goto gotack; if (val != KB_RESET_DONE) - printf("scprobe: keyboard RESET failed %02x\n", val); + printf("scprobe: keyboard RESET failed (result = 0x%02x)\n", val); } #ifdef XT_KEYBOARD kbd_wait(); |