#ifndef _SYS_ESUNDDI_H
#define _SYS_ESUNDDI_H
#include <sys/sunddi.h>
#include <sys/proc.h>
#include <sys/autoconf.h>
#include <sys/ddi_impldefs.h>
#include <sys/epm.h>
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _KERNEL
int
e_ddi_prop_create(dev_t dev, dev_info_t *dip, int flag,
char *name, caddr_t value, int length);
int
e_ddi_prop_modify(dev_t dev, dev_info_t *dip, int flag,
char *name, caddr_t value, int length);
int
e_ddi_prop_update_int(dev_t match_dev, dev_info_t *dip,
char *name, int data);
int
e_ddi_prop_update_int64(dev_t match_dev, dev_info_t *dip,
char *name, int64_t data);
int
e_ddi_prop_update_int_array(dev_t match_dev, dev_info_t *dip,
char *name, int *data, uint_t nelements);
int
e_ddi_prop_update_int64_array(dev_t match_dev, dev_info_t *dip,
char *name, int64_t *data, uint_t nelements);
int
e_ddi_prop_update_string(dev_t match_dev, dev_info_t *dip,
char *name, char *data);
int
e_ddi_prop_update_string_array(dev_t match_dev, dev_info_t *dip,
char *name, char **data, uint_t nelements);
int
e_ddi_prop_update_byte_array(dev_t match_dev, dev_info_t *dip,
char *name, uchar_t *data, uint_t nelements);
int
e_ddi_prop_remove(dev_t dev, dev_info_t *dip, char *name);
void
e_ddi_prop_remove_all(dev_info_t *dip);
int
e_ddi_prop_undefine(dev_t dev, dev_info_t *dip, int flag, char *name);
int
e_ddi_getprop(dev_t dev, vtype_t type, char *name, int flags, int defaultval);
int64_t
e_ddi_getprop_int64(dev_t dev, vtype_t type, char *name,
int flags, int64_t defvalue);
int
e_ddi_getproplen(dev_t dev, vtype_t type, char *name, int flags, int *lengthp);
int
e_ddi_getlongprop(dev_t dev, vtype_t type, char *name, int flags,
caddr_t valuep, int *lengthp);
int
e_ddi_getlongprop_buf(dev_t dev, vtype_t type, char *name, int flags,
caddr_t valuep, int *lengthp);
int
e_ddi_parental_suspend_resume(dev_info_t *dip);
int
e_ddi_resume(dev_info_t *dip, ddi_attach_cmd_t);
int
e_ddi_suspend(dev_info_t *dip, ddi_detach_cmd_t cmd);
void
pm_init(void);
void
e_ddi_prop_list_delete(ddi_prop_t *proplist);
int
e_ddi_copyfromdev(dev_info_t *, off_t, const void *, void *, size_t);
int
e_ddi_copytodev(dev_info_t *, off_t, const void *, void *, size_t);
#define DEVI_REFERENCED 1
#define DEVI_NOT_REFERENCED 0
int
devi_stillreferenced(dev_info_t *dip);
extern int (*pm_platform_power)(power_req_t *);
int
umem_lockmemory(caddr_t addr, size_t size, int flags,
ddi_umem_cookie_t *cookie, struct umem_callback_ops *ops_vector,
proc_t *procp);
#define DDI_UMEMLOCK_LONGTERM 0x04
dev_info_t *
e_ddi_hold_devi_by_dev(dev_t dev, int flags);
dev_info_t *
e_ddi_hold_devi_by_path(char *path, int flags);
#define E_DDI_HOLD_DEVI_NOATTACH 0x01
void
e_ddi_hold_devi(dev_info_t *);
int
e_ddi_devi_holdcnt(dev_info_t *dip);
int
e_ddi_majorinstance_to_path(major_t major, int instance, char *name);
void
e_ddi_walk_driver(char *, int (*f)(dev_info_t *, void *), void *);
dev_info_t *
e_ddi_nodeid_to_dip(pnode_t nodeid);
#define DEVI_BRANCH_CHILD 0x01
#define DEVI_BRANCH_CONFIGURE 0x02
#define DEVI_BRANCH_DESTROY 0x04
#define DEVI_BRANCH_EVENT 0x08
#define DEVI_BRANCH_PROM 0x10
#define DEVI_BRANCH_SID 0x20
#define DEVI_BRANCH_ROOT 0x40
typedef struct devi_branch {
void *arg;
void (*devi_branch_callback)(dev_info_t *, void *, uint_t);
int type;
union {
int (*prom_branch_select)(pnode_t, void *, uint_t);
int (*sid_branch_create)(dev_info_t *, void *, uint_t);
} create;
} devi_branch_t;
extern int e_ddi_branch_create(dev_info_t *pdip, devi_branch_t *bp,
dev_info_t **dipp, uint_t flags);
extern int e_ddi_branch_configure(dev_info_t *rdip, dev_info_t **dipp,
uint_t flags);
extern int e_ddi_branch_unconfigure(dev_info_t *rdip, dev_info_t **dipp,
uint_t flags);
extern int e_ddi_branch_destroy(dev_info_t *rdip, dev_info_t **dipp,
uint_t flags);
extern void e_ddi_branch_hold(dev_info_t *rdip);
extern void e_ddi_branch_rele(dev_info_t *rdip);
extern int e_ddi_branch_held(dev_info_t *rdip);
extern int e_ddi_branch_referenced(dev_info_t *rdip,
int (*cb)(dev_info_t *dip, void *, uint_t), void *arg);
void e_ddi_enter_driver_list(struct devnames *, int *);
int e_ddi_tryenter_driver_list(struct devnames *, int *);
void e_ddi_exit_driver_list(struct devnames *, int);
typedef struct ddi_unbind_callback {
list_node_t ddiub_next;
void (*ddiub_cb)(void *, dev_info_t *);
void *ddiub_arg;
} ddi_unbind_callback_t;
extern void e_ddi_register_unbind_callback(dev_info_t *,
ddi_unbind_callback_t *);
#endif
#ifdef __cplusplus
}
#endif
#endif