diff -ru /usr/src/sys/dev/atkbdc/atkbd.c src/sys/dev/atkbdc/atkbd.c --- /usr/src/sys/dev/atkbdc/atkbd.c Wed Oct 25 15:35:42 2006 +++ src/sys/dev/atkbdc/atkbd.c Thu Dec 20 12:14:12 2007 @@ -162,15 +162,15 @@ */ s = spltty(); kbd = (keyboard_t *)arg; - if ((*kbdsw[kbd->kb_index]->lock)(kbd, TRUE)) { + if (kbdd_lock(kbd, TRUE)) { /* * We have seen the lock flag is not set. Let's reset * the flag early, otherwise the LED update routine fails * which may want the lock during the interrupt routine. */ - (*kbdsw[kbd->kb_index]->lock)(kbd, FALSE); - if ((*kbdsw[kbd->kb_index]->check_char)(kbd)) - (*kbdsw[kbd->kb_index]->intr)(kbd, NULL); + kbdd_lock(kbd, FALSE); + if (kbdd_check_char(kbd)) + kbdd_intr(kbd, NULL); } splx(s); timeout(atkbd_timeout, arg, hz/10); diff -ru /usr/src/sys/dev/atkbdc/atkbd_atkbdc.c src/sys/dev/atkbdc/atkbd_atkbdc.c --- /usr/src/sys/dev/atkbdc/atkbd_atkbdc.c Sun Mar 25 03:25:23 2007 +++ src/sys/dev/atkbdc/atkbd_atkbdc.c Thu Dec 20 12:14:12 2007 @@ -158,9 +158,9 @@ kbd->kb_flags &= ~KB_INITIALIZED; args[0] = device_get_unit(device_get_parent(dev)); args[1] = rman_get_start(sc->intr); - (*kbdsw[kbd->kb_index]->init)(device_get_unit(dev), &kbd, - args, device_get_flags(dev)); - (*kbdsw[kbd->kb_index]->clear_state)(kbd); + kbdd_init(kbd, device_get_unit(dev), &kbd, args, + device_get_flags(dev)); + kbdd_clear_state(kbd); } return 0; } @@ -171,7 +171,7 @@ keyboard_t *kbd; kbd = (keyboard_t *)arg; - (*kbdsw[kbd->kb_index]->intr)(kbd, NULL); + kbdd_intr(kbd, NULL); } DRIVER_MODULE(atkbd, atkbdc, atkbd_driver, atkbd_devclass, 0, 0); Only in /usr/src/sys/dev/if_ndis: if_ndis.c.orig diff -ru /usr/src/sys/dev/kbd/kbd.c src/sys/dev/kbd/kbd.c --- /usr/src/sys/dev/kbd/kbd.c Mon Nov 6 14:41:54 2006 +++ src/sys/dev/kbd/kbd.c Thu Dec 20 12:14:12 2007 @@ -219,8 +219,7 @@ strcpy(ki.kb_name, kbd->kb_name); ki.kb_unit = kbd->kb_unit; - (*kbdsw[mux->kb_index]->ioctl) - (mux, KBADDKBD, (caddr_t) &ki); + kbdd_ioctl(mux, KBADDKBD, (caddr_t) &ki); } return (index); @@ -237,8 +236,7 @@ strcpy(ki.kb_name, kbd->kb_name); ki.kb_unit = kbd->kb_unit; - (*kbdsw[mux->kb_index]->ioctl) - (mux, KBADDKBD, (caddr_t) &ki); + kbdd_ioctl(mux, KBADDKBD, (caddr_t) &ki); } return (index); @@ -363,7 +361,7 @@ KBD_BUSY(keyboard[index]); keyboard[index]->kb_callback.kc_func = func; keyboard[index]->kb_callback.kc_arg = arg; - (*kbdsw[index]->clear_state)(keyboard[index]); + kbdd_clear_state(keyboard[index]); } splx(s); return (index); @@ -385,7 +383,7 @@ KBD_UNBUSY(kbd); kbd->kb_callback.kc_func = NULL; kbd->kb_callback.kc_arg = NULL; - (*kbdsw[kbd->kb_index]->clear_state)(kbd); + kbdd_clear_state(kbd); error = 0; } splx(s); @@ -664,7 +662,7 @@ kbd = kbd_get_keyboard(KBD_INDEX(dev)); if ((kbd == NULL) || !KBD_IS_VALID(kbd)) return (ENXIO); - error = (*kbdsw[kbd->kb_index]->ioctl)(kbd, cmd, arg); + error = kbdd_ioctl(kbd, cmd, arg); if (error == ENOIOCTL) error = ENODEV; return (error); @@ -723,12 +721,12 @@ } /* obtain the current key input mode */ - if ((*kbdsw[kbd->kb_index]->ioctl)(kbd, KDGKBMODE, (caddr_t)&mode)) + if (kbdd_ioctl(kbd, KDGKBMODE, (caddr_t)&mode)) mode = K_XLATE; /* read all pending input */ - while ((*kbdsw[kbd->kb_index]->check_char)(kbd)) { - c = (*kbdsw[kbd->kb_index]->read_char)(kbd, FALSE); + while (kbdd_check_char(kbd)) { + c = kbdd_read_char(kbd, FALSE); if (c == NOKEY) continue; if (c == ERRKEY) /* XXX: ring bell? */ @@ -771,8 +769,7 @@ putc(KEYCHAR(c), &sc->gkb_q); break; case FKEY | SPCLKEY: /* a function key, return string */ - cp = (*kbdsw[kbd->kb_index]->get_fkeystr)(kbd, - KEYCHAR(c), &len); + cp = kbdd_get_fkeystr(kbd, KEYCHAR(c), &len); if (cp != NULL) { while (len-- > 0) putc(*cp++, &sc->gkb_q); @@ -1110,7 +1107,7 @@ (s) |= l ## DOWN; \ (s) ^= l ## ED; \ i = (s) & LOCK_MASK; \ - (*kbdsw[(k)->kb_index]->ioctl)((k), KDSETLED, (caddr_t)&i); \ + kbdd_ioctl((k), KDSETLED, (caddr_t)&i); \ } static u_int @@ -1270,8 +1267,7 @@ #else state &= ~CLKED; i = state & LOCK_MASK; - (*kbdsw[kbd->kb_index]->ioctl)(kbd, KDSETLED, - (caddr_t)&i); + kbdd_ioctl(kbd, KDSETLED, (caddr_t)&i); #endif break; case SLK: @@ -1307,8 +1303,7 @@ #else state |= CLKED; i = state & LOCK_MASK; - (*kbdsw[kbd->kb_index]->ioctl)(kbd, KDSETLED, - (caddr_t)&i); + kbdd_ioctl(kbd, KDSETLED, (caddr_t)&i); #endif break; case SLK: diff -ru /usr/src/sys/dev/kbd/kbdreg.h src/sys/dev/kbd/kbdreg.h --- /usr/src/sys/dev/kbd/kbdreg.h Thu Jul 14 01:58:57 2005 +++ src/sys/dev/kbd/kbdreg.h Thu Dec 20 12:14:12 2007 @@ -157,6 +157,50 @@ kbd_diag_t *diag; } keyboard_switch_t; +/* + * Keyboard disciplines: call actual handlers via kbdsw[]. + */ +#define kbdd_probe(kbd, unit, arg, flags) \ + (*kbdsw[(kbd)->kb_index]->probe)((unit), (arg), (flags)) +#define kbdd_init(kbd, unit, kbdpp, arg, flags) \ + (*kbdsw[(kbd)->kb_index]->init)((unit), (kbdpp), (arg), (flags)) +#define kbdd_term(kbd) \ + (*kbdsw[(kbd)->kb_index]->term)((kbd)) +#define kbdd_intr(kbd, arg) \ + (*kbdsw[(kbd)->kb_index]->intr)((kbd), (arg)) +#define kbdd_test_if(kbd) \ + (*kbdsw[(kbd)->kb_index]->test_if)((kbd)) +#define kbdd_enable(kbd) \ + (*kbdsw[(kbd)->kb_index]->enable)((kbd)) +#define kbdd_disable(kbd) \ + (*kbdsw[(kbd)->kb_index]->disable)((kbd)) +#define kbdd_read(kbd, wait) \ + (*kbdsw[(kbd)->kb_index]->read)((kbd), (wait)) +#define kbdd_check(kbd) \ + (*kbdsw[(kbd)->kb_index]->check)((kbd)) +#define kbdd_read_char(kbd, wait) \ + (*kbdsw[(kbd)->kb_index]->read_char)((kbd), (wait)) +#define kbdd_check_char(kbd) \ + (*kbdsw[(kbd)->kb_index]->check_char)((kbd)) +#define kbdd_ioctl(kbd, cmd, arg) \ + (((kbd) == NULL) ? \ + ENODEV : \ + (*kbdsw[(kbd)->kb_index]->ioctl)((kbd), (cmd), (arg))) +#define kbdd_lock(kbd, lockf) \ + (*kbdsw[(kbd)->kb_index]->lock)((kbd), (lockf)) +#define kbdd_clear_state(kbd) \ + (*kbdsw[(kbd)->kb_index]->clear_state)((kbd)) +#define kbdd_get_state(kbd, buf, len) \ + (*kbdsw[(kbd)->kb_index]->get_state)((kbd), (buf), (len)) +#define kbdd_set_state(kbd, buf, len) \ + (*kbdsw[(kbd)->kb_index]->set_state)((kbd), (buf), (len)) +#define kbdd_get_fkeystr(kbd, fkey, len) \ + (*kbdsw[(kbd)->kb_index]->get_fkeystr)((kbd), (fkey), (len)) +#define kbdd_poll(kbd, on) \ + (*kbdsw[(kbd)->kb_index]->poll)((kbd), (on)) +#define kbdd_diag(kbd, level) \ + (*kbdsw[(kbd)->kb_index]->diag)((kbd), (leve)) + /* keyboard driver */ typedef struct keyboard_driver { SLIST_ENTRY(keyboard_driver) link; diff -ru /usr/src/sys/dev/kbdmux/kbdmux.c src/sys/dev/kbdmux/kbdmux.c --- /usr/src/sys/dev/kbdmux/kbdmux.c Mon Oct 15 22:20:10 2007 +++ src/sys/dev/kbdmux/kbdmux.c Thu Dec 20 12:14:13 2007 @@ -118,27 +118,6 @@ taskqueue_enqueue(taskqueue_swi_giant, &(s)->ks_task) #endif /* not yet */ -#define KBDMUX_INTR(kbd, arg) \ - (*kbdsw[(kbd)->kb_index]->intr)((kbd), (arg)) - -#define KBDMUX_IOCTL(kbd, cmd, arg) \ - (*kbdsw[(kbd)->kb_index]->ioctl)((kbd), (cmd), (caddr_t) (arg)) - -#define KBDMUX_CHECK_CHAR(kbd) \ - (*kbdsw[(kbd)->kb_index]->check_char)((kbd)) - -#define KBDMUX_READ_CHAR(kbd, wait) \ - (*kbdsw[(kbd)->kb_index]->read_char)((kbd), (wait)) - -#define KBDMUX_ENABLE(kbd) \ - (*kbdsw[(kbd)->kb_index]->enable)((kbd)) - -#define KBDMUX_POLL(kbd, on) \ - (*kbdsw[(kbd)->kb_index]->poll)((kbd), (on)) - -#define KBDMUX_CLEAR_STATE(kbd) \ - (*kbdsw[(kbd)->kb_index]->clear_state)((kbd)) - /* * kbdmux keyboard */ @@ -197,7 +176,7 @@ keyboard_t *kbd = (keyboard_t *) xkbd; kbdmux_state_t *state = (kbdmux_state_t *) kbd->kb_data; - KBDMUX_INTR(kbd, NULL); + kbdd_intr(kbd, NULL); KBDMUX_LOCK(state); @@ -258,8 +237,8 @@ * NOKEY. */ - while (KBDMUX_CHECK_CHAR(kbd)) { - c = KBDMUX_READ_CHAR(kbd, 0); + while (kbdd_check_char(kbd)) { + c = kbdd_read_char(kbd, 0); if (c == NOKEY) break; if (c == ERRKEY) @@ -662,8 +641,8 @@ kbdmux_kbd_t *k; SLIST_FOREACH(k, &state->ks_kbds, next) { - while (KBDMUX_CHECK_CHAR(k->kbd)) { - scancode = KBDMUX_READ_CHAR(k->kbd, 0); + while (kbdd_check_char(k->kbd)) { + scancode = kbdd_read_char(k->kbd, 0); if (scancode == NOKEY) break; if (scancode == ERRKEY) @@ -992,16 +971,16 @@ return (EINVAL); /* bad keyboard */ } - KBDMUX_ENABLE(k->kbd); - KBDMUX_CLEAR_STATE(k->kbd); + kbdd_enable(k->kbd); + kbdd_clear_state(k->kbd); /* set K_RAW mode on slave keyboard */ mode = K_RAW; - error = KBDMUX_IOCTL(k->kbd, KDSKBMODE, &mode); + error = kbdd_ioctl(k->kbd, KDSKBMODE, (caddr_t)&mode); if (error == 0) { /* set lock keys state on slave keyboard */ mode = state->ks_state & LOCK_MASK; - error = KBDMUX_IOCTL(k->kbd, KDSKBSTATE, &mode); + error = kbdd_ioctl(k->kbd, KDSKBSTATE, (caddr_t)&mode); } if (error != 0) { @@ -1115,7 +1094,7 @@ /* KDSETLED on all slave keyboards */ SLIST_FOREACH(k, &state->ks_kbds, next) - KBDMUX_IOCTL(k->kbd, KDSETLED, arg); + kbdd_ioctl(k->kbd, KDSETLED, arg); KBDMUX_UNLOCK(state); break; @@ -1146,7 +1125,7 @@ /* KDSKBSTATE on all slave keyboards */ SLIST_FOREACH(k, &state->ks_kbds, next) - KBDMUX_IOCTL(k->kbd, KDSKBSTATE, arg); + kbdd_ioctl(k->kbd, KDSKBSTATE, arg); KBDMUX_UNLOCK(state); @@ -1192,7 +1171,7 @@ /* perform command on all slave keyboards */ SLIST_FOREACH(k, &state->ks_kbds, next) - KBDMUX_IOCTL(k->kbd, cmd, arg); + kbdd_ioctl(k->kbd, cmd, arg); KBDMUX_UNLOCK(state); break; @@ -1205,7 +1184,7 @@ /* perform command on all slave keyboards */ SLIST_FOREACH(k, &state->ks_kbds, next) - KBDMUX_IOCTL(k->kbd, cmd, arg); + kbdd_ioctl(k->kbd, cmd, arg); KBDMUX_UNLOCK(state); /* FALLTHROUGH */ @@ -1302,7 +1281,7 @@ /* set poll on slave keyboards */ SLIST_FOREACH(k, &state->ks_kbds, next) - KBDMUX_POLL(k->kbd, on); + kbdd_poll(k->kbd, on); KBDMUX_UNLOCK(state); Only in src/sys/dev/syscons: change.sh Only in src/sys/dev/syscons: sed diff -ru /usr/src/sys/dev/syscons/syscons.c src/sys/dev/syscons/syscons.c --- /usr/src/sys/dev/syscons/syscons.c Mon Oct 15 22:20:50 2007 +++ src/sys/dev/syscons/syscons.c Thu Dec 20 12:14:14 2007 @@ -393,7 +393,7 @@ scrn_timer(sc); /* set up the keyboard */ - kbd_ioctl(sc->kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode); + kbdd_ioctl(sc->kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode); update_kbd_state(scp, scp->status, LOCK_MASK); printf("%s%d: %s <%d virtual consoles, flags=0x%x>\n", @@ -510,7 +510,7 @@ #ifndef __sparc64__ if (sc->kbd != NULL) { key.keynum = KEYCODE_BS; - kbd_ioctl(sc->kbd, GIO_KEYMAPENT, (caddr_t)&key); + kbdd_ioctl(sc->kbd, GIO_KEYMAPENT, (caddr_t)&key); tp->t_cc[VERASE] = key.key.map[0]; } #endif @@ -577,7 +577,7 @@ #endif scp->kbd_mode = K_XLATE; if (scp == scp->sc->cur_scp) - kbd_ioctl(scp->sc->kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode); + kbdd_ioctl(scp->sc->kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode); DPRINTF(5, ("done.\n")); } spltty(); @@ -641,7 +641,7 @@ ttyld_rint(cur_tty, KEYCHAR(c)); break; case FKEY: /* function key, return string */ - cp = kbd_get_fkeystr(thiskbd, KEYCHAR(c), &len); + cp = kbdd_get_fkeystr(thiskbd, KEYCHAR(c), &len); if (cp != NULL) { while (len-- > 0) ttyld_rint(cur_tty, *cp++); @@ -1137,7 +1137,7 @@ case KDGETREPEAT: /* get keyboard repeat & delay rates */ case KDSETREPEAT: /* set keyboard repeat & delay rates (new) */ - error = kbd_ioctl(sc->kbd, cmd, data); + error = kbdd_ioctl(sc->kbd, cmd, data); if (error == ENOIOCTL) error = ENODEV; return error; @@ -1152,7 +1152,7 @@ case KDSETRAD: /* set keyboard repeat & delay rates (old) */ if (*(int *)data & ~0x7f) return EINVAL; - error = kbd_ioctl(sc->kbd, KDSETRAD, data); + error = kbdd_ioctl(sc->kbd, KDSETRAD, data); if (error == ENOIOCTL) error = ENODEV; return error; @@ -1171,7 +1171,7 @@ case K_CODE: /* switch to CODE mode */ scp->kbd_mode = *(int *)data; if (scp == sc->cur_scp) - kbd_ioctl(sc->kbd, KDSKBMODE, data); + kbdd_ioctl(sc->kbd, KDSKBMODE, data); return 0; default: return EINVAL; @@ -1183,7 +1183,7 @@ return 0; case KDGKBINFO: - error = kbd_ioctl(sc->kbd, cmd, data); + error = kbdd_ioctl(sc->kbd, cmd, data); if (error == ENOIOCTL) error = ENODEV; return error; @@ -1220,7 +1220,7 @@ return 0; case KDGKBTYPE: /* get keyboard type */ - error = kbd_ioctl(sc->kbd, cmd, data); + error = kbdd_ioctl(sc->kbd, cmd, data); if (error == ENOIOCTL) { /* always return something? XXX */ *(int *)data = 0; @@ -1251,7 +1251,7 @@ case KBADDKBD: /* add/remove keyboard to/from mux */ case KBRELKBD: - error = kbd_ioctl(sc->kbd, cmd, data); + error = kbdd_ioctl(sc->kbd, cmd, data); if (error == ENOIOCTL) error = ENODEV; return error; @@ -1285,7 +1285,7 @@ } sc->kbd = kbd_get_keyboard(i); /* sc->kbd == newkbd */ sc->keyboard = i; - kbd_ioctl(sc->kbd, KDSKBMODE, + kbdd_ioctl(sc->kbd, KDSKBMODE, (caddr_t)&sc->cur_scp->kbd_mode); update_kbd_state(sc->cur_scp, sc->cur_scp->status, LOCK_MASK); @@ -1359,7 +1359,7 @@ case PIO_DEADKEYMAP: /* set accent key translation table */ case GETFKEY: /* get function key string */ case SETFKEY: /* set function key string */ - error = kbd_ioctl(sc->kbd, cmd, data); + error = kbdd_ioctl(sc->kbd, cmd, data); if (error == ENOIOCTL) error = ENODEV; return error; @@ -1612,27 +1612,27 @@ * Make sure the keyboard is accessible even when the kbd device * driver is disabled. */ - kbd_enable(scp->sc->kbd); + kbdd_enable(scp->sc->kbd); /* we shall always use the keyboard in the XLATE mode here */ cur_mode = scp->kbd_mode; scp->kbd_mode = K_XLATE; - kbd_ioctl(scp->sc->kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode); + kbdd_ioctl(scp->sc->kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode); - kbd_poll(scp->sc->kbd, TRUE); + kbdd_poll(scp->sc->kbd, TRUE); c = scgetc(scp->sc, SCGETC_CN | flags); - kbd_poll(scp->sc->kbd, FALSE); + kbdd_poll(scp->sc->kbd, FALSE); scp->kbd_mode = cur_mode; - kbd_ioctl(scp->sc->kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode); - kbd_disable(scp->sc->kbd); + kbdd_ioctl(scp->sc->kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode); + kbdd_disable(scp->sc->kbd); splx(s); switch (KEYFLAGS(c)) { case 0: /* normal char */ return KEYCHAR(c); case FKEY: /* function key */ - p = kbd_get_fkeystr(scp->sc->kbd, KEYCHAR(c), (size_t *)&fkeycp); + p = kbdd_get_fkeystr(scp->sc->kbd, KEYCHAR(c), (size_t *)&fkeycp); fkey.len = fkeycp; if ((p != NULL) && (fkey.len > 0)) { bcopy(p, fkey.str, fkey.len); @@ -1717,7 +1717,7 @@ sc->keyboard = sc_allocate_keyboard(sc, -1); if (sc->keyboard >= 0) { sc->kbd = kbd_get_keyboard(sc->keyboard); - kbd_ioctl(sc->kbd, KDSKBMODE, + kbdd_ioctl(sc->kbd, KDSKBMODE, (caddr_t)&sc->cur_scp->kbd_mode); update_kbd_state(sc->cur_scp, sc->cur_scp->status, LOCK_MASK); @@ -2501,7 +2501,7 @@ /* set up the keyboard for the new screen */ if (sc->old_scp->kbd_mode != scp->kbd_mode) - kbd_ioctl(sc->kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode); + kbdd_ioctl(sc->kbd, KDSKBMODE, (caddr_t)&scp->kbd_mode); update_kbd_state(scp, scp->status, LOCK_MASK); mark_all(scp); @@ -3182,7 +3182,7 @@ scp = sc->cur_scp; /* first see if there is something in the keyboard port */ for (;;) { - c = kbd_read_char(sc->kbd, !(flags & SCGETC_NONBLOCK)); + c = kbdd_read_char(sc->kbd, !(flags & SCGETC_NONBLOCK)); if (c == ERRKEY) { if (!(flags & SCGETC_CN)) sc_bell(scp, bios_value.bell_pitch, BELL_DURATION); @@ -3278,7 +3278,7 @@ case NLK: case CLK: case ALK: break; case SLK: - kbd_ioctl(sc->kbd, KDGKBSTATE, (caddr_t)&f); + kbdd_ioctl(sc->kbd, KDGKBSTATE, (caddr_t)&f); if (f & SLKED) { scp->status |= SLKED; } else { @@ -3446,7 +3446,7 @@ int state; int error; - error = kbd_ioctl(scp->sc->kbd, KDGKBSTATE, (caddr_t)&state); + error = kbdd_ioctl(scp->sc->kbd, KDGKBSTATE, (caddr_t)&state); if (error == ENOIOCTL) error = ENODEV; if (error == 0) { @@ -3463,7 +3463,7 @@ int error; if (mask != LOCK_MASK) { - error = kbd_ioctl(scp->sc->kbd, KDGKBSTATE, (caddr_t)&state); + error = kbdd_ioctl(scp->sc->kbd, KDGKBSTATE, (caddr_t)&state); if (error == ENOIOCTL) error = ENODEV; if (error) @@ -3473,7 +3473,7 @@ } else { state = new_bits & LOCK_MASK; } - error = kbd_ioctl(scp->sc->kbd, KDSKBSTATE, (caddr_t)&state); + error = kbdd_ioctl(scp->sc->kbd, KDSKBSTATE, (caddr_t)&state); if (error == ENOIOCTL) error = ENODEV; return error; @@ -3485,7 +3485,7 @@ int error; which &= LOCK_MASK; - error = kbd_ioctl(scp->sc->kbd, KDSETLED, (caddr_t)&which); + error = kbdd_ioctl(scp->sc->kbd, KDSETLED, (caddr_t)&which); if (error == ENOIOCTL) error = ENODEV; return error; @@ -3693,7 +3693,7 @@ strcpy(ki.kb_name, k->kb_name); ki.kb_unit = k->kb_unit; - kbd_ioctl(k0, KBADDKBD, (caddr_t) &ki); + kbdd_ioctl(k0, KBADDKBD, (caddr_t) &ki); } } else idx0 = kbd_allocate("*", unit, (void *)&sc->keyboard, sckbdevent, sc); diff -ru /usr/src/sys/dev/syscons/syscons.h src/sys/dev/syscons/syscons.h --- /usr/src/sys/dev/syscons/syscons.h Mon Oct 15 22:20:50 2007 +++ src/sys/dev/syscons/syscons.h Thu Dec 20 12:14:15 2007 @@ -516,26 +516,6 @@ #define ISSIGVALID(sig) ((sig) > 0 && (sig) < NSIG) -#define kbd_read_char(kbd, wait) \ - (*kbdsw[(kbd)->kb_index]->read_char)((kbd), (wait)) -#define kbd_check_char(kbd) \ - (*kbdsw[(kbd)->kb_index]->check_char)((kbd)) -#define kbd_enable(kbd) \ - (*kbdsw[(kbd)->kb_index]->enable)((kbd)) -#define kbd_disable(kbd) \ - (*kbdsw[(kbd)->kb_index]->disable)((kbd)) -#define kbd_lock(kbd, lockf) \ - (*kbdsw[(kbd)->kb_index]->lock)((kbd), (lockf)) -#define kbd_ioctl(kbd, cmd, arg) \ - (((kbd) == NULL) ? \ - ENODEV : (*kbdsw[(kbd)->kb_index]->ioctl)((kbd), (cmd), (arg))) -#define kbd_clear_state(kbd) \ - (*kbdsw[(kbd)->kb_index]->clear_state)((kbd)) -#define kbd_get_fkeystr(kbd, fkey, len) \ - (*kbdsw[(kbd)->kb_index]->get_fkeystr)((kbd), (fkey), (len)) -#define kbd_poll(kbd, on) \ - (*kbdsw[(kbd)->kb_index]->poll)((kbd), (on)) - #define SC_VIDEO_LOCKINIT(sc) \ mtx_init(&(sc)->video_mtx, "syscons video lock", NULL,MTX_SPIN); #define SC_VIDEO_LOCK(sc) \ diff -ru /usr/src/sys/dev/usb/ukbd.c src/sys/dev/usb/ukbd.c --- /usr/src/sys/dev/usb/ukbd.c Sun Nov 18 21:15:51 2007 +++ src/sys/dev/usb/ukbd.c Thu Dec 20 12:14:15 2007 @@ -222,14 +222,14 @@ DPRINTF(("%s: keyboard not attached!?\n", device_get_nameunit(self))); return ENXIO; } - (*kbdsw[kbd->kb_index]->disable)(kbd); + kbdd_disable(kbd); #ifdef KBD_INSTALL_CDEV error = kbd_detach(kbd); if (error) return error; #endif - error = (*kbdsw[kbd->kb_index]->term)(kbd); + error = kbdd_term(kbd); if (error) return error; @@ -246,7 +246,7 @@ kbd = kbd_get_keyboard(kbd_find_keyboard(DRIVER_NAME, device_get_unit(self))); if (kbd) - (*kbdsw[kbd->kb_index]->clear_state)(kbd); + kbdd_clear_state(kbd); return (0); } @@ -255,7 +255,7 @@ { keyboard_t *kbd = (keyboard_t *)addr; - (*kbdsw[kbd->kb_index]->intr)(kbd, (void *)status); + kbdd_intr(kbd, (void *)status); } #define UKBD_DEFAULT 0 @@ -705,7 +705,7 @@ kbd = (keyboard_t *)arg; state = (ukbd_state_t *)kbd->kb_data; s = splusb(); - (*kbdsw[kbd->kb_index]->intr)(kbd, (void *)USBD_NORMAL_COMPLETION); + kbdd_intr(kbd, (void *)USBD_NORMAL_COMPLETION); callout_reset(&state->ks_timeout_handle, hz / 40, ukbd_timeout, arg); splx(s); } diff -ru /usr/src/sys/dev/vkbd/vkbd.c src/sys/dev/vkbd/vkbd.c --- /usr/src/sys/dev/vkbd/vkbd.c Wed Sep 27 21:57:00 2006 +++ src/sys/dev/vkbd/vkbd.c Thu Dec 20 12:14:16 2007 @@ -278,11 +278,11 @@ VKBD_UNLOCK(state); - (*kbdsw[kbd->kb_index]->disable)(kbd); + kbdd_disable(kbd); #ifdef KBD_INSTALL_CDEV kbd_detach(kbd); #endif /* def KBD_INSTALL_CDEV */ - (*kbdsw[kbd->kb_index]->term)(kbd); + kbdd_term(kbd); /* XXX FIXME: dev->si_drv1 locking */ dev->si_drv1 = NULL; @@ -437,8 +437,7 @@ { keyboard_t *kbd = VKBD_KEYBOARD(dev); - return ((kbd == NULL)? ENXIO : - (*kbdsw[kbd->kb_index]->ioctl)(kbd, cmd, data)); + return ((kbd == NULL)? ENXIO : kbdd_ioctl(kbd, cmd, data)); } /* Poll device */ @@ -482,7 +481,7 @@ keyboard_t *kbd = (keyboard_t *) xkbd; vkbd_state_t *state = (vkbd_state_t *) kbd->kb_data; - (*kbdsw[kbd->kb_index]->intr)(kbd, NULL); + kbdd_intr(kbd, NULL); VKBD_LOCK(state);