l_strplumb.c revision da6c28aaf62fa55f0fdb8004aa40f88f23bf53f0
/*
* 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 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <sys/sysmacros.h>
/*
* Routines to allow strplumb() legitimate access
* to the kernel.
*/
int
{
int error;
/*
* Fix for 4170365: only allocate file descriptor entry
* if file descriptor is to be returned; otherwise VOP_OPEN.
*/
else
/*
* Must set vpp after calling fassign()/VOP_OPEN()
* since `vp' might change if it's a clone driver.
*/
return (error);
}
int
{
int id;
int error;
return (error);
if (mux_id)
return (0);
}
int
{
int rval;
}
int
{
int rval;
}
int
{
int rval;
}
int
{
int ret;
return (EINVAL);
if (fd != -1) {
return (0);
} else {
return (EINVAL);
}
} else {
return (ret);
}
}
int
{
int rval;
}
/*
* Optionally send data (if smp set) and optionally receive data (if rmp is
* set). If timeo is NULL the reception will sleep until a message is
* received; otherwise the sleep is limited to the specified amount of time.
*/
int
{
int error;
int pflag;
return (EINVAL);
return (EINVAL);
/* Send message while honoring flow control */
}
/* No reply wanted by caller */
return (0);
}
/*
* Convert from nanoseconds to milliseconds.
*/
return (EINVAL);
} else
timout = -1;
/* Wait for timeout millseconds for a message */
pri = 0;
/* Callers use *rmp == NULL to determine that there was a timeout */
error = 0;
return (error);
}
/*
* It is the callers responsibility to make sure that "mods"
* conforms to what is required. We do not check it here.
*
* "maj", "min", and "lastmin" are value-result parameters.
* for SET_AUTOPUSH, "anchor" should be set to the place in the stream
* to put the anchor, or NULL if no anchor needs to be set.
* for GET_AUTOPUSH, "anchor" should point to a uint_t to store the
* position of the anchor at, or NULL if the caller is not interested.
*/
int
{
li = ldi_ident_from_anon();
if (error) {
return (error);
}
} else {
if (error) {
return (error);
}
}
switch (op) {
case GET_AUTOPUSH:
/* Get autopush information */
if (error) {
printf("kstr_autopush: "
"ioctl(GET_AUTOPUSH) failed, error %d\n", error);
return (error);
}
case SAP_ONE:
*lastmin = 0;
break;
case SAP_RANGE:
break;
case SAP_ALL:
break;
}
}
return (0);
case CLR_AUTOPUSH:
/* Remove autopush information */
if (error) {
printf("kstr_autopush: "
"ioctl(CLR_AUTOPUSH) failed, error %d\n", error);
}
return (error);
case SET_AUTOPUSH:
/* Set autopush information */
} else if (*lastmin == 0) {
} else {
}
else
push.sap_anchor = 0;
if (lastmin)
else
push.sap_lastminor = 0;
/* pain */
}
if (error) {
printf("kstr_autopush: "
"ioctl(SET_AUTOPUSH) failed, error %d\n", error);
}
return (error);
default:
return (EINVAL);
}
}