/*
* 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.
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
#pragma ident "%Z%%M% %I% %E% SMI" /* from S5R4 1.4 */
/*
*/
/*
* Per-Stream private data structure.
*/
struct trw_trw {
};
/*
* stream data structure definitions
*/
static int check_strhead(queue_t *q);
/*
* To save instructions, since STREAMS ignores the return value
* from these functions, they are defined as void here. Kind of icky, but...
*/
"tirdwr",
0,
4096,
1024
};
(int (*)())tirdwrrput,
(int (*)())NULL,
};
(int (*)())tirdwrwput,
(int (*)())NULL,
};
NULL,
};
"tirdwr",
&trwinfo,
};
};
};
int
_init(void)
{
return (mod_install(&modlinkage));
}
int
_fini(void)
{
return (mod_remove(&modlinkage));
}
int
{
}
static void strip_strhead(queue_t *q);
/*
* tirdwropen - open routine gets called when the
* module gets pushed onto the stream.
*/
/*ARGSUSED*/
static int
queue_t *q,
int flag,
int sflag,
{
/* check if already open */
if (q->q_ptr) {
return (0);
}
/*
* Allocate a new trw_trw struct.
*/
/* initialize data structure */
qprocson(q);
freezestr(q);
if (!check_strhead(q)) {
unfreezestr(q);
qprocsoff(q);
return (EPROTO);
}
strip_strhead(q);
unfreezestr(q);
return (0);
}
/*
* tirdwrclose - This routine gets called when the module
* gets popped off of the stream.
*/
/*ARGSUSED1*/
static int
{
qprocsoff(q);
/*
* Send up a T_DISCON_IND if necessary.
*/
}
return (0);
}
/*
* tirdwrrput - Module read queue put procedure.
* This is called from the module or
* driver downstream.
*/
static void
{
return;
}
default:
break;
case M_DATA:
break;
case M_PCPROTO:
case M_PROTO:
/* is there enough data to check type */
/* malformed message */
break;
}
case T_EXDATA_IND:
send_fatal(q, mp);
break;
case T_DATA_IND:
break;
}
break;
case T_ORDREL_IND:
break;
case T_DISCON_IND:
}
break;
default:
send_fatal(q, mp);
break;
}
}
}
/*
* tirdwrwput - Module write queue put procedure.
* This is called from the module or
* stream head upstream.
*/
static void
{
return;
}
default:
break;
case M_DATA:
break;
case M_PROTO:
case M_PCPROTO:
send_fatal(q, mp);
break;
}
}
static void
{
else
}
static int
{
case M_PROTO:
return (0);
case T_EXDATA_IND:
return (0);
case T_DATA_IND:
return (0);
break;
default:
return (0);
}
break;
case M_PCPROTO:
return (0);
case M_DATA:
case M_SIG:
break;
default:
return (0);
}
}
return (1);
}
static void
{
q = q->q_next;
/*CSTYLED*/
case M_PROTO:
case T_DATA_IND:
break;
}
break;
}
break;
case M_DATA:
goto strip0;
break;
case M_SIG:
break;
}
}
}