1168404Spjd/*
2168404Spjd * CDDL HEADER START
3168404Spjd *
4168404Spjd * The contents of this file are subject to the terms of the
5168404Spjd * Common Development and Distribution License, Version 1.0 only
6168404Spjd * (the "License").  You may not use this file except in compliance
7168404Spjd * with the License.
8168404Spjd *
9168404Spjd * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10168404Spjd * or http://www.opensolaris.org/os/licensing.
11168404Spjd * See the License for the specific language governing permissions
12168404Spjd * and limitations under the License.
13168404Spjd *
14168404Spjd * When distributing Covered Code, include this CDDL HEADER in each
15168404Spjd * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16168404Spjd * If applicable, add the following below this CDDL HEADER, with the
17168404Spjd * fields enclosed by brackets "[]" replaced with your own identifying
18168404Spjd * information: Portions Copyright [yyyy] [name of copyright owner]
19168404Spjd *
20168404Spjd * CDDL HEADER END
21178414Sjb *
22178414Sjb * $FreeBSD$
23168404Spjd */
24168404Spjd/*
25168404Spjd * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
26168404Spjd * Use is subject to license terms.
27168404Spjd */
28168404Spjd
29168404Spjd#ifndef _OPENSOLARIS_DEVID_H_
30168404Spjd#define _OPENSOLARIS_DEVID_H_
31168404Spjd
32169303Spjd#include <sys/param.h>
33169303Spjd#include <sys/disk.h>
34168404Spjd#include <stdlib.h>
35168404Spjd
36169303Spjdtypedef struct ddi_devid {
37169303Spjd	char devid[DISK_IDENT_SIZE];
38169303Spjd} ddi_devid_t;
39168404Spjd
40168404Spjdtypedef struct devid_nmlist {
41169303Spjd	char devname[MAXPATHLEN];
42168404Spjd	dev_t dev;
43168404Spjd} devid_nmlist_t;
44168404Spjd
45169303Spjdint devid_str_decode(char *devidstr, ddi_devid_t *retdevid,
46169303Spjd    char **retminor_name);
47169303Spjdint devid_deviceid_to_nmlist(char *search_path, ddi_devid_t devid,
48169303Spjd    char *minor_name, devid_nmlist_t **retlist);
49169303Spjdvoid devid_str_free(char *str);
50169303Spjdvoid devid_free(ddi_devid_t devid);
51169303Spjdvoid devid_free_nmlist(devid_nmlist_t *list);
52169303Spjdint devid_get(int fd, ddi_devid_t *retdevid);
53169303Spjdint devid_get_minor_name(int fd, char **retminor_name);
54169303Spjdchar *devid_str_encode(ddi_devid_t devid, char *minor_name);
55168404Spjd
56168404Spjd#endif	/* !_OPENSOLARIS_DEVID_H_ */
57