• Home
  • Raw
  • Download

Lines Matching refs:kbd

77 	struct kbd_data *kbd;  in kbd_alloc()  local
80 kbd = kzalloc(sizeof(struct kbd_data), GFP_KERNEL); in kbd_alloc()
81 if (!kbd) in kbd_alloc()
83 kbd->key_maps = kzalloc(sizeof(ebc_key_maps), GFP_KERNEL); in kbd_alloc()
84 if (!kbd->key_maps) in kbd_alloc()
88 kbd->key_maps[i] = kmemdup(ebc_key_maps[i], in kbd_alloc()
91 if (!kbd->key_maps[i]) in kbd_alloc()
95 kbd->func_table = kzalloc(sizeof(ebc_func_table), GFP_KERNEL); in kbd_alloc()
96 if (!kbd->func_table) in kbd_alloc()
100 kbd->func_table[i] = kstrdup(ebc_func_table[i], in kbd_alloc()
102 if (!kbd->func_table[i]) in kbd_alloc()
106 kbd->fn_handler = in kbd_alloc()
108 if (!kbd->fn_handler) in kbd_alloc()
110 kbd->accent_table = kmemdup(ebc_accent_table, in kbd_alloc()
113 if (!kbd->accent_table) in kbd_alloc()
115 kbd->accent_table_size = ebc_accent_table_size; in kbd_alloc()
116 return kbd; in kbd_alloc()
119 kfree(kbd->fn_handler); in kbd_alloc()
122 kfree(kbd->func_table[i]); in kbd_alloc()
123 kfree(kbd->func_table); in kbd_alloc()
126 kfree(kbd->key_maps[i]); in kbd_alloc()
127 kfree(kbd->key_maps); in kbd_alloc()
129 kfree(kbd); in kbd_alloc()
135 kbd_free(struct kbd_data *kbd) in kbd_free() argument
139 kfree(kbd->accent_table); in kbd_free()
140 kfree(kbd->fn_handler); in kbd_free()
142 kfree(kbd->func_table[i]); in kbd_free()
143 kfree(kbd->func_table); in kbd_free()
145 kfree(kbd->key_maps[i]); in kbd_free()
146 kfree(kbd->key_maps); in kbd_free()
147 kfree(kbd); in kbd_free()
154 kbd_ascebc(struct kbd_data *kbd, unsigned char *ascebc) in kbd_ascebc() argument
161 keymap = kbd->key_maps[i]; in kbd_ascebc()
181 kbd_ebcasc(struct kbd_data *kbd, unsigned char *ebcasc)
188 keymap = kbd->key_maps[i];
212 handle_diacr(struct kbd_data *kbd, unsigned int ch) in handle_diacr() argument
216 d = kbd->diacr; in handle_diacr()
217 kbd->diacr = 0; in handle_diacr()
219 for (i = 0; i < kbd->accent_table_size; i++) { in handle_diacr()
220 if (kbd->accent_table[i].diacr == d && in handle_diacr()
221 kbd->accent_table[i].base == ch) in handle_diacr()
222 return kbd->accent_table[i].result; in handle_diacr()
228 kbd_put_queue(kbd->port, d); in handle_diacr()
236 k_dead(struct kbd_data *kbd, unsigned char value) in k_dead() argument
239 kbd->diacr = (kbd->diacr ? handle_diacr(kbd, value) : value); in k_dead()
246 k_self(struct kbd_data *kbd, unsigned char value) in k_self() argument
248 if (kbd->diacr) in k_self()
249 value = handle_diacr(kbd, value); in k_self()
250 kbd_put_queue(kbd->port, value); in k_self()
257 k_ignore(struct kbd_data *kbd, unsigned char value) in k_ignore() argument
265 k_fn(struct kbd_data *kbd, unsigned char value) in k_fn() argument
267 if (kbd->func_table[value]) in k_fn()
268 kbd_puts_queue(kbd->port, kbd->func_table[value]); in k_fn()
272 k_spec(struct kbd_data *kbd, unsigned char value) in k_spec() argument
276 if (kbd->fn_handler[value]) in k_spec()
277 kbd->fn_handler[value](kbd); in k_spec()
307 kbd_keycode(struct kbd_data *kbd, unsigned int keycode) in kbd_keycode() argument
312 if (!kbd) in kbd_keycode()
316 keysym = kbd->key_maps[5][keycode - 384]; in kbd_keycode()
318 keysym = kbd->key_maps[4][keycode - 256]; in kbd_keycode()
320 keysym = kbd->key_maps[1][keycode - 128]; in kbd_keycode()
322 keysym = kbd->key_maps[0][keycode]; in kbd_keycode()
331 if (kbd->sysrq) { in kbd_keycode()
332 if (kbd->sysrq == K(KT_LATIN, '-')) { in kbd_keycode()
333 kbd->sysrq = 0; in kbd_keycode()
338 kbd->sysrq = K(KT_LATIN, '-'); in kbd_keycode()
342 (*k_handler[KTYP(kbd->sysrq)])(kbd, KVAL(kbd->sysrq)); in kbd_keycode()
343 kbd->sysrq = 0; in kbd_keycode()
346 kbd->sysrq = K(type, value); in kbd_keycode()
350 (*k_handler[type])(kbd, value); in kbd_keycode()
352 to_utf8(kbd->port, keysym); in kbd_keycode()
359 do_kdsk_ioctl(struct kbd_data *kbd, struct kbentry __user *user_kbe, in do_kdsk_ioctl() argument
382 key_map = kbd->key_maps[kb_table]; in do_kdsk_ioctl()
395 key_map = kbd->key_maps[kb_table]; in do_kdsk_ioctl()
397 kbd->key_maps[kb_table] = NULL; in do_kdsk_ioctl()
408 if (!(key_map = kbd->key_maps[kb_table])) { in do_kdsk_ioctl()
415 kbd->key_maps[kb_table] = key_map; in do_kdsk_ioctl()
435 do_kdgkb_ioctl(struct kbd_data *kbd, struct kbsentry __user *u_kbs, in do_kdgkb_ioctl() argument
452 p = kbd->func_table[kb_func]; in do_kdgkb_ioctl()
470 kfree(kbd->func_table[kb_func]); in do_kdgkb_ioctl()
471 kbd->func_table[kb_func] = p; in do_kdgkb_ioctl()
477 int kbd_ioctl(struct kbd_data *kbd, unsigned int cmd, unsigned long arg) in kbd_ioctl() argument
490 tty = tty_port_tty_get(kbd->port); in kbd_ioctl()
499 return do_kdsk_ioctl(kbd, argp, cmd, perm); in kbd_ioctl()
502 return do_kdgkb_ioctl(kbd, argp, cmd, perm); in kbd_ioctl()
509 if (put_user(kbd->accent_table_size, &a->kb_cnt)) in kbd_ioctl()
511 for (i = 0; i < kbd->accent_table_size; i++) { in kbd_ioctl()
512 diacr.diacr = kbd->accent_table[i].diacr; in kbd_ioctl()
513 diacr.base = kbd->accent_table[i].base; in kbd_ioctl()
514 diacr.result = kbd->accent_table[i].result; in kbd_ioctl()
524 ct = kbd->accent_table_size; in kbd_ioctl()
527 if (copy_to_user(a->kbdiacruc, kbd->accent_table, in kbd_ioctl()
544 kbd->accent_table_size = ct; in kbd_ioctl()
548 kbd->accent_table[i].diacr = diacr.diacr; in kbd_ioctl()
549 kbd->accent_table[i].base = diacr.base; in kbd_ioctl()
550 kbd->accent_table[i].result = diacr.result; in kbd_ioctl()
564 kbd->accent_table_size = ct; in kbd_ioctl()
565 if (copy_from_user(kbd->accent_table, a->kbdiacruc, in kbd_ioctl()