ldlinux.c revision 9acbbeaf2a1ffe5c14b244867d427714fab43c5c
/*
* 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 2006 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* ldlinuxopen - open routine gets called when the module gets pushed onto the
* stream.
*/
/* ARGSUSED */
static int
queue_t *q, /* pointer to the read side queue */
int oflag, /* the user open(2) supplied flags */
int sflag, /* open state flag */
{
struct stroptions *sop;
int len;
return (EINVAL);
/* It's already attached. */
return (0);
}
return (ENOSR);
/*
* Allocate state structure.
*/
/* Stash a pointer to our private data in q_ptr. */
/*
* Get termios defaults. These are stored as
* a property in the "options" node.
*/
} else {
}
} else {
/*
* winge winge winge...
*/
"ldlinuxopen: Couldn't get ttymodes property!");
}
/*
* Commit to the open and send the M_SETOPTS off to the stream head.
*/
qprocson(q);
return (0);
}
/*
* ldlinuxclose - This routine gets called when the module gets
* popped off of the stream.
*/
/* ARGSUSED */
static int
{
qprocsoff(q);
return (0);
}
static void
{
int error;
case TIOCSETLD:
/* prepare caller supplied data for access */
if (error != 0) {
return;
}
/* get a pointer to the caller supplied data */
/* save caller supplied data in our per-stream cache */
/* initialize and send a reply indicating that we're done */
return;
case TIOCGETLD:
/* allocate a reply message */
return;
}
/* initialize the reply message */
/* get a pointer to the reply data */
/* copy data from our per-stream cache into the reply data */
/* send the reply indicating that we're done */
return;
case PTSSTTY:
break;
default:
break;
}
}
/*
* ldlinuxput - Module read and write queue put procedure.
*/
static void
{
default:
break;
case M_IOCTL:
return;
}
break;
case M_FLUSH:
/*
* Handle read and write flushes.
*/
else
}
break;
}
}
static struct module_info ldlinux_info = {
0,
0,
0
};
static struct qinit ldlinuxinit = {
(int (*)()) ldlinuxput,
NULL,
NULL,
};
static struct streamtab ldlinuxinfo = {
};
/*
* Module linkage information for the kernel.
*/
};
static struct modlstrmod modlstrmod = {
};
static struct modlinkage modlinkage = {
};
int
_init()
{
return (mod_install(&modlinkage));
}
int
_fini()
{
return (mod_remove(&modlinkage));
}
int
{
}