xref: /illumos-gate/usr/src/uts/common/sys/fibre-channel/fca/emlxs/emlxs_extern.h (revision 088c6f3f90c806c9ed1bdffa1b625233a27eb084)
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_gpio_write(emlxs_hba_t *hba,
490 					MAILBOXQ *mbq, uint8_t pin,
491 					uint8_t val);
492 extern void			emlxs_mb_request_features(emlxs_hba_t *hba,
493 					MAILBOXQ *mbq, uint32_t mask);
494 extern int			emlxs_mb_resume_rpi(emlxs_hba_t *hba,
495 					emlxs_buf_t *sbp, uint16_t rpi);
496 extern void			emlxs_mb_noop(emlxs_hba_t *hba,
497 					MAILBOXQ *mbq);
498 extern int			emlxs_mbext_noop(emlxs_hba_t *hba,
499 					MAILBOXQ *mbq);
500 extern void			emlxs_mb_resetport(emlxs_hba_t *hba,
501 					MAILBOXQ *mbq);
502 extern void			emlxs_mb_eq_create(emlxs_hba_t *hba,
503 					MAILBOXQ *mbq, uint32_t num);
504 extern void			emlxs_mb_cq_create(emlxs_hba_t *hba,
505 					MAILBOXQ *mbq, uint32_t num);
506 extern void			emlxs_mb_wq_create(emlxs_hba_t *hba,
507 					MAILBOXQ *mbq, uint32_t num);
508 extern void			emlxs_mb_rq_create(emlxs_hba_t *hba,
509 					MAILBOXQ *mbq, uint32_t num);
510 extern void			emlxs_mb_mq_create(emlxs_hba_t *hba,
511 					MAILBOXQ *mbq);
512 extern void			emlxs_mb_mq_create_ext(emlxs_hba_t *hba,
513 					MAILBOXQ *mbq);
514 extern int			emlxs_mb_reg_fcfi(emlxs_hba_t *hba,
515 					MAILBOXQ *mbq, FCFIobj_t *fcfp);
516 extern int			emlxs_mb_unreg_fcfi(emlxs_hba_t *hba,
517 					FCFIobj_t *fcfp);
518 extern int			emlxs_mb_reg_vfi(emlxs_hba_t *hba,
519 					MAILBOXQ *mb, VFIobj_t *vfip,
520 					emlxs_port_t *vpip);
521 extern int			emlxs_mb_unreg_vfi(emlxs_hba_t *hba,
522 					VFIobj_t *vfip);
523 extern int			emlxs_mbext_read_fcf_table(emlxs_hba_t *hba,
524 					MAILBOXQ *mbq, uint32_t index);
525 extern int			emlxs_mbext_add_fcf_table(emlxs_hba_t *hba,
526 					MAILBOXQ *mbq, uint32_t index);
527 extern void			emlxs_mb_rediscover_fcf_table(emlxs_hba_t *hba,
528 					MAILBOXQ *mbq);
529 extern void			emlxs_mb_async_event(emlxs_hba_t *hba,
530 					MAILBOXQ *mbq);
531 extern int32_t			emlxs_mb_check_sparm(emlxs_hba_t *hba,
532 					SERV_PARM *nsp);
533 extern void			emlxs_cmpl_mbox(emlxs_hba_t *hba, MAILBOXQ *mq);
534 extern void			emlxs_mb_dump(emlxs_hba_t *hba, MAILBOXQ *mbq,
535 					uint32_t offset, uint32_t words);
536 extern void			emlxs_mb_retry(emlxs_hba_t *hba, MAILBOXQ *mbq);
537 extern void			emlxs_mb_init(emlxs_hba_t *hba, MAILBOXQ *mbq,
538 					uint32_t flag, uint32_t tmo);
539 extern void			emlxs_mb_config_hbq(emlxs_hba_t *hba,
540 					MAILBOXQ *mbq, int hbq_id);
541 
542 /* Module emlxs_mem.c External Routine Declarations */
543 extern void			*emlxs_mem_pool_get(emlxs_hba_t *hba,
544 					MEMSEG *seg);
545 extern void 			emlxs_mem_pool_put(emlxs_hba_t *hba,
546 					MEMSEG *seg, void *bp);
547 extern uint32_t 		emlxs_mem_pool_create(emlxs_hba_t *hba,
548 					MEMSEG *seg);
549 extern void 			emlxs_mem_pool_destroy(emlxs_hba_t *hba,
550 					MEMSEG *seg);
551 extern void 			emlxs_mem_pool_clean(emlxs_hba_t *hba,
552 					MEMSEG *seg);
553 extern MATCHMAP			*emlxs_mem_get_vaddr(emlxs_hba_t *hba,
554 					RING *rp, uint64_t mapbp);
555 extern void			*emlxs_mem_get(emlxs_hba_t *hba,
556 					uint32_t seg_id);
557 extern void			emlxs_mem_put(emlxs_hba_t *hba,
558 					uint32_t seg_id, void *bp);
559 extern int32_t			emlxs_mem_free_buffer(emlxs_hba_t *hba);
560 extern int32_t			emlxs_mem_alloc_buffer(emlxs_hba_t *hba);
561 extern void			emlxs_mem_map_vaddr(emlxs_hba_t *hba,
562 					RING *rp, MATCHMAP *mp, uint32_t *haddr,
563 					uint32_t *laddr);
564 extern MATCHMAP			*emlxs_mem_buf_alloc(emlxs_hba_t *hba,
565 					uint32_t size);
566 extern void			emlxs_mem_buf_free(emlxs_hba_t *hba,
567 					MATCHMAP *mp);
568 extern uint32_t			emlxs_hbq_alloc(emlxs_hba_t *hba,
569 					uint32_t hbq_id);
570 
571 /* Module emlxs_hba.c  External Routine Declarations */
572 extern char			*emlxs_pci_cap_xlate(uint32_t id);
573 extern char			*emlxs_pci_ecap_xlate(uint32_t id);
574 
575 extern void			emlxs_decode_firmware_rev(emlxs_hba_t *hba,
576 					emlxs_vpd_t *vp);
577 extern uint32_t			emlxs_init_adapter_info(emlxs_hba_t *hba);
578 extern uint32_t			emlxs_strtol(char *str, uint32_t base);
579 extern uint64_t			emlxs_strtoll(char *str, uint32_t base);
580 extern void			emlxs_decode_version(uint32_t version,
581 					char *buffer, size_t len);
582 extern char			*emlxs_ffstate_xlate(uint32_t new_state);
583 extern char			*emlxs_ring_xlate(uint32_t ringno);
584 extern void			emlxs_proc_channel(emlxs_hba_t *hba,
585 					CHANNEL *cp, void *arg2);
586 extern void			emlxs_pcix_mxr_update(emlxs_hba_t *hba,
587 					uint32_t verbose);
588 extern void			emlxs_restart_thread(emlxs_hba_t *hba,
589 					void *arg1, void *arg2);
590 extern void			emlxs_fw_show(emlxs_hba_t *hba);
591 extern void			emlxs_proc_channel_event(emlxs_hba_t *hba,
592 					CHANNEL *cp, IOCBQ *iocbq);
593 
594 #ifdef MODFW_SUPPORT
595 extern void			emlxs_fw_load(emlxs_hba_t *hba,
596 					emlxs_firmware_t *fw);
597 extern void			emlxs_fw_unload(emlxs_hba_t *hba,
598 					emlxs_firmware_t *fw);
599 #endif /* MODFW_SUPPORT */
600 
601 #ifdef MSI_SUPPORT
602 extern int32_t			emlxs_msi_add(emlxs_hba_t *hba);
603 extern int32_t			emlxs_msi_remove(emlxs_hba_t *hba);
604 extern int32_t			emlxs_msi_init(emlxs_hba_t *hba, uint32_t max);
605 extern int32_t			emlxs_msi_uninit(emlxs_hba_t *hba);
606 #endif	/* MSI_SUPPORT */
607 
608 extern int32_t			emlxs_intx_add(emlxs_hba_t *hba);
609 extern int32_t			emlxs_intx_remove(emlxs_hba_t *hba);
610 extern int32_t			emlxs_intx_init(emlxs_hba_t *hba, uint32_t max);
611 extern int32_t			emlxs_intx_uninit(emlxs_hba_t *hba);
612 
613 extern void			emlxs_parse_prog_types(emlxs_hba_t *hba,
614 					char *types);
615 extern int32_t			emlxs_parse_vpd(emlxs_hba_t *hba, uint8_t *vpd,
616 					uint32_t size);
617 extern int32_t			emlxs_parse_fcoe(emlxs_hba_t *hba, uint8_t *p,
618 					uint32_t size);
619 
620 extern void			emlxs_decode_label(char *label, char *buffer,
621 					int bige, size_t len);
622 extern void			emlxs_build_prog_types(emlxs_hba_t *hba,
623 					emlxs_vpd_t *vpd);
624 extern void			emlxs_process_link_speed(emlxs_hba_t *hba);
625 
626 extern uint32_t			emlxs_iotag_flush(emlxs_hba_t *hba);
627 
628 extern int			emlxs_pci_model_count;
629 extern emlxs_model_t		emlxs_pci_model[];
630 
631 extern int			emlxs_fw_count;
632 extern emlxs_firmware_t		emlxs_fw_table[];
633 
634 
635 /* Module emlxs_sli3.c  External Routine Declarations */
636 extern emlxs_sli_api_t		emlxs_sli3_api;
637 
638 extern int			emlxs_handle_rcv_seq(emlxs_hba_t *hba,
639 					CHANNEL *cp, IOCBQ *iocbq);
640 extern void			emlxs_update_HBQ_index(emlxs_hba_t *hba,
641 					uint32_t hbq_id);
642 extern void			emlxs_hbq_free_all(emlxs_hba_t *hba,
643 					uint32_t hbq_id);
644 
645 /* Module emlxs_sli4.c  External Routine Declarations */
646 
647 extern uint32_t			emlxs_sli4_vfi_to_index(emlxs_hba_t *hba,
648 					uint32_t vfi);
649 extern uint32_t			emlxs_sli4_index_to_vfi(emlxs_hba_t *hba,
650 					uint32_t index);
651 extern uint32_t			emlxs_sli4_vpi_to_index(emlxs_hba_t *hba,
652 					uint32_t vpi);
653 extern uint32_t			emlxs_sli4_index_to_vpi(emlxs_hba_t *hba,
654 					uint32_t index);
655 extern uint32_t			emlxs_sli4_xri_to_index(emlxs_hba_t *hba,
656 					uint32_t xri);
657 extern uint32_t			emlxs_sli4_index_to_xri(emlxs_hba_t *hba,
658 					uint32_t index);
659 extern uint32_t			emlxs_sli4_rpi_to_index(emlxs_hba_t *hba,
660 					uint32_t rpi);
661 extern uint32_t			emlxs_sli4_index_to_rpi(emlxs_hba_t *hba,
662 					uint32_t index);
663 
664 extern uint32_t 		emlxs_sli4_unreg_all_nodes(
665 					emlxs_port_t *port);
666 extern void			emlxs_sli4_hba_reset_all(emlxs_hba_t *hba,
667 					uint32_t flag);
668 extern XRIobj_t 		*emlxs_sli4_reserve_xri(emlxs_port_t *port,
669 					RPIobj_t *rpip, uint32_t type,
670 					uint16_t rx_id);
671 extern emlxs_sli_api_t		emlxs_sli4_api;
672 
673 extern FCFIobj_t		*emlxs_sli4_assign_fcfi(emlxs_hba_t *hba,
674 					FCF_RECORD_t *fcfrec,
675 					uint32_t event_tag);
676 extern void			emlxs_data_dump(emlxs_port_t *port, char *str,
677 					uint32_t *data, int cnt, int err);
678 extern void			emlxs_ue_dump(emlxs_hba_t *hba, char *str);
679 
680 extern XRIobj_t			*emlxs_sli4_find_xri(emlxs_port_t *port,
681 					uint16_t xri);
682 extern VFIobj_t			*emlxs_sli4_alloc_vfi(emlxs_hba_t *hba,
683 					FCFIobj_t *fp);
684 extern void			emlxs_sli4_free_vfi(emlxs_hba_t *hba,
685 					VFIobj_t *xp);
686 extern void			emlxs_sli4_free_fcfi(emlxs_hba_t *hba,
687 					FCFIobj_t *xp);
688 extern void			emlxs_sli4_free_xri(emlxs_port_t *port,
689 					emlxs_buf_t *sbp, XRIobj_t *xp,
690 					uint8_t lock);
691 extern FCFIobj_t		*emlxs_sli4_bind_fcfi(emlxs_hba_t *hba);
692 
693 extern uint32_t			emlxs_sli4_unreserve_xri(emlxs_port_t *port,
694 					uint16_t xri, uint32_t lock);
695 extern XRIobj_t 		*emlxs_sli4_register_xri(emlxs_port_t *port,
696 					emlxs_buf_t *sbp, uint16_t xri,
697 					uint32_t did);
698 
699 
700 /* Module emlxs_diag.c  External Routine Declarations */
701 extern uint32_t			emlxs_diag_post_run(emlxs_hba_t *hba);
702 extern uint32_t			emlxs_diag_biu_run(emlxs_hba_t *hba,
703 					uint32_t pattern);
704 extern uint32_t			emlxs_diag_pattern[256];
705 extern uint32_t			emlxs_diag_echo_run(emlxs_port_t *port,
706 					uint32_t did, uint32_t pattern);
707 
708 /* Module emlxs_download.c External Routine Declarations */
709 extern void			emlxs_memset(uint8_t *buffer, uint8_t value,
710 					uint32_t size);
711 extern int32_t			emlxs_fw_download(emlxs_hba_t *hba,
712 					caddr_t buffer, uint32_t len,
713 					uint32_t offline);
714 extern uint32_t			emlxs_get_max_sram(emlxs_hba_t *hba,
715 					uint32_t *MaxRbusSize,
716 					uint32_t *MaxIbusSize);
717 extern uint32_t			emlxs_get_load_list(emlxs_hba_t *hba,
718 					PROG_ID *load_list);
719 extern uint32_t			emlxs_read_wakeup_parms(emlxs_hba_t *hba,
720 					PWAKE_UP_PARMS WakeUpParms,
721 					uint32_t verbose);
722 extern int32_t			emlxs_cfl_download(emlxs_hba_t *hba,
723 					uint32_t region, caddr_t buffer,
724 					uint32_t len);
725 
726 extern int32_t			emlxs_boot_code_disable(emlxs_hba_t *hba);
727 extern int32_t			emlxs_boot_code_enable(emlxs_hba_t *hba);
728 extern int32_t			emlxs_boot_code_state(emlxs_hba_t *hba);
729 
730 extern int32_t			emlxs_be_read_fw_version(emlxs_hba_t *hba,
731 					emlxs_firmware_t *fw);
732 
733 /* Module emlxs_fcp.c External Routine Declarations */
734 extern int			emlxs_power_up(emlxs_hba_t *hba);
735 extern int			emlxs_power_down(emlxs_hba_t *hba);
736 extern int			emlxs_reset_link(emlxs_hba_t *hba,
737 					uint32_t linkup, uint32_t wait);
738 extern emlxs_buf_t		*emlxs_unregister_pkt(CHANNEL *cp,
739 					uint16_t iotag, uint32_t forced);
740 extern uint16_t			emlxs_register_pkt(CHANNEL *cp,
741 					emlxs_buf_t *sbp);
742 
743 extern IOCBQ			*emlxs_create_abort_xri_cn(emlxs_port_t *port,
744 					NODELIST *ndlp, uint16_t iotag,
745 					CHANNEL *cp, uint8_t class,
746 					int32_t flag);
747 extern IOCBQ			*emlxs_create_close_xri_cn(emlxs_port_t *port,
748 					NODELIST *ndlp, uint16_t iotag,
749 					CHANNEL *cp);
750 extern IOCBQ			*emlxs_create_abort_xri_cx(emlxs_port_t *port,
751 					NODELIST *ndlp, uint16_t xid,
752 					CHANNEL *cp, uint8_t class,
753 					int32_t flag);
754 extern IOCBQ			*emlxs_create_close_xri_cx(emlxs_port_t *port,
755 					NODELIST *ndlp, uint16_t xid,
756 					CHANNEL *cp);
757 extern void			emlxs_abort_ct_exchange(emlxs_hba_t *hba,
758 					emlxs_port_t *port, uint32_t rxid);
759 extern void			emlxs_abort_els_exchange(emlxs_hba_t *hba,
760 					emlxs_port_t *port, uint32_t rxid);
761 extern void			emlxs_close_els_exchange(emlxs_hba_t *hba,
762 					emlxs_port_t *port, uint32_t rxid);
763 extern void			emlxs_abort_fct_exchange(emlxs_hba_t *hba,
764 					emlxs_port_t *port, uint32_t rxid);
765 extern emlxs_buf_t		*emlxs_chipq_get(CHANNEL *cp, uint16_t iotag);
766 extern void			emlxs_chipq_put(CHANNEL *cp, emlxs_buf_t *sbp);
767 extern uint32_t			emlxs_chipq_node_flush(emlxs_port_t *port,
768 					CHANNEL *cp, NODELIST *ndlp,
769 					emlxs_buf_t *fpkt);
770 extern uint32_t			emlxs_chipq_lun_flush(emlxs_port_t *port,
771 					NODELIST *ndlp, uint32_t lun,
772 					emlxs_buf_t *fpkt);
773 extern uint32_t			emlxs_chipq_node_check(emlxs_port_t *port,
774 					CHANNEL *cp, NODELIST *ndlp);
775 
776 extern IOCBQ			*emlxs_tx_get(CHANNEL *cp, uint32_t lock);
777 extern void			emlxs_tx_put(IOCBQ *iocbq, uint32_t lock);
778 extern void			emlxs_tx_move(NODELIST *ndlp, CHANNEL *from,
779 					CHANNEL *to, uint32_t cmd,
780 					emlxs_buf_t *fpkt, uint32_t lock);
781 
782 extern uint32_t			emlxs_tx_node_check(emlxs_port_t *port,
783 					NODELIST *ndlp, CHANNEL *cp);
784 extern uint32_t			emlxs_tx_node_flush(emlxs_port_t *port,
785 					NODELIST *ndlp, CHANNEL *cp,
786 					uint32_t shutdown, emlxs_buf_t *fpkt);
787 extern uint32_t			emlxs_tx_lun_flush(emlxs_port_t *port,
788 					NODELIST *ndlp, uint32_t lun,
789 					emlxs_buf_t *fpkt);
790 extern uint32_t			emlxs_tx_channel_flush(emlxs_hba_t *hba,
791 					CHANNEL *cp, emlxs_buf_t *fpkt);
792 
793 extern void			emlxs_linkdown(emlxs_hba_t *hba);
794 extern void			emlxs_linkup(emlxs_hba_t *hba);
795 extern void			emlxs_port_online(emlxs_port_t *port);
796 extern int32_t			emlxs_port_offline(emlxs_port_t *port,
797 					uint32_t scope);
798 extern void			emlxs_ffcleanup(emlxs_hba_t *hba);
799 extern int32_t			emlxs_offline(emlxs_hba_t *hba,
800 					uint32_t reset_requested);
801 extern int32_t			emlxs_online(emlxs_hba_t *hba);
802 extern int32_t			emlxs_post_buffer(emlxs_hba_t *hba,
803 					RING *rp, int16_t cnt);
804 extern void			emlxs_ff_start(emlxs_hba_t *hba);
805 extern void			emlxs_handle_fcp_event(emlxs_hba_t *hba,
806 					CHANNEL *rp, IOCBQ *temp);
807 extern int			emlxs_fct_handle_abort(emlxs_hba_t *hba,
808 					CHANNEL *rp, IOCBQ *iocbq);
809 
810 /* Module emlxs_thread.c External Routine Declarations */
811 extern void			emlxs_taskq_destroy(emlxs_taskq_t *taskq);
812 extern void			emlxs_taskq_create(emlxs_hba_t *hba,
813 					emlxs_taskq_t *taskq);
814 extern uint32_t			emlxs_taskq_dispatch(emlxs_taskq_t *taskq,
815 					void (*func) (), void *arg);
816 extern void			emlxs_thread_create(emlxs_hba_t *hba,
817 					emlxs_thread_t *ethread);
818 extern void			emlxs_thread_destroy(emlxs_thread_t *ethread);
819 extern void			emlxs_thread_trigger1(emlxs_thread_t *ethread,
820 					void (*func) ());
821 extern void			emlxs_thread_trigger2(emlxs_thread_t *ethread,
822 					void (*func) (), CHANNEL *cp);
823 extern void			emlxs_thread_spawn(emlxs_hba_t *hba,
824 					void (*func) (), void *arg1,
825 					void *arg2);
826 extern void			emlxs_thread_spawn_create(emlxs_hba_t *hba);
827 extern void			emlxs_thread_spawn_destroy(emlxs_hba_t *hba);
828 
829 /* Module emlxs_dfc.c External Routine Declarations */
830 extern int32_t			emlxs_dfc_manage(emlxs_hba_t *hba, void *dfc,
831 					int32_t mode);
832 extern int32_t			emlxs_dfc_handle_event(emlxs_hba_t *hba,
833 					CHANNEL *cp, IOCBQ *temp);
834 extern int			emlxs_dfc_handle_unsol_req(emlxs_port_t *port,
835 					CHANNEL *cp, IOCBQ *iocbq,
836 					MATCHMAP *mp, uint32_t size);
837 extern void			emlxs_fcoe_attention_thread(emlxs_hba_t *hba,
838 					void *arg1, void *arg2);
839 extern uint32_t		emlxs_set_hba_mode(emlxs_hba_t *hba, uint32_t mode);
840 extern uint32_t		emlxs_get_dump_region(emlxs_hba_t *hba, uint32_t region,
841 			    uint8_t *buffer, uint32_t *psize);
842 extern int32_t		emlxs_send_menlo_cmd(emlxs_hba_t *hba, uint8_t *cmd_buf,
843 			    uint32_t cmd_size, uint8_t *rsp_buf,
844 			    uint32_t *rsp_size);
845 
846 #ifdef SFCT_SUPPORT
847 /* Module emlxs_fct.c External Routine Declarations */
848 extern uint32_t			emlxs_fct_stmf_alloc(emlxs_hba_t *hba,
849 					MATCHMAP *mp);
850 extern void			emlxs_fct_stmf_free(emlxs_hba_t *hba,
851 					MATCHMAP *mp);
852 extern void			emlxs_fct_link_down(emlxs_port_t *port);
853 extern void			emlxs_fct_link_up(emlxs_port_t *port);
854 extern uint32_t			emlxs_fct_init(emlxs_hba_t *hba);
855 extern void			emlxs_fct_detach(emlxs_hba_t *hba);
856 extern int			emlxs_fct_handle_unsol_els(emlxs_port_t *port,
857 					CHANNEL *cp, IOCBQ *iocbq, MATCHMAP *mp,
858 					uint32_t size);
859 extern int			emlxs_fct_handle_unsol_req(emlxs_port_t *port,
860 					CHANNEL *cp, IOCBQ *iocbq, MATCHMAP *mp,
861 					uint32_t size);
862 extern int			emlxs_fct_handle_fcp_event(emlxs_hba_t *hba,
863 					CHANNEL *cp, IOCBQ *iocbq);
864 extern void			emlxs_fct_bind_port(emlxs_port_t *port);
865 extern void			emlxs_fct_unbind_port(emlxs_port_t *port);
866 extern void			emlxs_fct_unsol_callback(emlxs_port_t *port,
867 					fct_cmd_t *fct_cmd);
868 extern void			emlxs_fct_attach(emlxs_hba_t *hba);
869 extern int			emlxs_fct_port_shutdown(emlxs_port_t *port);
870 extern int			emlxs_fct_port_initialize(emlxs_port_t *port);
871 
872 #ifdef MODSYM_SUPPORT
873 extern int			emlxs_fct_modopen();
874 extern void			emlxs_fct_modclose();
875 #endif /* MODSYM_SUPPORT */
876 
877 #ifdef FCT_IO_TRACE
878 extern void			emlxs_fct_io_trace(emlxs_port_t *,
879 					fct_cmd_t *, uint32_t);
880 #endif /* FCT_IO_TRACE */
881 #endif /* SFCT_SUPPORT */
882 
883 #ifdef DUMP_SUPPORT
884 /* Module emlxs_dump.c External Routine Declarations */
885 extern uint32_t		emlxs_dump_drv_event(emlxs_hba_t *hba);
886 extern uint32_t		emlxs_dump_user_event(emlxs_hba_t *hba);
887 extern uint32_t		emlxs_dump_temp_event(emlxs_hba_t *hba,
888 				uint32_t tempType, uint32_t temp);
889 extern void		emlxs_dump_drv_thread(emlxs_hba_t *hba,
890 				void *arg1, void *arg2);
891 extern void		emlxs_dump_user_thread(emlxs_hba_t *hba,
892 				void *arg1, void *arg2);
893 extern void		emlxs_dump_temp_thread(emlxs_hba_t *hba,
894 				void *arg1, void *arg2);
895 extern uint32_t		emlxs_ftell(emlxs_file_t *fp);
896 extern uint32_t		emlxs_get_dump(emlxs_hba_t *hba, uint8_t *buffer,
897 			    uint32_t *buflen);
898 extern void		emlxs_dump_wait(emlxs_hba_t *hba);
899 extern void		emlxs_dump(emlxs_hba_t *hba, uint32_t type,
900 			    uint32_t temp_type, uint32_t temp);
901 
902 extern emlxs_file_t	*emlxs_fopen(emlxs_hba_t *hba, uint32_t file_type);
903 extern void		emlxs_fflush(emlxs_file_t *fp);
904 extern uint32_t		emlxs_fclose(emlxs_file_t *fp);
905 extern uint32_t		emlxs_dump_word_dmpfile(emlxs_file_t *fpDmpFile,
906 				uint8_t *pBuffer, uint32_t bufferLen,
907 				int fSwap);
908 #endif /* DUMP_SUPPORT */
909 
910 
911 /* Module emlxs_fcf.c External Routine Declarations */
912 extern void		emlxs_fcf_init(emlxs_hba_t *hba);
913 
914 extern void		emlxs_fcf_fini(emlxs_hba_t *hba);
915 
916 extern uint32_t 	emlxs_vpi_port_bind_notify(emlxs_port_t *port);
917 
918 extern uint32_t 	emlxs_vpi_port_unbind_notify(emlxs_port_t *port,
919 				uint32_t wait);
920 extern uint32_t		emlxs_vpi_logo_cmpl_notify(emlxs_port_t *port);
921 
922 extern uint32_t		emlxs_vpi_logi_notify(emlxs_port_t *port,
923 				emlxs_buf_t *sbp);
924 extern uint32_t		emlxs_vpi_logi_failed_notify(emlxs_port_t *port,
925 				emlxs_buf_t *sbp);
926 extern uint32_t		emlxs_vpi_rpi_offline_notify(emlxs_port_t *port,
927 				uint32_t did, uint32_t rpi);
928 extern uint32_t		emlxs_vpi_rpi_online_notify(emlxs_port_t *port,
929 				uint32_t did, uint32_t rpi, uint32_t lock);
930 extern uint32_t		emlxs_fcf_shutdown_notify(emlxs_port_t *port,
931 				uint32_t wait);
932 extern uint32_t		emlxs_fcf_linkup_notify(emlxs_port_t *port);
933 
934 extern uint32_t		emlxs_fcf_linkdown_notify(emlxs_port_t *port);
935 
936 extern uint32_t		emlxs_fcf_cvl_notify(emlxs_port_t *port, uint32_t vpi);
937 
938 extern uint32_t		emlxs_fcf_full_notify(emlxs_port_t *port);
939 
940 extern uint32_t		emlxs_fcf_found_notify(emlxs_port_t *port,
941 				uint32_t fcf_index);
942 extern uint32_t		emlxs_fcf_changed_notify(emlxs_port_t *port,
943 				uint32_t fcf_index);
944 extern uint32_t		emlxs_fcf_lost_notify(emlxs_port_t *port,
945 				uint32_t fcf_index);
946 extern void		emlxs_fcf_timer_notify(emlxs_hba_t *hba);
947 
948 
949 extern RPIobj_t 	*emlxs_rpi_find(emlxs_port_t *port, uint16_t rpi);
950 
951 extern RPIobj_t		*emlxs_rpi_reserve_notify(emlxs_port_t *port,
952 				uint32_t did, XRIobj_t *xrip);
953 extern RPIobj_t 	*emlxs_rpi_alloc_notify(emlxs_port_t *port,
954 				uint32_t did);
955 extern uint32_t		emlxs_rpi_free_notify(emlxs_port_t *port,
956 				RPIobj_t *rpip);
957 extern uint32_t		emlxs_rpi_online_notify(emlxs_port_t *port,
958 				RPIobj_t *rpip, uint32_t did, SERV_PARM *sparam,
959 				void *arg1, void *arg2, void *arg3);
960 extern uint32_t		emlxs_rpi_offline_notify(emlxs_port_t *port,
961 				RPIobj_t *rpip, void *arg1, void *arg2,
962 				void *arg3);
963 extern uint32_t		emlxs_rpi_pause_notify(emlxs_port_t *port,
964 				RPIobj_t *rpip);
965 extern uint32_t		emlxs_rpi_resume_notify(emlxs_port_t *port,
966 				RPIobj_t *rpip, emlxs_buf_t *sbp);
967 
968 
969 #ifdef	__cplusplus
970 }
971 #endif
972 
973 #endif	/* _EMLXS_EXTERN_H */
974