Exemple #1
0
int
akbd_ioctl(void *v, u_long cmd, caddr_t data, int flag, struct proc *p)
{
	struct akbd_softc *sc = v;

	switch (cmd) {

	case WSKBDIO_GTYPE:
		*(int *)data = WSKBD_TYPE_ADB;
		return 0;
	case WSKBDIO_SETLEDS:
		akbd_set_leds(v, *(int *)data);
		return 0;
	case WSKBDIO_GETLEDS:
		*(int *)data = sc->sc_leds;
		return 0;
#ifdef WSDISPLAY_COMPAT_RAWKBD
	case WSKBDIO_SETMODE:
		sc->sc_rawkbd = *(int *)data == WSKBD_RAW;
		return (0);
#endif

#if defined(__mac68k__)	/* XXX not worth creating akbd_machdep_ioctl() */
	case WSKBDIO_BELL:
	case WSKBDIO_COMPLEXBELL:
#define d ((struct wskbd_bell_data *)data)
		mac68k_ring_bell(d->pitch, d->period * hz / 1000, d->volume);
#undef d
		return (0);
#endif

	default:
		return (-1);
	}
}
void
akbd_cnbell(void *v, u_int pitch, u_int period, u_int volume)
{
	mac68k_ring_bell(pitch, period * hz / 1000, volume);
}