Update of /cvsroot/linux-vax/kernel-2.4/drivers/tc
In directory usw-pr-cvs1:/tmp/cvs-serv6177/tc
Modified Files:
Makefile tc.c zs.c zs.h
Added Files:
lk201-map.map lk201-remap.c lk201.c lk201.h
Removed Files:
tcsyms.c
Log Message:
synch 2.4.15 commit 27
--- NEW FILE ---
# Default kernel keymap. This uses 7 modifier combinations.
keymaps 0-2,4-5,8,12
# Change the above line into
# keymaps 0-2,4-6,8,12
# in case you want the entries
# altgr control keycode 83 = Boot
# altgr control keycode 111 = Boot
# below.
#
# In fact AltGr is used very little, and one more keymap can
# be saved by mapping AltGr to Alt (and adapting a few entries):
# keycode 100 = Alt
#
keycode 0x15 = grave tilde
alt keycode 0x15 = Escape
control keycode 0x15 = Meta_Escape
keycode 0x16 = one exclam
alt keycode 0x16 = Meta_one
keycode 0x17 = two at at
control keycode 0x17 = nul
shift control keycode 0x17 = nul
alt keycode 0x17 = Meta_two
keycode 0x18 = three numbersign
control keycode 0x18 = Escape
alt keycode 0x18 = Meta_three
keycode 0x19 = four dollar dollar
control keycode 0x19 = Control_backslash
alt keycode 0x19 = Meta_four
keycode 0x1a = five percent
control keycode 0x1a = Control_bracketright
alt keycode 0x1a = Meta_five
keycode 0x1b = six asciicircum
control keycode 0x1b = Control_asciicircum
alt keycode 0x1b = Meta_six
keycode 0x1c = seven ampersand braceleft
control keycode 0x1c = Control_underscore
alt keycode 0x1c = Meta_seven
keycode 0x1d = eight asterisk bracketleft
control keycode 0x1d = Delete
alt keycode 0x1d = Meta_eight
keycode 0x1e = nine parenleft bracketright
alt keycode 0x1e = Meta_nine
keycode 0x1f = zero parenright braceright
alt keycode 0x1f = Meta_zero
keycode 0x20 = minus underscore backslash
control keycode 0x20 = Control_underscore
shift control keycode 0x20 = Control_underscore
alt keycode 0x20 = Meta_minus
keycode 0x21 = equal plus
alt keycode 0x21 = Meta_equal
keycode 0x22 = Delete Delete
control keycode 0x22 = BackSpace
alt keycode 0x22 = Meta_Delete
keycode 0x2a = Tab Tab
alt keycode 0x2a = Meta_Tab
keycode 0x2b = q
keycode 0x2c = w
keycode 0x2d = e
altgr keycode 0x2d = Hex_E
keycode 0x2e = r
keycode 0x2f = t
keycode 0x30 = y
keycode 0x31 = u
keycode 0x32 = i
keycode 0x33 = o
keycode 0x34 = p
keycode 0x35 = bracketleft braceleft
control keycode 0x35 = Escape
alt keycode 0x35 = Meta_bracketleft
keycode 0x36 = bracketright braceright asciitilde
control keycode 0x36 = Control_bracketright
alt keycode 0x36 = Meta_bracketright
keycode 0x37 = Return
alt keycode 0x37 = Meta_Control_m
keycode 0x3f = Control
keycode 0x41 = a
altgr keycode 0x41 = Hex_A
keycode 0x42 = s
keycode 0x43 = d
altgr keycode 0x43 = Hex_D
keycode 0x44 = f
altgr keycode 0x44 = Hex_F
keycode 0x45 = g
keycode 0x46 = h
keycode 0x47 = j
keycode 0x48 = k
keycode 0x49 = l
keycode 0x4a = semicolon colon
alt keycode 0x4a = Meta_semicolon
keycode 0x4b = apostrophe quotedbl
control keycode 0x4b = Control_g
alt keycode 0x4b = Meta_apostrophe
# keycode 41 = grave asciitilde
# control keycode 41 = nul
# alt keycode 41 = Meta_grave
keycode 0x52 = Shift
keycode 0x4c = backslash bar
control keycode 0x4c = Control_backslash
alt keycode 0x4c = Meta_backslash
keycode 0x53 = greater less
keycode 0x54 = z
keycode 0x55 = x
keycode 0x56 = c
altgr keycode 0x56 = Hex_C
keycode 0x57 = v
keycode 0x58 = b
altgr keycode 0x58 = Hex_B
keycode 0x59 = n
keycode 0x5a = m
keycode 0x5b = comma less
alt keycode 0x5b = Meta_comma
keycode 0x5c = period greater
control keycode 0x5c = Compose
alt keycode 0x5c = Meta_period
keycode 0x5d = slash question
control keycode 0x5d = Delete
alt keycode 0x5d = Meta_slash
keycode 0x67 = Alt
keycode 0x68 = space space
control keycode 0x68 = nul
alt keycode 0x68 = Meta_space
keycode 0x40 = Caps_Lock
keycode 0x01 = F1
control keycode 0x01 = F1
alt keycode 0x01 = Console_1
control alt keycode 0x01 = Console_1
keycode 0x02 = F2
control keycode 0x02 = F2
alt keycode 0x02 = Console_2
control alt keycode 0x02 = Console_2
keycode 0x03 = F3
control keycode 0x03 = F3
alt keycode 0x03 = Console_3
control alt keycode 0x03 = Console_3
keycode 0x04 = F4
control keycode 0x04 = F4
alt keycode 0x04 = Console_4
control alt keycode 0x04 = Console_4
keycode 0x05 = F5
control keycode 0x05 = F5
alt keycode 0x05 = Console_5
control alt keycode 0x05 = Console_5
keycode 0x06 = F6
control keycode 0x06 = F6
alt keycode 0x06 = Console_6
control alt keycode 0x06 = Console_6
keycode 0x07 = F7
control keycode 0x07 = F7
alt keycode 0x07 = Console_7
control alt keycode 0x07 = Console_7
keycode 0x08 = F8
control keycode 0x08 = F8
alt keycode 0x08 = Console_8
control alt keycode 0x08 = Console_8
keycode 0x09 = F9
control keycode 0x09 = F9
alt keycode 0x09 = Console_9
control alt keycode 0x09 = Console_9
keycode 0x0a = F10
control keycode 0x0a = F10
alt keycode 0x0a = Console_10
control alt keycode 0x0a = Console_10
keycode 0x0b = F11
control keycode 0x0b = F11
alt keycode 0x0b = Console_11
control alt keycode 0x0b = Console_11
keycode 0x0c = F12
control keycode 0x0c = F12
alt keycode 0x0c = Console_12
control alt keycode 0x0c = Console_12
keycode 0x0d = F13
control keycode 0x0d = F13
alt keycode 0x0d = Console_13
control alt keycode 0x0d = Console_13
keycode 0x0e = F14
control keycode 0x0e = F14
alt keycode 0x0e = Console_14
control alt keycode 0x0e = Console_14
keycode 0x11 = F17
control keycode 0x11 = F17
alt keycode 0x11 = Console_17
control alt keycode 0x11 = Console_17
keycode 0x12 = F18
control keycode 0x12 = F18
alt keycode 0x12 = Console_18
control alt keycode 0x12 = Console_18
keycode 0x13 = F19
control keycode 0x13 = F19
alt keycode 0x13 = Console_19
control alt keycode 0x13 = Console_19
keycode 0x14 = F20
control keycode 0x14 = F20
alt keycode 0x14 = Console_20
control alt keycode 0x14 = Console_20
keycode 0x3b = KP_7
alt keycode 0x3b = Ascii_7
altgr keycode 0x3b = Hex_7
keycode 0x3c = KP_8
alt keycode 0x3c = Ascii_8
altgr keycode 0x3c = Hex_8
keycode 0x3d = KP_9
alt keycode 0x3d = Ascii_9
altgr keycode 0x3d = Hex_9
keycode 0x3e = KP_Subtract
keycode 0x4e = KP_4
alt keycode 0x4e = Ascii_4
altgr keycode 0x4e = Hex_4
keycode 0x4f = KP_5
alt keycode 0x4f = Ascii_5
altgr keycode 0x4f = Hex_5
keycode 0x50 = KP_6
alt keycode 0x50 = Ascii_6
altgr keycode 0x50 = Hex_6
keycode 0x62 = KP_1
alt keycode 0x62 = Ascii_1
altgr keycode 0x62 = Hex_1
keycode 0x63 = KP_2
alt keycode 0x63 = Ascii_2
altgr keycode 0x63 = Hex_2
keycode 0x64 = KP_3
alt keycode 0x64 = Ascii_3
altgr keycode 0x64 = Hex_3
keycode 0x6b = KP_0
alt keycode 0x6b = Ascii_0
altgr keycode 0x6b = Hex_0
keycode 0x6c = KP_Period
# altgr control keycode 0x6c = Boot
control alt keycode 0x6c = Boot
keycode 0x65 = KP_Enter
keycode 0x3f = Control
# keycode 100 = AltGr
keycode 0x23 = Find
keycode 0x4d = Up
keycode 0x39 = Prior
shift keycode 0x39 = Scroll_Backward
keycode 0x5f = Left
alt keycode 0x5f = Decr_Console
keycode 0x61 = Right
alt keycode 0x61 = Incr_Console
keycode 0x38 = Select
keycode 0x60 = Down
keycode 0x3a = Next
shift keycode 0x3a = Scroll_Forward
keycode 0x24 = Insert
keycode 0x25 = Remove
# altgr control keycode 0x25 = Boot
control alt keycode 0x25 = Boot
keycode 0x0f = Help Show_Memory Show_Registers
control keycode 0x0f = Show_State
keycode 0x10 = Do
string F1 = "\033[[A"
string F2 = "\033[[B"
string F3 = "\033[[C"
string F4 = "\033[[D"
string F5 = "\033[[E"
string F6 = "\033[17~"
string F7 = "\033[18~"
string F8 = "\033[19~"
string F9 = "\033[20~"
string F10 = "\033[21~"
string F11 = "\033[23~"
string F12 = "\033[24~"
string F13 = "\033[25~"
string F14 = "\033[26~"
string F15 = "\033[28~"
string F16 = "\033[29~"
string F17 = "\033[31~"
string F18 = "\033[32~"
string F19 = "\033[33~"
string F20 = "\033[34~"
string Find = "\033[1~"
string Insert = "\033[2~"
string Remove = "\033[3~"
string Select = "\033[4~"
string Prior = "\033[5~"
string Next = "\033[6~"
string Macro = "\033[M"
string Pause = "\033[P"
compose '`' 'A' to 'À'
compose '`' 'a' to 'à'
compose '\'' 'A' to 'Á'
compose '\'' 'a' to 'á'
compose '^' 'A' to 'Â'
compose '^' 'a' to 'â'
compose '~' 'A' to 'Ã'
compose '~' 'a' to 'ã'
compose '"' 'A' to 'Ä'
compose '"' 'a' to 'ä'
compose 'O' 'A' to 'Å'
compose 'o' 'a' to 'å'
compose '0' 'A' to 'Å'
compose '0' 'a' to 'å'
compose 'A' 'A' to 'Å'
compose 'a' 'a' to 'å'
compose 'A' 'E' to 'Æ'
compose 'a' 'e' to 'æ'
compose ',' 'C' to 'Ç'
compose ',' 'c' to 'ç'
compose '`' 'E' to 'È'
compose '`' 'e' to 'è'
compose '\'' 'E' to 'É'
compose '\'' 'e' to 'é'
compose '^' 'E' to 'Ê'
compose '^' 'e' to 'ê'
compose '"' 'E' to 'Ë'
compose '"' 'e' to 'ë'
compose '`' 'I' to 'Ì'
compose '`' 'i' to 'ì'
compose '\'' 'I' to 'Í'
compose '\'' 'i' to 'í'
compose '^' 'I' to 'Î'
compose '^' 'i' to 'î'
compose '"' 'I' to 'Ï'
compose '"' 'i' to 'ï'
compose '-' 'D' to 'Ð'
compose '-' 'd' to 'ð'
compose '~' 'N' to 'Ñ'
compose '~' 'n' to 'ñ'
compose '`' 'O' to 'Ò'
compose '`' 'o' to 'ò'
compose '\'' 'O' to 'Ó'
compose '\'' 'o' to 'ó'
compose '^' 'O' to 'Ô'
compose '^' 'o' to 'ô'
compose '~' 'O' to 'Õ'
compose '~' 'o' to 'õ'
compose '"' 'O' to 'Ö'
compose '"' 'o' to 'ö'
compose '/' 'O' to 'Ø'
compose '/' 'o' to 'ø'
compose '`' 'U' to 'Ù'
compose '`' 'u' to 'ù'
compose '\'' 'U' to 'Ú'
compose '\'' 'u' to 'ú'
compose '^' 'U' to 'Û'
compose '^' 'u' to 'û'
compose '"' 'U' to 'Ü'
compose '"' 'u' to 'ü'
compose '\'' 'Y' to 'Ý'
compose '\'' 'y' to 'ý'
compose 'T' 'H' to 'Þ'
compose 't' 'h' to 'þ'
compose 's' 's' to 'ß'
compose '"' 'y' to 'ÿ'
compose 's' 'z' to 'ß'
compose 'i' 'j' to 'ÿ'
--- NEW FILE ---
/*
* Keyboard mappings for DEC LK201/401/501 keyboards
*
* 17.05.99 Michael Engel (en...@un...)
*
* DEC US keyboards generate keycodes in the range 0x55 - 0xfb
*
* This conflicts with Linux scancode conventions which define
* 0x00-0x7f as "normal" and 0x80-0xff as "shifted" scancodes, so we
* have to remap the keycodes to 0x00-0x7f with the scancodeRemap
* array. The generated scancode is simply the number of the key counted
* from the left upper to the right lower corner of the keyboard ...
*
* These scancodes are then being remapped (I hope ;-)) with the
* lk501*map[] arrays which define scancode -> Linux code mapping
*
* Oh man is this horrible ;-)
*
* Scancodes with dual labels exist for keyboards as follows:
*
* code: left label / right label
*
* 0x73: LKx01, LK421 / LK443, LK444
* 0x74: LKx01, LK421 / LK443, LK444
* 0x7c: LKx01, LK421 / LK443, LK444
* 0x8a: LKx01, LK421 / LK443, LK444
* 0x8b: LKx01, LK421 / LK443, LK444
* 0x8c: LKx01, LK421 / LK443, LK444
* 0x8d: LKx01, LK421 / LK443, LK444
* 0x8e: LKx01, LK421 / LK443, LK444
* 0x8f: LKx01, LK421 / LK443, LK444
* 0x9c: LKx01, LK421 / LK443, LK444
* 0xa1: LKx01, LK421 / LK443, LK444
* 0xa2: LKx01, LK421 / LK443, LK444
* 0xa3: LKx01, LK421 / LK443, LK444
* 0xa4: LKx01, LK421 / LK443, LK444
* 0xad: LK421 / LK443, LK444
* 0xc9: LKx01, LK421, LK443 / LK444
* 0xf7: LKx01, LK443 / LK444
*/
unsigned char scancodeRemap[256] = {
/* ----- */
/* 0 */ 0, 0, 0, 0,
/* ----- */
/* 4 */ 0, 0, 0, 0,
/* ----- */
/* 8 */ 0, 0, 0, 0,
/* ----- */
/* c */ 0, 0, 0, 0,
/* ----- */
/* 10 */ 0, 0, 0, 0,
/* ----- */
/* 14 */ 0, 0, 0, 0,
/* ----- */
/* 18 */ 0, 0, 0, 0,
/* ----- */
/* 1c */ 0, 0, 0, 0,
/* ----- */
/* 20 */ 0, 0, 0, 0,
/* ----- */
/* 24 */ 0, 0, 0, 0,
/* ----- */
/* 28 */ 0, 0, 0, 0,
/* ----- */
/* 2c */ 0, 0, 0, 0,
/* ----- */
/* 30 */ 0, 0, 0, 0,
/* ----- */
/* 34 */ 0, 0, 0, 0,
/* ----- */
/* 38 */ 0, 0, 0, 0,
/* ----- */
/* 3c */ 0, 0, 0, 0,
/* ----- */
/* 40 */ 0, 0, 0, 0,
/* ----- */
/* 44 */ 0, 0, 0, 0,
/* ----- */
/* 48 */ 0, 0, 0, 0,
/* ----- */
/* 4c */ 0, 0, 0, 0,
/* ----- */
/* 50 */ 0, 0, 0, 0,
/* ----- ESC F1 F2 */
/* 54 */ 0, 0, 0x01, 0x02,
/* ----- F3 F4 F5 */
/* 58 */ 0x03, 0x04, 0x05, 0,
/* ----- */
/* 5c */ 0, 0, 0, 0,
/* ----- */
/* 60 */ 0, 0, 0, 0,
/* ----- F6 F7 F8 F9 */
/* 64 */ 0x06, 0x07, 0x08, 0x09,
/* ----- F10 */
/* 68 */ 0x0a, 0, 0, 0,
/* ----- */
/* 6c */ 0, 0, 0, 0,
/* ----- F11 F12 F13/PRNT SCRN */
/* 70 */ 0, 0x0b, 0x0c, 0x0d,
/* ----- F14/SCRL LCK */
/* 74 */ 0x0e, 0, 0, 0,
/* ----- */
/* 78 */ 0, 0, 0, 0,
/* ----- HELP/PAUSE DO */
/* 7c */ 0x0f, 0x10, 0, 0,
/* ----- F17 F18 F19 F20 */
/* 80 */ 0x11, 0x12, 0x13, 0x14,
/* ----- */
/* 84 */ 0, 0, 0, 0,
/* ----- FIND/INSERT INSERT/HOME */
/* 88 */ 0, 0, 0x23, 0x24,
/* ----- REMOVE/PG UP SELECT/DELETE PREVIOUS/END NEXT/PG DN */
/* 8c */ 0x25, 0x38, 0x39, 0x3a,
/* ----- KP 0 */
/* 90 */ 0, 0, 0x6b, 0,
/* ----- KP . KP ENTER KP 1 KP 2 */
/* 94 */ 0x6c, 0x65, 0x62, 0x63,
/* ----- KP 3 KP 4 KP 5 KP 6 */
/* 98 */ 0x64, 0x4e, 0x4f, 0x50,
/* ----- KP ,/KP + KP 7 KP 8 KP 9 */
/* 9c */ 0x51, 0x3b, 0x3c, 0x3d,
/* ----- KP - KP F1/NUM LCK KP F2/KP / KP F3/KP * */
/* a0 */ 0x3e, 0x26, 0x27, 0x28,
/* ----- KP F4/KP - LEFT */
/* a4 */ 0x29, 0, 0, 0x5f,
/* ----- RIGHT DOWN UP SHIFT Rt */
/* a8 */ 0x61, 0x60, 0x4d, 0x5e,
/* ----- ALT COMP Rt/CTRL Rt SHIFT CONTROL */
/* ac */ 0, 0, 0x52, 0x3f,
/* ----- CAPS COMPOSE ALT Rt */
/* b0 */ 0x40, 0x67, 0, 0,
/* ----- */
/* b4 */ 0, 0, 0, 0,
/* ----- */
/* b8 */ 0, 0, 0, 0,
/* ----- BKSP RET TAB ` */
/* bc */ 0x22, 0x37, 0x2a, 0x15,
/* ----- 1 q a z */
/* c0 */ 0x16, 0x2b, 0x41, 0x54,
/* ----- 2 w s */
/* c4 */ 0, 0x17, 0x2c, 0x42,
/* ----- x </\\ 3 */
/* c8 */ 0x55, 0x53, 0, 0x18,
/* ----- e d c */
/* cc */ 0x2d, 0x43, 0x56, 0,
/* ----- 4 r f v */
/* d0 */ 0x19, 0x2e, 0x44, 0x57,
/* ----- SPACE 5 t */
/* d4 */ 0x68, 0, 0x1a, 0x2f,
/* ----- g b 6 */
/* d8 */ 0x45, 0x58, 0, 0x1b,
/* ----- y h n */
/* dc */ 0x30, 0x46, 0x59, 0,
/* ----- 7 u j m */
/* e0 */ 0x1c, 0x31, 0x47, 0x5a,
/* ----- 8 i k */
/* e4 */ 0, 0x1d, 0x32, 0x48,
/* ----- , 9 o */
/* e8 */ 0x5b, 0, 0x1e, 0x33,
/* ----- l . 0 */
/* ec */ 0x49, 0x5c, 0, 0x1f,
/* ----- p ; / */
/* f0 */ 0x34, 0, 0x4a, 0x5d,
/* ----- = ] \\/\' */
/* f4 */ 0, 0x21, 0x36, 0x4c,
/* ----- - [ \' */
/* f8 */ 0, 0x20, 0x35, 0x4b,
/* ----- */
/* fc */ 0, 0, 0, 0,
};
--- NEW FILE ---
/*
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
*/
#include <linux/errno.h>
#include <linux/tty.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/kbd_ll.h>
#include <asm/wbflush.h>
#include <asm/dec/tc.h>
#include <asm/dec/machtype.h>
#include "zs.h"
#include "lk201.h"
/* Simple translation table for the SysRq keys */
#ifdef CONFIG_MAGIC_SYSRQ
/*
* Actually no translation at all, at least until we figure out
* how to define SysRq for LK201 and friends. --macro
*/
unsigned char lk201_sysrq_xlate[128];
unsigned char *kbd_sysrq_xlate = lk201_sysrq_xlate;
#endif
#define KEYB_LINE 3
static int __init lk201_init(struct dec_serial *);
static void __init lk201_info(struct dec_serial *);
static void lk201_kbd_rx_char(unsigned char, unsigned char);
struct zs_hook lk201_kbdhook = {
init_channel: lk201_init,
init_info: lk201_info,
rx_char: NULL,
poll_rx_char: NULL,
poll_tx_char: NULL,
cflags: B4800 | CS8 | CSTOPB | CLOCAL
};
/*
* This is used during keyboard initialisation
*/
static unsigned char lk201_reset_string[] = {
LK_CMD_LEDS_ON, LK_PARAM_LED_MASK(0xf), /* show we are resetting */
LK_CMD_SET_DEFAULTS,
LK_CMD_MODE(LK_MODE_RPT_DOWN, 1),
LK_CMD_MODE(LK_MODE_RPT_DOWN, 2),
LK_CMD_MODE(LK_MODE_RPT_DOWN, 3),
LK_CMD_MODE(LK_MODE_RPT_DOWN, 4),
LK_CMD_MODE(LK_MODE_DOWN_UP, 5),
LK_CMD_MODE(LK_MODE_DOWN_UP, 6),
LK_CMD_MODE(LK_MODE_RPT_DOWN, 7),
LK_CMD_MODE(LK_MODE_RPT_DOWN, 8),
LK_CMD_MODE(LK_MODE_RPT_DOWN, 9),
LK_CMD_MODE(LK_MODE_RPT_DOWN, 10),
LK_CMD_MODE(LK_MODE_RPT_DOWN, 11),
LK_CMD_MODE(LK_MODE_RPT_DOWN, 12),
LK_CMD_MODE(LK_MODE_DOWN, 13),
LK_CMD_MODE(LK_MODE_RPT_DOWN, 14),
LK_CMD_ENB_RPT,
LK_CMD_DIS_KEYCLK,
LK_CMD_RESUME,
LK_CMD_ENB_BELL, LK_PARAM_VOLUME(4),
LK_CMD_LEDS_OFF, LK_PARAM_LED_MASK(0xf)
};
static int __init lk201_reset(struct dec_serial *info)
{
int i;
for (i = 0; i < sizeof(lk201_reset_string); i++)
if (info->hook->poll_tx_char(info, lk201_reset_string[i])) {
printk(__FUNCTION__" transmit timeout\n");
return -EIO;
}
return 0;
}
void kbd_leds(unsigned char leds)
{
return;
}
int kbd_setkeycode(unsigned int scancode, unsigned int keycode)
{
return -EINVAL;
}
int kbd_getkeycode(unsigned int scancode)
{
return -EINVAL;
}
int kbd_translate(unsigned char scancode, unsigned char *keycode,
char raw_mode)
{
*keycode = scancode;
return 1;
}
char kbd_unexpected_up(unsigned char keycode)
{
return 0x80;
}
static void lk201_kbd_rx_char(unsigned char ch, unsigned char stat)
{
static int shift_state = 0;
static int prev_scancode;
unsigned char c = scancodeRemap[ch];
if (!stat || stat == 4) {
switch (ch) {
case LK_KEY_ACK:
break;
case LK_KEY_LOCK:
shift_state ^= LK_LOCK;
handle_scancode(c, shift_state && LK_LOCK ? 1 : 0);
break;
case LK_KEY_SHIFT:
shift_state ^= LK_SHIFT;
handle_scancode(c, shift_state && LK_SHIFT ? 1 : 0);
break;
case LK_KEY_CTRL:
shift_state ^= LK_CTRL;
handle_scancode(c, shift_state && LK_CTRL ? 1 : 0);
break;
case LK_KEY_COMP:
shift_state ^= LK_COMP;
handle_scancode(c, shift_state && LK_COMP ? 1 : 0);
break;
case LK_KEY_RELEASE:
if (shift_state & LK_SHIFT)
handle_scancode(scancodeRemap[LK_KEY_SHIFT], 0);
if (shift_state & LK_CTRL)
handle_scancode(scancodeRemap[LK_KEY_CTRL], 0);
if (shift_state & LK_COMP)
handle_scancode(scancodeRemap[LK_KEY_COMP], 0);
if (shift_state & LK_LOCK)
handle_scancode(scancodeRemap[LK_KEY_LOCK], 0);
shift_state = 0;
break;
case LK_KEY_REPEAT:
handle_scancode(prev_scancode, 1);
break;
default:
prev_scancode = c;
handle_scancode(c, 1);
break;
}
} else
printk("Error reading LKx01 keyboard: 0x%02x\n", stat);
}
static void __init lk201_info(struct dec_serial *info)
{
}
static int __init lk201_init(struct dec_serial *info)
{
unsigned int ch, id = 0;
int result;
printk("DECstation LK keyboard driver v0.04... ");
result = lk201_reset(info);
if (result)
return result;
mdelay(10);
/*
* Detect whether there is an LK201 or an LK401
* The LK401 has ALT keys...
*/
info->hook->poll_tx_char(info, LK_CMD_REQ_ID);
while ((ch = info->hook->poll_rx_char(info)) > 0)
id = ch;
switch (id) {
case 1:
printk("LK201 detected\n");
break;
case 2:
printk("LK401 detected\n");
break;
default:
printk("unknown keyboard, ID %d,\n", id);
printk("... please report to <lin...@os...>\n");
}
/*
* now we're ready
*/
info->hook->rx_char = lk201_kbd_rx_char;
return 0;
}
void __init kbd_init_hw(void)
{
extern int register_zs_hook(unsigned int, struct zs_hook *);
extern int unregister_zs_hook(unsigned int);
if (TURBOCHANNEL) {
if (mips_machtype != MACH_DS5000_XX) {
/*
* This is not a MAXINE, so:
*
* kbd_init_hw() is being called before
* rs_init() so just register the kbd hook
* and let zs_init do the rest :-)
*/
if (mips_machtype == MACH_DS5000_200)
printk("LK201 Support for DS5000/200 not yet ready ...\n");
else
if(!register_zs_hook(KEYB_LINE, &lk201_kbdhook))
unregister_zs_hook(KEYB_LINE);
}
} else {
/*
* TODO: modify dz.c to allow similar hooks
* for LK201 handling on DS2100, DS3100, and DS5000/200
*/
printk("LK201 Support for DS3100 not yet ready ...\n");
}
}
--- NEW FILE ---
/*
* Commands to the keyboard processor
*/
#define LK_PARAM 0x80 /* start/end parameter list */
#define LK_CMD_RESUME 0x8b
#define LK_CMD_INHIBIT 0xb9
#define LK_CMD_LEDS_ON 0x13 /* 1 param: led bitmask */
#define LK_CMD_LEDS_OFF 0x11 /* 1 param: led bitmask */
#define LK_CMD_DIS_KEYCLK 0x99
#define LK_CMD_ENB_KEYCLK 0x1b /* 1 param: volume */
#define LK_CMD_DIS_CTLCLK 0xb9
#define LK_CMD_ENB_CTLCLK 0xbb
#define LK_CMD_SOUND_CLK 0x9f
#define LK_CMD_DIS_BELL 0xa1
#define LK_CMD_ENB_BELL 0x23 /* 1 param: volume */
#define LK_CMD_BELL 0xa7
#define LK_CMD_TMP_NORPT 0xc1
#define LK_CMD_ENB_RPT 0xe3
#define LK_CMD_DIS_RPT 0xe1
#define LK_CMD_RPT_TO_DOWN 0xd9
#define LK_CMD_REQ_ID 0xab
#define LK_CMD_POWER_UP 0xfd
#define LK_CMD_TEST_MODE 0xcb
#define LK_CMD_SET_DEFAULTS 0xd3
/* there are 4 leds, represent them in the low 4 bits of a byte */
#define LK_PARAM_LED_MASK(ledbmap) (LK_PARAM|(ledbmap))
/* max volume is 0, lowest is 0x7 */
#define LK_PARAM_VOLUME(v) (LK_PARAM|((v)&0x7))
/* mode set command(s) details */
#define LK_MODE_DOWN 0x0
#define LK_MODE_RPT_DOWN 0x2
#define LK_MODE_DOWN_UP 0x6
#define LK_CMD_MODE(m,div) (LK_PARAM|(div<<3)|m)
#define LK_SHIFT 1<<0
#define LK_CTRL 1<<1
#define LK_LOCK 1<<2
#define LK_COMP 1<<3
#define LK_KEY_SHIFT 174
#define LK_KEY_CTRL 175
#define LK_KEY_LOCK 176
#define LK_KEY_COMP 177
#define LK_KEY_RELEASE 179
#define LK_KEY_REPEAT 180
#define LK_KEY_ACK 186
extern unsigned char scancodeRemap[256];
Index: Makefile
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/tc/Makefile,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- Makefile 14 Jan 2001 19:05:54 -0000 1.1.1.1
+++ Makefile 9 Apr 2002 16:45:53 -0000 1.2
@@ -7,27 +7,36 @@
#
# Note 2! The CFLAGS definitions are now in the main makefile...
-SUB_DIRS :=
-MOD_SUB_DIRS :=
-ALL_SUB_DIRS :=
-
-L_TARGET := tc.a
-L_OBJS := tc.o
-
-# Nasty trick as nobody references tcsyms.o, but we still want it linked.
-# Stolen from pci Makefile
-ifeq ($(CONFIG_MODULES),y)
-O_TARGET = tc_syms.o
-OX_OBJS = tcsyms.o
-O_OBJS = tc.o
-L_OBJS := tc_syms.o
-else
-L_OBJS := tc.o
-endif
-
-ifdef CONFIG_ZS
-L_OBJS += zs.o
-endif
+# All of the (potential) objects that export symbols.
+# This list comes from 'grep -l EXPORT_SYMBOL *.[hc]'.
+
+export-objs := tc.o
+
+# Object file lists.
+
+obj-y :=
+obj-m :=
+obj-n :=
+obj- :=
+
+obj-$(CONFIG_TC) += tc.o
+obj-$(CONFIG_ZS) += zs.o
+obj-$(CONFIG_VT) += lk201.o lk201-map.o lk201-remap.o
+
+# Files that are both resident and modular: remove from modular.
+
+obj-m := $(filter-out $(obj-y), $(obj-m))
+
+# Translate to Rules.make lists.
+
+L_TARGET := tc.a
+
+L_OBJS := $(sort $(filter-out $(export-objs), $(obj-y)))
+LX_OBJS := $(sort $(filter $(export-objs), $(obj-y)))
+M_OBJS := $(sort $(filter-out $(export-objs), $(obj-m)))
+MX_OBJS := $(sort $(filter $(export-objs), $(obj-m)))
include $(TOPDIR)/Rules.make
+lk201-map.c: lk201-map.map
+ loadkeys --mktable lk201-map.map > lk201-map.c
Index: tc.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/tc/tc.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- tc.c 14 Jan 2001 19:05:54 -0000 1.1.1.1
+++ tc.c 9 Apr 2002 16:45:53 -0000 1.2
@@ -1,4 +1,4 @@
-/* $Id$
+/*
* tc-init: We assume the TURBOchannel to be up and running so
* just probe for Modules and fill in the global data structure
* tc_bus.
@@ -8,9 +8,7 @@
* for more details.
*
* Copyright (c) Harald Koerfgen, 1998
- *
*/
-
#include <linux/string.h>
#include <linux/init.h>
#include <linux/ioport.h>
@@ -23,14 +21,16 @@
#include <asm/ptrace.h>
#include <linux/kernel.h>
+#include <linux/module.h>
#define TC_DEBUG
+MODULE_LICENSE("GPL");
slot_info tc_bus[MAX_SLOT];
-static int max_tcslot = 0;
-static tcinfo *info = (tcinfo *)0;
+static int max_tcslot;
+static tcinfo *info;
-unsigned long system_base = 0;
+unsigned long system_base;
extern void (*dbe_board_handler)(struct pt_regs *regs);
extern unsigned long *(*rex_slot_address)(int);
@@ -112,19 +112,19 @@
for (slot = 0; slot <= max_slot; slot++) {
module = (char *)(startaddr + slot * size);
offset = -1;
- if (module[OLDCARD + PATTERN0] == 0x55 && module[OLDCARD + PATTERN1] == 0x00
- && module[OLDCARD + PATTERN2] == 0xaa && module[OLDCARD + PATTERN3] == 0xff)
+ if (module[OLDCARD + TC_PATTERN0] == 0x55 && module[OLDCARD + TC_PATTERN1] == 0x00
+ && module[OLDCARD + TC_PATTERN2] == 0xaa && module[OLDCARD + TC_PATTERN3] == 0xff)
offset = OLDCARD;
- if (module[PATTERN0] == 0x55 && module[PATTERN1] == 0x00
- && module[PATTERN2] == 0xaa && module[PATTERN3] == 0xff)
+ if (module[TC_PATTERN0] == 0x55 && module[TC_PATTERN1] == 0x00
+ && module[TC_PATTERN2] == 0xaa && module[TC_PATTERN3] == 0xff)
offset = 0;
if (offset != -1) {
tc_bus[slot].base_addr = (unsigned long)module;
for(i = 0; i < 8; i++) {
- tc_bus[slot].firmware[i] = module[FIRM_VER + offset + 4 * i];
- tc_bus[slot].vendor[i] = module[VENDOR + offset + 4 * i];
- tc_bus[slot].name[i] = module[MODULE + offset + 4 * i];
+ tc_bus[slot].firmware[i] = module[TC_FIRM_VER + offset + 4 * i];
+ tc_bus[slot].vendor[i] = module[TC_VENDOR + offset + 4 * i];
+ tc_bus[slot].name[i] = module[TC_MODULE + offset + 4 * i];
}
tc_bus[slot].firmware[8] = 0;
tc_bus[slot].vendor[8] = 0;
@@ -206,7 +206,7 @@
if (TURBOCHANNEL && info->slot_size && slot0addr) {
printk("TURBOchannel rev. %1d at %2d.%1d MHz ", info->revision,
tc_clock / 10, tc_clock % 10);
- printk("(%sparity)\n", info->parity ? "" : "no ");
+ printk("(with%s parity)\n", info->parity ? "" : "out");
slot_size = info->slot_size << 20;
@@ -235,3 +235,11 @@
ioport_resource.end = KSEG2 - 1;
}
}
+
+EXPORT_SYMBOL(search_tc_card);
+EXPORT_SYMBOL(claim_tc_card);
+EXPORT_SYMBOL(release_tc_card);
+EXPORT_SYMBOL(get_tc_base_addr);
+EXPORT_SYMBOL(get_tc_irq_nr);
+EXPORT_SYMBOL(get_tc_speed);
+
Index: zs.c
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/tc/zs.c,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- zs.c 14 Jan 2001 19:06:02 -0000 1.1.1.1
+++ zs.c 9 Apr 2002 16:45:53 -0000 1.2
@@ -1,22 +1,46 @@
/*
- * decserial.c: Serial port driver for IOASIC DECsatations.
+ * decserial.c: Serial port driver for IOASIC DECstations.
*
- * Derived from drivers/macintosh/macserial.c by Harald Koerfgen.
* Derived from drivers/sbus/char/sunserial.c by Paul Mackerras.
+ * Derived from drivers/macintosh/macserial.c by Harald Koerfgen.
*
* DECstation changes
- * Copyright (C) 1998 Harald Koerfgen (Har...@ho...)
+ * Copyright (C) 1998-2000 Harald Koerfgen
[...1305 lines suppressed...]
+}
+
void __init zs_kgdb_hook(int tty_num)
{
/* Find out how many Z8530 SCCs we have */
@@ -2084,11 +2392,12 @@
zs_soft[tty_num].change_needed = 0;
zs_soft[tty_num].clk_divisor = 16;
zs_soft[tty_num].zs_baud = 38400;
- zs_soft[tty_num].kgdb_channel = 1; /* This runs kgdb */
- zs_soft[tty_num ^ 1].kgdb_channel = 0; /* This does not */
+ zs_soft[tty_num].hook = &zs_kgdbhook; /* This runs kgdb */
/* Turn on transmitter/receiver at 8-bits/char */
kgdb_chaninit(zs_soft[tty_num].zs_channel, 1, 38400);
printk("KGDB: on channel %d initialized\n", tty_num);
set_debug_traps(); /* init stub */
}
#endif /* ifdef CONFIG_KGDB */
+
+
Index: zs.h
===================================================================
RCS file: /cvsroot/linux-vax/kernel-2.4/drivers/tc/zs.h,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -u -r1.1.1.1 -r1.2
--- zs.h 14 Jan 2001 19:06:04 -0000 1.1.1.1
+++ zs.h 9 Apr 2002 16:45:53 -0000 1.2
@@ -89,6 +89,18 @@
unsigned char curregs[NUM_ZSREGS];
};
+struct dec_serial;
+
+struct zs_hook {
+ int (*init_channel)(struct dec_serial* info);
+ void (*init_info)(struct dec_serial* info);
+ void (*rx_char)(unsigned char ch, unsigned char stat);
+ int (*poll_rx_char)(struct dec_serial* info);
+ int (*poll_tx_char)(struct dec_serial* info,
+ unsigned char ch);
+ unsigned cflags;
+};
+
struct dec_serial {
struct dec_serial *zs_next; /* For IRQ servicing chain */
struct dec_zschannel *zs_channel; /* Channel registers */
@@ -97,7 +109,7 @@
char soft_carrier; /* Use soft carrier on this channel */
char break_abort; /* Is serial console in, so process brk/abrt */
- char kgdb_channel; /* Kgdb is running on this channel */
+ struct zs_hook *hook; /* Hook on this channel */
char is_cons; /* Is this our console. */
unsigned char tx_active; /* character is being xmitted */
unsigned char tx_stopped; /* output is suspended */
--- tcsyms.c DELETED ---
|