Ejemplo n.º 1
0
static int
btkbd_ioctl(void *cookie, unsigned long cmd, void *data, int flag,
    struct lwp *l)
{
	struct btkbd_softc *sc = cookie;

	switch (cmd) {
	case WSKBDIO_GTYPE:
		*(int *)data = WSKBD_TYPE_BLUETOOTH;
		break;

	case WSKBDIO_SETLEDS:
		btkbd_set_leds(sc, *(int *)data);
		break;

	case WSKBDIO_GETLEDS:
		*(int *)data = sc->sc_leds;
		break;

#ifdef WSDISPLAY_COMPAT_RAWKBD
	case WSKBDIO_SETMODE:
		sc->sc_rawkbd = (*(int *)data == WSKBD_RAW);
#ifdef BTKBD_REPEAT
		callout_stop(&sc->sc_repeat);
#endif
		break;
#endif

	default:
		return EPASSTHROUGH;
	}

	return 0;
}
Ejemplo n.º 2
0
int
btkbd_ioctl(void *self, u_long cmd, caddr_t data, int flag, struct proc *p)
{
    struct btkbd_softc *sc = (struct btkbd_softc *)self;
    struct hidkbd *kbd = &sc->sc_kbd;

    switch (cmd) {
    case WSKBDIO_GTYPE:
        *(int *)data = WSKBD_TYPE_BLUETOOTH;
        return 0;
    case WSKBDIO_SETLEDS:
        btkbd_set_leds(sc, *(int *)data);
        return 0;
    default:
        return hidkbd_ioctl(kbd, cmd, data, flag, p);
    }
}