1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 * or http://www.opensolaris.org/os/licensing. 10 * See the License for the specific language governing permissions 11 * and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL HEADER in each 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21 22 /* 23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 24 * Use is subject to license terms. 25 */ 26 27 #ifndef _DEVINFO_H 28 #define _DEVINFO_H 29 30 #ifdef __cplusplus 31 extern "C" { 32 #endif 33 34 #include <mdb/mdb_modapi.h> 35 36 /* 37 * Options for prtconf/devinfo/hotplug dcmd. 38 */ 39 #define DEVINFO_VERBOSE 0x1 40 #define DEVINFO_PARENT 0x2 41 #define DEVINFO_CHILD 0x4 42 #define DEVINFO_ALLBOLD 0x8 43 #define DEVINFO_SUMMARY 0x10 44 #define DEVINFO_HP_PHYSICAL 0x20 45 46 typedef struct devinfo_cb_data { 47 uintptr_t di_base; 48 uint_t di_flags; 49 } devinfo_cb_data_t; 50 51 extern int devinfo_walk_init(mdb_walk_state_t *); 52 extern int devinfo_walk_step(mdb_walk_state_t *); 53 extern void devinfo_walk_fini(mdb_walk_state_t *); 54 55 extern int devinfo_parents_walk_init(mdb_walk_state_t *); 56 extern int devinfo_parents_walk_step(mdb_walk_state_t *); 57 extern void devinfo_parents_walk_fini(mdb_walk_state_t *); 58 59 extern int devinfo_children_walk_init(mdb_walk_state_t *); 60 extern int devinfo_children_walk_step(mdb_walk_state_t *); 61 extern void devinfo_children_walk_fini(mdb_walk_state_t *); 62 63 extern int devinfo2driver(uintptr_t, uint_t, int, const mdb_arg_t *); 64 65 extern int devnames_walk_init(mdb_walk_state_t *); 66 extern int devnames_walk_step(mdb_walk_state_t *); 67 extern void devnames_walk_fini(mdb_walk_state_t *); 68 69 extern int devinfo_siblings_walk_init(mdb_walk_state_t *); 70 extern int devinfo_siblings_walk_step(mdb_walk_state_t *); 71 72 extern int devi_next_walk_step(mdb_walk_state_t *); 73 74 extern int prtconf(uintptr_t, uint_t, int, const mdb_arg_t *); 75 extern int devinfo(uintptr_t, uint_t, int, const mdb_arg_t *); 76 extern int modctl2devinfo(uintptr_t, uint_t, int, const mdb_arg_t *); 77 extern int devnames(uintptr_t, uint_t, int, const mdb_arg_t *); 78 extern int devbindings(uintptr_t, uint_t, int, const mdb_arg_t *); 79 extern int name2major(uintptr_t, uint_t, int, const mdb_arg_t *); 80 extern int major2name(uintptr_t, uint_t, int, const mdb_arg_t *); 81 extern int major2snode(uintptr_t, uint_t, int, const mdb_arg_t *); 82 extern int dev2major(uintptr_t, uint_t, int, const mdb_arg_t *); 83 extern int dev2minor(uintptr_t, uint_t, int, const mdb_arg_t *); 84 extern int dev2snode(uintptr_t, uint_t, int, const mdb_arg_t *); 85 extern int devt(uintptr_t, uint_t, int, const mdb_arg_t *); 86 extern int softstate(uintptr_t, uint_t, int, const mdb_arg_t *); 87 extern int devinfo_fm(uintptr_t, uint_t, int, const mdb_arg_t *); 88 extern int devinfo_fmce(uintptr_t, uint_t, int, const mdb_arg_t *); 89 90 extern int soft_state_walk_init(mdb_walk_state_t *); 91 extern int soft_state_walk_step(mdb_walk_state_t *); 92 extern int soft_state_all_walk_step(mdb_walk_state_t *); 93 extern void soft_state_walk_fini(mdb_walk_state_t *); 94 95 extern int devinfo_fmc_walk_init(mdb_walk_state_t *); 96 extern int devinfo_fmc_walk_step(mdb_walk_state_t *); 97 98 extern int binding_hash_walk_init(mdb_walk_state_t *); 99 extern int binding_hash_walk_step(mdb_walk_state_t *); 100 extern void binding_hash_walk_fini(mdb_walk_state_t *); 101 extern int binding_hash_entry(uintptr_t, uint_t, int, const mdb_arg_t *); 102 103 extern int devinfo_audit(uintptr_t, uint_t, int, const mdb_arg_t *); 104 105 extern int devinfo_audit_log_walk_init(mdb_walk_state_t *); 106 extern int devinfo_audit_log_walk_step(mdb_walk_state_t *); 107 extern void devinfo_audit_log_walk_fini(mdb_walk_state_t *); 108 extern int devinfo_audit_log(uintptr_t, uint_t, int, const mdb_arg_t *); 109 110 extern int devinfo_audit_node_walk_init(mdb_walk_state_t *); 111 extern int devinfo_audit_node_walk_step(mdb_walk_state_t *); 112 extern void devinfo_audit_node_walk_fini(mdb_walk_state_t *); 113 extern int devinfo_audit_node(uintptr_t, uint_t, int, const mdb_arg_t *); 114 115 extern int minornode_walk_init(mdb_walk_state_t *); 116 extern int minornode_walk_step(mdb_walk_state_t *); 117 extern int minornodes(uintptr_t, uint_t, int, const mdb_arg_t *); 118 119 extern void prtconf_help(void); 120 extern void devinfo_help(void); 121 122 #ifdef __cplusplus 123 } 124 #endif 125 126 #endif /* _DEVINFO_H */ 127