1*0Sstevel@tonic-gate /* 2*0Sstevel@tonic-gate * CDDL HEADER START 3*0Sstevel@tonic-gate * 4*0Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*0Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 6*0Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 7*0Sstevel@tonic-gate * with the License. 8*0Sstevel@tonic-gate * 9*0Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10*0Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 11*0Sstevel@tonic-gate * See the License for the specific language governing permissions 12*0Sstevel@tonic-gate * and limitations under the License. 13*0Sstevel@tonic-gate * 14*0Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 15*0Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16*0Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 17*0Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 18*0Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 19*0Sstevel@tonic-gate * 20*0Sstevel@tonic-gate * CDDL HEADER END 21*0Sstevel@tonic-gate */ 22*0Sstevel@tonic-gate /* 23*0Sstevel@tonic-gate * Copyright 2004 Sun Microsystems, Inc. All rights reserved. 24*0Sstevel@tonic-gate * Use is subject to license terms. 25*0Sstevel@tonic-gate */ 26*0Sstevel@tonic-gate 27*0Sstevel@tonic-gate #ifndef _LIBDEVICE_H 28*0Sstevel@tonic-gate #define _LIBDEVICE_H 29*0Sstevel@tonic-gate 30*0Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 31*0Sstevel@tonic-gate 32*0Sstevel@tonic-gate #include <sys/sunddi.h> 33*0Sstevel@tonic-gate #include <sys/ddi_impldefs.h> 34*0Sstevel@tonic-gate #include <sys/devctl.h> 35*0Sstevel@tonic-gate 36*0Sstevel@tonic-gate #ifdef __cplusplus 37*0Sstevel@tonic-gate extern "C" { 38*0Sstevel@tonic-gate #endif 39*0Sstevel@tonic-gate 40*0Sstevel@tonic-gate #define DC_EXCL 0x01 41*0Sstevel@tonic-gate #define DC_RDONLY 0x02 42*0Sstevel@tonic-gate 43*0Sstevel@tonic-gate typedef struct devctl_dummy_struct *devctl_hdl_t; 44*0Sstevel@tonic-gate typedef struct devctl_dummy_ddef *devctl_ddef_t; 45*0Sstevel@tonic-gate 46*0Sstevel@tonic-gate 47*0Sstevel@tonic-gate devctl_hdl_t 48*0Sstevel@tonic-gate devctl_device_acquire(char *devfs_path, uint_t flags); 49*0Sstevel@tonic-gate 50*0Sstevel@tonic-gate devctl_hdl_t 51*0Sstevel@tonic-gate devctl_bus_acquire(char *devfs_path, uint_t flags); 52*0Sstevel@tonic-gate 53*0Sstevel@tonic-gate devctl_hdl_t 54*0Sstevel@tonic-gate devctl_ap_acquire(char *devfs_path, uint_t flags); 55*0Sstevel@tonic-gate 56*0Sstevel@tonic-gate devctl_hdl_t 57*0Sstevel@tonic-gate devctl_pm_dev_acquire(char *devfs_path, uint_t flags); 58*0Sstevel@tonic-gate 59*0Sstevel@tonic-gate devctl_hdl_t 60*0Sstevel@tonic-gate devctl_pm_bus_acquire(char *devfs_path, uint_t flags); 61*0Sstevel@tonic-gate 62*0Sstevel@tonic-gate void 63*0Sstevel@tonic-gate devctl_release(devctl_hdl_t hdl); 64*0Sstevel@tonic-gate 65*0Sstevel@tonic-gate int 66*0Sstevel@tonic-gate devctl_device_offline(devctl_hdl_t hdl); 67*0Sstevel@tonic-gate 68*0Sstevel@tonic-gate int 69*0Sstevel@tonic-gate devctl_device_remove(devctl_hdl_t hdl); 70*0Sstevel@tonic-gate 71*0Sstevel@tonic-gate int 72*0Sstevel@tonic-gate devctl_pm_raisepower(devctl_hdl_t hdl); 73*0Sstevel@tonic-gate 74*0Sstevel@tonic-gate int 75*0Sstevel@tonic-gate devctl_pm_changepowerlow(devctl_hdl_t hdl); 76*0Sstevel@tonic-gate 77*0Sstevel@tonic-gate int 78*0Sstevel@tonic-gate devctl_pm_changepowerhigh(devctl_hdl_t hdl); 79*0Sstevel@tonic-gate 80*0Sstevel@tonic-gate int 81*0Sstevel@tonic-gate devctl_pm_idlecomponent(devctl_hdl_t hdl); 82*0Sstevel@tonic-gate 83*0Sstevel@tonic-gate int 84*0Sstevel@tonic-gate devctl_pm_busycomponent(devctl_hdl_t hdl); 85*0Sstevel@tonic-gate 86*0Sstevel@tonic-gate int 87*0Sstevel@tonic-gate devctl_pm_testbusy(devctl_hdl_t hdl, uint_t *busyp); 88*0Sstevel@tonic-gate 89*0Sstevel@tonic-gate int 90*0Sstevel@tonic-gate devctl_pm_failsuspend(devctl_hdl_t hdl); 91*0Sstevel@tonic-gate 92*0Sstevel@tonic-gate int 93*0Sstevel@tonic-gate devctl_pm_bus_teststrict(devctl_hdl_t hdl, uint_t *strict); 94*0Sstevel@tonic-gate 95*0Sstevel@tonic-gate int 96*0Sstevel@tonic-gate devctl_pm_device_changeonresume(devctl_hdl_t hdl); 97*0Sstevel@tonic-gate 98*0Sstevel@tonic-gate int 99*0Sstevel@tonic-gate devctl_pm_device_no_lower_power(devctl_hdl_t hdl); 100*0Sstevel@tonic-gate 101*0Sstevel@tonic-gate int 102*0Sstevel@tonic-gate devctl_pm_bus_no_invol(devctl_hdl_t hdl); 103*0Sstevel@tonic-gate 104*0Sstevel@tonic-gate int 105*0Sstevel@tonic-gate devctl_pm_device_promprintf(devctl_hdl_t hdl); 106*0Sstevel@tonic-gate 107*0Sstevel@tonic-gate int 108*0Sstevel@tonic-gate devctl_device_online(devctl_hdl_t hdl); 109*0Sstevel@tonic-gate 110*0Sstevel@tonic-gate int 111*0Sstevel@tonic-gate devctl_device_reset(devctl_hdl_t hdl); 112*0Sstevel@tonic-gate 113*0Sstevel@tonic-gate int 114*0Sstevel@tonic-gate devctl_device_getstate(devctl_hdl_t hdl, uint_t *statep); 115*0Sstevel@tonic-gate 116*0Sstevel@tonic-gate int 117*0Sstevel@tonic-gate devctl_bus_quiesce(devctl_hdl_t hdl); 118*0Sstevel@tonic-gate 119*0Sstevel@tonic-gate int 120*0Sstevel@tonic-gate devctl_bus_unquiesce(devctl_hdl_t hdl); 121*0Sstevel@tonic-gate 122*0Sstevel@tonic-gate int 123*0Sstevel@tonic-gate devctl_bus_reset(devctl_hdl_t hdl); 124*0Sstevel@tonic-gate 125*0Sstevel@tonic-gate int 126*0Sstevel@tonic-gate devctl_bus_resetall(devctl_hdl_t hdl); 127*0Sstevel@tonic-gate 128*0Sstevel@tonic-gate int 129*0Sstevel@tonic-gate devctl_bus_getstate(devctl_hdl_t hdl, uint_t *statep); 130*0Sstevel@tonic-gate 131*0Sstevel@tonic-gate int 132*0Sstevel@tonic-gate devctl_bus_configure(devctl_hdl_t hdl); 133*0Sstevel@tonic-gate 134*0Sstevel@tonic-gate int 135*0Sstevel@tonic-gate devctl_bus_unconfigure(devctl_hdl_t hdl); 136*0Sstevel@tonic-gate 137*0Sstevel@tonic-gate int 138*0Sstevel@tonic-gate devctl_ap_insert(devctl_hdl_t, nvlist_t *); 139*0Sstevel@tonic-gate 140*0Sstevel@tonic-gate int 141*0Sstevel@tonic-gate devctl_ap_remove(devctl_hdl_t, nvlist_t *); 142*0Sstevel@tonic-gate 143*0Sstevel@tonic-gate int 144*0Sstevel@tonic-gate devctl_ap_connect(devctl_hdl_t, nvlist_t *); 145*0Sstevel@tonic-gate 146*0Sstevel@tonic-gate int 147*0Sstevel@tonic-gate devctl_ap_disconnect(devctl_hdl_t, nvlist_t *); 148*0Sstevel@tonic-gate 149*0Sstevel@tonic-gate int 150*0Sstevel@tonic-gate devctl_ap_configure(devctl_hdl_t, nvlist_t *); 151*0Sstevel@tonic-gate 152*0Sstevel@tonic-gate int 153*0Sstevel@tonic-gate devctl_ap_unconfigure(devctl_hdl_t, nvlist_t *); 154*0Sstevel@tonic-gate 155*0Sstevel@tonic-gate int 156*0Sstevel@tonic-gate devctl_ap_getstate(devctl_hdl_t, nvlist_t *, devctl_ap_state_t *); 157*0Sstevel@tonic-gate 158*0Sstevel@tonic-gate devctl_ddef_t 159*0Sstevel@tonic-gate devctl_ddef_alloc(char *, int); 160*0Sstevel@tonic-gate 161*0Sstevel@tonic-gate void 162*0Sstevel@tonic-gate devctl_ddef_free(devctl_ddef_t); 163*0Sstevel@tonic-gate 164*0Sstevel@tonic-gate int 165*0Sstevel@tonic-gate devctl_ddef_int(devctl_ddef_t, char *, int32_t); 166*0Sstevel@tonic-gate 167*0Sstevel@tonic-gate int 168*0Sstevel@tonic-gate devctl_ddef_int_array(devctl_ddef_t, char *, int, int32_t *); 169*0Sstevel@tonic-gate 170*0Sstevel@tonic-gate int 171*0Sstevel@tonic-gate devctl_ddef_string(devctl_ddef_t ddef_hdl, char *, char *); 172*0Sstevel@tonic-gate 173*0Sstevel@tonic-gate int 174*0Sstevel@tonic-gate devctl_ddef_string_array(devctl_ddef_t, char *, int, char **); 175*0Sstevel@tonic-gate 176*0Sstevel@tonic-gate int 177*0Sstevel@tonic-gate devctl_ddef_byte_array(devctl_ddef_t, char *, int, uchar_t *); 178*0Sstevel@tonic-gate 179*0Sstevel@tonic-gate int 180*0Sstevel@tonic-gate devctl_bus_dev_create(devctl_hdl_t, devctl_ddef_t, uint_t, devctl_hdl_t *); 181*0Sstevel@tonic-gate 182*0Sstevel@tonic-gate char * 183*0Sstevel@tonic-gate devctl_get_pathname(devctl_hdl_t, char *, size_t); 184*0Sstevel@tonic-gate 185*0Sstevel@tonic-gate #ifdef __cplusplus 186*0Sstevel@tonic-gate } 187*0Sstevel@tonic-gate #endif 188*0Sstevel@tonic-gate 189*0Sstevel@tonic-gate #endif /* _LIBDEVICE_H */ 190