/*
* 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 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* The MDESC picl plugin serves 2 different functionalities.
* --The first is to look up certain CPU properties in the MDESC an to add
* these properties in the already created CPU PICL nodes in the /platform
* section of the tree.
* --The second functionality is to create a /disk_discovery section of the
* PICL tree which will have a disk node created for each disk node in the
* machine description.
*/
#include "mdescplugin.h"
#include <libnvpair.h>
void mdescplugin_init(void);
void mdescplugin_fini(void);
static void signal_devtree(void);
extern int disk_discovery(void);
extern md_t *mdesc_devinit(void);
"mdesc_plugin",
};
typedef struct disk_lookup {
char *path;
int result;
int
{
int status;
if (status != PICL_SUCCESS) {
return (PICL_WALK_CONTINUE);
}
return (PICL_WALK_TERMINATE);
}
return (PICL_WALK_CONTINUE);
}
/*
* DR event handler
* respond to the picl events:
* PICLEVENT_DR_AP_STATE_CHANGE
*/
static void
{
char *dtype;
char *ap_id;
char *hint;
return;
}
return;
}
return;
}
return;
}
return;
}
return;
}
mdp = mdesc_devinit();
return;
}
/*
* Signal the devtree plugin to add more cpu properties.
*/
}
/*
* Discovery event handler
* respond to the picl events:
* PICLEVENT_SYSEVENT_DEVICE_ADDED
* PICLEVENT_SYSEVENT_DEVICE_REMOVED
*/
static void
{
char *path;
int status;
/*
* retrieve the device's physical path from the event arg
* and determine which disk (if any) we are working with
*/
return;
return;
if (status != PICL_SUCCESS) {
return;
}
}
}
/*ARGSUSED*/
static void
{
}
static void
signal_devtree(void)
{
char *packed_nvl;
int status;
return;
/*
* Right now (Aug. 2007) snowbird is the only other platform
* which uses this event. Since that's a sun4u platform and
* this is sun4v we do not have to worry about possible confusion
* or interference between the two by grabbing this event for
* our own use here. This event is consumed by the devtree
* plug-in. The event signals the plug-in to re-run its
* cpu initialization function, which will cause it to add
* additional information to the cpu devtree nodes (particularly,
* the administrative state of the cpus.)
*/
PICLEVENT_CPU_STATE_CHANGE) != 0) {
return;
}
/*
* The devtree plug-in needs to see a devfs path argument for
* any event it considers. We supply one here which is essentially
* a dummy since it is not processed by the devtree plug-in for
* this event.
*/
return;
}
packed_nvl = NULL;
0) != 0) {
return;
}
PICL_SUCCESS) {
"signal_devtree: can't post cpu event: %d\n", status);
}
}
void
mdescplugin_init(void)
{
int status;
if (status != PICL_SUCCESS) {
return;
}
mdp = mdesc_devinit();
return;
/*
* update the cpu configuration in case the snapshot cache used by the
* devtree plugin is out of date.
*/
/*
* This is the start of the CPU property augmentation code.
* add_cpu_prop and the rest of the CPU code lives in cpu_prop_update.c
*/
if (status != PICL_SUCCESS) {
return;
}
(void) disk_discovery();
/*
* register dsc_handler for both "sysevent-device-added" and
* and for "sysevent-device-removed" PICL events
*/
dsc_handler, NULL);
dsc_handler, NULL);
dr_handler, NULL);
}
void
mdescplugin_fini(void)
{
/* unregister the event handler */
dsc_handler, NULL);
dsc_handler, NULL);
dr_handler, NULL);
}
void
mdescplugin_register(void)
{
}