/*
* 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 dlcosmk ipp module */
static int dlcosmk_update_stats(ipp_stat_t *, void *, int);
/* Entry points for this IPP module */
dlcosmk_create_action, /* ippo_action_create */
dlcosmk_modify_action, /* ippo_action_modify */
dlcosmk_destroy_action, /* ippo_action_destroy */
dlcosmk_info, /* ippo_action_info */
dlcosmk_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
{
}
static int
{
char *next_action;
int err;
return (ENOMEM);
}
/* parse next action name */
&next_action)) != 0) {
dlcosmk0dbg(("dlcosmk_create_action: invalid config, "\
"next_action name missing\n"));
return (err);
}
if ((dlcosmk_data->next_action =
dlcosmk0dbg(("dlcosmk_create_action: next_action invalid\n"));
return (EINVAL);
}
/* parse cos - from the config file */
&dlcosmk_data->usr_pri)) != 0) {
dlcosmk0dbg(("dlcosmk_create_action: invalid config, "\
"cos missing\n"));
return (err);
}
/* parse b_band - mapped from cos */
dlcosmk0dbg(("dlcosmk_create_action: invalid config, "\
"b_band missing\n"));
return (err);
}
/* parse dl_priority.dl_max - mapped from cos */
dlcosmk0dbg(("dlcosmk_create_action: invalid config, "\
"dl_priority missing\n"));
return (err);
}
/* parse gather_stats boolean */
!= 0) {
} else {
/* If stats is needed, initialize the stats structure */
if (dlcosmk_data->gather_stats) {
return (err);
}
}
}
/* Free the nvlist */
/* set action chain reference */
flags)) != 0) {
dlcosmk0dbg(("dlcosmk_create_action: ipp_action_ref " \
"returned with error %d\n", err));
return (err);
}
return (0);
}
static int
{
int err = 0;
char *next_action_name;
!= 0) {
dlcosmk0dbg(("dlcosmk_modify_action: invalid configuration "\
"type\n"));
return (err);
}
if (config_type != IPP_SET) {
dlcosmk0dbg(("dlcosmk_modify_action: invalid configuration "\
"type %d\n", config_type));
return (EINVAL);
}
/* parse next action name, if present */
&next_action_name)) == 0) {
/* lookup action name to get action id */
== IPP_ACTION_INVAL) {
dlcosmk0dbg(("dlcosmk_modify_action: next_action "\
"invalid\n"));
return (EINVAL);
}
/* reference new action */
dlcosmk0dbg(("dlcosmk_modify_action: ipp_action_ref "\
"returned with error %d\n", err));
return (err);
}
/* unref old action */
}
/* parse cos, if present */
/* parse b_band, mapped from cos */
&band)) != 0) {
dlcosmk0dbg(("dlcosmk_modify_action: b_band not "\
"provided\n"));
return (err);
}
/* parse dl_priority, mapped from cos */
&dlpri)) != 0) {
dlcosmk0dbg(("dlcosmk_modify_action: dl_priority not "\
"provided\n"));
return (err);
}
/* Have all the three values, change them */
}
/* parse gather_stats boolean, if present */
== 0) {
/* Turning on stats */
return (err);
}
/* Turning off stats */
}
}
/* Free thenvlist */
return (0);
}
static int
{
int err;
/* Destroy stats, if gathered */
if (dlcosmk_data->gather_stats) {
}
/* unreference the action */
return (0);
}
static int
{
int err;
/* get mblk from ipp_packet structure */
/* dlcosmk packet as configured */
return (err);
} else {
/* return packet with next action set */
}
}
static int
{
int err;
/* install stats entry */
&dlcosmk_data->stats)) != 0) {
dlcosmk0dbg(("dlcosmk_create_action: ipp_stat_create " \
"returned with error %d\n", err));
return (err);
}
dlcosmk0dbg(("dlcosmk_create_action: ipp_stat_named_init " \
"returned with error %d\n", err));
return (err);
}
dlcosmk0dbg(("dlcosmk_create_action: ipp_stat_named_init " \
"returned with error %d\n", err));
return (err);
}
dlcosmk0dbg(("dlcosmk_create_action: ipp_stat_named_init " \
"returned with error %d\n", err));
return (err);
}
dlcosmk0dbg(("dlcosmk_create_action: ipp_stat_named_init " \
"returned with error %d", err));
return (err);
}
dlcosmk0dbg(("dlcosmk_create_action: ipp_stat_named_init " \
"returned with error %d\n", err));
return (err);
}
dlcosmk0dbg(("dlcosmk_create_action: ipp_stat_named_init " \
"returned with error %d\n", err));
return (err);
}
return (0);
}
static int
{
rw);
rw);
rw);
return (0);
}
/* ARGSUSED */
static int
{
char *next_action;
int err;
/* allocate nvlist to be passed back */
dlcosmk0dbg(("dlcosmk_info: error allocating memory\n"));
return (err);
}
/* look up next action with the next action id */
&next_action)) != 0) {
dlcosmk0dbg(("dlcosmk_info: next action not available\n"));
return (err);
}
/* add next action name */
next_action)) != 0) {
dlcosmk0dbg(("dlcosmk_info: error adding next action\n"));
return (err);
}
/* free action name */
/* add config type */
dlcosmk0dbg(("dlcosmk_info: error adding config. type\n"));
return (err);
}
/* just give the cos, since that is what is provided in the config */
!= 0) {
dlcosmk0dbg(("dlcosmk_info: error adding cos\n"));
return (err);
}
/* add gather stats boolean */
dlcosmk0dbg(("dlcosmk_info: error adding stats status\n"));
return (err);
}
/* call back with nvlist */
return (err);
}