av1394_async.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (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 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* av1394 asynchronous module
*/
/* configuration routines */
static void av1394_async_cleanup(av1394_inst_t *, int);
static int av1394_async_create_minor_node(av1394_inst_t *);
static void av1394_async_remove_minor_node(av1394_inst_t *);
static int av1394_async_update_targetinfo(av1394_inst_t *);
static int av1394_async_db2arq_type(int);
static int av1394_ioctl_arq_get_ibuf_size(av1394_inst_t *, void *, int);
static int av1394_ioctl_arq_set_ibuf_size(av1394_inst_t *, void *, int);
#define AV1394_TNF_ENTER(func) \
#define AV1394_TNF_EXIT(func) \
/* tunables */
/*
*
* --- configuration entry points
*
*/
int
{
return (DDI_FAILURE);
}
return (DDI_FAILURE);
}
return (DDI_FAILURE);
}
return (DDI_FAILURE);
}
return (DDI_SUCCESS);
}
void
{
}
void
{
(void) av1394_async_update_targetinfo(avp);
return;
}
/* queue up a bus reset message */
AV1394_TNF_ASYNC_ERROR, "");
} else {
}
}
int
{
int ret;
return (ret);
}
void
{
(void) av1394_async_update_targetinfo(avp);
}
int
{
ap->a_pollevents = 0;
}
return (0);
}
/*ARGSUSED*/
int
{
ap->a_pollevents = 0;
return (0);
}
int
{
int ret = 0;
int dbtype;
int len;
/* copyout as much as we can */
/*
* if data is available, copy it out. otherwise wait until
* data arrives, unless opened with non-blocking flag
*/
return (EAGAIN);
}
if (av1394_qwait_sig(q) <= 0) {
}
continue;
}
/* generate and copyout ARQ header, if not already */
if (!AV1394_IS_NOHDR(mp)) {
/* headers cannot be partially read */
av1394_async_putbq(q, mp);
break;
}
/* copy ARQ-embedded data */
/* copyout the ARQ */
if (ret != 0) {
av1394_async_putbq(q, mp);
break;
}
}
/* any data left? */
continue;
}
/* now we have some data and some user buffer space to fill */
if (len > 0) {
if (ret != 0) {
av1394_async_putbq(q, mp);
break;
}
}
/* save the rest of the data for later */
av1394_async_putbq(q, mp);
}
}
return (0);
}
int
{
int ret;
/* all data should arrive in ARQ format */
break;
}
case IEC61883_ARQ_FCP_CMD:
case IEC61883_ARQ_FCP_RESP:
break;
default:
}
if (ret != 0) {
break;
}
}
return (ret);
}
/*ARGSUSED*/
int
int *rvalp)
{
switch (cmd) {
break;
break;
break;
case IEC61883_NODE_GET_UID:
break;
}
return (ret);
}
/*ARGSUSED*/
int
{
if (av1394_peekq(rq)) {
} else if (!anyyet) {
}
}
return (0);
}
/*
* put a message on the read queue, take care of polling
*/
void
{
AV1394_TNF_ASYNC_ERROR, "");
} else {
} else {
}
}
}
/*
*
* --- configuration routines
*
* av1394_async_cleanup()
* Cleanup after attach
*/
static void
{
switch (level) {
default:
/* FALLTHRU */
case 3:
/* FALLTHRU */
case 2:
/* FALLTHRU */
case 1:
}
}
/*
* av1394_async_create_minor_node()
* Create async minor node
*/
static int
{
int ret;
if (ret != DDI_SUCCESS) {
AV1394_TNF_ASYNC_ERROR, "");
}
return (ret);
}
/*
* av1394_async_remove_minor_node()
* Remove async minor node
*/
static void
{
}
/*
* av1394_async_update_targetinfo()
* Retrieve target info and bus generation
*/
static int
{
int ret;
return (ret);
}
static int
{
int arq_type;
switch (dbtype) {
case AV1394_M_FCP_RESP:
break;
case AV1394_M_FCP_CMD:
break;
case AV1394_M_BUS_RESET:
break;
default:
ASSERT(0); /* cannot happen */
}
return (arq_type);
}
static void
{
if (!av1394_putbq(q, mp)) {
AV1394_TNF_ASYNC_ERROR, "");
}
}
/*ARGSUSED*/
static int
{
int sz;
int ret = 0;
}
return (ret);
}
/*ARGSUSED*/
static int
{
int sz;
int ret = 0;
} else {
}
return (ret);
}