diff options
-rw-r--r-- | sys/dev/syscons/syscons.c | 25 | ||||
-rw-r--r-- | sys/dev/syscons/syscons.h | 3 | ||||
-rw-r--r-- | sys/i386/isa/syscons.c | 25 | ||||
-rw-r--r-- | sys/i386/isa/syscons.h | 3 | ||||
-rw-r--r-- | sys/isa/syscons.c | 25 | ||||
-rw-r--r-- | sys/isa/syscons.h | 3 |
6 files changed, 60 insertions, 24 deletions
diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c index e38ec37..d326ebe 100644 --- a/sys/dev/syscons/syscons.c +++ b/sys/dev/syscons/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.182 1996/10/26 20:16:58 sos Exp $ + * $Id: syscons.c,v 1.183 1996/11/04 21:01:08 sos Exp $ */ #include "sc.h" @@ -295,6 +295,7 @@ static int scprobe(struct isa_device *dev) { int i, j, retries = 5; + int xt_keyboard = 0; u_char val; /* Enable interrupts and keyboard controller */ @@ -341,13 +342,23 @@ gotack: goto fail; } } + /* + * Allow us to set the XT_KEYBD flag in UserConfig so that keyboards + * such as those on the IBM ThinkPad laptop computers can be used + * with the standard console driver. + */ + if ( dev->id_flags & XT_KEYBD ) + xt_keyboard = 1; #ifdef XT_KEYBOARD - kbd_wait(); - outb(KB_DATA, 0xF0); - kbd_wait(); - outb(KB_DATA, 1); - kbd_wait(); -#endif /* XT_KEYBOARD */ + xt_keyboard = 1; +#endif + if ( xt_keyboard ) { + kbd_wait(); + outb(KB_DATA, 0xF0); + kbd_wait(); + outb(KB_DATA, 1); + kbd_wait(); + } succeed: return (IO_KBDSIZE); diff --git a/sys/dev/syscons/syscons.h b/sys/dev/syscons/syscons.h index 2a724f4..19a3d67 100644 --- a/sys/dev/syscons/syscons.h +++ b/sys/dev/syscons/syscons.h @@ -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.h,v 1.22 1996/10/18 18:51:37 sos Exp $ + * $Id: syscons.h,v 1.23 1996/10/23 07:29:44 pst Exp $ */ #ifndef _I386_ISA_SYSCONS_H_ @@ -70,6 +70,7 @@ #define BLINK_CURSOR 0x00002 #define CHAR_CURSOR 0x00004 #define DETECT_KBD 0x00008 +#define XT_KEYBD 0x00010 /* attribute flags */ #define NORMAL_ATTR 0x00 diff --git a/sys/i386/isa/syscons.c b/sys/i386/isa/syscons.c index e38ec37..d326ebe 100644 --- a/sys/i386/isa/syscons.c +++ b/sys/i386/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.182 1996/10/26 20:16:58 sos Exp $ + * $Id: syscons.c,v 1.183 1996/11/04 21:01:08 sos Exp $ */ #include "sc.h" @@ -295,6 +295,7 @@ static int scprobe(struct isa_device *dev) { int i, j, retries = 5; + int xt_keyboard = 0; u_char val; /* Enable interrupts and keyboard controller */ @@ -341,13 +342,23 @@ gotack: goto fail; } } + /* + * Allow us to set the XT_KEYBD flag in UserConfig so that keyboards + * such as those on the IBM ThinkPad laptop computers can be used + * with the standard console driver. + */ + if ( dev->id_flags & XT_KEYBD ) + xt_keyboard = 1; #ifdef XT_KEYBOARD - kbd_wait(); - outb(KB_DATA, 0xF0); - kbd_wait(); - outb(KB_DATA, 1); - kbd_wait(); -#endif /* XT_KEYBOARD */ + xt_keyboard = 1; +#endif + if ( xt_keyboard ) { + kbd_wait(); + outb(KB_DATA, 0xF0); + kbd_wait(); + outb(KB_DATA, 1); + kbd_wait(); + } succeed: return (IO_KBDSIZE); diff --git a/sys/i386/isa/syscons.h b/sys/i386/isa/syscons.h index 2a724f4..19a3d67 100644 --- a/sys/i386/isa/syscons.h +++ b/sys/i386/isa/syscons.h @@ -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.h,v 1.22 1996/10/18 18:51:37 sos Exp $ + * $Id: syscons.h,v 1.23 1996/10/23 07:29:44 pst Exp $ */ #ifndef _I386_ISA_SYSCONS_H_ @@ -70,6 +70,7 @@ #define BLINK_CURSOR 0x00002 #define CHAR_CURSOR 0x00004 #define DETECT_KBD 0x00008 +#define XT_KEYBD 0x00010 /* attribute flags */ #define NORMAL_ATTR 0x00 diff --git a/sys/isa/syscons.c b/sys/isa/syscons.c index e38ec37..d326ebe 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.182 1996/10/26 20:16:58 sos Exp $ + * $Id: syscons.c,v 1.183 1996/11/04 21:01:08 sos Exp $ */ #include "sc.h" @@ -295,6 +295,7 @@ static int scprobe(struct isa_device *dev) { int i, j, retries = 5; + int xt_keyboard = 0; u_char val; /* Enable interrupts and keyboard controller */ @@ -341,13 +342,23 @@ gotack: goto fail; } } + /* + * Allow us to set the XT_KEYBD flag in UserConfig so that keyboards + * such as those on the IBM ThinkPad laptop computers can be used + * with the standard console driver. + */ + if ( dev->id_flags & XT_KEYBD ) + xt_keyboard = 1; #ifdef XT_KEYBOARD - kbd_wait(); - outb(KB_DATA, 0xF0); - kbd_wait(); - outb(KB_DATA, 1); - kbd_wait(); -#endif /* XT_KEYBOARD */ + xt_keyboard = 1; +#endif + if ( xt_keyboard ) { + kbd_wait(); + outb(KB_DATA, 0xF0); + kbd_wait(); + outb(KB_DATA, 1); + kbd_wait(); + } succeed: return (IO_KBDSIZE); diff --git a/sys/isa/syscons.h b/sys/isa/syscons.h index 2a724f4..19a3d67 100644 --- a/sys/isa/syscons.h +++ b/sys/isa/syscons.h @@ -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.h,v 1.22 1996/10/18 18:51:37 sos Exp $ + * $Id: syscons.h,v 1.23 1996/10/23 07:29:44 pst Exp $ */ #ifndef _I386_ISA_SYSCONS_H_ @@ -70,6 +70,7 @@ #define BLINK_CURSOR 0x00002 #define CHAR_CURSOR 0x00004 #define DETECT_KBD 0x00008 +#define XT_KEYBD 0x00010 /* attribute flags */ #define NORMAL_ATTR 0x00 |