It is already possible to deactivate the vc bell on a per-tty basis, by using echo -en "\e[11;0]", but this is reset on reset(1). This adds a sysfs parameter to globally control the vc bell, as well as sysfs parameters for default pitch and duration. Signed-off-by: Jan Engelhardt <jengelh@gmx.de> --- drivers/char/vt.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) Index: linux-2.6.23/drivers/char/vt.c =================================================================== --- linux-2.6.23.orig/drivers/char/vt.c +++ linux-2.6.23/drivers/char/vt.c @@ -134,8 +134,12 @@ const struct consw *conswitchp; /* * Here is the default bell parameters: 750HZ, 1/8th of a second */ -#define DEFAULT_BELL_PITCH 750 -#define DEFAULT_BELL_DURATION (HZ/8) +static unsigned int default_bell_pitch = 750; +static unsigned int default_bell_duration = HZ / 8; +static unsigned int vc_bell_enabled = true; +module_param_named(bell_pitch, default_bell_pitch, uint, S_IRUGO | S_IWUSR); +module_param_named(bell_duration, default_bell_duration, uint, S_IRUGO | S_IWUSR); +module_param_named(bell_enabled, vc_bell_enabled, uint, S_IRUGO | S_IWUSR); struct vc vc_cons [MAX_NR_CONSOLES]; @@ -1401,14 +1405,14 @@ static void setterm_command(struct vc_da if (vc->vc_npar >= 1) vc->vc_bell_pitch = vc->vc_par[1]; else - vc->vc_bell_pitch = DEFAULT_BELL_PITCH; + vc->vc_bell_pitch = default_bell_pitch; break; case 11: /* set bell duration in msec */ if (vc->vc_npar >= 1) vc->vc_bell_duration = (vc->vc_par[1] < 2000) ? vc->vc_par[1] * HZ / 1000 : 0; else - vc->vc_bell_duration = DEFAULT_BELL_DURATION; + vc->vc_bell_duration = default_bell_duration; break; case 12: /* bring specified console to the front */ if (vc->vc_par[1] >= 1 && vc_cons_allocated(vc->vc_par[1] - 1)) @@ -1554,8 +1558,8 @@ static void reset_terminal(struct vc_dat vc->vc_tab_stop[3] = vc->vc_tab_stop[4] = 0x01010101; - vc->vc_bell_pitch = DEFAULT_BELL_PITCH; - vc->vc_bell_duration = DEFAULT_BELL_DURATION; + vc->vc_bell_pitch = default_bell_pitch; + vc->vc_bell_duration = default_bell_duration; gotoxy(vc, 0, 0); save_cur(vc); @@ -1574,7 +1578,7 @@ static void do_con_trol(struct tty_struc case 0: return; case 7: - if (vc->vc_bell_duration) + if (vc_bell_enabled && vc->vc_bell_duration) kd_mksound(vc->vc_bell_pitch, vc->vc_bell_duration); return; case 8: -
| David Miller | [GIT]: Networking |
| Chuck Ebbert | Why do so many machines need "noapic"? |
| Joerg Roedel | [PATCH 4/8] x86: add alloc_coherent dma_ops callback to NOMMU driver |
| Nicholas A. Bellinger | Re: Integration of SCST in the mainstream Linux kernel |
git: | |
| Petr Baudis | [ANNOUNCE] TopGit - A different patch queue manager |
| Mike | I don't want the .git directory next to my code. |
| Linus Torvalds | Be more careful about updating refs |
| Jonathan del Strother | blame vs annotate? |
| Jim Winstead Jr. | Re: Root Disk/Book Disk Compatibility |
| Corey Minyard | Re: Seagate ST-01/02 info/experiences |
| Dave `geek' Gymer | WARNING (was Re: New afio release) |
| Cary Sandvig | Re: possible bug in gcc2.3.3 with C++ function templates |
| Linux Kernel Mailing List | powerpc/mpc5121: Update device tree for MPC5121ADS evaluation board |
| Linux Kernel Mailing List | KVM: Free apic access page on vm destruction |
| Linux Kernel Mailing List | KVM: hlt emulation should take in-kernel APIC/PIT timers into account |
| Linux Kernel Mailing List | lxfb: rename kernel arg fbsize to vram |
