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.
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.
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]
23 * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
33 #include <sys/scsi/generic/smp_frames.h>
35 #include <scsi/libsmp.h>
36 #include <scsi/libsmp_plugin.h>
40 #define LIBSMP_ERRMSGLEN 512
42 #define LIBSMP_DEFAULT_PLUGINDIR "/usr/lib/scsi/plugins/smp"
43 #define LIBSMP_PLUGIN_ENGINE "engine"
44 #define LIBSMP_PLUGIN_FRAMEWORK "framework"
45 #define LIBSMP_PLUGIN_VENDOR "vendor"
47 #define LIBSMP_PLUGIN_EXT ".so"
49 #define LIBSMP_DEFAULT_ENGINE "usmp"
53 const smp_engine_ops_t
*se_ops
;
55 int (*se_init
)(struct smp_engine
*);
56 void (*se_fini
)(struct smp_engine
*);
58 struct smp_engine
*se_next
;
62 struct smp_plugin
*sp_next
;
63 struct smp_plugin
*sp_prev
;
64 smp_target_t
*sp_target
;
68 boolean_t sp_initialized
;
69 const smp_function_def_t
*sp_functions
;
70 int (*sp_init
)(smp_plugin_t
*);
71 void (*sp_fini
)(smp_plugin_t
*);
74 #define SMP_ACTION_F_OFFSET 0x01
75 #define SMP_ACTION_F_EXEC 0x02
76 #define SMP_ACTION_F_DECODE 0x04
80 const smp_function_def_t
*sa_def
;
82 size_t sa_request_rqsd
;
83 size_t sa_request_alloc_len
;
84 off_t sa_request_data_off
;
86 size_t sa_response_alloc_len
;
87 size_t sa_response_engine_len
;
88 size_t sa_response_data_len
;
89 off_t sa_response_data_off
;
90 smp_result_t sa_result
;
97 smp_engine_t
*st_engine
;
99 uint_t st_mtbf_request
;
100 uint_t st_mtbf_response
;
101 uint16_t st_change_count
;
102 smp_plugin_t
*st_plugin_first
;
103 smp_plugin_t
*st_plugin_last
;
107 char *st_component_vendor
;
108 uint16_t st_component_id
;
109 uint8_t st_component_revision
;
110 smp_report_general_resp_t st_repgen
;
113 extern void smp_engine_init(void);
114 extern void smp_engine_fini(void);
116 extern int smp_plugin_load(smp_target_t
*);
117 extern void smp_plugin_unload(smp_target_t
*);
123 #endif /* _SMP_IMPL_H */