Add cnbell() support.

This commit is contained in:
thorpej 2000-03-06 21:37:16 +00:00
parent a183d34f04
commit da4dc67d3e
4 changed files with 31 additions and 10 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: wscons_callbacks.h,v 1.11 1999/12/01 23:22:59 augustss Exp $ */
/* $NetBSD: wscons_callbacks.h,v 1.12 2000/03/06 21:37:16 thorpej Exp $ */
/*
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
@ -48,7 +48,8 @@ void wsdisplay_reset __P((struct device *, enum wsdisplay_resetops));
void wsdisplay_kbdholdscreen __P((struct device *v, int));
void wsdisplay_set_cons_kbd __P((int (*get)(dev_t),
void (*poll)(dev_t, int)));
void (*poll)(dev_t, int),
void (*bell)(dev_t, u_int, u_int, u_int)));
void wsdisplay_unset_cons_kbd __P((void));
/*

View File

@ -1,4 +1,4 @@
/* $NetBSD: wsdisplay.c,v 1.34 2000/01/05 11:19:36 drochner Exp $ */
/* $NetBSD: wsdisplay.c,v 1.35 2000/03/06 21:37:16 thorpej Exp $ */
/*
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.34 2000/01/05 11:19:36 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: wsdisplay.c,v 1.35 2000/03/06 21:37:16 thorpej Exp $");
#include <sys/param.h>
#include <sys/conf.h>
@ -204,7 +204,7 @@ static void (*wsdisplay_cons_kbd_pollc) __P((dev_t, int));
static struct consdev wsdisplay_cons = {
NULL, NULL, wsdisplay_getc_dummy, wsdisplay_cnputc,
wsdisplay_pollc, NODEV, CN_NORMAL
wsdisplay_pollc, NULL, NODEV, CN_NORMAL
};
#ifndef WSDISPLAY_DEFAULTSCREENS
@ -1761,11 +1761,13 @@ wsdisplay_pollc(dev, on)
}
void
wsdisplay_set_cons_kbd(get, poll)
wsdisplay_set_cons_kbd(get, poll, bell)
int (*get) __P((dev_t));
void (*poll) __P((dev_t, int));
void (*bell) __P((dev_t, u_int, u_int, u_int));
{
wsdisplay_cons.cn_getc = get;
wsdisplay_cons.cn_bell = bell;
wsdisplay_cons_kbd_pollc = poll;
}
@ -1773,6 +1775,7 @@ void
wsdisplay_unset_cons_kbd()
{
wsdisplay_cons.cn_getc = wsdisplay_getc_dummy;
wsdisplay_cons.cn_bell = NULL;
wsdisplay_cons_kbd_pollc = 0;
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: wskbd.c,v 1.36 2000/01/22 15:09:00 drochner Exp $ */
/* $NetBSD: wskbd.c,v 1.37 2000/03/06 21:37:16 thorpej Exp $ */
/*
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: wskbd.c,v 1.36 2000/01/22 15:09:00 drochner Exp $");
__KERNEL_RCSID(0, "$NetBSD: wskbd.c,v 1.37 2000/03/06 21:37:16 thorpej Exp $");
/*
* Copyright (c) 1992, 1993
@ -434,7 +434,7 @@ wskbd_cnattach(consops, conscookie, mapdata)
wskbd_console_data.t_consaccesscookie = conscookie;
#if NWSDISPLAY > 0
wsdisplay_set_cons_kbd(wskbd_cngetc, wskbd_cnpollc);
wsdisplay_set_cons_kbd(wskbd_cngetc, wskbd_cnpollc, wskbd_cnbell);
#endif
wskbd_console_initted = 1;
@ -1214,6 +1214,21 @@ wskbd_cnpollc(dev, poll)
(wskbd_console_data.t_consaccesscookie, poll);
}
void
wskbd_cnbell(dev, pitch, period, volume)
dev_t dev;
u_int pitch, period, volume;
{
if (!wskbd_console_initted)
return;
if (wskbd_console_data.t_consops->bell != NULL)
(*wskbd_console_data.t_consops->bell)
(wskbd_console_data.t_consaccesscookie, pitch, period,
volume);
}
static inline void
update_leds(id)
struct wskbd_internal *id;

View File

@ -1,4 +1,4 @@
/* $NetBSD: wskbdvar.h,v 1.9 2000/01/22 15:09:01 drochner Exp $ */
/* $NetBSD: wskbdvar.h,v 1.10 2000/03/06 21:37:16 thorpej Exp $ */
/*
* Copyright (c) 1996, 1997 Christopher G. Demetriou. All rights reserved.
@ -56,6 +56,7 @@ struct wskbd_accessops {
struct wskbd_consops {
void (*getc) __P((void *, u_int *, int *));
void (*pollc) __P((void *, int));
void (*bell) __P((void *, u_int, u_int, u_int));
};
/*
@ -97,3 +98,4 @@ void wskbd_rawinput __P((struct device *, u_char *, int));
*/
int wskbd_cngetc __P((dev_t dev));
void wskbd_cnpollc __P((dev_t dev, int poll));
void wskbd_cnbell __P((dev_t, u_int, u_int, u_int));