patch-2.1.115 linux/arch/mips/sni/hw-access.c

Next file: linux/arch/mips/sni/int-handler.S
Previous file: linux/arch/mips/sgi/kernel/setup.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.114/linux/arch/mips/sni/hw-access.c linux/arch/mips/sni/hw-access.c
@@ -1,4 +1,5 @@
-/*
+/* $Id: hw-access.c,v 1.5 1998/05/07 00:39:56 ralf Exp $
+ *
  * Low-level hardware access stuff for SNI RM200 PCI
  *
  * This file is subject to the terms and conditions of the GNU General Public
@@ -6,8 +7,6 @@
  * for more details.
  *
  * Copyright (C) 1996, 1997, 1998 by Ralf Baechle
- *
- * $Id: hw-access.c,v 1.4 1998/05/01 01:35:32 ralf Exp $
  */
 #include <linux/delay.h>
 #include <linux/init.h>
@@ -163,6 +162,8 @@
 	rtc_write_data
 };
 
+#define KBD_STAT_IBF		0x02	/* Keyboard input buffer full */
+
 static unsigned char sni_read_input(void)
 {
 	return inb(KBD_DATA_REG);
@@ -170,11 +171,21 @@
 
 static void sni_write_output(unsigned char val)
 {
+	int status;
+
+	do {
+		status = inb(KBD_CNTL_REG);
+	} while (status & KBD_STAT_IBF);
 	outb(val, KBD_DATA_REG);
 }
 
 static void sni_write_command(unsigned char val)
 {
+	int status;
+
+	do {
+		status = inb(KBD_CNTL_REG);
+	} while (status & KBD_STAT_IBF);
 	outb(val, KBD_CNTL_REG);
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov