spkr.c (47625) | spkr.c (47640) |
---|---|
1/* 2 * spkr.c -- device driver for console speaker 3 * 4 * v1.4 by Eric S. Raymond (esr@snark.thyrsus.com) Aug 1993 5 * modified for FreeBSD by Andrew A. Chernov <ache@astral.msk.su> 6 * | 1/* 2 * spkr.c -- device driver for console speaker 3 * 4 * v1.4 by Eric S. Raymond (esr@snark.thyrsus.com) Aug 1993 5 * modified for FreeBSD by Andrew A. Chernov <ache@astral.msk.su> 6 * |
7 * $Id: spkr.c,v 1.35 1998/08/24 02:28:16 bde Exp $ | 7 * $Id: spkr.c,v 1.36 1999/05/30 16:52:27 phk Exp $ |
8 */ 9 10#include "speaker.h" 11 12#if NSPEAKER > 0 13 14#include "opt_devfs.h" 15 --- 580 unchanged lines hidden (view full) --- 596 else 597 tone(ttp.frequency, ttp.duration); 598 } 599 return(0); 600 } 601 return(EINVAL); 602} 603 | 8 */ 9 10#include "speaker.h" 11 12#if NSPEAKER > 0 13 14#include "opt_devfs.h" 15 --- 580 unchanged lines hidden (view full) --- 596 else 597 tone(ttp.frequency, ttp.duration); 598 } 599 return(0); 600 } 601 return(EINVAL); 602} 603 |
604 605static int spkr_devsw_installed; 606 | |
607static void 608spkr_drvinit(void *unused) 609{ | 604static void 605spkr_drvinit(void *unused) 606{ |
610 dev_t dev; 611 612 if( ! spkr_devsw_installed ) { 613 dev = makedev(CDEV_MAJOR, 0); 614 cdevsw_add(&dev,&spkr_cdevsw, NULL); 615 spkr_devsw_installed = 1; | 607 cdevsw_add(&spkr_cdevsw); |
616#ifdef DEVFS | 608#ifdef DEVFS |
617 devfs_token = devfs_add_devswf(&spkr_cdevsw, 0, DV_CHR, 618 UID_ROOT, GID_WHEEL, 0600, 619 "speaker"); | 609 devfs_token = devfs_add_devswf(&spkr_cdevsw, 0, DV_CHR, 610 UID_ROOT, GID_WHEEL, 0600, "speaker"); |
620#endif | 611#endif |
621 } | |
622} 623 624SYSINIT(spkrdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,spkr_drvinit,NULL) 625 626 627#endif /* NSPEAKER > 0 */ 628/* spkr.c ends here */ | 612} 613 614SYSINIT(spkrdev,SI_SUB_DRIVERS,SI_ORDER_MIDDLE+CDEV_MAJOR,spkr_drvinit,NULL) 615 616 617#endif /* NSPEAKER > 0 */ 618/* spkr.c ends here */ |