/*
* 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 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Logical Domains System Agent
*/
#include <errno.h>
#include <fcntl.h>
#include <libds.h>
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include <synch.h>
#include <thread.h>
#include <unistd.h>
#include <sys/mdesc_impl.h>
#include "ldma.h"
#include "pri.h"
/* ptr to cached value of chassisno */
};
};
/*ARGSUSED*/
static ldma_request_status_t
{
char *data;
int status;
LDMA_DBG("GET_SYSINFO");
goto done;
}
goto done;
}
goto done;
}
*reply_dlenp = rlen;
return (LDMA_REQ_COMPLETED);
done:
return (status);
}
/*
* Wrapper for MD free: need unused size argument.
*/
/* ARGSUSED */
static void
{
}
/*
* Wrapper for MD init: read PRI MD and invoke md_init_intern.
*/
static md_t *
{
if (pri_init() == -1)
return (NULL);
pri_fini();
return (NULL);
return (mdp);
}
/*
* Wrapper for md_fini. Allow NULL md ptr and free MD buffer.
*/
static void
{
if (mdp) {
}
}
static int
{
int rv = 0;
(void) mutex_lock(&ldma_chassisno_lock);
if (ldma_sys_chassisno != NULL) {
(void) mutex_unlock(&ldma_chassisno_lock);
return (1);
}
mdp = ldma_md_init();
(void) mutex_unlock(&ldma_chassisno_lock);
return (0);
}
if (component_nodes == NULL) {
(void) mutex_unlock(&ldma_chassisno_lock);
return (0);
}
for (i = 0; i < ncomponents; i++) {
continue;
continue;
"serial_number", &serialno) == 0) {
rv = 1;
break;
}
}
(void) mutex_unlock(&ldma_chassisno_lock);
return (rv);
}
/*ARGSUSED*/
static ldma_request_status_t
{
char *str;
char *data;
int status;
LDMA_DBG("GET_CHASSISNO");
goto done;
}
if (ldma_get_chassis_serialno(&str) == 0) {
LDMA_DBG("GET_CHASSISNO: ldma_get_chassisno failed "
"with error %d", errno);
goto done;
}
goto done;
}
*reply_dlenp = rlen;
return (LDMA_REQ_COMPLETED);
done:
return (status);
}