10Sstevel@tonic-gate /* 20Sstevel@tonic-gate * CDDL HEADER START 30Sstevel@tonic-gate * 40Sstevel@tonic-gate * The contents of this file are subject to the terms of the 55839Sdmick * Common Development and Distribution License (the "License"). 65839Sdmick * You may not use this file except in compliance with the License. 70Sstevel@tonic-gate * 80Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 90Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 100Sstevel@tonic-gate * See the License for the specific language governing permissions 110Sstevel@tonic-gate * and limitations under the License. 120Sstevel@tonic-gate * 130Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 140Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 150Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 160Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 170Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 180Sstevel@tonic-gate * 190Sstevel@tonic-gate * CDDL HEADER END 200Sstevel@tonic-gate */ 215839Sdmick 220Sstevel@tonic-gate /* 23*10923SEvan.Yan@Sun.COM * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 240Sstevel@tonic-gate * Use is subject to license terms. 250Sstevel@tonic-gate */ 260Sstevel@tonic-gate 270Sstevel@tonic-gate #ifndef _DEVINFO_H 280Sstevel@tonic-gate #define _DEVINFO_H 290Sstevel@tonic-gate 300Sstevel@tonic-gate #ifdef __cplusplus 310Sstevel@tonic-gate extern "C" { 320Sstevel@tonic-gate #endif 330Sstevel@tonic-gate 340Sstevel@tonic-gate #include <mdb/mdb_modapi.h> 350Sstevel@tonic-gate 36*10923SEvan.Yan@Sun.COM /* 37*10923SEvan.Yan@Sun.COM * Options for prtconf/devinfo/hotplug dcmd. 38*10923SEvan.Yan@Sun.COM */ 39*10923SEvan.Yan@Sun.COM #define DEVINFO_VERBOSE 0x1 40*10923SEvan.Yan@Sun.COM #define DEVINFO_PARENT 0x2 41*10923SEvan.Yan@Sun.COM #define DEVINFO_CHILD 0x4 42*10923SEvan.Yan@Sun.COM #define DEVINFO_ALLBOLD 0x8 43*10923SEvan.Yan@Sun.COM #define DEVINFO_SUMMARY 0x10 44*10923SEvan.Yan@Sun.COM #define DEVINFO_HP_PHYSICAL 0x20 45*10923SEvan.Yan@Sun.COM 46*10923SEvan.Yan@Sun.COM typedef struct devinfo_cb_data { 47*10923SEvan.Yan@Sun.COM uintptr_t di_base; 48*10923SEvan.Yan@Sun.COM uint_t di_flags; 49*10923SEvan.Yan@Sun.COM } devinfo_cb_data_t; 50*10923SEvan.Yan@Sun.COM 510Sstevel@tonic-gate extern int devinfo_walk_init(mdb_walk_state_t *); 520Sstevel@tonic-gate extern int devinfo_walk_step(mdb_walk_state_t *); 530Sstevel@tonic-gate extern void devinfo_walk_fini(mdb_walk_state_t *); 540Sstevel@tonic-gate 550Sstevel@tonic-gate extern int devinfo_parents_walk_init(mdb_walk_state_t *); 560Sstevel@tonic-gate extern int devinfo_parents_walk_step(mdb_walk_state_t *); 570Sstevel@tonic-gate extern void devinfo_parents_walk_fini(mdb_walk_state_t *); 580Sstevel@tonic-gate 590Sstevel@tonic-gate extern int devinfo_children_walk_init(mdb_walk_state_t *); 600Sstevel@tonic-gate extern int devinfo_children_walk_step(mdb_walk_state_t *); 610Sstevel@tonic-gate extern void devinfo_children_walk_fini(mdb_walk_state_t *); 620Sstevel@tonic-gate 630Sstevel@tonic-gate extern int devinfo2driver(uintptr_t, uint_t, int, const mdb_arg_t *); 640Sstevel@tonic-gate 650Sstevel@tonic-gate extern int devnames_walk_init(mdb_walk_state_t *); 660Sstevel@tonic-gate extern int devnames_walk_step(mdb_walk_state_t *); 670Sstevel@tonic-gate extern void devnames_walk_fini(mdb_walk_state_t *); 680Sstevel@tonic-gate 690Sstevel@tonic-gate extern int devinfo_siblings_walk_init(mdb_walk_state_t *); 700Sstevel@tonic-gate extern int devinfo_siblings_walk_step(mdb_walk_state_t *); 710Sstevel@tonic-gate 720Sstevel@tonic-gate extern int devi_next_walk_step(mdb_walk_state_t *); 730Sstevel@tonic-gate 740Sstevel@tonic-gate extern int prtconf(uintptr_t, uint_t, int, const mdb_arg_t *); 750Sstevel@tonic-gate extern int devinfo(uintptr_t, uint_t, int, const mdb_arg_t *); 760Sstevel@tonic-gate extern int modctl2devinfo(uintptr_t, uint_t, int, const mdb_arg_t *); 770Sstevel@tonic-gate extern int devnames(uintptr_t, uint_t, int, const mdb_arg_t *); 780Sstevel@tonic-gate extern int devbindings(uintptr_t, uint_t, int, const mdb_arg_t *); 790Sstevel@tonic-gate extern int name2major(uintptr_t, uint_t, int, const mdb_arg_t *); 800Sstevel@tonic-gate extern int major2name(uintptr_t, uint_t, int, const mdb_arg_t *); 810Sstevel@tonic-gate extern int major2snode(uintptr_t, uint_t, int, const mdb_arg_t *); 820Sstevel@tonic-gate extern int dev2major(uintptr_t, uint_t, int, const mdb_arg_t *); 830Sstevel@tonic-gate extern int dev2minor(uintptr_t, uint_t, int, const mdb_arg_t *); 840Sstevel@tonic-gate extern int dev2snode(uintptr_t, uint_t, int, const mdb_arg_t *); 850Sstevel@tonic-gate extern int devt(uintptr_t, uint_t, int, const mdb_arg_t *); 860Sstevel@tonic-gate extern int softstate(uintptr_t, uint_t, int, const mdb_arg_t *); 870Sstevel@tonic-gate extern int devinfo_fm(uintptr_t, uint_t, int, const mdb_arg_t *); 880Sstevel@tonic-gate extern int devinfo_fmce(uintptr_t, uint_t, int, const mdb_arg_t *); 890Sstevel@tonic-gate 900Sstevel@tonic-gate extern int soft_state_walk_init(mdb_walk_state_t *); 910Sstevel@tonic-gate extern int soft_state_walk_step(mdb_walk_state_t *); 920Sstevel@tonic-gate extern int soft_state_all_walk_step(mdb_walk_state_t *); 930Sstevel@tonic-gate extern void soft_state_walk_fini(mdb_walk_state_t *); 940Sstevel@tonic-gate 950Sstevel@tonic-gate extern int devinfo_fmc_walk_init(mdb_walk_state_t *); 960Sstevel@tonic-gate extern int devinfo_fmc_walk_step(mdb_walk_state_t *); 970Sstevel@tonic-gate 980Sstevel@tonic-gate extern int binding_hash_walk_init(mdb_walk_state_t *); 990Sstevel@tonic-gate extern int binding_hash_walk_step(mdb_walk_state_t *); 1000Sstevel@tonic-gate extern void binding_hash_walk_fini(mdb_walk_state_t *); 1010Sstevel@tonic-gate extern int binding_hash_entry(uintptr_t, uint_t, int, const mdb_arg_t *); 1020Sstevel@tonic-gate 1030Sstevel@tonic-gate extern int devinfo_audit(uintptr_t, uint_t, int, const mdb_arg_t *); 1040Sstevel@tonic-gate 1050Sstevel@tonic-gate extern int devinfo_audit_log_walk_init(mdb_walk_state_t *); 1060Sstevel@tonic-gate extern int devinfo_audit_log_walk_step(mdb_walk_state_t *); 1070Sstevel@tonic-gate extern void devinfo_audit_log_walk_fini(mdb_walk_state_t *); 1080Sstevel@tonic-gate extern int devinfo_audit_log(uintptr_t, uint_t, int, const mdb_arg_t *); 1090Sstevel@tonic-gate 1100Sstevel@tonic-gate extern int devinfo_audit_node_walk_init(mdb_walk_state_t *); 1110Sstevel@tonic-gate extern int devinfo_audit_node_walk_step(mdb_walk_state_t *); 1120Sstevel@tonic-gate extern void devinfo_audit_node_walk_fini(mdb_walk_state_t *); 1130Sstevel@tonic-gate extern int devinfo_audit_node(uintptr_t, uint_t, int, const mdb_arg_t *); 1140Sstevel@tonic-gate 1150Sstevel@tonic-gate extern int minornode_walk_init(mdb_walk_state_t *); 1160Sstevel@tonic-gate extern int minornode_walk_step(mdb_walk_state_t *); 1170Sstevel@tonic-gate extern int minornodes(uintptr_t, uint_t, int, const mdb_arg_t *); 1180Sstevel@tonic-gate 1190Sstevel@tonic-gate extern void prtconf_help(void); 1200Sstevel@tonic-gate extern void devinfo_help(void); 1210Sstevel@tonic-gate 1220Sstevel@tonic-gate #ifdef __cplusplus 1230Sstevel@tonic-gate } 1240Sstevel@tonic-gate #endif 1250Sstevel@tonic-gate 1260Sstevel@tonic-gate #endif /* _DEVINFO_H */ 127