/*
* 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 (C) 4Front Technologies 1996-2008.
*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <sys/sysmacros.h>
#include "audio_impl.h"
/*
* Audio DDI glue implementation.
*/
/*
* The audio module is itself a pseudo driver, as it contains the
*/
static int
{
/* pseudo devices don't need S/R support */
return (DDI_FAILURE);
}
if (ddi_get_instance(dip) != 0) {
return (DDI_FAILURE);
}
/* this can't fail */
/* look up our properties! */
return (DDI_FAILURE);
}
return (DDI_SUCCESS);
}
static int
{
/* pseudo devices don't need S/R support */
if (cmd != DDI_DETACH) {
return (DDI_FAILURE);
}
return (DDI_FAILURE);
}
return (DDI_FAILURE);
}
return (DDI_FAILURE);
}
return (DDI_SUCCESS);
}
static int
{
audio_client_t *c;
if (c != NULL) {
auclnt_release(c);
}
} else {
}
}
return (DDI_FAILURE);
}
switch (cmd) {
case DDI_INFO_DEVT2DEVINFO:
break;
case DDI_INFO_DEVT2INSTANCE:
break;
default:
return (DDI_FAILURE);
}
return (DDI_SUCCESS);
}
static int
{
int rv;
audio_client_t *c;
return (ENXIO);
}
return (ENXIO);
}
c->c_pid = ddi_get_pid();
/*
* Call client/personality specific open handler. Note that
* we "insist" that there is an open. The personality layer
* will initialize/allocate any engines required.
*
* Hmm... do we need to pass in the cred?
*/
return (rv);
}
/* we do device cloning! */
/* now we can receive upcalls */
return (0);
}
static int
{
int rv;
audio_client_t *c;
if (sflag != 0) {
/* no direct clone or module opens */
return (ENXIO);
}
/*
* Make sure its a STREAMS personality - only legacy Sun API uses
* STREAMS.
*/
case AUDIO_MINOR_DEVAUDIO:
case AUDIO_MINOR_DEVAUDIOCTL:
break;
default:
return (ENOSTR);
}
return (ENXIO);
}
c->c_pid = ddi_get_pid();
/*
* Call client/personality specific open handler. Note that
* we "insist" that there is an open. The personality layer
* will initialize/allocate any engines required.
*
* Hmm... do we need to pass in the cred?
*/
return (rv);
}
/* we do device cloning! */
/* now we can receive upcalls */
return (0);
}
static int
{
audio_client_t *c;
audio_dev_t *d;
int rv;
return (ENXIO);
}
if (ddi_can_receive_sig() || (ddi_get_pid() == 0)) {
rv = auclnt_drain(c);
}
/* make sure we won't get any upcalls */
/*
* Pick up any data sitting around in input buffers. This
* avoids leaving record data stuck in queues.
*/
/* get a local hold on the device */
d = c->c_dev;
auimpl_dev_hold(c->c_dev);
/* Turn off queue processing... */
/* Call personality specific close handler */
c->c_close(c);
/* notify peers that a change has occurred */
atomic_inc_uint(&d->d_serial);
/* now we can drop the release we had on the device */
return (rv);
}
static int
{
audio_client_t *c;
audio_dev_t *d;
return (ENXIO);
}
/* we don't want any upcalls anymore */
/*
* Pick up any data sitting around in input buffers. This
* avoids leaving record data stuck in queues.
*/
/* get a local hold on the device */
d = c->c_dev;
auimpl_dev_hold(c->c_dev);
/*
* NB: This must be done before c->c_close, since it calls
* auclnt_close which will block waiting for the refence count
* to drop to zero.
*/
auclnt_release(c);
/* Call personality specific close handler */
c->c_close(c);
/* notify peers that a change has occurred */
atomic_inc_uint(&d->d_serial);
/* now we can drop the release we had on the device */
return (0);
}
static int
{
audio_client_t *c;
int rv;
return (ENXIO);
}
if ((rv = auclnt_serialize(c)) == 0) {
}
auclnt_release(c);
return (rv);
}
static int
{
audio_client_t *c;
int rv;
return (ENXIO);
}
if ((rv = auclnt_serialize(c)) == 0) {
}
auclnt_release(c);
return (rv);
}
static int
int *rvalp)
{
audio_client_t *c;
int rv;
return (ENXIO);
}
auclnt_release(c);
return (rv);
}
static int
{
audio_client_t *c;
int rv;
return (ENXIO);
}
ENXIO :
auclnt_release(c);
return (rv);
}
static int
{
audio_client_t *c;
if (c->c_wput) {
} else {
}
return (0);
}
static int
{
audio_client_t *c;
if (c->c_wsrv) {
c->c_wsrv(c);
} else {
}
return (0);
}
static int
{
audio_client_t *c;
if (c->c_rsrv) {
c->c_rsrv(c);
} else {
}
return (0);
}
DEVO_REV, /* rev */
0, /* refcnt */
NULL, /* getinfo */
nulldev, /* identify */
nulldev, /* probe */
audio_attach, /* attach */
audio_detach, /* detach */
nodev, /* reset */
NULL, /* cb_ops */
NULL, /* bus_ops */
NULL, /* power */
};
"Audio Framework",
};
MODREV_1, /* MODREV_1 indicated by manual */
&modldrv,
};
struct audio_ops_helper {
};
void
{
}
void
{
}
void
{
fmt);
} else {
}
}
void
{
}
/*
* _init, _info, and _fini DDI glue.
*/
int
_init(void)
{
int rv;
}
return (rv);
}
int
{
}
int
_fini(void)
{
int rv;
return (rv);
return (rv);
}