xref: /titanic_44/usr/src/uts/common/sys/fibre-channel/fca/emlxs/emlxs_extern.h (revision 8f23e9fa8abcb5857661066b954e63400d589b65)
1 /*
2  * CDDL HEADER START
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
9  * http://www.opensource.org/licenses/cddl1.txt.
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 /*
23  * Copyright (c) 2004-2011 Emulex. All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #ifndef _EMLXS_EXTERN_H
28 #define	_EMLXS_EXTERN_H
29 
30 #ifdef	__cplusplus
31 extern "C" {
32 #endif
33 
34 extern void			*emlxs_soft_state;
35 extern uint32_t			emlxs_instance[MAX_FC_BRDS];
36 extern uint32_t			emlxs_instance_count;
37 extern char			emlxs_revision[32];
38 extern char			emlxs_version[32];
39 extern char			emlxs_name[64];
40 extern char			emlxs_label[64];
41 
42 extern emlxs_device_t		emlxs_device;
43 extern uint32_t			emlxs_instance[MAX_FC_BRDS];
44 extern uint32_t			emlxs_instance_count;
45 
46 extern ddi_device_acc_attr_t	emlxs_data_acc_attr;
47 extern ddi_device_acc_attr_t	emlxs_dev_acc_attr;
48 extern ddi_dma_lim_t		emlxs_dma_lim;
49 extern emlxs_config_t		emlxs_cfg[];
50 extern ddi_dma_attr_t		emlxs_dma_attr;
51 extern ddi_dma_attr_t		emlxs_dma_attr_ro;
52 extern ddi_dma_attr_t		emlxs_dma_attr_fcip_rsp;
53 extern ddi_dma_attr_t		emlxs_dma_attr_1sg;
54 
55 /* Module emlxs_msg.c External Routine Declarations */
56 extern void			emlxs_msg_printf(emlxs_port_t *port,
57 					const uint32_t fileno,
58 					const uint32_t line,
59 					emlxs_msg_t *msg,
60 					const char *fmt, ...);
61 extern uint32_t			emlxs_msg_log_create(emlxs_hba_t *hba);
62 extern void			emlxs_msg_lock_reinit(emlxs_hba_t *hba);
63 extern void			emlxs_msg_log_destroy(emlxs_hba_t *hba);
64 extern uint32_t			emlxs_msg_log_get(emlxs_hba_t *hba,
65 					emlxs_log_req_t *req,
66 					emlxs_log_resp_t *resp);
67 
68 /* Module emlxs_event.c External Routine Declarations */
69 extern uint32_t			emlxs_flush_ct_event(emlxs_port_t *port,
70 					uint32_t rxid);
71 extern void			emlxs_timer_check_events(emlxs_hba_t *hba);
72 
73 extern uint32_t			emlxs_event_queue_create(emlxs_hba_t *hba);
74 
75 extern void			emlxs_event_queue_destroy(emlxs_hba_t *hba);
76 
77 extern void			emlxs_event(emlxs_port_t *port,
78 					emlxs_event_t *evt, void *bp,
79 					uint32_t size);
80 extern void			emlxs_log_dump_event(emlxs_port_t *port,
81 					uint8_t *buffer, uint32_t size);
82 extern void			emlxs_log_link_event(emlxs_port_t *port);
83 
84 extern uint32_t			emlxs_log_ct_event(emlxs_port_t *port,
85 					uint8_t *payload, uint32_t size,
86 					uint32_t rxid);
87 extern void			emlxs_log_rscn_event(emlxs_port_t *port,
88 					uint8_t *payload, uint32_t size);
89 extern void			emlxs_log_vportrscn_event(emlxs_port_t *port,
90 					uint8_t *payload, uint32_t size);
91 extern void			emlxs_get_dfc_event(emlxs_port_t *port,
92 					emlxs_dfc_event_t *dfc_event,
93 					uint32_t sleep);
94 extern uint32_t			emlxs_kill_dfc_event(emlxs_port_t *port,
95 					emlxs_dfc_event_t *dfc_event);
96 extern uint32_t			emlxs_get_dfc_eventinfo(emlxs_port_t *port,
97 					HBA_EVENTINFO *eventinfo,
98 					uint32_t *eventcount,
99 					uint32_t *missed);
100 extern void			emlxs_log_temp_event(emlxs_port_t *port,
101 					uint32_t type, uint32_t temp);
102 extern void			emlxs_log_fcoe_event(emlxs_port_t *port,
103 					menlo_init_rsp_t *init_rsp);
104 extern void			emlxs_log_async_event(emlxs_port_t *port,
105 					IOCB *iocb);
106 
107 #ifdef SAN_DIAG_SUPPORT
108 extern void			emlxs_get_sd_event(emlxs_port_t *port,
109 					emlxs_dfc_event_t *dfc_event,
110 					uint32_t sleep);
111 extern void			emlxs_log_sd_basic_els_event(emlxs_port_t *port,
112 					uint32_t subcat, HBA_WWN *portname,
113 					HBA_WWN *nodename);
114 extern void			emlxs_log_sd_prlo_event(emlxs_port_t *port,
115 					HBA_WWN *portname);
116 extern void			emlxs_log_sd_lsrjt_event(emlxs_port_t *port,
117 					HBA_WWN *remoteport, uint32_t orig_cmd,
118 					uint32_t reason, uint32_t reason_expl);
119 extern void			emlxs_log_sd_fc_bsy_event(emlxs_port_t *port,
120 					HBA_WWN *remoteport);
121 extern void			emlxs_log_sd_fc_rdchk_event(emlxs_port_t *port,
122 					HBA_WWN *remoteport, uint32_t lun,
123 					uint32_t opcode, uint32_t fcp_param);
124 extern void			emlxs_log_sd_scsi_event(emlxs_port_t *port,
125 					uint32_t type, HBA_WWN *remoteport,
126 					int32_t lun);
127 extern void			emlxs_log_sd_scsi_check_event(
128 					emlxs_port_t *port,
129 					HBA_WWN *remoteport, uint32_t lun,
130 					uint32_t cmdcode, uint32_t sensekey,
131 					uint32_t asc, uint32_t ascq);
132 #endif  /* SAN_DIAG_SUPPORT */
133 
134 /* Module emlxs_solaris.c External Routine Declarations */
135 
136 extern void			emlxs_fca_link_up(emlxs_port_t *port);
137 
138 extern void			emlxs_fca_link_down(emlxs_port_t *port);
139 
140 extern void 			emlxs_ulp_unsol_cb(emlxs_port_t *port,
141 					fc_unsol_buf_t *ubp);
142 extern void			emlxs_ulp_statec_cb(emlxs_port_t *port,
143 					uint32_t statec);
144 extern int32_t			emlxs_fca_reset(opaque_t fca_port_handle,
145 					uint32_t cmd);
146 extern int32_t			emlxs_fca_pkt_abort(opaque_t fca_port_handle,
147 					fc_packet_t *pkt, int32_t sleep);
148 extern char			*emlxs_state_xlate(uint8_t state);
149 extern char			*emlxs_error_xlate(uint8_t errno);
150 extern void			emlxs_mem_free(emlxs_hba_t *hba,
151 					MBUF_INFO *buf_info);
152 extern uint8_t			*emlxs_mem_alloc(emlxs_hba_t *hba,
153 					MBUF_INFO *buf_info);
154 extern int			emlxs_map_bus(emlxs_hba_t *hba);
155 extern void			emlxs_unmap_bus(emlxs_hba_t *hba);
156 extern fc_unsol_buf_t		*emlxs_ub_find(emlxs_port_t *port,
157 					uint32_t token);
158 extern fc_unsol_buf_t		*emlxs_ub_get(emlxs_port_t *port, uint32_t size,
159 					uint32_t type, uint32_t resv);
160 extern int32_t			emlxs_log_printf(int32_t f, int32_t type,
161 					int32_t num, int32_t brdno,
162 					const char *fmt, ...);
163 extern void			emlxs_set_pkt_state(emlxs_buf_t *sbp,
164 					uint32_t iostat, uint8_t localstat,
165 					uint32_t lock);
166 extern char			*emlxs_elscmd_xlate(uint32_t cmd);
167 extern char			*emlxs_ctcmd_xlate(uint32_t cmd);
168 extern char			*emlxs_rmcmd_xlate(uint32_t cmd);
169 extern char			*emlxs_wwn_xlate(char *buffer, size_t len,
170 					uint8_t *wwn);
171 extern int32_t			emlxs_wwn_cmp(uint8_t *wwn1, uint8_t *wwn2);
172 extern int32_t			emlxs_fca_transport(opaque_t fca_port_handle,
173 					fc_packet_t *pkt);
174 extern int32_t			emlxs_fca_pkt_uninit(opaque_t fca_port_handle,
175 					fc_packet_t *pkt);
176 extern int32_t			emlxs_fca_pkt_init(opaque_t fca_port_handle,
177 					fc_packet_t *pkt, int32_t sleep);
178 extern void			emlxs_pkt_complete(emlxs_buf_t *sbp,
179 					uint32_t iostat, uint8_t localstat,
180 					uint32_t doneq);
181 
182 #ifdef SAN_DIAG_SUPPORT
183 extern void			emlxs_update_sd_bucket(emlxs_buf_t *sbp);
184 #endif /* SAN_DIAG_SUPPORT */
185 
186 extern uint32_t			emlxs_get_instance(int32_t ddiinst);
187 extern char			*emlxs_mscmd_xlate(uint16_t cmd);
188 extern int32_t			emlxs_reset(emlxs_port_t *port, uint32_t cmd);
189 extern void			emlxs_swap_service_params(SERV_PARM *sp);
190 extern void			emlxs_swap_fcp_pkt(emlxs_buf_t *sbp);
191 extern void			emlxs_swap_ct_pkt(emlxs_buf_t *sbp);
192 extern void			emlxs_swap_els_pkt(emlxs_buf_t *sbp);
193 extern int			emlxs_fca_ub_release(opaque_t fca_port_handle,
194 					uint32_t count, uint64_t tokens[]);
195 extern void			emlxs_swap_els_ub(fc_unsol_buf_t *ubp);
196 extern void			emlxs_unswap_pkt(emlxs_buf_t *sbp);
197 extern uint32_t			emlxs_get_key(emlxs_hba_t *hba, MAILBOXQ *mbq);
198 extern int			emlxs_pm_busy_component(dev_info_t *dip);
199 extern int			emlxs_pm_idle_component(dev_info_t *dip);
200 extern void			emlxs_pm_idle_timer(dev_info_t *dip);
201 extern void			emlxs_shutdown_thread(emlxs_hba_t *hba,
202 					void *arg1, void *arg2);
203 extern uint32_t			emlxs_set_parm(emlxs_hba_t *hba, uint32_t index,
204 					uint32_t new_value);
205 extern void			emlxs_ub_destroy(emlxs_port_t *port,
206 					emlxs_unsol_buf_t *pool);
207 extern void			emlxs_ub_callback(emlxs_port_t *port,
208 					fc_unsol_buf_t *ubp);
209 extern void			emlxs_ub_flush(emlxs_port_t *port);
210 extern uint32_t			emlxs_check_parm(emlxs_hba_t *hba,
211 					uint32_t index, uint32_t new_value);
212 extern int32_t			emlxs_fca_port_manage(opaque_t fca_port_handle,
213 					fc_fca_pm_t *pm);
214 extern void			emlxs_port_init(emlxs_port_t *port);
215 extern void			emlxs_get_fcode_version(emlxs_hba_t *hba);
216 
217 extern void			emlxs_swap32_buffer(uint8_t *buffer,
218 					uint32_t size);
219 extern void			emlxs_swap32_bcopy(uint8_t *src,
220 					uint8_t *dst, uint32_t size);
221 
222 extern char 			*emlxs_strtoupper(char *str);
223 
224 extern void			emlxs_mode_set(emlxs_hba_t *hba);
225 
226 extern char			*emlxs_mode_xlate(uint32_t mode);
227 
228 #ifdef MENLO_SUPPORT
229 extern char			*emlxs_menlo_cmd_xlate(uint32_t cmd);
230 extern char			*emlxs_menlo_rsp_xlate(uint32_t rsp);
231 #endif /* MENLO_SUPPORT */
232 
233 #ifdef FMA_SUPPORT
234 extern void			emlxs_fm_init(emlxs_hba_t *hba);
235 extern void			emlxs_fm_fini(emlxs_hba_t *hba);
236 extern int			emlxs_fm_check_acc_handle(emlxs_hba_t *hba,
237 					ddi_acc_handle_t handle);
238 extern int			emlxs_fm_check_dma_handle(emlxs_hba_t *hba,
239 					ddi_dma_handle_t handle);
240 extern void			emlxs_fm_ereport(emlxs_hba_t *hba,
241 					char *detail);
242 extern void			emlxs_fm_service_impact(emlxs_hba_t *hba,
243 					int impact);
244 extern int			emlxs_fm_error_cb(dev_info_t *dip,
245 					ddi_fm_error_t *err,
246 					const void *impl_data);
247 extern void			emlxs_check_dma(emlxs_hba_t *hba,
248 					emlxs_buf_t *sbp);
249 #endif	/* FMA_SUPPORT */
250 
251 /* Module emlxs_pkt.c External Routine Declarations */
252 extern int32_t			emlxs_pkt_send(fc_packet_t *pkt, uint32_t now);
253 extern void			emlxs_pkt_free(fc_packet_t *pkt);
254 extern void			emlxs_pkt_callback(fc_packet_t *pkt);
255 extern fc_packet_t		*emlxs_pkt_alloc(emlxs_port_t *port,
256 					uint32_t cmdlen, uint32_t rsplen,
257 					uint32_t datalen, int32_t sleep);
258 
259 /* Module emlxs_clock.c External Routine Declarations */
260 extern void			emlxs_timer_checks(emlxs_hba_t *hba);
261 extern void			emlxs_timer_start(emlxs_hba_t *hba);
262 extern void			emlxs_timer_stop(emlxs_hba_t *hba);
263 extern void			emlxs_link_timeout(emlxs_hba_t *hba);
264 extern clock_t			emlxs_timeout(emlxs_hba_t *hba,
265 					uint32_t timeout);
266 extern void			emlxs_timer_cancel_clean_address(
267 					emlxs_port_t *port);
268 
269 /* Module emlxs_dhchap.c External Routine Declarations */
270 #ifdef DHCHAP_SUPPORT
271 extern int			emlxs_dhchap_state_machine(emlxs_port_t *port,
272 					CHANNEL *cp, IOCBQ *iocbq,
273 					MATCHMAP *mp, NODELIST *node, int evt);
274 
275 extern void			emlxs_dhc_attach(emlxs_hba_t *hba);
276 extern void			emlxs_dhc_detach(emlxs_hba_t *hba);
277 extern void			emlxs_dhc_authrsp_timeout(emlxs_port_t *port,
278 					void *node, void *null);
279 extern void			emlxs_dhc_reauth_timeout(emlxs_port_t *port,
280 					void *newtimeout, void *node);
281 extern void			emlxs_dhc_auth_stop(emlxs_port_t *port,
282 					emlxs_node_t *node);
283 extern int			emlxs_dhc_auth_start(emlxs_port_t *port,
284 					emlxs_node_t *node, uint8_t *sbp,
285 					uint8_t *ubp);
286 extern void			emlxs_dhc_init_sp(emlxs_port_t *port,
287 					uint32_t did, SERV_PARM *sp,
288 					char **msg);
289 extern uint32_t			emlxs_dhc_verify_login(emlxs_port_t *port,
290 					uint32_t sid, SERV_PARM *sp);
291 extern void			emlxs_dhc_status(emlxs_port_t *port,
292 					emlxs_node_t *ndlp, uint32_t reason,
293 					uint32_t explaination);
294 extern void			emlxs_dhc_state(emlxs_port_t *port,
295 					emlxs_node_t *ndlp, uint32_t state,
296 					uint32_t reason,
297 					uint32_t explaination);
298 extern uint32_t			emlxs_dhc_init_auth(emlxs_hba_t *hba,
299 					uint8_t *lwwpn, uint8_t *rwwpn);
300 extern uint32_t			emlxs_dhc_get_auth_cfg(emlxs_hba_t *hba,
301 					dfc_fcsp_config_t *fcsp_cfg);
302 extern uint32_t			emlxs_dhc_get_auth_key(emlxs_hba_t *hba,
303 					dfc_auth_password_t *dfc_auth_pwd);
304 extern uint32_t			emlxs_dhc_add_auth_cfg(emlxs_hba_t *hba,
305 					dfc_fcsp_config_t *fcsp_cfg,
306 					dfc_password_t *dfc_pwd);
307 extern uint32_t			emlxs_dhc_delete_auth_cfg(emlxs_hba_t *hba,
308 					dfc_fcsp_config_t *fcsp_cfg,
309 					dfc_password_t *dfc_pwd);
310 extern uint32_t			emlxs_dhc_set_auth_key(emlxs_hba_t *hba,
311 					dfc_auth_password_t *dfc_pwd);
312 extern uint32_t			emlxs_dhc_get_auth_status(emlxs_hba_t *hba,
313 					dfc_auth_status_t *fcsp_status);
314 extern uint32_t			emlxs_dhc_get_auth_cfg_table(emlxs_hba_t *hba,
315 					dfc_fcsp_config_t *fcsp_cfg);
316 extern uint32_t			emlxs_dhc_get_auth_key_table(emlxs_hba_t *hba,
317 					dfc_auth_password_t *auth_pwd);
318 #endif	/* DHCHAP_SUPPORT */
319 
320 /* Module emlxs_node.c External Routine Declarations */
321 extern void 			emlxs_node_throttle_set(emlxs_port_t *port,
322 					NODELIST *node);
323 extern NODELIST *		emlxs_node_create(emlxs_port_t *port,
324 					uint32_t did, uint32_t rpi,
325 					SERV_PARM *sp);
326 extern void			emlxs_node_timeout(emlxs_port_t *port,
327 					NODELIST *ndlp, uint32_t ringno);
328 extern void			emlxs_node_open(emlxs_port_t *port,
329 					NODELIST *ndlp, uint32_t ringno);
330 extern void			emlxs_node_close(emlxs_port_t *port,
331 					NODELIST *ndlp, uint32_t ringno,
332 					int32_t timeout);
333 extern NODELIST			*emlxs_node_find_did(emlxs_port_t *port,
334 					uint32_t did, uint32_t lock);
335 extern NODELIST			*emlxs_node_find_rpi(emlxs_port_t *port,
336 					uint32_t rpi);
337 extern void			emlxs_node_destroy_all(emlxs_port_t *port);
338 extern NODELIST			*emlxs_node_find_mac(emlxs_port_t *port,
339 					uint8_t *mac);
340 extern void			emlxs_node_rm(emlxs_port_t *port,
341 					NODELIST *ndlp);
342 extern NODELIST			*emlxs_node_find_wwpn(emlxs_port_t *port,
343 					uint8_t *wwpn, uint32_t lock);
344 extern NODELIST			*emlxs_node_find_index(emlxs_port_t *port,
345 					uint32_t index, uint32_t nports_only);
346 extern uint32_t			emlxs_nport_count(emlxs_port_t *port);
347 
348 /* Module emlxs_els.c External Routine Declarations */
349 extern int32_t			emlxs_els_handle_event(emlxs_hba_t *hba,
350 					CHANNEL *cp, IOCBQ *temp);
351 extern int32_t			emlxs_els_handle_unsol_req(emlxs_port_t *port,
352 					CHANNEL *cp, IOCBQ *iocbq,
353 					MATCHMAP *mp, uint32_t size);
354 extern uint32_t			emlxs_generate_rscn(emlxs_port_t *port,
355 					uint32_t d_id);
356 extern int32_t			emlxs_ct_handle_event(emlxs_hba_t *hba,
357 					CHANNEL *cp, IOCBQ *temp);
358 extern int32_t			emlxs_ct_handle_unsol_req(emlxs_port_t *port,
359 					CHANNEL *cp, IOCBQ *iocbq,
360 					MATCHMAP *mp, uint32_t size);
361 extern int32_t			emlxs_els_reply(emlxs_port_t *port,
362 					IOCBQ *iocbq, uint32_t type,
363 					uint32_t type2, uint32_t reason,
364 					uint32_t explain);
365 extern void			emlxs_send_logo(emlxs_port_t *port,
366 					uint32_t d_id);
367 extern void			emlxs_reset_link_thread(emlxs_hba_t *hba,
368 					void *arg1, void *arg2);
369 extern uint32_t			emlxs_process_unsol_flogi(emlxs_port_t *port,
370 					IOCBQ *iocbq, MATCHMAP *mp,
371 					uint32_t size, char *buffer,
372 					size_t len);
373 extern uint32_t			emlxs_process_unsol_plogi(emlxs_port_t *port,
374 					IOCBQ *iocbq, MATCHMAP *mp,
375 					uint32_t size, char *buffer,
376 					size_t len);
377 extern uint32_t			emlxs_ub_send_login_acc(emlxs_port_t *port,
378 					fc_unsol_buf_t *ubp);
379 
380 #ifdef MENLO_SUPPORT
381 extern int			emlxs_menlo_handle_event(emlxs_hba_t *hba,
382 					CHANNEL *cp, IOCBQ *iocbq);
383 #endif /* MENLO_SUPPORT */
384 
385 /* Module emlxs_ip.c External Routine Declarations */
386 extern int32_t			emlxs_ip_handle_event(emlxs_hba_t *hba,
387 					CHANNEL *cp, IOCBQ *temp);
388 extern int			emlxs_ip_handle_rcv_seq_list(emlxs_hba_t *hba,
389 					CHANNEL *cp, IOCBQ *saveq);
390 extern int			emlxs_ip_handle_unsol_req(emlxs_port_t *port,
391 					CHANNEL *cp, IOCBQ *iocbq, MATCHMAP *mp,
392 					uint32_t size);
393 extern int			emlxs_create_xri(emlxs_port_t *port,
394 					CHANNEL *cp, NODELIST *ndlp);
395 extern int			emlxs_handle_create_xri(emlxs_hba_t *hba,
396 					CHANNEL *cp, IOCBQ *temp);
397 extern int			emlxs_handle_xri_aborted(emlxs_hba_t *hba,
398 					CHANNEL *cp, IOCBQ *temp);
399 
400 /* Module emlxs_mbox.c External Routine Declarations */
401 extern void			emlxs_mb_get_port_name(emlxs_hba_t *hba,
402 					MAILBOXQ *mbq);
403 extern void			emlxs_mb_get_extents_info(emlxs_hba_t *hba,
404 					MAILBOXQ *mbq, uint16_t type);
405 extern void			emlxs_mb_get_extents(emlxs_hba_t *hba,
406 					MAILBOXQ *mbq, uint16_t type);
407 extern void			emlxs_mb_dealloc_extents(emlxs_hba_t *hba,
408 					MAILBOXQ *mbq, uint16_t type);
409 extern void			emlxs_mb_alloc_extents(emlxs_hba_t *hba,
410 					MAILBOXQ *mbq, uint16_t type,
411 					uint16_t count);
412 extern void			emlxs_mb_get_sli4_params(emlxs_hba_t *hba,
413 					MAILBOXQ *mbq);
414 extern char			*emlxs_mb_xlate_status(uint32_t status);
415 
416 extern void			emlxs_mb_config_msi(emlxs_hba_t *hba,
417 					MAILBOXQ *mbq, uint32_t *intr_map,
418 					uint32_t intr_count);
419 extern void			emlxs_mb_config_msix(emlxs_hba_t *hba,
420 					MAILBOXQ *mbq, uint32_t *intr_map,
421 					uint32_t intr_count);
422 extern void			emlxs_mb_read_lnk_stat(emlxs_hba_t *hba,
423 					MAILBOXQ *mbq);
424 extern void			emlxs_mb_config_link(emlxs_hba_t *hba,
425 					MAILBOXQ *mbq);
426 extern void			emlxs_mb_config_ring(emlxs_hba_t *hba,
427 					int32_t ring, MAILBOXQ *mbq);
428 extern void			emlxs_mb_init_link(emlxs_hba_t *hba,
429 					MAILBOXQ *mbq, uint32_t topology,
430 					uint32_t linkspeed);
431 extern void			emlxs_mb_down_link(emlxs_hba_t *hba,
432 					MAILBOXQ *mbq);
433 extern uint32_t			emlxs_mb_read_la(emlxs_hba_t *hba,
434 					MAILBOXQ *mbq);
435 extern void			emlxs_mb_read_nv(emlxs_hba_t *hba,
436 					MAILBOXQ *mbq);
437 extern void			emlxs_mb_read_rev(emlxs_hba_t *hba,
438 					MAILBOXQ *mbq, uint32_t v3);
439 extern uint32_t			emlxs_mb_read_rpi(emlxs_hba_t *hba,
440 					uint32_t rpi, MAILBOXQ *mbq,
441 					uint32_t flg);
442 extern uint32_t			emlxs_mb_read_xri(emlxs_hba_t *hba,
443 					uint32_t xri, MAILBOXQ *mbq,
444 					uint32_t flg);
445 extern uint32_t			emlxs_mb_read_sparam(emlxs_hba_t *hba,
446 					MAILBOXQ *mbq);
447 extern void			emlxs_disable_tc(emlxs_hba_t *hba,
448 					MAILBOXQ *mbq);
449 extern uint32_t			emlxs_mb_run_biu_diag(emlxs_hba_t *hba,
450 					MAILBOXQ *mbq, uint64_t in,
451 					uint64_t out);
452 extern void			emlxs_mb_dump_vpd(emlxs_hba_t *hba,
453 					MAILBOXQ *mbq, uint32_t offset);
454 extern void			emlxs_mb_dump_fcoe(emlxs_hba_t *hba,
455 					MAILBOXQ *mbq, uint32_t offset);
456 extern void			emlxs_mb_config_farp(emlxs_hba_t *hba,
457 					MAILBOXQ *mbq);
458 extern void			emlxs_mb_read_config(emlxs_hba_t *hba,
459 					MAILBOXQ *mbq);
460 extern void			emlxs_mb_put(emlxs_hba_t *hba,
461 					MAILBOXQ *mbq);
462 extern MAILBOXQ			*emlxs_mb_get(emlxs_hba_t *hba);
463 extern void			emlxs_mb_clear_la(emlxs_hba_t *hba,
464 					MAILBOXQ *mbq);
465 extern void			emlxs_mb_set_var(emlxs_hba_t *hba,
466 					MAILBOXQ *mbq, uint32_t addr,
467 					uint32_t value);
468 extern void			emlxs_mb_reset_ring(emlxs_hba_t *hba,
469 					MAILBOXQ *mbq, uint32_t ringno);
470 extern char			*emlxs_mb_cmd_xlate(uint8_t command);
471 extern char			*emlxs_request_feature_xlate(uint32_t mask);
472 extern void			emlxs_mb_read_status(emlxs_hba_t *hba,
473 					MAILBOXQ *mbq);
474 extern int			emlxs_cmpl_init_vpi(void *arg1, MAILBOXQ *mbq);
475 extern uint32_t			emlxs_mb_init_vpi(emlxs_port_t *port);
476 extern int			emlxs_cmpl_reg_vpi(void *arg1, MAILBOXQ *mbq);
477 extern uint32_t			emlxs_mb_reg_vpi(emlxs_port_t *port,
478 					emlxs_buf_t *sbp);
479 extern int			emlxs_cmpl_unreg_vpi(void *arg1, MAILBOXQ *mbq);
480 extern uint32_t			emlxs_mb_unreg_vpi(emlxs_port_t *port);
481 extern void			emlxs_mb_fini(emlxs_hba_t *hba,
482 					MAILBOX *mb, uint32_t mbxStatus);
483 extern void			emlxs_mb_deferred_cmpl(emlxs_port_t *port,
484 					uint32_t mbxStatus, emlxs_buf_t *sbp,
485 					fc_unsol_buf_t *ubp, IOCBQ *iocbq);
486 extern void			emlxs_mb_flush(emlxs_hba_t *hba);
487 extern void			emlxs_mb_heartbeat(emlxs_hba_t *hba,
488 					MAILBOXQ *mbq);
489 extern void			emlxs_mb_request_features(emlxs_hba_t *hba,
490 					MAILBOXQ *mbq, uint32_t mask);
491 extern int			emlxs_mb_resume_rpi(emlxs_hba_t *hba,
492 					emlxs_buf_t *sbp, uint16_t rpi);
493 extern void			emlxs_mb_noop(emlxs_hba_t *hba,
494 					MAILBOXQ *mbq);
495 extern int			emlxs_mbext_noop(emlxs_hba_t *hba,
496 					MAILBOXQ *mbq);
497 extern void			emlxs_mb_resetport(emlxs_hba_t *hba,
498 					MAILBOXQ *mbq);
499 extern void			emlxs_mb_eq_create(emlxs_hba_t *hba,
500 					MAILBOXQ *mbq, uint32_t num);
501 extern void			emlxs_mb_cq_create(emlxs_hba_t *hba,
502 					MAILBOXQ *mbq, uint32_t num);
503 extern void			emlxs_mb_wq_create(emlxs_hba_t *hba,
504 					MAILBOXQ *mbq, uint32_t num);
505 extern void			emlxs_mb_rq_create(emlxs_hba_t *hba,
506 					MAILBOXQ *mbq, uint32_t num);
507 extern void			emlxs_mb_mq_create(emlxs_hba_t *hba,
508 					MAILBOXQ *mbq);
509 extern void			emlxs_mb_mq_create_ext(emlxs_hba_t *hba,
510 					MAILBOXQ *mbq);
511 extern int			emlxs_mb_reg_fcfi(emlxs_hba_t *hba,
512 					MAILBOXQ *mbq, FCFIobj_t *fcfp);
513 extern int			emlxs_mb_unreg_fcfi(emlxs_hba_t *hba,
514 					FCFIobj_t *fcfp);
515 extern int			emlxs_mb_reg_vfi(emlxs_hba_t *hba,
516 					MAILBOXQ *mb, VFIobj_t *vfip,
517 					emlxs_port_t *vpip);
518 extern int			emlxs_mb_unreg_vfi(emlxs_hba_t *hba,
519 					VFIobj_t *vfip);
520 extern int			emlxs_mbext_read_fcf_table(emlxs_hba_t *hba,
521 					MAILBOXQ *mbq, uint32_t index);
522 extern int			emlxs_mbext_add_fcf_table(emlxs_hba_t *hba,
523 					MAILBOXQ *mbq, uint32_t index);
524 extern void			emlxs_mb_rediscover_fcf_table(emlxs_hba_t *hba,
525 					MAILBOXQ *mbq);
526 extern void			emlxs_mb_async_event(emlxs_hba_t *hba,
527 					MAILBOXQ *mbq);
528 extern int32_t			emlxs_mb_check_sparm(emlxs_hba_t *hba,
529 					SERV_PARM *nsp);
530 extern void			emlxs_cmpl_mbox(emlxs_hba_t *hba, MAILBOXQ *mq);
531 extern void			emlxs_mb_dump(emlxs_hba_t *hba, MAILBOXQ *mbq,
532 					uint32_t offset, uint32_t words);
533 extern void			emlxs_mb_retry(emlxs_hba_t *hba, MAILBOXQ *mbq);
534 extern void			emlxs_mb_init(emlxs_hba_t *hba, MAILBOXQ *mbq,
535 					uint32_t flag, uint32_t tmo);
536 extern void			emlxs_mb_config_hbq(emlxs_hba_t *hba,
537 					MAILBOXQ *mbq, int hbq_id);
538 
539 /* Module emlxs_mem.c External Routine Declarations */
540 extern void			*emlxs_mem_pool_get(emlxs_hba_t *hba,
541 					MEMSEG *seg);
542 extern void 			emlxs_mem_pool_put(emlxs_hba_t *hba,
543 					MEMSEG *seg, void *bp);
544 extern uint32_t 		emlxs_mem_pool_create(emlxs_hba_t *hba,
545 					MEMSEG *seg);
546 extern void 			emlxs_mem_pool_destroy(emlxs_hba_t *hba,
547 					MEMSEG *seg);
548 extern void 			emlxs_mem_pool_clean(emlxs_hba_t *hba,
549 					MEMSEG *seg);
550 extern MATCHMAP			*emlxs_mem_get_vaddr(emlxs_hba_t *hba,
551 					RING *rp, uint64_t mapbp);
552 extern void			*emlxs_mem_get(emlxs_hba_t *hba,
553 					uint32_t seg_id);
554 extern void			emlxs_mem_put(emlxs_hba_t *hba,
555 					uint32_t seg_id, void *bp);
556 extern int32_t			emlxs_mem_free_buffer(emlxs_hba_t *hba);
557 extern int32_t			emlxs_mem_alloc_buffer(emlxs_hba_t *hba);
558 extern void			emlxs_mem_map_vaddr(emlxs_hba_t *hba,
559 					RING *rp, MATCHMAP *mp, uint32_t *haddr,
560 					uint32_t *laddr);
561 extern MATCHMAP			*emlxs_mem_buf_alloc(emlxs_hba_t *hba,
562 					uint32_t size);
563 extern void			emlxs_mem_buf_free(emlxs_hba_t *hba,
564 					MATCHMAP *mp);
565 extern uint32_t			emlxs_hbq_alloc(emlxs_hba_t *hba,
566 					uint32_t hbq_id);
567 
568 /* Module emlxs_hba.c  External Routine Declarations */
569 extern char			*emlxs_pci_cap_xlate(uint32_t id);
570 extern char			*emlxs_pci_ecap_xlate(uint32_t id);
571 
572 extern void			emlxs_decode_firmware_rev(emlxs_hba_t *hba,
573 					emlxs_vpd_t *vp);
574 extern uint32_t			emlxs_init_adapter_info(emlxs_hba_t *hba);
575 extern uint32_t			emlxs_strtol(char *str, uint32_t base);
576 extern uint64_t			emlxs_strtoll(char *str, uint32_t base);
577 extern void			emlxs_decode_version(uint32_t version,
578 					char *buffer, size_t len);
579 extern char			*emlxs_ffstate_xlate(uint32_t new_state);
580 extern char			*emlxs_ring_xlate(uint32_t ringno);
581 extern void			emlxs_proc_channel(emlxs_hba_t *hba,
582 					CHANNEL *cp, void *arg2);
583 extern void			emlxs_pcix_mxr_update(emlxs_hba_t *hba,
584 					uint32_t verbose);
585 extern void			emlxs_restart_thread(emlxs_hba_t *hba,
586 					void *arg1, void *arg2);
587 extern void			emlxs_fw_show(emlxs_hba_t *hba);
588 extern void			emlxs_proc_channel_event(emlxs_hba_t *hba,
589 					CHANNEL *cp, IOCBQ *iocbq);
590 
591 #ifdef MODFW_SUPPORT
592 extern void			emlxs_fw_load(emlxs_hba_t *hba,
593 					emlxs_firmware_t *fw);
594 extern void			emlxs_fw_unload(emlxs_hba_t *hba,
595 					emlxs_firmware_t *fw);
596 #endif /* MODFW_SUPPORT */
597 
598 #ifdef MSI_SUPPORT
599 extern int32_t			emlxs_msi_add(emlxs_hba_t *hba);
600 extern int32_t			emlxs_msi_remove(emlxs_hba_t *hba);
601 extern int32_t			emlxs_msi_init(emlxs_hba_t *hba, uint32_t max);
602 extern int32_t			emlxs_msi_uninit(emlxs_hba_t *hba);
603 #endif	/* MSI_SUPPORT */
604 
605 extern int32_t			emlxs_intx_add(emlxs_hba_t *hba);
606 extern int32_t			emlxs_intx_remove(emlxs_hba_t *hba);
607 extern int32_t			emlxs_intx_init(emlxs_hba_t *hba, uint32_t max);
608 extern int32_t			emlxs_intx_uninit(emlxs_hba_t *hba);
609 
610 extern void			emlxs_parse_prog_types(emlxs_hba_t *hba,
611 					char *types);
612 extern int32_t			emlxs_parse_vpd(emlxs_hba_t *hba, uint8_t *vpd,
613 					uint32_t size);
614 extern int32_t			emlxs_parse_fcoe(emlxs_hba_t *hba, uint8_t *p,
615 					uint32_t size);
616 
617 extern void			emlxs_decode_label(char *label, char *buffer,
618 					int bige, size_t len);
619 extern void			emlxs_build_prog_types(emlxs_hba_t *hba,
620 					emlxs_vpd_t *vpd);
621 extern void			emlxs_process_link_speed(emlxs_hba_t *hba);
622 
623 extern uint32_t			emlxs_iotag_flush(emlxs_hba_t *hba);
624 
625 extern int			emlxs_pci_model_count;
626 extern emlxs_model_t		emlxs_pci_model[];
627 
628 extern int			emlxs_fw_count;
629 extern emlxs_firmware_t		emlxs_fw_table[];
630 
631 
632 /* Module emlxs_sli3.c  External Routine Declarations */
633 extern emlxs_sli_api_t		emlxs_sli3_api;
634 
635 extern int			emlxs_handle_rcv_seq(emlxs_hba_t *hba,
636 					CHANNEL *cp, IOCBQ *iocbq);
637 extern void			emlxs_update_HBQ_index(emlxs_hba_t *hba,
638 					uint32_t hbq_id);
639 extern void			emlxs_hbq_free_all(emlxs_hba_t *hba,
640 					uint32_t hbq_id);
641 
642 /* Module emlxs_sli4.c  External Routine Declarations */
643 
644 extern uint32_t			emlxs_sli4_vfi_to_index(emlxs_hba_t *hba,
645 					uint32_t vfi);
646 extern uint32_t			emlxs_sli4_index_to_vfi(emlxs_hba_t *hba,
647 					uint32_t index);
648 extern uint32_t			emlxs_sli4_vpi_to_index(emlxs_hba_t *hba,
649 					uint32_t vpi);
650 extern uint32_t			emlxs_sli4_index_to_vpi(emlxs_hba_t *hba,
651 					uint32_t index);
652 extern uint32_t			emlxs_sli4_xri_to_index(emlxs_hba_t *hba,
653 					uint32_t xri);
654 extern uint32_t			emlxs_sli4_index_to_xri(emlxs_hba_t *hba,
655 					uint32_t index);
656 extern uint32_t			emlxs_sli4_rpi_to_index(emlxs_hba_t *hba,
657 					uint32_t rpi);
658 extern uint32_t			emlxs_sli4_index_to_rpi(emlxs_hba_t *hba,
659 					uint32_t index);
660 
661 extern uint32_t 		emlxs_sli4_unreg_all_nodes(
662 					emlxs_port_t *port);
663 extern void			emlxs_sli4_hba_reset_all(emlxs_hba_t *hba,
664 					uint32_t flag);
665 extern XRIobj_t 		*emlxs_sli4_reserve_xri(emlxs_port_t *port,
666 					RPIobj_t *rpip, uint32_t type,
667 					uint16_t rx_id);
668 extern emlxs_sli_api_t		emlxs_sli4_api;
669 
670 extern FCFIobj_t		*emlxs_sli4_assign_fcfi(emlxs_hba_t *hba,
671 					FCF_RECORD_t *fcfrec,
672 					uint32_t event_tag);
673 extern void			emlxs_data_dump(emlxs_port_t *port, char *str,
674 					uint32_t *data, int cnt, int err);
675 extern void			emlxs_ue_dump(emlxs_hba_t *hba, char *str);
676 
677 extern XRIobj_t			*emlxs_sli4_find_xri(emlxs_port_t *port,
678 					uint16_t xri);
679 extern VFIobj_t			*emlxs_sli4_alloc_vfi(emlxs_hba_t *hba,
680 					FCFIobj_t *fp);
681 extern void			emlxs_sli4_free_vfi(emlxs_hba_t *hba,
682 					VFIobj_t *xp);
683 extern void			emlxs_sli4_free_fcfi(emlxs_hba_t *hba,
684 					FCFIobj_t *xp);
685 extern void			emlxs_sli4_free_xri(emlxs_port_t *port,
686 					emlxs_buf_t *sbp, XRIobj_t *xp,
687 					uint8_t lock);
688 extern FCFIobj_t		*emlxs_sli4_bind_fcfi(emlxs_hba_t *hba);
689 
690 extern uint32_t			emlxs_sli4_unreserve_xri(emlxs_port_t *port,
691 					uint16_t xri, uint32_t lock);
692 extern XRIobj_t 		*emlxs_sli4_register_xri(emlxs_port_t *port,
693 					emlxs_buf_t *sbp, uint16_t xri,
694 					uint32_t did);
695 
696 
697 /* Module emlxs_diag.c  External Routine Declarations */
698 extern uint32_t			emlxs_diag_post_run(emlxs_hba_t *hba);
699 extern uint32_t			emlxs_diag_biu_run(emlxs_hba_t *hba,
700 					uint32_t pattern);
701 extern uint32_t			emlxs_diag_pattern[256];
702 extern uint32_t			emlxs_diag_echo_run(emlxs_port_t *port,
703 					uint32_t did, uint32_t pattern);
704 
705 /* Module emlxs_download.c External Routine Declarations */
706 extern void			emlxs_memset(uint8_t *buffer, uint8_t value,
707 					uint32_t size);
708 extern int32_t			emlxs_fw_download(emlxs_hba_t *hba,
709 					caddr_t buffer, uint32_t len,
710 					uint32_t offline);
711 extern uint32_t			emlxs_get_max_sram(emlxs_hba_t *hba,
712 					uint32_t *MaxRbusSize,
713 					uint32_t *MaxIbusSize);
714 extern uint32_t			emlxs_get_load_list(emlxs_hba_t *hba,
715 					PROG_ID *load_list);
716 extern uint32_t			emlxs_read_wakeup_parms(emlxs_hba_t *hba,
717 					PWAKE_UP_PARMS WakeUpParms,
718 					uint32_t verbose);
719 extern int32_t			emlxs_cfl_download(emlxs_hba_t *hba,
720 					uint32_t region, caddr_t buffer,
721 					uint32_t len);
722 
723 extern int32_t			emlxs_boot_code_disable(emlxs_hba_t *hba);
724 extern int32_t			emlxs_boot_code_enable(emlxs_hba_t *hba);
725 extern int32_t			emlxs_boot_code_state(emlxs_hba_t *hba);
726 
727 extern int32_t			emlxs_be_read_fw_version(emlxs_hba_t *hba,
728 					emlxs_firmware_t *fw);
729 
730 /* Module emlxs_fcp.c External Routine Declarations */
731 extern int			emlxs_power_up(emlxs_hba_t *hba);
732 extern int			emlxs_power_down(emlxs_hba_t *hba);
733 extern int			emlxs_reset_link(emlxs_hba_t *hba,
734 					uint32_t linkup, uint32_t wait);
735 extern emlxs_buf_t		*emlxs_unregister_pkt(CHANNEL *cp,
736 					uint16_t iotag, uint32_t forced);
737 extern uint16_t			emlxs_register_pkt(CHANNEL *cp,
738 					emlxs_buf_t *sbp);
739 
740 extern IOCBQ			*emlxs_create_abort_xri_cn(emlxs_port_t *port,
741 					NODELIST *ndlp, uint16_t iotag,
742 					CHANNEL *cp, uint8_t class,
743 					int32_t flag);
744 extern IOCBQ			*emlxs_create_close_xri_cn(emlxs_port_t *port,
745 					NODELIST *ndlp, uint16_t iotag,
746 					CHANNEL *cp);
747 extern IOCBQ			*emlxs_create_abort_xri_cx(emlxs_port_t *port,
748 					NODELIST *ndlp, uint16_t xid,
749 					CHANNEL *cp, uint8_t class,
750 					int32_t flag);
751 extern IOCBQ			*emlxs_create_close_xri_cx(emlxs_port_t *port,
752 					NODELIST *ndlp, uint16_t xid,
753 					CHANNEL *cp);
754 extern void			emlxs_abort_ct_exchange(emlxs_hba_t *hba,
755 					emlxs_port_t *port, uint32_t rxid);
756 extern void			emlxs_abort_els_exchange(emlxs_hba_t *hba,
757 					emlxs_port_t *port, uint32_t rxid);
758 extern void			emlxs_close_els_exchange(emlxs_hba_t *hba,
759 					emlxs_port_t *port, uint32_t rxid);
760 extern void			emlxs_abort_fct_exchange(emlxs_hba_t *hba,
761 					emlxs_port_t *port, uint32_t rxid);
762 extern emlxs_buf_t		*emlxs_chipq_get(CHANNEL *cp, uint16_t iotag);
763 extern void			emlxs_chipq_put(CHANNEL *cp, emlxs_buf_t *sbp);
764 extern uint32_t			emlxs_chipq_node_flush(emlxs_port_t *port,
765 					CHANNEL *cp, NODELIST *ndlp,
766 					emlxs_buf_t *fpkt);
767 extern uint32_t			emlxs_chipq_lun_flush(emlxs_port_t *port,
768 					NODELIST *ndlp, uint32_t lun,
769 					emlxs_buf_t *fpkt);
770 extern uint32_t			emlxs_chipq_node_check(emlxs_port_t *port,
771 					CHANNEL *cp, NODELIST *ndlp);
772 
773 extern IOCBQ			*emlxs_tx_get(CHANNEL *cp, uint32_t lock);
774 extern void			emlxs_tx_put(IOCBQ *iocbq, uint32_t lock);
775 extern void			emlxs_tx_move(NODELIST *ndlp, CHANNEL *from,
776 					CHANNEL *to, uint32_t cmd,
777 					emlxs_buf_t *fpkt, uint32_t lock);
778 
779 extern uint32_t			emlxs_tx_node_check(emlxs_port_t *port,
780 					NODELIST *ndlp, CHANNEL *cp);
781 extern uint32_t			emlxs_tx_node_flush(emlxs_port_t *port,
782 					NODELIST *ndlp, CHANNEL *cp,
783 					uint32_t shutdown, emlxs_buf_t *fpkt);
784 extern uint32_t			emlxs_tx_lun_flush(emlxs_port_t *port,
785 					NODELIST *ndlp, uint32_t lun,
786 					emlxs_buf_t *fpkt);
787 extern uint32_t			emlxs_tx_channel_flush(emlxs_hba_t *hba,
788 					CHANNEL *cp, emlxs_buf_t *fpkt);
789 
790 extern void			emlxs_linkdown(emlxs_hba_t *hba);
791 extern void			emlxs_linkup(emlxs_hba_t *hba);
792 extern void			emlxs_port_online(emlxs_port_t *port);
793 extern int32_t			emlxs_port_offline(emlxs_port_t *port,
794 					uint32_t scope);
795 extern void			emlxs_ffcleanup(emlxs_hba_t *hba);
796 extern int32_t			emlxs_offline(emlxs_hba_t *hba,
797 					uint32_t reset_requested);
798 extern int32_t			emlxs_online(emlxs_hba_t *hba);
799 extern int32_t			emlxs_post_buffer(emlxs_hba_t *hba,
800 					RING *rp, int16_t cnt);
801 extern void			emlxs_ff_start(emlxs_hba_t *hba);
802 extern void			emlxs_handle_fcp_event(emlxs_hba_t *hba,
803 					CHANNEL *rp, IOCBQ *temp);
804 extern int			emlxs_fct_handle_abort(emlxs_hba_t *hba,
805 					CHANNEL *rp, IOCBQ *iocbq);
806 
807 /* Module emlxs_thread.c External Routine Declarations */
808 extern void			emlxs_taskq_destroy(emlxs_taskq_t *taskq);
809 extern void			emlxs_taskq_create(emlxs_hba_t *hba,
810 					emlxs_taskq_t *taskq);
811 extern uint32_t			emlxs_taskq_dispatch(emlxs_taskq_t *taskq,
812 					void (*func) (), void *arg);
813 extern void			emlxs_thread_create(emlxs_hba_t *hba,
814 					emlxs_thread_t *ethread);
815 extern void			emlxs_thread_destroy(emlxs_thread_t *ethread);
816 extern void			emlxs_thread_trigger1(emlxs_thread_t *ethread,
817 					void (*func) ());
818 extern void			emlxs_thread_trigger2(emlxs_thread_t *ethread,
819 					void (*func) (), CHANNEL *cp);
820 extern void			emlxs_thread_spawn(emlxs_hba_t *hba,
821 					void (*func) (), void *arg1,
822 					void *arg2);
823 extern void			emlxs_thread_spawn_create(emlxs_hba_t *hba);
824 extern void			emlxs_thread_spawn_destroy(emlxs_hba_t *hba);
825 
826 /* Module emlxs_dfc.c External Routine Declarations */
827 extern int32_t			emlxs_dfc_manage(emlxs_hba_t *hba, void *dfc,
828 					int32_t mode);
829 extern int32_t			emlxs_dfc_handle_event(emlxs_hba_t *hba,
830 					CHANNEL *cp, IOCBQ *temp);
831 extern int			emlxs_dfc_handle_unsol_req(emlxs_port_t *port,
832 					CHANNEL *cp, IOCBQ *iocbq,
833 					MATCHMAP *mp, uint32_t size);
834 extern void			emlxs_fcoe_attention_thread(emlxs_hba_t *hba,
835 					void *arg1, void *arg2);
836 extern uint32_t		emlxs_set_hba_mode(emlxs_hba_t *hba, uint32_t mode);
837 extern uint32_t		emlxs_get_dump_region(emlxs_hba_t *hba, uint32_t region,
838 			    uint8_t *buffer, uint32_t *psize);
839 extern int32_t		emlxs_send_menlo_cmd(emlxs_hba_t *hba, uint8_t *cmd_buf,
840 			    uint32_t cmd_size, uint8_t *rsp_buf,
841 			    uint32_t *rsp_size);
842 
843 #ifdef SFCT_SUPPORT
844 /* Module emlxs_fct.c External Routine Declarations */
845 extern uint32_t			emlxs_fct_stmf_alloc(emlxs_hba_t *hba,
846 					MATCHMAP *mp);
847 extern void			emlxs_fct_stmf_free(emlxs_hba_t *hba,
848 					MATCHMAP *mp);
849 extern void			emlxs_fct_link_down(emlxs_port_t *port);
850 extern void			emlxs_fct_link_up(emlxs_port_t *port);
851 extern uint32_t			emlxs_fct_init(emlxs_hba_t *hba);
852 extern void			emlxs_fct_detach(emlxs_hba_t *hba);
853 extern int			emlxs_fct_handle_unsol_els(emlxs_port_t *port,
854 					CHANNEL *cp, IOCBQ *iocbq, MATCHMAP *mp,
855 					uint32_t size);
856 extern int			emlxs_fct_handle_unsol_req(emlxs_port_t *port,
857 					CHANNEL *cp, IOCBQ *iocbq, MATCHMAP *mp,
858 					uint32_t size);
859 extern int			emlxs_fct_handle_fcp_event(emlxs_hba_t *hba,
860 					CHANNEL *cp, IOCBQ *iocbq);
861 extern void			emlxs_fct_bind_port(emlxs_port_t *port);
862 extern void			emlxs_fct_unbind_port(emlxs_port_t *port);
863 extern void			emlxs_fct_unsol_callback(emlxs_port_t *port,
864 					fct_cmd_t *fct_cmd);
865 extern void			emlxs_fct_attach(emlxs_hba_t *hba);
866 extern int			emlxs_fct_port_shutdown(emlxs_port_t *port);
867 extern int			emlxs_fct_port_initialize(emlxs_port_t *port);
868 
869 #ifdef MODSYM_SUPPORT
870 extern int			emlxs_fct_modopen();
871 extern void			emlxs_fct_modclose();
872 #endif /* MODSYM_SUPPORT */
873 
874 #ifdef FCT_IO_TRACE
875 extern void			emlxs_fct_io_trace(emlxs_port_t *,
876 					fct_cmd_t *, uint32_t);
877 #endif /* FCT_IO_TRACE */
878 #endif /* SFCT_SUPPORT */
879 
880 #ifdef DUMP_SUPPORT
881 /* Module emlxs_dump.c External Routine Declarations */
882 extern uint32_t		emlxs_dump_drv_event(emlxs_hba_t *hba);
883 extern uint32_t		emlxs_dump_user_event(emlxs_hba_t *hba);
884 extern uint32_t		emlxs_dump_temp_event(emlxs_hba_t *hba,
885 				uint32_t tempType, uint32_t temp);
886 extern void		emlxs_dump_drv_thread(emlxs_hba_t *hba,
887 				void *arg1, void *arg2);
888 extern void		emlxs_dump_user_thread(emlxs_hba_t *hba,
889 				void *arg1, void *arg2);
890 extern void		emlxs_dump_temp_thread(emlxs_hba_t *hba,
891 				void *arg1, void *arg2);
892 extern uint32_t		emlxs_ftell(emlxs_file_t *fp);
893 extern uint32_t		emlxs_get_dump(emlxs_hba_t *hba, uint8_t *buffer,
894 			    uint32_t *buflen);
895 extern void		emlxs_dump_wait(emlxs_hba_t *hba);
896 extern void		emlxs_dump(emlxs_hba_t *hba, uint32_t type,
897 			    uint32_t temp_type, uint32_t temp);
898 
899 extern emlxs_file_t	*emlxs_fopen(emlxs_hba_t *hba, uint32_t file_type);
900 extern void		emlxs_fflush(emlxs_file_t *fp);
901 extern uint32_t		emlxs_fclose(emlxs_file_t *fp);
902 extern uint32_t		emlxs_dump_word_dmpfile(emlxs_file_t *fpDmpFile,
903 				uint8_t *pBuffer, uint32_t bufferLen,
904 				int fSwap);
905 #endif /* DUMP_SUPPORT */
906 
907 
908 /* Module emlxs_fcf.c External Routine Declarations */
909 extern void		emlxs_fcf_init(emlxs_hba_t *hba);
910 
911 extern void		emlxs_fcf_fini(emlxs_hba_t *hba);
912 
913 extern uint32_t 	emlxs_vpi_port_bind_notify(emlxs_port_t *port);
914 
915 extern uint32_t 	emlxs_vpi_port_unbind_notify(emlxs_port_t *port,
916 				uint32_t wait);
917 extern uint32_t		emlxs_vpi_logo_cmpl_notify(emlxs_port_t *port);
918 
919 extern uint32_t		emlxs_vpi_logi_notify(emlxs_port_t *port,
920 				emlxs_buf_t *sbp);
921 extern uint32_t		emlxs_vpi_logi_failed_notify(emlxs_port_t *port,
922 				emlxs_buf_t *sbp);
923 extern uint32_t		emlxs_vpi_rpi_offline_notify(emlxs_port_t *port,
924 				uint32_t did, uint32_t rpi);
925 extern uint32_t		emlxs_vpi_rpi_online_notify(emlxs_port_t *port,
926 				uint32_t did, uint32_t rpi, uint32_t lock);
927 extern uint32_t		emlxs_fcf_shutdown_notify(emlxs_port_t *port,
928 				uint32_t wait);
929 extern uint32_t		emlxs_fcf_linkup_notify(emlxs_port_t *port);
930 
931 extern uint32_t		emlxs_fcf_linkdown_notify(emlxs_port_t *port);
932 
933 extern uint32_t		emlxs_fcf_cvl_notify(emlxs_port_t *port, uint32_t vpi);
934 
935 extern uint32_t		emlxs_fcf_full_notify(emlxs_port_t *port);
936 
937 extern uint32_t		emlxs_fcf_found_notify(emlxs_port_t *port,
938 				uint32_t fcf_index);
939 extern uint32_t		emlxs_fcf_changed_notify(emlxs_port_t *port,
940 				uint32_t fcf_index);
941 extern uint32_t		emlxs_fcf_lost_notify(emlxs_port_t *port,
942 				uint32_t fcf_index);
943 extern void		emlxs_fcf_timer_notify(emlxs_hba_t *hba);
944 
945 
946 extern RPIobj_t 	*emlxs_rpi_find(emlxs_port_t *port, uint16_t rpi);
947 
948 extern RPIobj_t		*emlxs_rpi_reserve_notify(emlxs_port_t *port,
949 				uint32_t did, XRIobj_t *xrip);
950 extern RPIobj_t 	*emlxs_rpi_alloc_notify(emlxs_port_t *port,
951 				uint32_t did);
952 extern uint32_t		emlxs_rpi_free_notify(emlxs_port_t *port,
953 				RPIobj_t *rpip);
954 extern uint32_t		emlxs_rpi_online_notify(emlxs_port_t *port,
955 				RPIobj_t *rpip, uint32_t did, SERV_PARM *sparam,
956 				void *arg1, void *arg2, void *arg3);
957 extern uint32_t		emlxs_rpi_offline_notify(emlxs_port_t *port,
958 				RPIobj_t *rpip, void *arg1, void *arg2,
959 				void *arg3);
960 extern uint32_t		emlxs_rpi_pause_notify(emlxs_port_t *port,
961 				RPIobj_t *rpip);
962 extern uint32_t		emlxs_rpi_resume_notify(emlxs_port_t *port,
963 				RPIobj_t *rpip, emlxs_buf_t *sbp);
964 
965 
966 #ifdef	__cplusplus
967 }
968 #endif
969 
970 #endif	/* _EMLXS_EXTERN_H */
971