Print this page
10886 smatch debug macro cleanup in usr/src/uts
Split |
Close |
Expand all |
Collapse all |
--- old/usr/src/uts/common/sys/fibre-channel/impl/fp.h
+++ new/usr/src/uts/common/sys/fibre-channel/impl/fp.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
↓ open down ↓ |
15 lines elided |
↑ open up ↑ |
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 2008 Sun Microsystems, Inc. All rights reserved.
23 23 * Use is subject to license terms.
24 24 */
25 25
26 +/*
27 + * Copyright 2019 Joyent, Inc.
28 + */
29 +
26 30 #ifndef _FP_H
27 31 #define _FP_H
28 32
29 33
30 34 #include <sys/note.h>
31 35
32 36 #ifdef __cplusplus
33 37 extern "C" {
34 38 #endif
35 39
36 40 /*
37 41 * Debugging, Error reporting, and tracing
38 42 */
39 43 #define FP_LOG_SIZE 1024 * 1024
40 44
41 45 #define FP_LEVEL_1 0x00001 /* attach/detach PM CPR */
42 46 #define FP_LEVEL_2 0x00002 /* startup */
43 47 #define FP_LEVEL_3 0x00004 /* state change, discovery */
44 48 #define FP_LEVEL_4 0x00008 /* statec/devc to ULPs */
45 49 #define FP_LEVEL_5 0x00010 /* FCA UB callbacks */
46 50 #define FP_LEVEL_6 0x00020 /* Name Server */
47 51 #define FP_LEVEL_7 0x00040 /* RSCN */
48 52 #define FP_LEVEL_8 0x00080 /* I/O tracing */
49 53 #define FP_LEVEL_9 0x00100 /* Failure messages */
50 54
51 55
52 56 /*
53 57 * Log contents to system messages file
54 58 */
55 59 #define FP_MSG_LEVEL_1 (FP_LEVEL_1 | FC_TRACE_LOG_MSG)
56 60 #define FP_MSG_LEVEL_2 (FP_LEVEL_2 | FC_TRACE_LOG_MSG)
57 61 #define FP_MSG_LEVEL_3 (FP_LEVEL_3 | FC_TRACE_LOG_MSG)
58 62 #define FP_MSG_LEVEL_4 (FP_LEVEL_4 | FC_TRACE_LOG_MSG)
59 63 #define FP_MSG_LEVEL_5 (FP_LEVEL_5 | FC_TRACE_LOG_MSG)
60 64 #define FP_MSG_LEVEL_6 (FP_LEVEL_6 | FC_TRACE_LOG_MSG)
61 65 #define FP_MSG_LEVEL_7 (FP_LEVEL_7 | FC_TRACE_LOG_MSG)
62 66 #define FP_MSG_LEVEL_8 (FP_LEVEL_8 | FC_TRACE_LOG_MSG)
63 67 #define FP_MSG_LEVEL_9 (FP_LEVEL_9 | FC_TRACE_LOG_MSG)
64 68
65 69
66 70 /*
67 71 * Log contents to trace buffer
68 72 */
69 73 #define FP_BUF_LEVEL_1 (FP_LEVEL_1 | FC_TRACE_LOG_BUF)
70 74 #define FP_BUF_LEVEL_2 (FP_LEVEL_2 | FC_TRACE_LOG_BUF)
71 75 #define FP_BUF_LEVEL_3 (FP_LEVEL_3 | FC_TRACE_LOG_BUF)
72 76 #define FP_BUF_LEVEL_4 (FP_LEVEL_4 | FC_TRACE_LOG_BUF)
73 77 #define FP_BUF_LEVEL_5 (FP_LEVEL_5 | FC_TRACE_LOG_BUF)
74 78 #define FP_BUF_LEVEL_6 (FP_LEVEL_6 | FC_TRACE_LOG_BUF)
75 79 #define FP_BUF_LEVEL_7 (FP_LEVEL_7 | FC_TRACE_LOG_BUF)
76 80 #define FP_BUF_LEVEL_8 (FP_LEVEL_8 | FC_TRACE_LOG_BUF)
77 81 #define FP_BUF_LEVEL_9 (FP_LEVEL_9 | FC_TRACE_LOG_BUF)
78 82
79 83
80 84 /*
81 85 * Log contents to both system messages file and trace buffer
82 86 */
83 87 #define FP_MSG_BUF_LEVEL_1 (FP_LEVEL_1 | FC_TRACE_LOG_BUF |\
84 88 FC_TRACE_LOG_MSG)
85 89 #define FP_MSG_BUF_LEVEL_2 (FP_LEVEL_2 | FC_TRACE_LOG_BUF |\
86 90 FC_TRACE_LOG_MSG)
87 91 #define FP_MSG_BUF_LEVEL_3 (FP_LEVEL_3 | FC_TRACE_LOG_BUF |\
88 92 FC_TRACE_LOG_MSG)
89 93 #define FP_MSG_BUF_LEVEL_4 (FP_LEVEL_4 | FC_TRACE_LOG_BUF |\
90 94 FC_TRACE_LOG_MSG)
91 95 #define FP_MSG_BUF_LEVEL_5 (FP_LEVEL_5 | FC_TRACE_LOG_BUF |\
92 96 FC_TRACE_LOG_MSG)
93 97 #define FP_MSG_BUF_LEVEL_6 (FP_LEVEL_6 | FC_TRACE_LOG_BUF |\
94 98 FC_TRACE_LOG_MSG)
95 99 #define FP_MSG_BUF_LEVEL_7 (FP_LEVEL_7 | FC_TRACE_LOG_BUF |\
96 100 FC_TRACE_LOG_MSG)
97 101 #define FP_MSG_BUF_LEVEL_8 (FP_LEVEL_8 | FC_TRACE_LOG_BUF |\
98 102 FC_TRACE_LOG_MSG)
99 103 #define FP_MSG_BUF_LEVEL_9 (FP_LEVEL_9 | FC_TRACE_LOG_BUF |\
100 104 FC_TRACE_LOG_MSG)
101 105
102 106 /*
103 107 * Log contents to system messages file, console and trace buffer
104 108 */
105 109 #define FP_MSG_BUF_CONSOLE_LEVEL_1 (FP_LEVEL_1 | FC_TRACE_LOG_BUF |\
106 110 FC_TRACE_LOG_MSG | FC_TRACE_LOG_CONSOLE)
107 111 #define FP_MSG_BUF_CONSOLE_LEVEL_2 (FP_LEVEL_2 | FC_TRACE_LOG_BUF |\
108 112 FC_TRACE_LOG_MSG | FC_TRACE_LOG_CONSOLE)
109 113 #define FP_MSG_BUF_CONSOLE_LEVEL_3 (FP_LEVEL_3 | FC_TRACE_LOG_BUF |\
110 114 FC_TRACE_LOG_MSG | FC_TRACE_LOG_CONSOLE)
111 115 #define FP_MSG_BUF_CONSOLE_LEVEL_4 (FP_LEVEL_4 | FC_TRACE_LOG_BUF |\
112 116 FC_TRACE_LOG_MSG | FC_TRACE_LOG_CONSOLE)
113 117 #define FP_MSG_BUF_CONSOLE_LEVEL_5 (FP_LEVEL_5 | FC_TRACE_LOG_BUF |\
114 118 FC_TRACE_LOG_MSG | FC_TRACE_LOG_CONSOLE)
115 119 #define FP_MSG_BUF_CONSOLE_LEVEL_6 (FP_LEVEL_6 | FC_TRACE_LOG_BUF |\
116 120 FC_TRACE_LOG_MSG | FC_TRACE_LOG_CONSOLE)
117 121 #define FP_MSG_BUF_CONSOLE_LEVEL_7 (FP_LEVEL_7 | FC_TRACE_LOG_BUF |\
118 122 FC_TRACE_LOG_MSG | FC_TRACE_LOG_CONSOLE)
↓ open down ↓ |
83 lines elided |
↑ open up ↑ |
119 123 #define FP_MSG_BUF_CONSOLE_LEVEL_8 (FP_LEVEL_8 | FC_TRACE_LOG_BUF |\
120 124 FC_TRACE_LOG_MSG | FC_TRACE_LOG_CONSOLE)
121 125 #define FP_MSG_BUF_CONSOLE_LEVEL_9 (FP_LEVEL_9 | FC_TRACE_LOG_BUF |\
122 126 FC_TRACE_LOG_MSG | FC_TRACE_LOG_CONSOLE)
123 127 #ifdef DEBUG
124 128
125 129 #define FP_DTRACE fc_trace_debug
126 130
127 131 #else
128 132
129 -#define FP_DTRACE
133 +#define FP_DTRACE(...) (void)(0)
130 134
131 135 #endif
132 136
133 137 #define FP_TRACE fc_trace_debug
134 138
135 139
136 140 #ifdef DEBUG
137 141
138 142 #define FP_TRACE_DEFAULT (FC_TRACE_LOG_MASK | FP_LEVEL_1 |\
139 143 FP_LEVEL_2 | FP_LEVEL_3 |\
140 144 FP_LEVEL_4 | FP_LEVEL_5 |\
141 145 FP_LEVEL_6 | FP_LEVEL_7 | FP_LEVEL_9)
142 146
143 147 #else
144 148
145 149 #define FP_TRACE_DEFAULT (FC_TRACE_LOG_MASK | FP_LEVEL_1 |\
146 150 FP_LEVEL_2 | FP_LEVEL_3 |\
147 151 FP_LEVEL_4 | FP_LEVEL_5 |\
148 152 FP_LEVEL_6 | FP_LEVEL_7 | FP_LEVEL_9)
149 153 #endif
150 154
151 155 #define FP_THEAD(x, y, z) fp_logq, x->fp_ibuf, fp_trace, y, z
152 156
153 157 #define FP_NHEAD1(x, y) FP_THEAD(port, FP_BUF_LEVEL_##x, y)
154 158
155 159 #define FP_NHEAD2(x, y) FP_THEAD(port, FP_MSG_BUF_LEVEL_##x, y)
156 160
157 161 #define FP_NHEAD3(x, y) FP_THEAD(port, FP_MSG_BUF_CONSOLE_LEVEL_##x, y)
158 162
159 163
160 164 /* This is used in about a dozen or so places in fp.c */
161 165 #define FP_IS_PKT_ERROR(pkt) (((pkt)->pkt_state != FC_PKT_SUCCESS) ||\
162 166 ((pkt)->pkt_state == FC_PKT_SUCCESS &&\
163 167 (pkt)->pkt_resp_resid != 0))
164 168
165 169
166 170 /*
167 171 * This is only used in fp_ns_init() and fp_fabric_online().
168 172 */
169 173 #define FP_MAX_DEVICES 255
170 174
171 175
172 176 /*
173 177 * Software restoration bit fields while doing (PM)SUSPEND/(PM)RESUME
174 178 * Used with the fp_restore field in the fc_local_port_t struct.
175 179 */
176 180 #define FP_RESTORE_WAIT_TIMEOUT 0x01
177 181 #define FP_RESTORE_OFFLINE_TIMEOUT 0x02
178 182 #define FP_ELS_TIMEOUT (20)
179 183 #define FP_NS_TIMEOUT (120)
180 184 #define FP_IS_F_PORT(p) ((p) & 0x1000)
181 185 #define FP_RETRY_COUNT (5)
182 186 #define FP_RETRY_DELAY (3) /* E_D_TOV + 1 second */
183 187 #define FP_OFFLINE_TICKER (90) /* seconds */
184 188 #define FP_DEFAULT_SID (0x000AE) /* Used once */
185 189 #define FP_DEFAULT_DID (0x000EA) /* Used once */
186 190 #define FP_PORT_IDENTIFIER_LEN (4)
187 191 #define FP_UNSOL_BUF_COUNT (20)
188 192 #define FP_UNSOL_BUF_SIZE (sizeof (la_els_logi_t))
189 193 #define FP_CMDWAIT_DELAY (240) /* Enough time for all cmds to complt */
190 194
191 195
192 196 /*
193 197 * Values and macros used with fp_task and fp_last_task fields in
194 198 * the fc_local_port_t struct. Also see fp_job_handler() for more info.
195 199 */
196 200 #define FP_TASK_IDLE 0
197 201 #define FP_TASK_PORT_STARTUP 1
198 202 #define FP_TASK_OFFLINE 2
199 203 #define FP_TASK_ONLINE 3
200 204 #define FP_TASK_GETMAP 4
201 205
202 206
203 207 /*
204 208 * cmd_flags
205 209 */
206 210 #define FP_CMD_CFLAG_UNDEFINED (-1)
207 211 #define FP_CMD_PLOGI_DONT_CARE 0x00
208 212 #define FP_CMD_PLOGI_RETAIN 0x01 /* Retain LOGIN */
209 213 #define FP_CMD_DELDEV_ON_ERROR 0x02 /* Remove device on error */
210 214
211 215 /*
212 216 * cmd_dflags
213 217 */
214 218 #define FP_CMD_VALID_DMA_MEM 0x01
215 219 #define FP_CMD_VALID_DMA_BIND 0x02
216 220 #define FP_RESP_VALID_DMA_MEM 0x04
217 221 #define FP_RESP_VALID_DMA_BIND 0x08
218 222
219 223
220 224 /* Values for fp_flag field in the fc_local_port_t struct */
221 225 #define FP_IDLE 0x00
222 226 #define FP_OPEN 0x01
223 227 #define FP_EXCL 0x02
224 228 #define FP_EXCL_BUSY 0x04 /* Exclusive operation in progress */
225 229
226 230
227 231 /* message block/unblock'ing */
228 232 #define FP_WARNING_MESSAGES 0x01
229 233 #define FP_FATAL_MESSAGES 0x02
230 234
231 235
232 236 #define FP_IS_CLASS_1_OR_2(x) \
233 237 ((x) == FC_TRAN_CLASS1 || (x) == FC_TRAN_CLASS2)
234 238
235 239
236 240 /*
237 241 * Driver message control
238 242 */
239 243 typedef enum fp_mesg_dest {
240 244 FP_CONSOLE_ONLY,
241 245 FP_LOG_ONLY,
242 246 FP_LOG_AND_CONSOLE
243 247 } fp_mesg_dest_t;
244 248
245 249 typedef struct soft_attach {
246 250 fc_attach_cmd_t att_cmd;
247 251 struct fc_local_port *att_port;
248 252 boolean_t att_need_pm_idle;
249 253 } fp_soft_attach_t;
250 254
251 255 typedef struct fp_cmd {
252 256 uint16_t cmd_dflags; /* DMA flags */
253 257 ksema_t cmd_sema;
254 258 int cmd_flags; /* cmd flags */
255 259 int cmd_retry_count;
256 260 int cmd_retry_interval; /* milli secs */
257 261 fc_packet_t cmd_pkt;
258 262 fc_local_port_t *cmd_port;
259 263 opaque_t cmd_private;
260 264 struct fp_cmd *cmd_next;
261 265 fc_packet_t *cmd_ulp_pkt;
262 266 job_request_t *cmd_job;
263 267 int (*cmd_transport) (opaque_t fca_handle, fc_packet_t *);
264 268 } fp_cmd_t;
265 269
266 270 typedef struct fp_unsol_spec {
267 271 fc_local_port_t *port;
268 272 fc_unsol_buf_t *buf;
269 273 } fp_unsol_spec_t;
270 274
271 275
272 276 #if !defined(__lint)
273 277 _NOTE(SCHEME_PROTECTS_DATA("unique per request", fp_cmd))
274 278 _NOTE(SCHEME_PROTECTS_DATA("unique per request", soft_attach))
275 279 _NOTE(SCHEME_PROTECTS_DATA("unique per request", fp_unsol_spec))
276 280 #endif /* __lint */
277 281
278 282 /*
279 283 * Procedure templates.
280 284 */
281 285 static int fp_attach(dev_info_t *dip, ddi_attach_cmd_t cmd);
282 286 static int fp_detach(dev_info_t *dip, ddi_detach_cmd_t cmd);
283 287 static int fp_getinfo(dev_info_t *dip, ddi_info_cmd_t cmd,
284 288 void *arg, void **result);
285 289 static int fp_power(dev_info_t *dip, int comp, int level);
286 290 static int fp_open(dev_t *devp, int flag, int otype, cred_t *credp);
287 291 static int fp_close(dev_t dev, int flag, int otype, cred_t *credp);
288 292 static int fp_ioctl(dev_t dev, int cmd, intptr_t data, int mode,
289 293 cred_t *credp, int *rval);
290 294 static int fp_attach_handler(dev_info_t *dip);
291 295 static int fp_resume_handler(dev_info_t *dip);
292 296 static int fp_power_up(fc_local_port_t *port);
293 297 static int fp_resume_all(fc_local_port_t *port, fc_attach_cmd_t cmd);
294 298 static int fp_detach_handler(fc_local_port_t *port);
295 299 static int fp_suspend_handler(fc_local_port_t *port);
296 300 static int fp_power_down(fc_local_port_t *port);
297 301 static void fp_suspend_all(fc_local_port_t *port);
298 302 static int fp_cache_constructor(void *buf, void *cdarg, int kmflags);
299 303 static void fp_cache_destructor(void *buf, void *cdarg);
300 304 static fp_cmd_t *fp_alloc_pkt(fc_local_port_t *port, int cmd_len,
301 305 int resp_len, int kmflags, fc_remote_port_t *pd);
302 306 static void fp_free_pkt(fp_cmd_t *cmd);
303 307 static void fp_free_dma(fp_cmd_t *cmd);
304 308 static void fp_job_handler(fc_local_port_t *port);
305 309 static int fp_port_startup(fc_local_port_t *port, job_request_t *job);
306 310 static void fp_startup_done(opaque_t arg, uchar_t result);
307 311 static void fp_ulp_port_attach(void *arg);
308 312 static int fp_sendcmd(fc_local_port_t *port, fp_cmd_t *cmd,
309 313 opaque_t fca_handle);
310 314 static void fp_resendcmd(void *port_handle);
311 315 static int fp_retry_cmd(fc_packet_t *pkt);
312 316 static void fp_enque_cmd(fc_local_port_t *port, fp_cmd_t *cmd);
313 317 static int fp_handle_reject(fc_packet_t *pkt);
314 318 static uchar_t fp_get_nextclass(fc_local_port_t *port, uchar_t cur_class);
315 319 static int fp_is_class_supported(uint32_t cos, uchar_t tran_class);
316 320 static fp_cmd_t *fp_deque_cmd(fc_local_port_t *port);
317 321 static void fp_jobwait(job_request_t *job);
318 322 int fp_state_to_rval(uchar_t state);
319 323 static void fp_iodone(fp_cmd_t *cmd);
320 324 static void fp_jobdone(job_request_t *job);
321 325 static void fp_port_shutdown(fc_local_port_t *port, job_request_t *job);
322 326 static void fp_get_loopmap(fc_local_port_t *port, job_request_t *job);
323 327 static void fp_loop_online(fc_local_port_t *port, job_request_t *job,
324 328 int orphan);
325 329 static int fp_get_lilpmap(fc_local_port_t *port, fc_lilpmap_t *lilp_map);
326 330 static int fp_fabric_login(fc_local_port_t *port, uint32_t s_id,
327 331 job_request_t *job, int flag, int sleep);
328 332 static int fp_port_login(fc_local_port_t *port, uint32_t d_id,
329 333 job_request_t *job, int cmd_flag, int sleep, fc_remote_port_t *pd,
330 334 fc_packet_t *ulp_pkt);
331 335 static void fp_register_login(ddi_acc_handle_t *handle, fc_remote_port_t *pd,
332 336 la_els_logi_t *acc, uchar_t class);
333 337 static void fp_remote_port_offline(fc_remote_port_t *pd);
334 338 static void fp_unregister_login(fc_remote_port_t *pd);
335 339 static void fp_port_offline(fc_local_port_t *port, int notify);
336 340 static void fp_offline_timeout(void *port_handle);
337 341 static void fp_els_init(fp_cmd_t *cmd, uint32_t s_id, uint32_t d_id,
338 342 void (*comp) (), job_request_t *job);
339 343 static void fp_xlogi_init(fc_local_port_t *port, fp_cmd_t *cmd, uint32_t s_id,
340 344 uint32_t d_id, void (*intr) (), job_request_t *job, uchar_t ls_code);
341 345 static void fp_logo_init(fc_remote_port_t *pd, fp_cmd_t *cmd,
342 346 job_request_t *job);
343 347 static void fp_adisc_init(fp_cmd_t *cmd, job_request_t *job);
344 348 static int fp_ulp_statec_cb(fc_local_port_t *port, uint32_t state,
345 349 fc_portmap_t *changelist, uint32_t listlen, uint32_t alloc_len, int sleep);
346 350 static int fp_ulp_devc_cb(fc_local_port_t *port, fc_portmap_t *changelist,
347 351 uint32_t listlen, uint32_t alloc_len, int sleep, int sync);
348 352 static void fp_plogi_group(fc_local_port_t *port, job_request_t *job);
349 353 static void fp_ns_init(fc_local_port_t *port, job_request_t *job, int sleep);
350 354 static void fp_ns_fini(fc_local_port_t *port, job_request_t *job);
351 355 static int fp_ns_reg(fc_local_port_t *port, fc_remote_port_t *pd,
352 356 uint16_t cmd_code, job_request_t *job, int polled, int sleep);
353 357 static int fp_common_intr(fc_packet_t *pkt, int iodone);
354 358 static void fp_flogi_intr(fc_packet_t *pkt);
355 359 static void fp_plogi_intr(fc_packet_t *pkt);
356 360 static void fp_adisc_intr(fc_packet_t *pkt);
357 361 static void fp_logo_intr(fc_packet_t *pkt);
358 362 static void fp_rls_intr(fc_packet_t *pkt);
359 363 static void fp_rnid_intr(fc_packet_t *pkt);
360 364 static int fp_send_rnid(fc_local_port_t *port, intptr_t data, int mode,
361 365 fcio_t *fcio, la_wwn_t *pwwn);
362 366 static int fp_get_rnid(fc_local_port_t *port, intptr_t data, int mode,
363 367 fcio_t *fcio);
364 368 static int fp_set_rnid(fc_local_port_t *port, intptr_t data, int mode,
365 369 fcio_t *fcio);
366 370 static void fp_intr(fc_packet_t *pkt);
367 371 static void fp_statec_cb(opaque_t port_handle, uint32_t state);
368 372 static int fp_ns_scr(fc_local_port_t *port, job_request_t *job,
369 373 uchar_t scr_func, int sleep);
370 374 static int fp_ns_get_devcount(fc_local_port_t *port, job_request_t *job,
371 375 int create, int sleep);
372 376 static int fp_fciocmd(fc_local_port_t *port, intptr_t data, int mode,
373 377 fcio_t *fcio);
374 378 static int fp_copyout(void *from, void *to, size_t len, int mode);
375 379 static int fp_fcio_copyout(fcio_t *fcio, intptr_t data, int mode);
376 380 static void fp_p2p_online(fc_local_port_t *port, job_request_t *job);
377 381 static int fp_fillout_p2pmap(fc_local_port_t *port, fcio_t *fcio, int mode);
378 382 static void fp_fabric_online(fc_local_port_t *port, job_request_t *job);
379 383 static int fp_fillout_loopmap(fc_local_port_t *port, fcio_t *fcio, int mode);
380 384 static void fp_unsol_intr(fc_packet_t *pkt);
381 385 static void fp_linit_intr(fc_packet_t *pkt);
382 386 static void fp_unsol_cb(opaque_t port_handle, fc_unsol_buf_t *buf,
383 387 uint32_t type);
384 388 static void fp_handle_unsol_buf(fc_local_port_t *port, fc_unsol_buf_t *buf,
385 389 job_request_t *job);
386 390 static void fp_ba_rjt_init(fc_local_port_t *port, fp_cmd_t *cmd,
387 391 fc_unsol_buf_t *buf, job_request_t *job);
388 392 static void fp_els_rjt_init(fc_local_port_t *port, fp_cmd_t *cmd,
389 393 fc_unsol_buf_t *buf, uchar_t action, uchar_t reason, job_request_t *job);
390 394 static void fp_els_acc_init(fc_local_port_t *port, fp_cmd_t *cmd,
391 395 fc_unsol_buf_t *buf, job_request_t *job);
392 396 static void fp_handle_unsol_logo(fc_local_port_t *port, fc_unsol_buf_t *buf,
393 397 fc_remote_port_t *pd, job_request_t *job);
394 398 static void fp_handle_unsol_prlo(fc_local_port_t *port, fc_unsol_buf_t *buf,
395 399 fc_remote_port_t *pd, job_request_t *job);
396 400 static void fp_unsol_resp_init(fc_packet_t *pkt, fc_unsol_buf_t *buf,
397 401 uchar_t r_ctl, uchar_t type);
398 402 static void fp_i_handle_unsol_els(fc_local_port_t *port, fc_unsol_buf_t *buf);
399 403 static void fp_handle_unsol_plogi(fc_local_port_t *port, fc_unsol_buf_t *buf,
400 404 job_request_t *job, int sleep);
401 405 static void fp_handle_unsol_flogi(fc_local_port_t *port, fc_unsol_buf_t *buf,
402 406 job_request_t *job, int sleep);
403 407 static void fp_login_acc_init(fc_local_port_t *port, fp_cmd_t *cmd,
404 408 fc_unsol_buf_t *buf, job_request_t *job, int sleep);
405 409 static void fp_handle_unsol_rscn(fc_local_port_t *port, fc_unsol_buf_t *buf,
406 410 job_request_t *job, int sleep);
407 411 static void fp_fillout_old_map_held(fc_portmap_t *map, fc_remote_port_t *pd,
408 412 uchar_t flag);
409 413 static void fp_fillout_old_map(fc_portmap_t *map, fc_remote_port_t *pd,
410 414 uchar_t flag);
411 415 static void fp_fillout_changed_map(fc_portmap_t *map, fc_remote_port_t *pd,
412 416 uint32_t *new_did, la_wwn_t *new_pwwn);
413 417 static void fp_fillout_new_nsmap(fc_local_port_t *port,
414 418 ddi_acc_handle_t *handle, fc_portmap_t *port_map, ns_resp_gan_t *gan_resp,
415 419 uint32_t d_id);
416 420 static int fp_remote_lip(fc_local_port_t *port, la_wwn_t *pwwn, int sleep,
417 421 job_request_t *job);
418 422 static void fp_stuff_device_with_gan(ddi_acc_handle_t *handle,
419 423 fc_remote_port_t *pd, ns_resp_gan_t *gan_resp);
420 424 static int fp_ns_query(fc_local_port_t *port, fctl_ns_req_t *ns_cmd,
421 425 job_request_t *job, int polled, int sleep);
422 426 static void fp_ct_init(fc_local_port_t *port, fp_cmd_t *cmd,
423 427 fctl_ns_req_t *ns_cmd, uint16_t cmd_code, caddr_t cmd_buf,
424 428 uint16_t cmd_len, uint16_t resp_len, job_request_t *job);
425 429 static void fp_ns_intr(fc_packet_t *pkt);
426 430 static void fp_gan_handler(fc_packet_t *pkt, fctl_ns_req_t *ns_cmd);
427 431 static void fp_ns_query_handler(fc_packet_t *pkt, fctl_ns_req_t *ns_cmd);
428 432 static void fp_handle_unsol_adisc(fc_local_port_t *port, fc_unsol_buf_t *buf,
429 433 fc_remote_port_t *pd, job_request_t *job);
430 434 static void fp_adisc_acc_init(fc_local_port_t *port, fp_cmd_t *cmd,
431 435 fc_unsol_buf_t *buf, job_request_t *job);
432 436 static void fp_load_ulp_modules(dev_info_t *dip, fc_local_port_t *port);
433 437 static int fp_logout(fc_local_port_t *port, fc_remote_port_t *pd,
434 438 job_request_t *job);
435 439 static void fp_attach_ulps(fc_local_port_t *port, fc_attach_cmd_t cmd);
436 440 static int fp_ulp_notify(fc_local_port_t *port, uint32_t statec, int sleep);
437 441 static int fp_ns_getmap(fc_local_port_t *port, job_request_t *job,
438 442 fc_portmap_t **map, uint32_t *len, uint32_t sid);
439 443 static fc_remote_port_t *fp_create_remote_port_by_ns(fc_local_port_t *port,
440 444 uint32_t d_id, int sleep);
441 445 static int fp_check_perms(uchar_t open_flag, uint16_t ioctl_cmd);
442 446 static int fp_bind_callbacks(fc_local_port_t *port);
443 447 static void fp_retrieve_caps(fc_local_port_t *port);
444 448 static void fp_validate_area_domain(fc_local_port_t *port, uint32_t id,
445 449 uint32_t mask, job_request_t *job, int sleep);
446 450 static void fp_validate_rscn_page(fc_local_port_t *port, fc_affected_id_t *page,
447 451 job_request_t *job, fctl_ns_req_t *ns_cmd, fc_portmap_t *listptr,
448 452 int *listindex, int sleep);
449 453 static int fp_ns_validate_device(fc_local_port_t *port, fc_remote_port_t *pd,
450 454 job_request_t *job, int polled, int sleep);
451 455 static int fp_validate_lilp_map(fc_lilpmap_t *lilp_map);
452 456 static int fp_is_valid_alpa(uchar_t al_pa);
453 457 static void fp_ulp_unsol_cb(void *arg);
454 458 static void fp_printf(fc_local_port_t *port, int level, fp_mesg_dest_t dest,
455 459 int fc_errno, fc_packet_t *pkt, const char *fmt, ...);
456 460 static int fp_fcio_logout(fc_local_port_t *port, fcio_t *fcio,
457 461 job_request_t *job);
458 462 static int fp_fcio_login(fc_local_port_t *port, fcio_t *fcio,
459 463 job_request_t *job);
460 464
461 465 #ifdef __cplusplus
462 466 }
463 467 #endif
464 468
465 469 #endif /* _FP_H */
↓ open down ↓ |
326 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX