/*
* 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
*/
/*
* Copyright 2010 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* WARNING:
* The interfaces defined in this header file are for Sun private use only.
* The contents of this file are subject to change without notice in
* future releases.
*/
#ifndef _DEVICE_INFO_H
#define _DEVICE_INFO_H
#ifdef __cplusplus
extern "C" {
#endif
/* error return values */
/*
* for devfs_set_boot_dev()
* default behavior is to translate the input logical device name
* to most compact prom name(i.e. a prom alias, if one exists)
* as possible. And to prepend the new entry to the existing
* list.
*/
/* perform no translation on the input device path */
/* convert the input device path only a prom device path; not an alias */
/* overwrite the existing entry in boot-device - default is to prepend */
/*
* for devfs_get_prom_names()
* returns a list of prom names for a given logical device name.
* the list is sorted first in order of exact aliases, inexact alias
* matches (where an option override was needed), and finally the
* equivalent prom device path. Each sublist is sorted in collating
* order.
*/
/* for devfs_get_boot_dev() */
struct boot_dev {
};
/* for devfs_get_all_prom_names() */
struct devfs_prom_path {
char *obp_path;
char **alias_list;
};
/* prototypes */
/* return the driver for a given device path */
/* convert a logical or physical device name to the equivalent prom path */
extern int devfs_dev_to_prom_name(char *, char *);
/* return the driver name after resolving any aliases */
extern char *devfs_resolve_aliases(char *drv);
/* set the boot-device configuration variable */
extern int devfs_bootdev_set_list(const char *, const uint_t);
/* is the boot-device variable modifiable on this platform? */
extern int devfs_bootdev_modifiable(void);
/*
* retrieve the boot-device config variable and corresponding logical
* device names
*/
extern int devfs_bootdev_get_list(const char *, struct boot_dev ***);
/*
* free a list of bootdev structs
*/
extern void devfs_bootdev_free_list(struct boot_dev **);
/*
* given a logical device name, return a list of equivalent
* prom names (aliases and device paths)
*/
extern int devfs_get_prom_names(const char *, uint_t, char ***);
/*
* like devfs_get_prom_names(), but deals with 1 to many mappings
* introduced by mpxio devices
*/
extern int devfs_get_all_prom_names(const char *, uint_t,
struct devfs_prom_path **);
/*
* free a list of devfs_prom_path structures
*/
extern void devfs_free_all_prom_names(struct devfs_prom_path *);
/*
* Interpret a /dev link to its /devices path (does not require path to
* still exist, as long as the links exist)
*/
extern int devfs_resolve_link(char *, char **);
/*
* map a device name from install OS environment to target OS environment or
* vice-versa.
*/
extern int devfs_target2install(const char *, const char *, char *, size_t);
extern int devfs_install2target(const char *, const char *, char *, size_t);
/*
* Minor perm parsing library support for devfsadm, add_drv etc.
*/
/*
* Possible errors the callers of devfs_read_minor_perm() need
* to be prepared to deal with via callback.
*/
typedef enum {
/*
*/
extern void devfs_free_minor_perm(struct mperm *);
/*
*/
extern int devfs_load_minor_perm(struct mperm *,
void (*)(minorperm_err_t, int));
extern int devfs_add_minor_perm(char *, void (*)(minorperm_err_t, int));
extern int devfs_rm_minor_perm(char *, void (*)(minorperm_err_t, int));
/* devfsadm dca_flags values: some are used by libdevinfo devlink_create() */
/* UNUSED was DCA_NOTIFY_RCM 0x000000020 (can be recycled) */
#ifdef __cplusplus
}
#endif
#endif /* _DEVICE_INFO_H */