#include <linux/tty_flip.h>
#include <linux/mm.h>
#include <linux/string.h>
-#include <linux/random.h>
#include <linux/init.h>
#include <linux/slab.h>
/* Simple translation table for the SysRq keys */
#ifdef CONFIG_MAGIC_SYSRQ
-unsigned char kbd_sysrq_xlate[KEY_MAX] =
+unsigned char kbd_sysrq_xlate[KEY_MAX + 1] =
"\000\0331234567890-=\177\t" /* 0x00 - 0x0f */
"qwertyuiop[]\r\000as" /* 0x10 - 0x1f */
"dfghjkl;'`\000\\zxcv" /* 0x20 - 0x2f */
if (!dev)
return -ENODEV;
- if (scancode < 0 || scancode >= dev->keycodemax)
+ if (scancode >= dev->keycodemax)
return -EINVAL;
return INPUT_KEYCODE(dev, scancode);
{
struct list_head * node;
struct input_dev *dev = NULL;
- int i, oldkey;
+ unsigned int i, oldkey;
list_for_each(node,&kbd_handler.h_list) {
struct input_handle *handle = to_handle_h(node);
if (!dev)
return -ENODEV;
- if (scancode < 0 || scancode >= dev->keycodemax)
+ if (scancode >= dev->keycodemax)
+ return -EINVAL;
+ if (keycode > KEY_MAX)
+ return -EINVAL;
+ if (keycode < 0 || keycode > KEY_MAX)
return -EINVAL;
oldkey = SET_INPUT_KEYCODE(dev, scancode, keycode);
* in utf-8 already. UTF-8 is defined for words of up to 31 bits,
* but we need only 16 bits here
*/
-void to_utf8(struct vc_data *vc, ushort c)
+static void to_utf8(struct vc_data *vc, ushort c)
{
if (c < 0x80)
/* 0******* */
*/
void compute_shiftstate(void)
{
- int i, j, k, sym, val;
+ unsigned int i, j, k, sym, val;
shift_state = 0;
memset(shift_down, 0, sizeof(shift_down));
* Otherwise, conclude that DIACR was not combining after all,
* queue it and return CH.
*/
-unsigned char handle_diacr(struct vc_data *vc, unsigned char ch)
+static unsigned char handle_diacr(struct vc_data *vc, unsigned char ch)
{
int d = diacr;
- int i;
+ unsigned int i;
diacr = 0;
static void fn_scroll_forw(struct vc_data *vc, struct pt_regs *regs)
{
- scrollfront(0);
+ scrollfront(vc, 0);
}
static void fn_scroll_back(struct vc_data *vc, struct pt_regs *regs)
{
- scrollback(0);
+ scrollback(vc, 0);
}
static void fn_show_mem(struct vc_data *vc, struct pt_regs *regs)
*/
if (tty)
do_SAK(tty);
- reset_vc(fg_console);
+ reset_vc(vc);
}
static void fn_null(struct vc_data *vc, struct pt_regs *regs)
set_leds();
}
-void register_leds(struct kbd_struct *kbd, unsigned int led,
- unsigned int *addr, unsigned int mask)
-{
- if (led < 3) {
- ledptrs[led].addr = addr;
- ledptrs[led].mask = mask;
- ledptrs[led].valid = 1;
- kbd->ledmode = LED_SHOW_MEM;
- } else
- kbd->ledmode = LED_SHOW_FLAGS;
-}
-
static inline unsigned char getleds(void)
{
struct kbd_struct *kbd = kbd_table + fg_console;
/*
* This allows a newly plugged keyboard to pick the LED state.
*/
-void kbd_refresh_leds(struct input_handle *handle)
+static void kbd_refresh_leds(struct input_handle *handle)
{
unsigned char leds = ledstate;
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_SUPERH)
+#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) ||\
+ (defined(CONFIG_ARM) && defined(CONFIG_KEYBOARD_ATKBD) && !defined(CONFIG_ARCH_RPC))
#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))
}
#endif
-void kbd_rawcode(unsigned char data)
+static void kbd_rawcode(unsigned char data)
{
struct vc_data *vc = vc_cons[fg_console].d;
kbd = kbd_table + fg_console;
put_queue(vc, data);
}
-void kbd_keycode(unsigned int keycode, int down, int hw_raw, struct pt_regs *regs)
+static 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 tty_struct *tty;
int shift_final;
- if (down != 2)
- add_keyboard_randomness((keycode << 1) ^ down);
-
tty = vc->vc_tty;
if (tty && (!tty->driver_data)) {