Print this page
NEX-3705 Need to update libses with LID/USN code from sesctld
Reviewed by: Dan Fields <dan.fields@nexenta.com>
Reviewed by: Rob Gittins <rob.gittins@nexenta.com>
Reviewed by: Hans Rosenfeld <hans.rosenfeld@nexenta.com>
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/lib/scsi/libscsi/common/libscsi_impl.h
+++ new/usr/src/lib/scsi/libscsi/common/libscsi_impl.h
1 1 /*
2 2 * CDDL HEADER START
3 3 *
4 4 * The contents of this file are subject to the terms of the
5 5 * Common Development and Distribution License (the "License").
6 6 * You may not use this file except in compliance with the License.
7 7 *
8 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 9 * or http://www.opensolaris.org/os/licensing.
10 10 * See the License for the specific language governing permissions
11 11 * and limitations under the License.
12 12 *
13 13 * When distributing Covered Code, include this CDDL HEADER in each
14 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
|
↓ open down ↓ |
14 lines elided |
↑ open up ↑ |
15 15 * If applicable, add the following below this CDDL HEADER, with the
16 16 * fields enclosed by brackets "[]" replaced with your own identifying
17 17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 18 *
19 19 * CDDL HEADER END
20 20 */
21 21
22 22 /*
23 23 * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
24 24 * Use is subject to license terms.
25 + * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
25 26 */
26 27
27 28 #ifndef _LIBSCSI_IMPL_H
28 29 #define _LIBSCSI_IMPL_H
29 30
30 31 #pragma ident "%Z%%M% %I% %E% SMI"
31 32
32 33 #ifdef __cplusplus
33 34 extern "C" {
34 35 #endif
35 36
36 37 #include <libscsi.h>
37 38
38 39 #define LIBSCSI_ENGINE_EXT ".so"
39 40
40 41 #define LIBSCSI_ERRMSGLEN 512
41 42
42 43 typedef struct libscsi_engine_impl {
43 44 const libscsi_engine_t *lsei_engine;
44 45 void *lsei_dl_hdl;
45 46 struct libscsi_engine_impl *lsei_next;
46 47 } libscsi_engine_impl_t;
47 48
48 49 typedef struct libscsi_action_impl {
49 50 libscsi_hdl_t *lsai_hdl;
50 51 uint_t lsai_flags;
51 52 uint32_t lsai_timeout;
52 53 uint8_t *lsai_cdb;
53 54 size_t lsai_cdb_len;
54 55 size_t lsai_data_len;
55 56 size_t lsai_data_alloc;
56 57 uint8_t *lsai_data;
57 58 sam4_status_t lsai_status;
58 59 size_t lsai_sense_len;
59 60 uint8_t *lsai_sense_data;
60 61 uint8_t lsai_buf[1];
61 62 } libscsi_action_impl_t;
62 63
63 64 struct libscsi_hdl {
64 65 uint_t lsh_version;
65 66 libscsi_errno_t lsh_errno;
|
↓ open down ↓ |
31 lines elided |
↑ open up ↑ |
66 67 char lsh_errmsg[LIBSCSI_ERRMSGLEN];
67 68 libscsi_engine_impl_t *lsh_engines;
68 69 uint_t lsh_targets;
69 70 };
70 71
71 72 struct libscsi_target {
72 73 const libscsi_engine_t *lst_engine;
73 74 char *lst_vendor;
74 75 char *lst_product;
75 76 char *lst_revision;
77 + char *lst_lid;
78 + char *lst_usn;
76 79 void *lst_priv;
77 80 uint_t lst_mtbf_cdb;
78 81 uint_t lst_mtbf_read;
79 82 uint_t lst_mtbf_write;
80 83 struct libscsi_hdl *lst_hdl;
81 84 };
82 85
83 86 #define VERIFY(x) ((void)((x) || libscsi_assert(#x, __FILE__, __LINE__)))
84 87
85 88 #ifdef DEBUG
86 89 #define ASSERT(x) VERIFY(x)
87 90 #else
88 91 #define ASSERT(x)
89 92 #endif
90 93
91 94 #define LXOR(l, r) (((l) != 0) ^ ((r) != 0))
92 95
93 96 extern int libscsi_assert(const char *, const char *, int);
94 97 extern int libscsi_get_inquiry(struct libscsi_hdl *, struct libscsi_target *);
98 +extern int libscsi_get_inquiry_dev_id(struct libscsi_hdl *,
99 + struct libscsi_target *);
100 +extern int libscsi_get_inquiry_usn(struct libscsi_hdl *,
101 + struct libscsi_target *);
95 102
96 103 #ifdef __cplusplus
97 104 }
98 105 #endif
99 106
100 107 #endif /* _LIBSCSI_IMPL_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX