• Home
  • Raw
  • Download

Lines Matching refs:kbd

51 	struct kbd_data *kbd;  in kbd_alloc()  local
54 kbd = kzalloc(sizeof(struct kbd_data), GFP_KERNEL); in kbd_alloc()
55 if (!kbd) in kbd_alloc()
57 kbd->key_maps = kzalloc(sizeof(key_maps), GFP_KERNEL); in kbd_alloc()
58 if (!kbd->key_maps) in kbd_alloc()
62 kbd->key_maps[i] = kmemdup(key_maps[i], in kbd_alloc()
65 if (!kbd->key_maps[i]) in kbd_alloc()
69 kbd->func_table = kzalloc(sizeof(func_table), GFP_KERNEL); in kbd_alloc()
70 if (!kbd->func_table) in kbd_alloc()
74 kbd->func_table[i] = kstrdup(func_table[i], in kbd_alloc()
76 if (!kbd->func_table[i]) in kbd_alloc()
80 kbd->fn_handler = in kbd_alloc()
82 if (!kbd->fn_handler) in kbd_alloc()
84 kbd->accent_table = kmemdup(accent_table, in kbd_alloc()
87 if (!kbd->accent_table) in kbd_alloc()
89 kbd->accent_table_size = accent_table_size; in kbd_alloc()
90 return kbd; in kbd_alloc()
93 kfree(kbd->fn_handler); in kbd_alloc()
96 kfree(kbd->func_table[i]); in kbd_alloc()
97 kfree(kbd->func_table); in kbd_alloc()
100 kfree(kbd->key_maps[i]); in kbd_alloc()
101 kfree(kbd->key_maps); in kbd_alloc()
103 kfree(kbd); in kbd_alloc()
109 kbd_free(struct kbd_data *kbd) in kbd_free() argument
113 kfree(kbd->accent_table); in kbd_free()
114 kfree(kbd->fn_handler); in kbd_free()
116 kfree(kbd->func_table[i]); in kbd_free()
117 kfree(kbd->func_table); in kbd_free()
119 kfree(kbd->key_maps[i]); in kbd_free()
120 kfree(kbd->key_maps); in kbd_free()
121 kfree(kbd); in kbd_free()
128 kbd_ascebc(struct kbd_data *kbd, unsigned char *ascebc) in kbd_ascebc() argument
135 keymap = kbd->key_maps[i]; in kbd_ascebc()
155 kbd_ebcasc(struct kbd_data *kbd, unsigned char *ebcasc)
162 keymap = kbd->key_maps[i];
186 handle_diacr(struct kbd_data *kbd, unsigned int ch) in handle_diacr() argument
190 d = kbd->diacr; in handle_diacr()
191 kbd->diacr = 0; in handle_diacr()
193 for (i = 0; i < kbd->accent_table_size; i++) { in handle_diacr()
194 if (kbd->accent_table[i].diacr == d && in handle_diacr()
195 kbd->accent_table[i].base == ch) in handle_diacr()
196 return kbd->accent_table[i].result; in handle_diacr()
202 kbd_put_queue(kbd->tty, d); in handle_diacr()
210 k_dead(struct kbd_data *kbd, unsigned char value) in k_dead() argument
213 kbd->diacr = (kbd->diacr ? handle_diacr(kbd, value) : value); in k_dead()
220 k_self(struct kbd_data *kbd, unsigned char value) in k_self() argument
222 if (kbd->diacr) in k_self()
223 value = handle_diacr(kbd, value); in k_self()
224 kbd_put_queue(kbd->tty, value); in k_self()
231 k_ignore(struct kbd_data *kbd, unsigned char value) in k_ignore() argument
239 k_fn(struct kbd_data *kbd, unsigned char value) in k_fn() argument
241 if (kbd->func_table[value]) in k_fn()
242 kbd_puts_queue(kbd->tty, kbd->func_table[value]); in k_fn()
246 k_spec(struct kbd_data *kbd, unsigned char value) in k_spec() argument
250 if (kbd->fn_handler[value]) in k_spec()
251 kbd->fn_handler[value](kbd); in k_spec()
281 kbd_keycode(struct kbd_data *kbd, unsigned int keycode) in kbd_keycode() argument
286 if (!kbd || !kbd->tty) in kbd_keycode()
290 keysym = kbd->key_maps[5][keycode - 384]; in kbd_keycode()
292 keysym = kbd->key_maps[4][keycode - 256]; in kbd_keycode()
294 keysym = kbd->key_maps[1][keycode - 128]; in kbd_keycode()
296 keysym = kbd->key_maps[0][keycode]; in kbd_keycode()
305 if (kbd->sysrq) { in kbd_keycode()
306 if (kbd->sysrq == K(KT_LATIN, '-')) { in kbd_keycode()
307 kbd->sysrq = 0; in kbd_keycode()
312 kbd->sysrq = K(KT_LATIN, '-'); in kbd_keycode()
316 (*k_handler[KTYP(kbd->sysrq)])(kbd, KVAL(kbd->sysrq)); in kbd_keycode()
317 kbd->sysrq = 0; in kbd_keycode()
320 kbd->sysrq = K(type, value); in kbd_keycode()
324 (*k_handler[type])(kbd, value); in kbd_keycode()
326 to_utf8(kbd->tty, keysym); in kbd_keycode()
333 do_kdsk_ioctl(struct kbd_data *kbd, struct kbentry __user *user_kbe, in do_kdsk_ioctl() argument
352 key_map = kbd->key_maps[tmp.kb_table]; in do_kdsk_ioctl()
365 key_map = kbd->key_maps[tmp.kb_table]; in do_kdsk_ioctl()
367 kbd->key_maps[tmp.kb_table] = NULL; in do_kdsk_ioctl()
378 if (!(key_map = kbd->key_maps[tmp.kb_table])) { in do_kdsk_ioctl()
385 kbd->key_maps[tmp.kb_table] = key_map; in do_kdsk_ioctl()
405 do_kdgkb_ioctl(struct kbd_data *kbd, struct kbsentry __user *u_kbs, in do_kdgkb_ioctl() argument
422 p = kbd->func_table[kb_func]; in do_kdgkb_ioctl()
451 kfree(kbd->func_table[kb_func]); in do_kdgkb_ioctl()
452 kbd->func_table[kb_func] = p; in do_kdgkb_ioctl()
458 int kbd_ioctl(struct kbd_data *kbd, unsigned int cmd, unsigned long arg) in kbd_ioctl() argument
470 perm = current->signal->tty == kbd->tty || capable(CAP_SYS_TTY_CONFIG); in kbd_ioctl()
476 return do_kdsk_ioctl(kbd, argp, cmd, perm); in kbd_ioctl()
479 return do_kdgkb_ioctl(kbd, argp, cmd, perm); in kbd_ioctl()
486 if (put_user(kbd->accent_table_size, &a->kb_cnt)) in kbd_ioctl()
488 for (i = 0; i < kbd->accent_table_size; i++) { in kbd_ioctl()
489 diacr.diacr = kbd->accent_table[i].diacr; in kbd_ioctl()
490 diacr.base = kbd->accent_table[i].base; in kbd_ioctl()
491 diacr.result = kbd->accent_table[i].result; in kbd_ioctl()
501 ct = kbd->accent_table_size; in kbd_ioctl()
504 if (copy_to_user(a->kbdiacruc, kbd->accent_table, in kbd_ioctl()
521 kbd->accent_table_size = ct; in kbd_ioctl()
525 kbd->accent_table[i].diacr = diacr.diacr; in kbd_ioctl()
526 kbd->accent_table[i].base = diacr.base; in kbd_ioctl()
527 kbd->accent_table[i].result = diacr.result; in kbd_ioctl()
541 kbd->accent_table_size = ct; in kbd_ioctl()
542 if (copy_from_user(kbd->accent_table, a->kbdiacruc, in kbd_ioctl()