/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Simple beeper support for PC platform, using standard timer 2 beeper.
*/
#include <sys/inttypes.h>
typedef struct pit_beep_state {
/* Dip of pit_beep device */
#define PIT_BEEP_OFF 0
/* Pointer to the state structure */
static void *pit_beep_statep;
static void pit_beep_on(void *arg);
static void pit_beep_off(void *arg);
nulldev, /* open */
nulldev, /* close */
nulldev, /* strategy */
nulldev, /* print */
nulldev, /* dump */
nulldev, /* read */
nulldev, /* write */
nulldev, /* ioctl */
nulldev, /* devmap */
nulldev, /* mmap */
nulldev, /* segmap */
nochpoll, /* poll */
ddi_prop_op, /* cb_prop_op */
NULL, /* streamtab */
};
DEVO_REV, /* Devo_rev */
0, /* Refcnt */
pit_beep_info, /* Info */
nulldev, /* Identify */
nulldev, /* Probe */
pit_beep_attach, /* Attach */
pit_beep_detach, /* Detach */
nodev, /* Reset */
&pit_beep_cb_ops, /* Driver operations */
0, /* Bus operations */
NULL, /* Power */
ddi_quiesce_not_needed, /* quiesce */
};
&mod_driverops, /* This one is a driver */
"Intel Pit_beep Driver", /* Name of the module. */
&pit_beep_ops, /* Driver ops */
};
};
int
_init(void)
{
int error;
/* Initialize the soft state structures */
sizeof (pit_beep_state_t), 1)) != 0) {
return (error);
}
/* Install the loadable module */
}
return (error);
}
int
{
}
int
_fini(void)
{
int error;
if (error == 0) {
/* Release per module resources */
}
return (error);
}
/*
* pit_beep_attach:
*/
static int
{
switch (cmd) {
case DDI_ATTACH:
break;
case DDI_RESUME:
return (DDI_SUCCESS);
default:
return (DDI_FAILURE);
}
/* Display information in the banner */
return (DDI_SUCCESS);
}
/*
* pit_beep_detach:
*/
/* ARGSUSED */
static int
{
switch (cmd) {
case DDI_SUSPEND:
/*
* If a beep is in progress; fail suspend
*/
if (!beep_busy()) {
return (DDI_SUCCESS);
} else {
return (DDI_FAILURE);
}
default:
return (DDI_FAILURE);
}
}
/*
* pit_beep_info:
*/
/* ARGSUSED */
static int
{
switch (infocmd) {
case DDI_INFO_DEVT2DEVINFO:
return (DDI_FAILURE);
}
error = DDI_SUCCESS;
break;
case DDI_INFO_DEVT2INSTANCE:
error = DDI_SUCCESS;
break;
default:
error = DDI_FAILURE;
}
return (error);
}
/* ARGSUSED */
static void
{
int counter;
if (freq == 0)
counter = 0;
else {
if (counter > UINT16_MAX)
else if (counter < 1)
counter = 1;
}
}
/* ARGSUSED */
static void
{
}
/* ARGSUSED */
static void
{
}