2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License (the "License").
2N/A * You may not use this file except in compliance with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A
2N/A/*
2N/A * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
2N/A */
2N/A
2N/A#ifndef _DID_PROPS_H
2N/A#define _DID_PROPS_H
2N/A
2N/A#include <sys/pci.h>
2N/A#include <fm/topo_mod.h>
2N/A#include <libdevinfo.h>
2N/A#include <libnvpair.h>
2N/A
2N/A#include <did.h>
2N/A
2N/A#ifdef __cplusplus
2N/Aextern "C" {
2N/A#endif
2N/A
2N/A/*
2N/A * pci_props_set() processes an array of structures that translate
2N/A * from devinfo props to properties on topology nodes. The structure
2N/A * provides the name of a devinfo prop, the name of the property
2N/A * group, the name of the property and the stability of the property
2N/A * group that should be established on the topology node, as well as a
2N/A * function to do the work.
2N/A */
2N/Atypedef struct txprop {
2N/A const char *tx_diprop; /* property examined off the di_node_t */
2N/A const topo_pgroup_info_t *tx_tpgroup; /* pgroup defined for tnode_t */
2N/A const char *tx_tprop; /* property defined on the tnode_t */
2N/A /*
2N/A * translation function
2N/A * If NULL, the devinfo prop's value is copied to the
2N/A * topo property.
2N/A */
2N/A int (*tx_xlate)(tnode_t *, did_t *,
2N/A const char *, const char *, const char *);
2N/A} txprop_t;
2N/A
2N/A#define DI_DEVTYPPROP "device_type"
2N/A#define DI_VENDIDPROP "vendor-id"
2N/A#define DI_DEVIDPROP "device-id"
2N/A#define DI_CLASSPROP "class-code"
2N/A#define DI_REGPROP "reg"
2N/A#define DI_CCPROP "class-code"
2N/A#define DI_PHYSPROP "physical-slot#"
2N/A#define DI_SLOTPROP "slot-names"
2N/A#define DI_AADDRPROP "assigned-addresses"
2N/A#define DI_RECEPTACLE_PHYMASK "receptacle-pm"
2N/A#define DI_RECEPTACLE_LABEL "receptacle-label"
2N/A
2N/Aextern int did_props_set(tnode_t *, did_t *, txprop_t[], int);
2N/Aextern tnode_t *find_predecessor(tnode_t *, char *);
2N/A
2N/Aextern char *pci_devtype_get(topo_mod_t *, di_node_t);
2N/Aextern int pciex_cap_get(topo_mod_t *, di_node_t);
2N/Aextern int pci_BDF_get(topo_mod_t *, di_node_t, int *, int *, int *);
2N/Aextern int pci_classcode_get(topo_mod_t *, di_node_t, uint_t *, uint_t *);
2N/A
2N/Aextern int di_uintprop_get(topo_mod_t *, di_node_t, const char *, uint_t *);
2N/Aextern int di_bytes_get(topo_mod_t *, di_node_t, const char *, int *,
2N/A uchar_t **);
2N/Aextern int FRU_fmri_set(topo_mod_t *, tnode_t *);
2N/A
2N/A#ifdef __cplusplus
2N/A}
2N/A#endif
2N/A
2N/A#endif /* _DID_PROPS_H */