1 /* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 * or http://www.opensolaris.org/os/licensing. 10 * See the License for the specific language governing permissions 11 * and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL HEADER in each 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ 21 22 /* 23 * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 24 * Use is subject to license terms. 25 * Copyright 2017 Nexenta Systems, Inc. 26 */ 27 28 #ifndef _DEVID_H 29 #define _DEVID_H 30 31 #ifndef _KERNEL 32 #include <sys/types.h> 33 #endif /* _KERNEL */ 34 35 #include <sys/sunddi.h> 36 37 #ifdef __cplusplus 38 extern "C" { 39 #endif 40 41 typedef struct devid_nmlist { 42 char *devname; 43 dev_t dev; 44 } devid_nmlist_t; 45 46 extern int devid_get(int fd, ddi_devid_t *retdevid); 47 extern void devid_free(ddi_devid_t devid); 48 extern int devid_get_minor_name(int fd, char **retminor_name); 49 extern size_t devid_sizeof(ddi_devid_t devid); 50 extern int devid_compare(ddi_devid_t devid1, ddi_devid_t devid2); 51 extern int devid_deviceid_to_nmlist(char *search_path, ddi_devid_t devid, 52 char *minor_name, devid_nmlist_t **retlist); 53 extern void devid_free_nmlist(devid_nmlist_t *list); 54 extern int devid_valid(ddi_devid_t devid); 55 extern char *devid_str_encode(ddi_devid_t devid, char *minor_name); 56 extern int devid_str_decode(char *devidstr, 57 ddi_devid_t *retdevid, char **retminor_name); 58 extern void devid_str_free(char *devidstr); 59 extern char *devid_str_from_path(const char *path); 60 61 #ifdef __cplusplus 62 } 63 #endif 64 65 #endif /* _DEVID_H */ 66