Print this page
NEX-3622 COMSTAR should have per remote port kstats for I/O and latency
Reviewed by: Rob Gittins <rob.gittins@nexenta.com>
Reviewed by: Yuri Pankov <yuri.pankov@nexenta.com>
| Split |
Close |
| Expand all |
| Collapse all |
--- old/usr/src/uts/common/sys/portif.h
+++ new/usr/src/uts/common/sys/portif.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.
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 * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
23 23 */
24 24 #ifndef _PORTIF_H
25 25 #define _PORTIF_H
26 26
27 27 /*
28 28 * Definitions for stmf local ports and port providers.
29 29 */
30 30
31 31 #include <sys/stmf_defines.h>
32 32
33 33 #ifdef __cplusplus
34 34 extern "C" {
35 35 #endif
36 36
37 37 typedef struct stmf_dbuf_store {
38 38 void *ds_stmf_private;
39 39 void *ds_port_private;
40 40
41 41 stmf_data_buf_t *(*ds_alloc_data_buf)(struct scsi_task *task,
42 42 uint32_t size, uint32_t *pminsize, uint32_t flags);
43 43
44 44 void (*ds_free_data_buf)(
45 45 struct stmf_dbuf_store *ds, stmf_data_buf_t *dbuf);
46 46
47 47 stmf_status_t (*ds_setup_dbuf)(struct scsi_task *task,
48 48 stmf_data_buf_t *dbuf, uint32_t flags);
49 49
50 50 void (*ds_teardown_dbuf)(
51 51 struct stmf_dbuf_store *ds, stmf_data_buf_t *dbuf);
52 52 } stmf_dbuf_store_t;
53 53
54 54 #define PORTIF_REV_1 0x00010000
55 55
56 56 typedef struct stmf_local_port {
57 57 void *lport_stmf_private;
58 58 void *lport_port_private;
59 59
60 60 uint32_t lport_abort_timeout;
61 61
62 62 struct scsi_devid_desc *lport_id;
63 63 char *lport_alias;
64 64 struct stmf_port_provider *lport_pp;
65 65 struct stmf_dbuf_store *lport_ds;
66 66 /* lport ops */
67 67 stmf_status_t (*lport_xfer_data)(struct scsi_task *task,
68 68 struct stmf_data_buf *dbuf, uint32_t ioflags);
69 69 stmf_status_t (*lport_send_status)(struct scsi_task *task,
70 70 uint32_t ioflags);
71 71 void (*lport_task_free)(struct scsi_task *task);
72 72 stmf_status_t (*lport_abort)(struct stmf_local_port *lport,
73 73 int abort_cmd, void *arg, uint32_t flags);
74 74 void (*lport_task_poll)(struct scsi_task *task);
75 75 void (*lport_ctl)(struct stmf_local_port *lport,
76 76 int cmd, void *arg);
77 77 stmf_status_t (*lport_info)(uint32_t cmd,
78 78 struct stmf_local_port *lport, void *arg, uint8_t *buf,
79 79 uint32_t *bufsizep);
80 80 void (*lport_event_handler)(
81 81 struct stmf_local_port *lport, int eventid, void *arg,
82 82 uint32_t flags);
83 83 } stmf_local_port_t;
84 84
85 85 typedef struct stmf_remote_port {
86 86 struct scsi_transport_id *rport_tptid;
87 87 uint16_t rport_tptid_sz;
88 88 } stmf_remote_port_t;
89 89
90 90 typedef struct stmf_dflt_scsi_tptid {
91 91 #if defined(_BIT_FIELDS_LTOH)
92 92 uint8_t protocol_id : 4,
93 93 resbits : 2,
94 94 format_code : 2;
95 95 #elif defined(_BIT_FIELDS_HTOL)
96 96 uint8_t format_code : 2,
97 97 resbits : 2,
98 98 protocol_id : 4;
99 99 #else
100 100 #error One of _BIT_FIELDS_LTOH or _BIT_FIELDS_HTOL must be defined
101 101 #endif /* _BIT_FIELDS_LTOH */
102 102 uint8_t rsvbyte1;
103 103 uint8_t ident_len[2];
104 104 char ident[1];
105 105 } stmf_dflt_scsi_tptid_t;
106 106 /*
107 107 * abort cmd
108 108 */
109 109 #define STMF_LPORT_ABORT_TASK 0x40
110 110
111 111 typedef struct stmf_port_provider {
112 112 void *pp_stmf_private;
113 113 void *pp_provider_private;
114 114
115 115 uint32_t pp_portif_rev; /* Currently PORTIF_REV_1 */
116 116 int pp_instance;
117 117 char *pp_name;
118 118 void (*pp_cb)(struct stmf_port_provider *pp,
119 119 int cmd, void *arg, uint32_t flags);
120 120 } stmf_port_provider_t;
121 121
122 122 #define STMF_SESSION_ID_NONE ((uint64_t)0)
123 123
124 124 typedef struct stmf_scsi_session {
125 125 void *ss_stmf_private;
126 126 void *ss_port_private;
127 127
128 128 struct scsi_devid_desc *ss_rport_id;
129 129 char *ss_rport_alias;
130 130 struct stmf_local_port *ss_lport;
|
↓ open down ↓ |
130 lines elided |
↑ open up ↑ |
131 131 uint64_t ss_session_id;
132 132 struct stmf_remote_port *ss_rport;
133 133 } stmf_scsi_session_t;
134 134
135 135 stmf_status_t stmf_register_port_provider(stmf_port_provider_t *pp);
136 136 stmf_status_t stmf_deregister_port_provider(stmf_port_provider_t *pp);
137 137 stmf_status_t stmf_register_local_port(stmf_local_port_t *lportp);
138 138 stmf_status_t stmf_deregister_local_port(stmf_local_port_t *lport);
139 139 stmf_status_t stmf_register_scsi_session(stmf_local_port_t *lport,
140 140 stmf_scsi_session_t *ss);
141 +stmf_status_t stmf_add_rport_info(stmf_scsi_session_t *ss,
142 + const char *prop_name, const char *prop_value);
143 +void stmf_remove_rport_info(stmf_scsi_session_t *ss,
144 + const char *prop_name);
141 145 void stmf_deregister_scsi_session(stmf_local_port_t *lport,
142 146 stmf_scsi_session_t *ss);
143 147 void stmf_set_port_standby(stmf_local_port_t *lport, uint16_t rtpid);
144 148 void stmf_set_port_alua(stmf_local_port_t *lport);
145 149
146 150 #ifdef __cplusplus
147 151 }
148 152 #endif
149 153
150 154 #endif /* _PORTIF_H */
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX