xref: /titanic_51/usr/src/lib/libdevid/libdevid.h (revision 1dbc1fed8be6e82e676ff3f124628dc470058bfb)
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  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
23  * Use is subject to license terms.
24  */
25 
26 #ifndef	_LIBDEVID_H
27 #define	_LIBDEVID_H
28 
29 #include <errno.h>
30 #include <sys/param.h>
31 #include <sys/sunddi.h>
32 #include <sys/ddi_impldefs.h>
33 #include <sys/dkio.h>
34 #include <devid.h>
35 
36 #ifdef	__cplusplus
37 extern "C" {
38 #endif
39 
40 /*
41  * libdevid SUN private interfaces or structures.
42  */
43 extern int	devid_str_compare(char *devid1_str, char *devid2_str);
44 
45 extern int	devid_scsi_encode(int version, char *driver_name, uchar_t *inq,
46 		    size_t inq_len, uchar_t *inq80, size_t inq80_len,
47 		    uchar_t *inq83, size_t inq83_len, ddi_devid_t *devid);
48 
49 extern char	*devid_to_guid(ddi_devid_t devid);
50 extern void	devid_free_guid(char *guid);
51 
52 extern int	scsi_wwnstr_to_wwn(const char *wwnstr, uint64_t *wwnp);
53 extern char	*scsi_wwn_to_wwnstr(uint64_t wwn,
54 		    int unit_address_form, char *wwnstr);
55 extern void	scsi_wwnstr_hexcase(char *wwnstr, int lower_case);
56 extern const char	*scsi_wwnstr_skip_ua_prefix(const char *wwnstr);
57 extern void	scsi_free_wwnstr(char *wwnstr);
58 
59 #ifdef	SCSI_ADDR_PROP_LUN64
60 extern scsi_lun64_t	scsi_lun_to_lun64(scsi_lun_t lun);
61 extern scsi_lun_t	scsi_lun64_to_lun(scsi_lun64_t lun64);
62 #endif	/* SCSI_ADDR_PROP_LUN64 */
63 
64 #ifdef	__cplusplus
65 }
66 #endif
67 
68 #endif	/* _LIBDEVID_H */
69