/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#include <ipp/ipp_config.h>
/* DDI file for tswtcl ipp module */
/* Stats init function */
/* Stats callback function */
static int tswtcl_update_stats(ipp_stat_t *, void *, int);
tswtcl_create_action, /* ippo_action_create */
tswtcl_modify_action, /* ippo_action_modify */
tswtcl_destroy_action, /* ippo_action_destroy */
tswtcl_info, /* ippo_action_info */
tswtcl_invoke_action /* ippo_action_invoke */
};
extern struct mod_ops mod_ippops;
/*
* Module linkage information for the kernel.
*/
};
(void *)&modlipp,
};
int
_init(void)
{
return (mod_install(&modlinkage));
}
int
_fini(void)
{
return (mod_remove(&modlinkage));
}
int
{
}
/* ARGSUSED */
static int
{
char *next_action;
return (ENOMEM);
}
/* parse red next action name */
&next_action)) != 0) {
tswtcl0dbg(("tswtcl_create_action:invalid config, red action" \
" name missing\n"));
return (rc);
}
== IPP_ACTION_INVAL) {
tswtcl0dbg(("tswtcl_create_action: red action invalid\n"));
return (EINVAL);
}
/* parse yellow next action name */
&next_action)) != 0) {
tswtcl0dbg(("tswtcl_create_action:invalid config, yellow " \
"action name missing\n"));
return (rc);
}
== IPP_ACTION_INVAL) {
tswtcl0dbg(("tswtcl_create_action: yellow action invalid\n"));
return (EINVAL);
}
/* parse green next action name */
&next_action)) != 0) {
tswtcl0dbg(("tswtcl_create_action:invalid config, green " \
"action name missing\n"));
return (rc);
}
== IPP_ACTION_INVAL) {
tswtcl0dbg(("tswtcl_create_action: green action invalid\n"));
return (EINVAL);
}
/* parse committed rate - in bits / sec */
&cfg_parms->committed_rate)) != 0) {
tswtcl0dbg(("tswtcl_create_action: invalid config, "\
" committed rate missing\n"));
return (rc);
}
/* parse peak rate - in bits / sec */
tswtcl0dbg(("tswtcl_create_action: invalid config, "\
" peak rate missing\n"));
return (rc);
}
tswtcl0dbg(("tswtcl_create_action: invalid config, "\
" peak rate < committed rate\n"));
return (EINVAL);
}
/* parse window - in msec */
tswtcl0dbg(("tswtcl_create_action: invalid config, "\
" window missing\n"));
return (rc);
}
/* convert to nsec */
/* parse stats */
!= 0) {
} else {
}
/* Initialize other stuff */
if (tswtcl_data == NULL) {
return (ENOMEM);
}
return (rc);
}
}
/* set action chain reference */
tswtcl0dbg(("tswtcl_create_action: ipp_action_ref " \
"returned with error %d", rc));
goto cleanup;
}
tswtcl0dbg(("tswtcl_create_action: ipp_action_ref " \
"returned with error %d", rc));
goto cleanup;
}
tswtcl0dbg(("tswtcl_create_action: ipp_action_ref " \
"returned with error %d", rc));
goto cleanup;
}
/* Initializations */
return (0);
}
return (rc);
}
static int
{
char *next_action_name;
!= 0) {
tswtcl0dbg(("tswtcl_modify_action:invalid configuration type"));
return (err);
}
if (config_type != IPP_SET) {
tswtcl0dbg(("tswtcl_modify_action:invalid configuration type " \
"%d", config_type));
return (EINVAL);
}
tswtcl0dbg(("tswtcl_modify_action:mem. allocation failure\n"));
return (ENOMEM);
}
/* Just copy all and change as needed */
/* parse red action name, if present */
&next_action_name)) == 0) {
/* Get action id */
== IPP_ACTION_INVAL) {
tswtcl0dbg(("tswtcl_modify_action: red next_action"\
" invalid\n"));
return (EINVAL);
}
}
/* parse yellow action name, if present */
&next_action_name)) == 0) {
/* Get action id */
== IPP_ACTION_INVAL) {
tswtcl0dbg(("tswtcl_modify_action: yellow next_action"\
" invalid\n"));
return (EINVAL);
}
}
/* parse green action name, if present */
&next_action_name)) == 0) {
/* Get action id */
== IPP_ACTION_INVAL) {
tswtcl0dbg(("tswtcl_modify_action: green next_action"\
" invalid\n"));
return (EINVAL);
}
}
/* parse committed rate, if present */
== 0) {
}
/* parse peak rate, if present */
== 0) {
}
tswtcl0dbg(("tswtcl_create_action: invalid config, "\
" peak rate < committed rate\n"));
return (EINVAL);
}
/* parse window - in msec */
}
/* parse stats, if present */
return (err);
}
}
}
/* Can we ref all the new actions? */
tswtcl0dbg(("tswtcl_modify_data: can't ref. red action\n"));
return (err);
}
tswtcl0dbg(("tswtcl_modify_data:can't ref. yellow action\n"));
return (err);
}
tswtcl0dbg(("tswtcl_modify_data:can't ref. green action\n"));
return (err);
}
/* Re-compute pminusc */
/* Actually modify the configuration */
/* Un-ref the old actions */
/* Free the old configuration */
return (0);
}
static int
{
int rc;
}
/* unreference the action */
return (0);
}
static int
{
int rc;
/* get mblk from ipp_packet structure */
/* tswtcl packet as configured */
return (rc);
} else {
}
}
static int
{
int rc = 0;
/* install stats entry */
tswtcl0dbg(("tswtcl_statinit:ipp_stat_create failed "\
" with %d\n", rc));
return (rc);
}
tswtcl0dbg(("tswtcl_statinit:ipp_stat_create failed "\
" with %d\n", rc));
return (rc);
}
tswtcl0dbg(("tswtcl_statinit:ipp_stat_create failed "\
" with %d\n", rc));
return (rc);
}
tswtcl0dbg(("tswtcl_statinit:ipp_stat_named_init failed "\
" with %d\n", rc));
return (rc);
}
tswtcl0dbg(("tswtcl_statinit:ipp_stat_create failed "\
" with %d\n", rc));
return (rc);
}
tswtcl0dbg(("tswtcl_statinit:ipp_stat_named_init failed "\
" with %d\n", rc));
return (rc);
}
tswtcl0dbg(("tswtcl_statinit:ipp_stat_create failed "\
" with %d\n", rc));
return (rc);
}
tswtcl0dbg(("tswtcl_statinit:ipp_stat_named_init failed "\
" with %d\n", rc));
return (rc);
}
return (rc);
}
static int
{
rw);
rw);
return (0);
}
/* ARGSUSED */
static int
{
char *next_action;
int rc;
/* allocate nvlist to be passed back */
tswtcl0dbg(("tswtcl_info: memory allocation failure\n"));
return (rc);
}
/* look up red next action with the next action id */
tswtcl0dbg(("tswtcl_info: red action not available\n"));
return (rc);
}
/* add next action name */
next_action)) != 0) {
tswtcl0dbg(("tswtcl_info: error adding\n"));
return (rc);
}
/* free action name */
/* look up yellow next action with the next action id */
&next_action)) != 0) {
tswtcl0dbg(("tswtcl_info: yellow action not available\n"));
return (rc);
}
/* add next action name */
next_action)) != 0) {
tswtcl0dbg(("tswtcl_info: error adding yellow action\n"));
return (rc);
}
/* free action name */
/* look up green next action with the next action id */
&next_action)) != 0) {
tswtcl0dbg(("tswtcl_info: green action not available\n"));
return (rc);
}
/* add next action name */
next_action)) != 0) {
tswtcl0dbg(("tswtcl_info: error adding green action\n"));
return (rc);
}
/* free action name */
/* add config type */
tswtcl0dbg(("tswtcl_info: error adding config_type\n"));
return (rc);
}
/* add committed_rate */
cfg_parms->committed_rate)) != 0) {
tswtcl0dbg(("tswtcl_info: error adding committed_rate\n"));
return (rc);
}
/* add peak_rate */
tswtcl0dbg(("tswtcl_info: error adding peak_rate\n"));
return (rc);
}
/* add window */
tswtcl0dbg(("tswtcl_info: error adding window\n"));
return (rc);
}
tswtcl0dbg(("tswtcl_info: error adding stats status\n"));
return (rc);
}
/* call back with nvlist */
return (rc);
}