diff options
author | Jason Wright <jason@cvs.openbsd.org> | 2002-01-25 03:24:54 +0000 |
---|---|---|
committer | Jason Wright <jason@cvs.openbsd.org> | 2002-01-25 03:24:54 +0000 |
commit | 8fd40781e9157c26315a13657f21a53da243a39e (patch) | |
tree | 0793c33e8b85d1d09c0dfacbddcb603068d1a711 /sys/arch/sparc64/dev/comkbd_ebus.c | |
parent | 75bde044c48199d317a5b7caf35a986602dc4e17 (diff) |
move the scancode -> wskbd event map into a seperate file... more still
to move, though.
Diffstat (limited to 'sys/arch/sparc64/dev/comkbd_ebus.c')
-rw-r--r-- | sys/arch/sparc64/dev/comkbd_ebus.c | 159 |
1 files changed, 6 insertions, 153 deletions
diff --git a/sys/arch/sparc64/dev/comkbd_ebus.c b/sys/arch/sparc64/dev/comkbd_ebus.c index f65d91f397e..a26779f7750 100644 --- a/sys/arch/sparc64/dev/comkbd_ebus.c +++ b/sys/arch/sparc64/dev/comkbd_ebus.c @@ -1,4 +1,4 @@ -/* $OpenBSD: comkbd_ebus.c,v 1.1 2002/01/24 15:54:37 jason Exp $ */ +/* $OpenBSD: comkbd_ebus.c,v 1.2 2002/01/25 03:24:53 jason Exp $ */ /* * Copyright (c) 2002 Jason L. Wright (jason@thought.net) @@ -56,162 +56,15 @@ #include <dev/wscons/wsksymdef.h> #include <dev/wscons/wsksymvar.h> +#include <dev/sun/sunkbdreg.h> +#include <dev/sun/sunkbdvar.h> + #include <dev/ic/comreg.h> #include <dev/ic/comvar.h> #include <dev/ic/ns16550reg.h> #include <dev/cons.h> -/* keyboard commands (host->kbd) */ -#define SKBD_CMD_RESET 0x01 -#define SKBD_CMD_BELLON 0x02 -#define SKBD_CMD_BELLOFF 0x03 -#define SKBD_CMD_CLICKON 0x0a -#define SKBD_CMD_CLICKOFF 0x0b -#define SKBD_CMD_SETLED 0x0e -#define SKBD_CMD_LAYOUT 0x0f - -/* keyboard responses (kbd->host) */ -#define SKBD_RSP_RESET_OK 0x04 /* normal reset status */ -#define SKBD_RSP_IDLE 0x7f /* no keys down */ -#define SKBD_RSP_LAYOUT 0xfe /* layout follows */ -#define SKBD_RSP_RESET 0xff /* reset status follows */ - -#define SKBD_LED_NUMLOCK 0x01 -#define SKBD_LED_COMPOSE 0x02 -#define SKBD_LED_SCROLLLOCK 0x04 -#define SKBD_LED_CAPSLOCK 0x08 - -#define SKBD_STATE_RESET 0 -#define SKBD_STATE_LAYOUT 1 -#define SKBD_STATE_GETKEY 2 - -#define KC(n) KS_KEYCODE(n) -const keysym_t comkbd_keydesc_us[] = { - KC(0x01), KS_Cmd, - KC(0x02), KS_Cmd_BrightnessDown, - KC(0x04), KS_Cmd_BrightnessUp, - KC(0x05), KS_f1, - KC(0x06), KS_f2, - KC(0x07), KS_f10, - KC(0x08), KS_f3, - KC(0x09), KS_f11, - KC(0x0a), KS_f4, - KC(0x0b), KS_f12, - KC(0x0c), KS_f5, - KC(0x0d), KS_Alt_R, - KC(0x0e), KS_f6, - KC(0x10), KS_f7, - KC(0x11), KS_f8, - KC(0x12), KS_f9, - KC(0x13), KS_Alt_L, - KC(0x14), KS_Up, - KC(0x15), KS_Pause, - KC(0x16), KS_Print_Screen, - KC(0x18), KS_Left, - KC(0x19), KS_Hold_Screen, - KC(0x1b), KS_Down, - KC(0x1c), KS_Right, - KC(0x1d), KS_Escape, - KC(0x1e), KS_1, KS_exclam, - KC(0x1f), KS_2, KS_at, - KC(0x20), KS_3, KS_numbersign, - KC(0x21), KS_4, KS_dollar, - KC(0x22), KS_5, KS_percent, - KC(0x23), KS_6, KS_asciicircum, - KC(0x24), KS_7, KS_ampersand, - KC(0x25), KS_8, KS_asterisk, - KC(0x26), KS_9, KS_parenleft, - KC(0x27), KS_0, KS_parenright, - KC(0x28), KS_minus, KS_underscore, - KC(0x29), KS_equal, KS_plus, - KC(0x2a), KS_grave, KS_asciitilde, - KC(0x2b), KS_BackSpace, - KC(0x2c), KS_Insert, - KC(0x2d), KS_KP_Equal, - KC(0x2e), KS_KP_Divide, - KC(0x2f), KS_KP_Multiply, - KC(0x32), KS_KP_Delete, - KC(0x34), KS_Home, - KC(0x35), KS_Tab, - KC(0x36), KS_q, - KC(0x37), KS_w, - KC(0x38), KS_e, - KC(0x39), KS_r, - KC(0x3a), KS_t, - KC(0x3b), KS_y, - KC(0x3c), KS_u, - KC(0x3d), KS_i, - KC(0x3e), KS_o, - KC(0x3f), KS_p, - KC(0x40), KS_bracketleft, KS_braceleft, - KC(0x41), KS_bracketright,KS_braceright, - KC(0x42), KS_Delete, - KC(0x43), KS_Multi_key, - KC(0x44), KS_KP_Home, KS_KP_7, - KC(0x45), KS_KP_Up, KS_KP_8, - KC(0x46), KS_KP_Prior, KS_KP_9, - KC(0x47), KS_KP_Subtract, - KC(0x4a), KS_End, - KC(0x4c), KS_Control_L, - KC(0x4d), KS_Cmd_Debugger, KS_a, - KC(0x4e), KS_s, - KC(0x4f), KS_d, - KC(0x50), KS_f, - KC(0x51), KS_g, - KC(0x52), KS_h, - KC(0x53), KS_j, - KC(0x54), KS_k, - KC(0x55), KS_l, - KC(0x56), KS_semicolon, KS_colon, - KC(0x57), KS_apostrophe, KS_quotedbl, - KC(0x58), KS_backslash, KS_bar, - KC(0x59), KS_Return, - KC(0x5a), KS_KP_Enter, - KC(0x5b), KS_KP_Left, KS_KP_4, - KC(0x5c), KS_KP_Begin, KS_KP_5, - KC(0x5d), KS_KP_Right, KS_KP_6, - KC(0x5e), KS_KP_Insert, KS_KP_0, - KC(0x5f), KS_Find, - KC(0x60), KS_Prior, - KC(0x62), KS_Num_Lock, - KC(0x63), KS_Shift_L, - KC(0x64), KS_z, - KC(0x65), KS_x, - KC(0x66), KS_c, - KC(0x67), KS_v, - KC(0x68), KS_b, - KC(0x69), KS_n, - KC(0x6a), KS_m, - KC(0x6b), KS_comma, KS_less, - KC(0x6c), KS_period, KS_greater, - KC(0x6d), KS_slash, KS_question, - KC(0x6e), KS_Shift_R, - KC(0x6f), KS_Linefeed, - KC(0x70), KS_KP_End, KS_KP_1, - KC(0x71), KS_KP_Down, KS_KP_2, - KC(0x72), KS_KP_Next, KS_KP_3, - KC(0x76), KS_Help, - KC(0x77), KS_Caps_Lock, - KC(0x78), KS_Meta_L, - KC(0x79), KS_space, - KC(0x7a), KS_Meta_R, - KC(0x7b), KS_Next, - KC(0x7d), KS_KP_Add, -}; - -#define KBD_MAP(name, base, map) \ - { name, base, sizeof(map)/sizeof(keysym_t), map } - -const struct wscons_keydesc comkbd_keydesctab[] = { - KBD_MAP(KB_US, 0, comkbd_keydesc_us), - {0, 0, 0, 0}, -}; - -struct wskbd_mapdata comkbd_keymapdata = { - comkbd_keydesctab, KB_US -}; - #define COMK_RX_RING 64 #define COMK_TX_RING 64 @@ -375,7 +228,7 @@ comkbd_attach(parent, self, aux) cn_tab->cn_dev = makedev(77, sc->sc_dv.dv_unit); /* XXX */ cn_tab->cn_pollc = wskbd_cnpollc; cn_tab->cn_getc = wskbd_cngetc; - wskbd_cnattach(&comkbd_consops, sc, &comkbd_keymapdata); + wskbd_cnattach(&comkbd_consops, sc, &sunkbd_keymapdata); sc->sc_ier = IER_ETXRDY | IER_ERXRDY; COM_WRITE(sc, com_ier, sc->sc_ier); COM_READ(sc, com_iir); @@ -383,7 +236,7 @@ comkbd_attach(parent, self, aux) } a.console = console; - a.keymap = &comkbd_keymapdata; + a.keymap = &sunkbd_keymapdata; a.accessops = &comkbd_accessops; a.accesscookie = sc; sc->sc_wskbddev = config_found(self, &a, wskbddevprint); |