wrsm_confpack.c revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* 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 (c) 2001 by Sun Microsystems, Inc.
* All rights reserved.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* Configuration parser for the Wildcat RSM driver. This file parses the
* configuration data structure passed in by the INITIALCONFIG and
* REPLACECONFIG ioctls, and constructs a config data structure usable by
* the Wildcat RSM driver.
*/
#include <sys/wrsm_common.h>
#include <sys/wrsm_config.h>
#define PACK_DEBUG 1
#ifdef DEBUG
static uint_t wrsm_pack_debug = 0;
#else
#define DPRINTF(a, b) { }
#endif /* DEBUG */
/*
* wrsm_controller
* wrsm_routing_data (1)
* wrsm_wci_data (nwcis)
* wrsm_stripe_group (ngroups)
* wrsm_routing_policy (npolicy)
* wrsm_preferred_route (nroutes)
* wrsm_net_member (nmembers)
*/
wrsm_cf_unpack(char *data)
{
int size;
int i, j;
size = 0;
/* wrsm_controller */
/* wrsm_routing_data */
goto err_finish;
}
}
kmem_alloc(sizeof (wrsm_stripe_group_t *) *
if (!routing->stripe_groups) {
"no stripe_groups"));
goto err_finish;
}
}
}
goto err_finish;
}
kmem_alloc(sizeof (wrsm_preferred_route_t *) *
if (!policy->preferred_routes) {
"no preferred_routes nroutes=%d",
goto err_finish;
}
policy->preferred_routes[j] =
}
}
goto err_finish;
}
}
return (cont);
return (NULL);
}
/*
* Free all the components of an wrsm_controller_t struct
*/
void
{
int i;
if (!cont)
return;
if (!routing)
return;
sizeof (wrsm_preferred_route_t *) *
}
}
}