/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (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
*/
/*
*/
#ifndef _LIBDEVINFO_H
#define _LIBDEVINFO_H
#ifdef __cplusplus
extern "C" {
#endif
#include <errno.h>
#include <libnvpair.h>
#include <sys/openpromio.h>
#include <sys/ddi_impldefs.h>
#include <sys/devinfo_impl.h>
#include <limits.h>
/*
* flags for di_walk_node
*/
#define DI_WALK_CLDFIRST 0
/*
* flags for di_walk_link
*/
/*
* return code for node_callback
*/
#define DI_WALK_CONTINUE 0
/*
* flags for di_walk_minor
*/
/*
* flags for di_walk_hp
*/
/* nodeid types */
/* node & device states */
/* property types */
#define DI_PROP_TYPE_BOOLEAN 0
/* private macro for checking if a prop type is valid */
((type) == DI_PROP_TYPE_INT64))
/* opaque handles */
/*
* Null handles to make handles really opaque
*/
/*
* IEEE 1275 properties and other standardized property names
*/
/* Interface Prototypes */
/*
* Snapshot initialization and cleanup
*/
/*
* node: traversal, data access, and parameters
*/
extern void di_devfs_path_free(char *path_buf);
/*
* path_node: traversal, data access, and parameters
*/
/*
* minor_node: traversal, data access, and parameters
*/
/*
* node: property access
*/
/*
* prom_node: property access
*/
extern di_prom_handle_t di_prom_init(void);
int **prom_prop_data);
char **prom_prop_data);
/*
* path_node: property access
*/
int **prop_data);
char **prop_data);
/*
*/
/*
* hp_node: traversal, data access, and parameters
*/
void *arg));
/*
* Private interfaces
*
* The interfaces and structures below are private to this implementation
* of Solaris and are subject to change at any time without notice.
*
* Applications and drivers using these interfaces may fail
* to run on future releases.
*/
const char *name);
/*
* Interfaces for handling IEEE 1275 and other standardized properties
*/
/* structure for a single slot */
typedef struct di_slot_name {
char *name;
/*
* XXX Remove the private di_path_(addr,next,next_phci,next_client) interfaces
* below after NWS consolidation switches to using di_path_bus_addr,
* di_path_phci_next_path, and di_path_client_next_path per CR6638521.
*/
/*
* Interfaces for private data
*/
struct di_priv_data *priv_data);
/*
* Prtconf needs to know property lists, raw prop_data, and private data
*/
/*
* The value of the dip's devi_flags field
*/
/*
* Types of links for devlink lookup
*/
/*
* Flag for di_devlink_init()
*/
/*
* Flag for di_devlink_close()
*/
/*
* For devfsadm synchronous link creation interfaces
*/
/*
* devlink create argument
*/
struct dca_off {
int dca_error;
int dca_flags;
};
int (*devlink_callback)(di_devlink_t, void *));
int (*devlink_callback)(di_devlink_t, void *));
/*
* Private interfaces for I/O retire
*/
typedef struct di_retire {
void *rt_hdl;
} di_retire_t;
/*
* Private interfaces for /etc/logindevperm
*/
extern int di_devperm_logout(const char *);
/*
* in a snapshot.
*/
/*
* Private hotplug interfaces to be used between cfgadm pci plugin and
* devfsadm link generator.
*/
extern char *di_dli_name(char *);
extern int di_dli_openr(char *);
extern int di_dli_openw(char *);
extern void di_dli_close(int);
/*
* Private interface for parsing path_to_inst binding file
*/
extern int devfs_parse_binding_file(const char *,
int (*)(void *, const char *, int, const char *), void *);
extern int devfs_walk_minor_nodes(const char *,
int (*)(void *, const char *), void *);
/*
* finddev - alternate readdir to discover only /dev persisted device names
*/
extern int device_exists(const char *);
extern int finddev_readdir(const char *, finddevhdl_t *);
extern int finddev_emptydir(const char *);
extern void finddev_close(finddevhdl_t);
extern const char *finddev_next(finddevhdl_t);
/*
* Private interfaces for non-global /dev profile
*/
extern void di_prof_fini(di_prof_t);
extern int di_prof_commit(di_prof_t);
extern int di_prof_add_dev(di_prof_t, const char *);
extern int di_prof_add_exclude(di_prof_t, const char *);
extern int di_prof_add_symlink(di_prof_t, const char *, const char *);
extern int di_prof_add_map(di_prof_t, const char *, const char *);
/*
* Private interfaces for <driver><instance><minor> to path conversion.
* NOTE: These interfaces do not require or cause attach. The implementation
* uses the kernel instance-tree (/etc/path_to_inst) and the di_devlinks
* database information.
*/
extern di_dim_t di_dim_init();
extern void di_dim_fini(di_dim_t);
extern char *di_dim_path_devices(di_dim_t,
extern char *di_dim_path_dev(di_dim_t,
/*
* Alias related exported interfaces
*/
#ifdef __cplusplus
}
#endif
#endif /* _LIBDEVINFO_H */