Lines Matching defs:hc
200 hpckbd_initcore(struct hpckbd_core *hc, struct hpckbd_ic_if *ic, int console)
202 hc->hc_polling = 0;
203 hc->hc_console = console;
204 hc->hc_ic = ic;
207 hc->hc_head = hc->hc_tail = hc->hc_eventq;
208 hc->hc_nevents = 0;
210 hpckbd_keymap_lookup(hc);
214 hpckbd_initif(struct hpckbd_core *hc)
216 struct hpckbd_if *kbdif = &hc->hc_if;
218 kbdif->hi_ctx = hc;
221 hpckbd_ic_establish(hc->hc_ic, &hc->hc_if);
225 hpckbd_putevent(struct hpckbd_core* hc, u_int type, int data)
229 if (hc->hc_nevents == NEVENTQ) {
234 hc->hc_nevents++;
235 hc->hc_tail->hq_type = type;
236 hc->hc_tail->hq_data = data;
237 if (&hc->hc_eventq[NEVENTQ] <= ++hc->hc_tail)
238 hc->hc_tail = hc->hc_eventq;
245 hpckbd_getevent(struct hpckbd_core* hc, u_int *type, int *data)
249 if (hc->hc_nevents == 0) {
254 *type = hc->hc_head->hq_type;
255 *data = hc->hc_head->hq_data;
256 hc->hc_nevents--;
257 if (&hc->hc_eventq[NEVENTQ] <= ++hc->hc_head)
258 hc->hc_head = hc->hc_eventq;
272 hpckbd_keymap_setup(struct hpckbd_core *hc,
301 hpckbd_keymap_setup(struct hpckbd_core *hc,
337 hpckbd_keymap_lookup(struct hpckbd_core *hc)
347 hc->hc_keymap = tab->ht_keymap;
348 hc->hc_special = tab->ht_special;
353 hpckbd_keymap_setup(hc, tab->ht_cmdmap.map,
366 hc->hc_keymap = default_keymap;
367 hc->hc_special = default_special_keymap;
377 struct hpckbd_core *hc = arg;
379 if (hc->hc_polling) {
380 hc->hc_type = WSCONS_EVENT_ALL_KEYS_UP;
388 struct hpckbd_core *hc = arg;
397 key = hc->hc_keymap[scancode];
415 if (scancode == hc->hc_special[KEY_SPECIAL_OFF]) {
418 } else if (scancode == hc->hc_special[KEY_SPECIAL_LIGHT]) {
432 if (hc->hc_polling) {
433 if (hpckbd_putevent(hc, type, key) == 0)
437 if (hc->hc_rawkbd) {
441 wskbd_rawinput(hc->hc_wskbddev, data, n);
444 wskbd_input(hc->hc_wskbddev, type, key);
456 struct hpckbd_core *hc = &hpckbd_consdata;
458 hpckbd_initcore(hc, ic, 1 /* console */);
461 hpckbd_initif(hc);
464 wskbd_cnattach(&hpckbd_consops, hc, &hpckbd_keymapdata);
472 struct hpckbd_core *hc = arg;
474 if (!hc->hc_console || !hc->hc_polling || !hc->hc_ic)
477 while (hpckbd_getevent(hc, type, data) == 0) /* busy loop */
478 hpckbd_ic_poll(hc->hc_ic);
484 struct hpckbd_core *hc = arg;
486 hc->hc_polling = on;
492 struct hpckbd_core *hc = arg;
495 if (hc->hc_enabled)
497 hc->hc_enabled = 1;
499 if (hc->hc_console)
501 hc->hc_enabled = 0;
518 struct hpckbd_core *hc = arg;
531 hc->hc_rawkbd = (*(int *)data == WSKBD_RAW);