prt_xxx.c revision 1ac69ea687cc5094a956b1eb0a67df515029be6f
/*
* 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 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <stddef.h>
#include <fcntl.h>
#include <string.h>
#include <libdevinfo.h>
#include "prtconf.h"
struct priv_data {
char *drv_name; /* parent name */
};
extern void indent_to_level();
static void obio_printregs(struct regspec *, int);
static void obio_printranges(struct rangespec *, int);
static void obio_printintr(struct intrspec *, int);
static void obio_print(uintptr_t, int);
static void pcmcia_printregs(struct pcm_regs *, int);
static void pcmcia_printintr(struct intrspec *, int);
static void pcmcia_print(uintptr_t, int);
static void sbus_print(uintptr_t, int);
/*
* This is a hardcoded list of drivers we print parent private
* data as of Solaris 7.
*/
static struct di_priv_format ppd_format[] = {
{
/*
* obio format: applies the following list
* of nexus drivers. Note that obio driver
* went away with sun4m.
*/
"central dma ebus fhc isa pci pci_pci rootnex",
sizeof (struct ddi_parent_private_data),
sizeof (struct regspec), /* first pointer */
sizeof (struct intrspec), /* second pointer */
sizeof (struct rangespec), /* third pointer */
0, 0, 0, /* no more pointers */
0, 0, 0
},
{ /* pcmcia format */
"pcic stp4020",
sizeof (struct pcmcia_parent_private),
sizeof (struct pcm_regs), /* first pointer */
sizeof (struct intrspec), /* second pointer */
0, 0, 0, /* no more pointers */
0, 0, 0,
0, 0, 0
},
{ /* sbus format--it's different on sun4u!! */
"sbus",
sizeof (struct ddi_parent_private_data),
sizeof (struct regspec), /* first pointer */
sizeof (struct intrspec), /* second pointer */
sizeof (struct rangespec), /* third pointer */
0, 0, 0, /* no more pointers */
0, 0, 0
}
};
static struct priv_data prt_priv_data[] = {
};
void
{
/* no driver private data */
}
static void
{
(void) printf(" Bus Type=0x%x, Address=0x%x, Size=0x%x\n",
}
static void
{
(void) printf(" Ch: %.2x,%.8x Pa: %.2x,%.8x, Sz: %x\n",
}
static void
{
(void) printf(" Interrupt Priority=0x%x (ipl %d)",
if (ip->intrspec_vec)
(void) printf(", vector=0x%x (%d)",
(void) printf("\n");
}
static void
{
struct ddi_parent_private_data *dp;
#ifdef DEBUG
dprintf("obio parent private data: nreg = 0x%x offset = 0x%x"
" nintr = 0x%x offset = 0x%x nrng = 0x%x offset = %x\n",
#endif /* DEBUG */
/*
* All pointers are translated to di_off_t by the devinfo driver.
* This is a private agreement between libdevinfo and prtconf.
*/
if (nreg != 0) {
(void) printf("Register Specifications:\n");
for (i = 0; i < nreg; ++i)
}
if (nrng != 0) {
(void) printf("Range Specifications:\n");
for (i = 0; i < nrng; ++i)
}
if (nintr != 0) {
(void) printf("Interrupt Specifications:\n");
for (i = 0; i < nintr; ++i)
}
}
static void
{
(void) printf(" Phys hi=0x%x, Phys lo=0x%x, Phys len=%x\n",
}
static void
{
}
static void
{
struct pcmcia_parent_private *dp;
#ifdef DEBUG
dprintf("pcmcia parent private data: nreg = 0x%x offset = 0x%x"
" intr = 0x%x offset = %x\n",
#endif /* DEBUG */
/*
* All pointers are translated to di_off_t by the devinfo driver.
* This is a private agreement between libdevinfo and prtconf.
*/
if (nreg != 0) {
(void) printf("Register Specifications:\n");
for (i = 0; i < nreg; ++i)
}
if (nintr != 0) {
(void) printf("Interrupt Specifications:\n");
for (i = 0; i < nintr; ++i)
}
}
static void
{
struct ddi_parent_private_data *dp;
#ifdef DEBUG
dprintf("sbus parent private data: nreg = 0x%x offset = 0x%x"
" nintr = 0x%x offset = 0x%x nrng = 0x%x offset = %x\n",
#endif /* DEBUG */
/*
* All pointers are translated to di_off_t by the devinfo driver.
* This is a private agreement between libdevinfo and prtconf.
*/
if (nreg != 0) {
(void) printf("Register Specifications:\n");
for (i = 0; i < nreg; ++i)
}
if (nrng != 0) {
(void) printf("Range Specifications:\n");
for (i = 0; i < nrng; ++i)
}
/*
* To print interrupt property for children of sbus on sun4u requires
* definitions in sysiosbus.h.
*
* We can't #include <sys/sysiosbus.h> to have the build work on
* non sun4u machines. It's not right either to
* #include "../../uts/sun4u/sys/sysiosbus.h"
* As a result, we will not print the information.
*/
(void) printf("Interrupt Specifications:\n");
for (i = 0; i < nintr; ++i) {
}
}
}
static struct priv_data *
{
int i;
return (NULL);
return (NULL);
pdp = prt_priv_data;
for (i = 0; i < nprt_priv_data; ++i, ++pdp) {
#ifdef DEBUG
dprintf("matched parent private data"
" at Node <%s> parent driver <%s>\n",
#endif /* DEBUG */
return (pdp);
}
/*
* skip a white space
*/
tmp++;
}
}
return (NULL);
}
void
{
return;
#ifdef DEBUG
dprintf("Error: parent private data format unknown\n");
#endif /* DEBUG */
return;
}
/* ignore driver private data for now */
}