/*
* 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.
*/
/*
* Sun4v Platform specific functions.
*
* called when :
* machine_type == huron
*
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <kstat.h>
#include <fcntl.h>
#include <string.h>
#include <assert.h>
#include <libintl.h>
#include <note.h>
#include <sys/systeminfo.h>
#include <sys/openpromio.h>
#include <sys/sysmacros.h>
#include <picl.h>
#include "picldefs.h"
#include <pdevinfo.h>
#include <display.h>
#include <display_sun4v.h>
#include <libprtdiag.h>
#include "huron.h"
#if !defined(TEXT_DOMAIN)
#endif
static void
{
} else {
}
}
void
{
strlen(HURON_PCIE_SLOT0)) == 0) {
strlen(HURON_PCIE_SLOT1)) == 0) {
strlen(HURON_PCIE_SLOT2)) == 0) {
strlen(HURON_PCIE_SLOT3)) == 0) {
strlen(HURON_PCIE_SLOT4)) == 0) {
strlen(HURON_PCIE_SLOT5)) == 0) {
} else {
}
}
int
{
return (0);
return (1);
return (2);
return (3);
return (0);
return (1);
} else {
return (-1);
}
}
/*
* add all io devices under pci in io list
*/
/* ARGSUSED */
int
{
char *compatible;
sizeof (parent_path));
if (err != PICL_SUCCESS) {
return (err);
}
/* Walk through the children */
sizeof (picl_nodehdl_t));
while (err == PICL_SUCCESS) {
if (err != PICL_SUCCESS)
return (err);
&nodeh, sizeof (picl_nodehdl_t));
continue;
}
&nodeh, sizeof (picl_nodehdl_t));
continue;
}
if (err != PICL_SUCCESS) {
return (err);
}
sizeof (name));
if (err == PICL_PROPNOTFOUND)
else if (err != PICL_SUCCESS)
return (err);
else
/* Figure NAC name */
"NET", instance);
} else {
} else {
}
}
/*
* Get the name of this card. Iif binding_name is found,
* name will be <nodename>-<binding_name>
*/
&binding_name, sizeof (binding_name));
if (err == PICL_PROPNOTFOUND) {
/*
* if compatible prop is found, name will be
* <nodename>-<compatible>
*/
&compatible);
if (err == PICL_SUCCESS) {
} else if (err != PICL_PROPNOTFOUND) {
return (err);
}
} else if (err != PICL_SUCCESS) {
return (err);
}
/* Get the model of this card */
if (err == PICL_PROPNOTFOUND)
else if (err != PICL_SUCCESS)
return (err);
/* Print NAC name */
/* Print IO Type */
/* Print Slot # */
/* Print Parent Path */
/* Printf Card Name */
else
/* Print Card Model */
else
log_printf("\n");
sizeof (picl_nodehdl_t));
}
return (PICL_WALK_CONTINUE);
}
/*
* local functions
*/
/*
* add all io devices under pci in io list
*/
/* ARGSUSED */
int
{
char *compatible;
int device_found = 0;
sizeof (path));
if (err != PICL_SUCCESS) {
return (err);
}
device_found = 1;
MOTHERBOARD, OPHIR, 0);
&err);
}
device_found = 1;
OPHIR, 1);
&err);
}
device_found = 1;
&err);
}
device_found = 1;
&err);
}
device_found = 1;
&err);
}
device_found = 1;
&err);
}
if (device_found == 1) {
/* Print NAC name */
/* Print Device Path */
else
/* Print Compatible # */
if (err == PICL_SUCCESS) {
} else
/* Print Revision */
log_printf("\n");
}
return (PICL_WALK_CONTINUE);
}
/*
* return the first compatible value
*/
int
{
int err;
char *pval;
if (err != PICL_SUCCESS)
return (err);
return (PICL_FAILURE);
if (err != PICL_SUCCESS) {
return (err);
}
return (PICL_SUCCESS);
}
return (PICL_FAILURE);
/* get first string from table */
if (err != PICL_SUCCESS)
return (err);
if (err != PICL_SUCCESS)
return (err);
if (err != PICL_SUCCESS)
return (err);
return (PICL_FAILURE);
if (err != PICL_SUCCESS) {
return (err);
}
return (PICL_SUCCESS);
}
{
int err;
if (err != PICL_SUCCESS) {
return (0);
}
/*
* If it is not an int, uint or byte array prop, return failure
*/
*ret = PICL_FAILURE;
return (0);
}
case sizeof (int8_t):
return (int8v);
case sizeof (int16_t):
return (int16v);
case sizeof (int32_t):
return (int32v);
case sizeof (int64_t):
return (int64v);
default: /* not supported size */
*ret = PICL_FAILURE;
return (0);
}
}