git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
vserver 1.9.3
[linux-2.6.git]
/
drivers
/
char
/
keyboard.c
diff --git
a/drivers/char/keyboard.c
b/drivers/char/keyboard.c
index
010bff6
..
3137898
100644
(file)
--- a/
drivers/char/keyboard.c
+++ b/
drivers/char/keyboard.c
@@
-52,13
+52,12
@@
extern void ctrl_alt_del(void);
/*
* Some laptops take the 789uiojklm,. keys as number pad when NumLock is on.
/*
* Some laptops take the 789uiojklm,. keys as number pad when NumLock is on.
- * This seems a good reason to start with NumLock off. On
PC9800 and HIL keyboards
+ * This seems a good reason to start with NumLock off. On
HIL keyboards
* of PARISC machines however there is no NumLock key and everyone expects the keypad
* to be used for numbers.
*/
* of PARISC machines however there is no NumLock key and everyone expects the keypad
* to be used for numbers.
*/
-#if defined(CONFIG_X86_PC9800) || \
- defined(CONFIG_PARISC) && (defined(CONFIG_KEYBOARD_HIL) || defined(CONFIG_KEYBOARD_HIL_OLD))
+#if defined(CONFIG_PARISC) && (defined(CONFIG_KEYBOARD_HIL) || defined(CONFIG_KEYBOARD_HIL_OLD))
#define KBD_DEFLEDS (1 << VC_NUMLOCK)
#else
#define KBD_DEFLEDS 0
#define KBD_DEFLEDS (1 << VC_NUMLOCK)
#else
#define KBD_DEFLEDS 0
@@
-124,7
+123,7
@@
int shift_state = 0;
*/
static struct input_handler kbd_handler;
*/
static struct input_handler kbd_handler;
-static unsigned long key_down[
256/BITS_PER_LONG];
/* keyboard key bitmap */
+static unsigned long key_down[
NBITS(KEY_MAX)];
/* keyboard key bitmap */
static unsigned char shift_down[NR_SHIFT]; /* shift state counters.. */
static int dead_key_next;
static int npadch = -1; /* -1 or number assembled on pad */
static unsigned char shift_down[NR_SHIFT]; /* shift state counters.. */
static int dead_key_next;
static int npadch = -1; /* -1 or number assembled on pad */
@@
-143,7
+142,7
@@
static struct ledptr {
/* Simple translation table for the SysRq keys */
#ifdef CONFIG_MAGIC_SYSRQ
/* Simple translation table for the SysRq keys */
#ifdef CONFIG_MAGIC_SYSRQ
-unsigned char kbd_sysrq_xlate[
128
] =
+unsigned char kbd_sysrq_xlate[
KEY_MAX
] =
"\000\0331234567890-=\177\t" /* 0x00 - 0x0f */
"qwertyuiop[]\r\000as" /* 0x10 - 0x1f */
"dfghjkl;'`\000\\zxcv" /* 0x20 - 0x2f */
"\000\0331234567890-=\177\t" /* 0x00 - 0x0f */
"qwertyuiop[]\r\000as" /* 0x10 - 0x1f */
"dfghjkl;'`\000\\zxcv" /* 0x20 - 0x2f */
@@
-940,7
+939,10
@@
void kbd_refresh_leds(struct input_handle *handle)
tasklet_enable(&keyboard_tasklet);
}
tasklet_enable(&keyboard_tasklet);
}
-#if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_ALPHA) || defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_SPARC32) || defined(CONFIG_SPARC64) || defined(CONFIG_PARISC) || defined(CONFIG_SH_MPC1211)
+#if defined(CONFIG_X86) || defined(CONFIG_IA64) || defined(CONFIG_ALPHA) || defined(CONFIG_MIPS) || defined(CONFIG_PPC) || defined(CONFIG_SPARC32) || defined(CONFIG_SPARC64) || defined(CONFIG_PARISC) || defined(CONFIG_SUPERH)
+
+#define HW_RAW(dev) (test_bit(EV_MSC, dev->evbit) && test_bit(MSC_RAW, dev->mscbit) &&\
+ ((dev)->id.bustype == BUS_I8042) && ((dev)->id.vendor == 0x0001) && ((dev)->id.product == 0x0001))
static unsigned short x86_keycodes[256] =
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
static unsigned short x86_keycodes[256] =
{ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
@@
-1008,6
+1010,8
@@
static int emulate_raw(struct vc_data *vc, unsigned int keycode,
#else
#else
+#define HW_RAW(dev) 0
+
#warning "Cannot generate rawmode keyboard for your architecture yet."
static int emulate_raw(struct vc_data *vc, unsigned int keycode, unsigned char up_flag)
#warning "Cannot generate rawmode keyboard for your architecture yet."
static int emulate_raw(struct vc_data *vc, unsigned int keycode, unsigned char up_flag)
@@
-1020,7
+1024,15
@@
static int emulate_raw(struct vc_data *vc, unsigned int keycode, unsigned char u
}
#endif
}
#endif
-void kbd_keycode(unsigned int keycode, int down, struct pt_regs *regs)
+void kbd_rawcode(unsigned char data)
+{
+ struct vc_data *vc = vc_cons[fg_console].d;
+ kbd = kbd_table + fg_console;
+ if (kbd->kbdmode == VC_RAW)
+ put_queue(vc, data);
+}
+
+void kbd_keycode(unsigned int keycode, int down, int hw_raw, struct pt_regs *regs)
{
struct vc_data *vc = vc_cons[fg_console].d;
unsigned short keysym, *key_map;
{
struct vc_data *vc = vc_cons[fg_console].d;
unsigned short keysym, *key_map;
@@
-1054,7
+1066,7
@@
void kbd_keycode(unsigned int keycode, int down, struct pt_regs *regs)
return;
#endif /* CONFIG_MAC_EMUMOUSEBTN */
return;
#endif /* CONFIG_MAC_EMUMOUSEBTN */
- if ((raw_mode = (kbd->kbdmode == VC_RAW)))
+ if ((raw_mode = (kbd->kbdmode == VC_RAW))
&& !hw_raw
)
if (emulate_raw(vc, keycode, !down << 7))
if (keycode < BTN_MISC)
printk(KERN_WARNING "keyboard.c: can't emulate rawmode for keycode %d\n", keycode);
if (emulate_raw(vc, keycode, !down << 7))
if (keycode < BTN_MISC)
printk(KERN_WARNING "keyboard.c: can't emulate rawmode for keycode %d\n", keycode);
@@
-1120,6
+1132,9
@@
void kbd_keycode(unsigned int keycode, int down, struct pt_regs *regs)
return;
}
return;
}
+ if (keycode > NR_KEYS)
+ return;
+
keysym = key_map[keycode];
type = KTYP(keysym);
keysym = key_map[keycode];
type = KTYP(keysym);
@@
-1149,11
+1164,12
@@
void kbd_keycode(unsigned int keycode, int down, struct pt_regs *regs)
}
static void kbd_event(struct input_handle *handle, unsigned int event_type,
}
static void kbd_event(struct input_handle *handle, unsigned int event_type,
- unsigned int
keycode, int down
)
+ unsigned int
event_code, int value
)
{
{
- if (event_type != EV_KEY)
- return;
- kbd_keycode(keycode, down, handle->dev->regs);
+ if (event_type == EV_MSC && event_code == MSC_RAW && HW_RAW(handle->dev))
+ kbd_rawcode(value);
+ if (event_type == EV_KEY)
+ kbd_keycode(event_code, value, HW_RAW(handle->dev), handle->dev->regs);
tasklet_schedule(&keyboard_tasklet);
do_poke_blanked_console = 1;
schedule_console_callback();
tasklet_schedule(&keyboard_tasklet);
do_poke_blanked_console = 1;
schedule_console_callback();