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 (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
23 */
24 #ifndef _LPIF_H
25 #define _LPIF_H
26
27 /*
28 * Definitions for stmf LUs and lu providers.
29 */
30
31 #include <sys/stmf_defines.h>
32 #include <sys/stmf.h>
33
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37
38 #define LPIF_REV_1 0x00010000
39 #define LPIF_REV_2 0x00020000
40
41 typedef struct stmf_lu {
42 void *lu_stmf_private;
114 void *lp_stmf_private;
115 void *lp_private;
116
117 uint32_t lp_lpif_rev; /* Currently LPIF_REV_2 */
118 int lp_instance;
119 char *lp_name;
120 void (*lp_cb)(struct stmf_lu_provider *lp,
121 int cmd, void *arg, uint32_t flags);
122 uint8_t lp_alua_support;
123 stmf_status_t (*lp_proxy_msg)(uint8_t *luid,
124 void *proxy_reg_arg, uint32_t proxy_reg_arg_len, uint32_t type);
125 } stmf_lu_provider_t;
126
127 stmf_status_t stmf_deregister_lu_provider(stmf_lu_provider_t *lp);
128 stmf_status_t stmf_register_lu_provider(stmf_lu_provider_t *lp);
129 stmf_status_t stmf_register_lu(stmf_lu_t *lup);
130 stmf_status_t stmf_deregister_lu(stmf_lu_t *lup);
131 stmf_status_t stmf_set_lu_access(stmf_lu_t *lup, uint8_t access_state);
132 stmf_status_t stmf_proxy_scsi_cmd(scsi_task_t *, stmf_data_buf_t *dbuf);
133 int stmf_is_standby_port(scsi_task_t *);
134 void stmf_lu_xfer_start(struct scsi_task *task);
135 void stmf_lu_xfer_done(struct scsi_task *task, boolean_t read,
136 uint64_t xfer_bytes, hrtime_t elapsed_time);
137
138 #ifdef __cplusplus
139 }
140 #endif
141
142 #endif /* _LPIF_H */
|
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 (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
23 * Copyright (c) 2013 by Delphix. All rights reserved.
24 */
25 #ifndef _LPIF_H
26 #define _LPIF_H
27
28 /*
29 * Definitions for stmf LUs and lu providers.
30 */
31
32 #include <sys/stmf_defines.h>
33 #include <sys/stmf.h>
34
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38
39 #define LPIF_REV_1 0x00010000
40 #define LPIF_REV_2 0x00020000
41
42 typedef struct stmf_lu {
43 void *lu_stmf_private;
115 void *lp_stmf_private;
116 void *lp_private;
117
118 uint32_t lp_lpif_rev; /* Currently LPIF_REV_2 */
119 int lp_instance;
120 char *lp_name;
121 void (*lp_cb)(struct stmf_lu_provider *lp,
122 int cmd, void *arg, uint32_t flags);
123 uint8_t lp_alua_support;
124 stmf_status_t (*lp_proxy_msg)(uint8_t *luid,
125 void *proxy_reg_arg, uint32_t proxy_reg_arg_len, uint32_t type);
126 } stmf_lu_provider_t;
127
128 stmf_status_t stmf_deregister_lu_provider(stmf_lu_provider_t *lp);
129 stmf_status_t stmf_register_lu_provider(stmf_lu_provider_t *lp);
130 stmf_status_t stmf_register_lu(stmf_lu_t *lup);
131 stmf_status_t stmf_deregister_lu(stmf_lu_t *lup);
132 stmf_status_t stmf_set_lu_access(stmf_lu_t *lup, uint8_t access_state);
133 stmf_status_t stmf_proxy_scsi_cmd(scsi_task_t *, stmf_data_buf_t *dbuf);
134 int stmf_is_standby_port(scsi_task_t *);
135
136 #ifdef __cplusplus
137 }
138 #endif
139
140 #endif /* _LPIF_H */
|