lkml.org 
[lkml]   [2003]   [Jul]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subject"Where's the Beep?" (PCMCIA/vt_ioctl-s)
On my old DELL LM laptop the -2.5 series no longer issues any beeps when
a card is inserted. The problem is in the kernel, as the test program
below (extracted from cardmgr) beeps on -2.4, but not on -2.5.

===========================================================
#include <sys/types.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <fcntl.h>
#include <errno.h>
#include <sys/ioctl.h>

#define BEEP_TIME 150
#define BEEP_OK 1000
#define BEEP_WARN 2000
#define BEEP_ERR 4000

#include <sys/kd.h>

static void beep(unsigned int, unsigned int);

int
main(int argc, char **argv)
{
beep(500, 1000);
beep(500, 2000);
beep(500, 4000);
return 0;
}

static
void beep(unsigned int ms, unsigned int freq)
{
int fd, arg;

fd = open("/dev/tty0", O_RDWR);
if (fd < 0)
return;
arg = (ms << 16) | freq;
ioctl(fd, KDMKTONE, arg);
close(fd);
usleep(ms*1000);
}
===========================================================

--
B. D. Elliott bde@nwlink.com
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:46    [W:0.023 / U:1.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site