Add "beep" ioctl. (#10 is reserved for PIOCSVIR)

Obtained from:	PAO3
Reviewed by:	-current list
This commit is contained in:
Jun Kuriyama 1999-02-13 11:32:00 +00:00
parent b187c6cd83
commit a766716a9a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=43964
4 changed files with 14 additions and 4 deletions

View File

@ -45,6 +45,7 @@
#define PIOCRWFLAG _IOW('P', 7, int) /* Set flags for drv use */
#define PIOCRWMEM _IOWR('P', 8, unsigned long) /* Set mem for drv use */
#define PIOCSPOW _IOW('P', 9, struct power) /* Set power structure */
#define PIOCSBEEP _IOW('P', 11, int) /* Select Beep */
/*
* Debug codes.
*/

View File

@ -23,6 +23,6 @@ void pccard_insert_beep __P((void));
void pccard_remove_beep __P((void));
void pccard_success_beep __P((void));
void pccard_failure_beep __P((void));
void pccard_beep_select __P((enum beepstate));
int pccard_beep_select __P((enum beepstate));
#endif /* !_PCCARD_DRIVER_H_ */

View File

@ -28,7 +28,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $Id: pccard.c,v 1.69 1999/01/27 10:10:03 bde Exp $
* $Id: pccard.c,v 1.70 1999/01/27 23:45:40 dillon Exp $
*/
#include "opt_devfs.h"
@ -1026,6 +1026,11 @@ crdioctl(dev_t dev, u_long cmd, caddr_t data, int fflag, struct proc *p)
else
pccard_failure_beep();
return err;
case PIOCSBEEP:
if (pccard_beep_select(*(int *)data)) {
return EINVAL;
}
break;
}
return(0);
}

View File

@ -64,7 +64,11 @@ void pccard_failure_beep(void)
sysbeep(PCCARD_BEEP_PITCH2, PCCARD_BEEP_DURATION2);
}
void pccard_beep_select(enum beepstate state)
int pccard_beep_select(enum beepstate state)
{
allow_beep = state;
if (state == BEEP_ON || state == BEEP_OFF) {
allow_beep = state;
return 0;
}
return 1;
}