Patrick Welche <prlw1@cam.ac.uk>
[netbsd-mini2440.git] / external / cddl / osnet / include / devid.h
blob134bdefda5108326823c70790d97af8ce749cda7
1 /* $NetBSD: devid.h,v 1.1 2009/03/26 22:11:43 ad Exp $ */
3 /*
4 * CDDL HEADER START
6 * The contents of this file are subject to the terms of the
7 * Common Development and Distribution License, Version 1.0 only
8 * (the "License"). You may not use this file except in compliance
9 * with the License.
11 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
12 * or http://www.opensolaris.org/os/licensing.
13 * See the License for the specific language governing permissions
14 * and limitations under the License.
16 * When distributing Covered Code, include this CDDL HEADER in each
17 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
18 * If applicable, add the following below this CDDL HEADER, with the
19 * fields enclosed by brackets "[]" replaced with your own identifying
20 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * CDDL HEADER END
25 * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
26 * Use is subject to license terms.
29 #ifndef _OPENSOLARIS_DEVID_H_
30 #define _OPENSOLARIS_DEVID_H_
32 #include <sys/param.h>
33 #include <sys/disk.h>
34 #include <stdlib.h>
36 #define DISK_IDENT_SIZE 128
38 typedef struct ddi_devid {
39 char devid[DISK_IDENT_SIZE];
40 } ddi_devid_t;
42 typedef struct devid_nmlist {
43 char devname[MAXPATHLEN];
44 dev_t dev;
45 } devid_nmlist_t;
47 int devid_str_decode(char *devidstr, ddi_devid_t *retdevid,
48 char **retminor_name);
49 int devid_deviceid_to_nmlist(char *search_path, ddi_devid_t devid,
50 char *minor_name, devid_nmlist_t **retlist);
51 void devid_str_free(char *str);
52 void devid_free(ddi_devid_t devid);
53 void devid_free_nmlist(devid_nmlist_t *list);
54 int devid_get(int fd, ddi_devid_t *retdevid);
55 int devid_get_minor_name(int fd, char **retminor_name);
56 char *devid_str_encode(ddi_devid_t devid, char *minor_name);
58 #endif /* !_OPENSOLARIS_DEVID_H_ */