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.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
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]
23 * Copyright 2009 Emulex. All rights reserved.
24 * Use is subject to License terms.
28 #ifndef _EMLXS_EXTERN_H
29 #define _EMLXS_EXTERN_H
35 extern void *emlxs_soft_state
;
36 extern uint32_t emlxs_instance
[MAX_FC_BRDS
];
37 extern uint32_t emlxs_instance_count
;
38 extern char emlxs_revision
[32];
39 extern char emlxs_version
[32];
40 extern char emlxs_name
[64];
41 extern char emlxs_label
[64];
43 extern emlxs_device_t emlxs_device
;
44 extern uint32_t emlxs_instance
[MAX_FC_BRDS
];
45 extern uint32_t emlxs_instance_count
;
47 extern ddi_device_acc_attr_t emlxs_data_acc_attr
;
48 extern ddi_device_acc_attr_t emlxs_dev_acc_attr
;
49 extern ddi_dma_lim_t emlxs_dma_lim
;
50 extern uint32_t emlxs_diag_state
;
51 extern emlxs_config_t emlxs_cfg
[];
52 extern ddi_dma_attr_t emlxs_dma_attr
;
53 extern ddi_dma_attr_t emlxs_dma_attr_ro
;
54 extern ddi_dma_attr_t emlxs_dma_attr_fcip_rsp
;
55 extern ddi_dma_attr_t emlxs_dma_attr_1sg
;
57 /* Module emlxs_msg.c External Routine Declarations */
58 extern void emlxs_msg_printf(emlxs_port_t
*port
,
59 const uint32_t fileno
,
61 void *bp
, uint32_t size
,
63 const char *fmt
, ...);
64 extern uint32_t emlxs_msg_log_create(emlxs_hba_t
*hba
);
65 extern uint32_t emlxs_msg_log_destroy(emlxs_hba_t
*hba
);
66 extern uint32_t emlxs_msg_log_get(emlxs_hba_t
*hba
,
68 emlxs_log_resp_t
*resp
);
69 extern void emlxs_log_dump_event(emlxs_port_t
*port
,
70 uint8_t *buffer
, uint32_t size
);
71 extern void emlxs_log_link_event(emlxs_port_t
*port
);
72 extern uint32_t emlxs_log_ct_event(emlxs_port_t
*port
,
73 uint8_t *payload
, uint32_t size
,
75 extern void emlxs_log_rscn_event(emlxs_port_t
*port
,
76 uint8_t *payload
, uint32_t size
);
77 extern void emlxs_log_vportrscn_event(emlxs_port_t
*port
,
78 uint8_t *payload
, uint32_t size
);
79 extern uint32_t emlxs_get_dfc_event(emlxs_port_t
*port
,
80 emlxs_dfc_event_t
*dfc_event
,
82 extern uint32_t emlxs_kill_dfc_event(emlxs_port_t
*port
,
83 emlxs_dfc_event_t
*dfc_event
);
84 extern uint32_t emlxs_get_dfc_eventinfo(emlxs_port_t
*port
,
85 HBA_EVENTINFO
*eventinfo
,
88 extern void emlxs_log_temp_event(emlxs_port_t
*port
,
89 uint32_t type
, uint32_t temp
);
90 extern void emlxs_log_fcoe_event(emlxs_port_t
*port
,
91 menlo_init_rsp_t
*init_rsp
);
92 extern void emlxs_log_async_event(emlxs_port_t
*port
,
95 /* Module emlxs_solaris.c External Routine Declarations */
96 extern int32_t emlxs_pkt_abort(opaque_t fca_port_handle
,
97 fc_packet_t
*pkt
, int32_t sleep
);
98 extern char *emlxs_state_xlate(uint8_t state
);
99 extern char *emlxs_error_xlate(uint8_t errno
);
100 extern void emlxs_mem_free(emlxs_hba_t
*hba
,
101 MBUF_INFO
*buf_info
);
102 extern uint8_t *emlxs_mem_alloc(emlxs_hba_t
*hba
,
103 MBUF_INFO
*buf_info
);
104 extern int emlxs_map_bus(emlxs_hba_t
*hba
);
105 extern void emlxs_unmap_bus(emlxs_hba_t
*hba
);
106 extern fc_unsol_buf_t
*emlxs_ub_find(emlxs_port_t
*port
,
108 extern fc_unsol_buf_t
*emlxs_ub_get(emlxs_port_t
*port
, uint32_t size
,
109 uint32_t type
, uint32_t resv
);
110 extern int32_t emlxs_log_printf(int32_t f
, int32_t type
,
111 int32_t num
, int32_t brdno
,
112 const char *fmt
, ...);
113 extern void emlxs_set_pkt_state(emlxs_buf_t
*sbp
,
114 uint32_t iostat
, uint8_t localstat
,
116 extern char *emlxs_elscmd_xlate(uint32_t cmd
);
117 extern char *emlxs_ctcmd_xlate(uint32_t cmd
);
118 extern char *emlxs_rmcmd_xlate(uint32_t cmd
);
119 extern char *emlxs_wwn_xlate(char *buffer
, uint8_t *wwn
);
120 extern int32_t emlxs_transport(opaque_t fca_port_handle
,
122 extern int32_t emlxs_pkt_uninit(opaque_t fca_port_handle
,
124 extern int32_t emlxs_pkt_init(opaque_t fca_port_handle
,
125 fc_packet_t
*pkt
, int32_t sleep
);
126 extern void emlxs_pkt_complete(emlxs_buf_t
*sbp
,
127 uint32_t iostat
, uint8_t localstat
,
130 #ifdef SAN_DIAG_SUPPORT
131 extern void emlxs_update_sd_bucket(emlxs_buf_t
*sbp
);
132 #endif /* SAN_DIAG_SUPPORT */
134 extern uint32_t emlxs_get_instance(int32_t ddiinst
);
135 extern char *emlxs_mscmd_xlate(uint16_t cmd
);
136 extern int32_t emlxs_reset(opaque_t fca_port_handle
,
138 extern void emlxs_swap_service_params(SERV_PARM
*sp
);
139 extern void emlxs_swap_fcp_pkt(emlxs_buf_t
*sbp
);
140 extern void emlxs_swap_ct_pkt(emlxs_buf_t
*sbp
);
141 extern void emlxs_swap_els_pkt(emlxs_buf_t
*sbp
);
142 extern int emlxs_ub_release(opaque_t fca_port_handle
,
143 uint32_t count
, uint64_t tokens
[]);
144 extern void emlxs_swap_els_ub(fc_unsol_buf_t
*ubp
);
145 extern void emlxs_unswap_pkt(emlxs_buf_t
*sbp
);
146 extern uint32_t emlxs_get_key(emlxs_hba_t
*hba
, MAILBOX
*mb
);
147 extern int emlxs_pm_busy_component(dev_info_t
*dip
);
148 extern int emlxs_pm_idle_component(dev_info_t
*dip
);
149 extern void emlxs_pm_idle_timer(dev_info_t
*dip
);
150 extern void emlxs_shutdown_thread(void *arg
);
151 extern uint32_t emlxs_set_parm(emlxs_hba_t
*hba
, uint32_t index
,
153 extern void emlxs_ub_destroy(emlxs_port_t
*port
,
154 emlxs_unsol_buf_t
*pool
);
155 extern void emlxs_ub_callback(emlxs_port_t
*port
,
156 fc_unsol_buf_t
*ubp
);
157 extern void emlxs_ub_flush(emlxs_port_t
*port
);
158 extern uint32_t emlxs_check_parm(emlxs_hba_t
*hba
,
159 uint32_t index
, uint32_t new_value
);
160 extern int32_t emlxs_port_manage(opaque_t fca_port_handle
,
162 extern void emlxs_port_init(emlxs_port_t
*port
);
163 extern void emlxs_get_fcode_version(emlxs_hba_t
*hba
);
166 extern char *emlxs_menlo_cmd_xlate(uint32_t cmd
);
167 extern char *emlxs_menlo_rsp_xlate(uint32_t rsp
);
168 #endif /* MENLO_SUPPORT */
171 extern void emlxs_fm_init(emlxs_hba_t
*hba
);
172 extern void emlxs_fm_fini(emlxs_hba_t
*hba
);
173 extern int emlxs_fm_check_acc_handle(
174 ddi_acc_handle_t handle
);
175 extern int emlxs_fm_check_dma_handle(
176 ddi_dma_handle_t handle
);
177 extern void emlxs_fm_ereport(emlxs_hba_t
*hba
,
179 extern int emlxs_fm_error_cb(dev_info_t
*dip
,
181 const void *impl_data
);
182 #endif /* FMA_SUPPORT */
184 /* Module emlxs_pkt.c External Routine Declarations */
185 extern int32_t emlxs_pkt_send(fc_packet_t
*pkt
, uint32_t now
);
186 extern void emlxs_pkt_free(fc_packet_t
*pkt
);
187 extern void emlxs_pkt_callback(fc_packet_t
*pkt
);
188 extern fc_packet_t
*emlxs_pkt_alloc(emlxs_port_t
*port
,
189 uint32_t cmdlen
, uint32_t rsplen
,
190 uint32_t datalen
, int32_t sleep
);
192 /* Module emlxs_clock.c External Routine Declarations */
193 extern void emlxs_timer_checks(emlxs_hba_t
*hba
);
194 extern void emlxs_timer_start(emlxs_hba_t
*hba
);
195 extern void emlxs_timer_stop(emlxs_hba_t
*hba
);
196 extern void emlxs_link_timeout(emlxs_hba_t
*hba
);
197 extern clock_t emlxs_timeout(emlxs_hba_t
*hba
,
200 /* Module emlxs_dhchap.c External Routine Declarations */
201 #ifdef DHCHAP_SUPPORT
202 extern int emlxs_dhchap_state_machine(emlxs_port_t
*port
,
203 RING
*ring
, IOCBQ
*iocbq
, MATCHMAP
*mp
,
204 NODELIST
*node
, int event
);
206 extern void emlxs_dhc_attach(emlxs_hba_t
*hba
);
207 extern void emlxs_dhc_detach(emlxs_hba_t
*hba
);
208 extern void emlxs_dhc_authrsp_timeout(emlxs_port_t
*port
,
209 void *node
, void *null
);
210 extern void emlxs_dhc_reauth_timeout(emlxs_port_t
*port
,
211 void *newtimeout
, void *node
);
212 extern void emlxs_dhc_auth_stop(emlxs_port_t
*port
,
214 extern int emlxs_dhc_auth_start(emlxs_port_t
*port
,
215 emlxs_node_t
*node
, uint8_t *sbp
,
217 extern void emlxs_dhc_init_sp(emlxs_port_t
*port
,
218 uint32_t did
, SERV_PARM
*sp
,
220 extern uint32_t emlxs_dhc_verify_login(emlxs_port_t
*port
,
221 uint32_t sid
, SERV_PARM
*sp
);
222 extern void emlxs_dhc_status(emlxs_port_t
*port
,
223 emlxs_node_t
*ndlp
, uint32_t reason
,
224 uint32_t explaination
);
225 extern void emlxs_dhc_state(emlxs_port_t
*port
,
226 emlxs_node_t
*ndlp
, uint32_t state
,
228 uint32_t explaination
);
229 extern uint32_t emlxs_dhc_init_auth(emlxs_hba_t
*hba
,
230 uint8_t *lwwpn
, uint8_t *rwwpn
);
231 extern uint32_t emlxs_dhc_get_auth_cfg(emlxs_hba_t
*hba
,
232 dfc_fcsp_config_t
*fcsp_cfg
);
233 extern uint32_t emlxs_dhc_get_auth_key(emlxs_hba_t
*hba
,
234 dfc_auth_password_t
*dfc_auth_pwd
);
235 extern uint32_t emlxs_dhc_add_auth_cfg(emlxs_hba_t
*hba
,
236 dfc_fcsp_config_t
*fcsp_cfg
,
237 dfc_password_t
*dfc_pwd
);
238 extern uint32_t emlxs_dhc_delete_auth_cfg(emlxs_hba_t
*hba
,
239 dfc_fcsp_config_t
*fcsp_cfg
,
240 dfc_password_t
*dfc_pwd
);
241 extern uint32_t emlxs_dhc_set_auth_key(emlxs_hba_t
*hba
,
242 dfc_auth_password_t
*dfc_pwd
);
243 extern uint32_t emlxs_dhc_get_auth_status(emlxs_hba_t
*hba
,
244 dfc_auth_status_t
*fcsp_status
);
245 extern uint32_t emlxs_dhc_get_auth_cfg_table(emlxs_hba_t
*hba
,
246 dfc_fcsp_config_t
*fcsp_cfg
);
247 extern uint32_t emlxs_dhc_get_auth_key_table(emlxs_hba_t
*hba
,
248 dfc_auth_password_t
*auth_pwd
);
249 #endif /* DHCHAP_SUPPORT */
251 /* Module emlxs_node.c External Routine Declarations */
252 extern void emlxs_node_timeout(emlxs_port_t
*port
,
253 NODELIST
*ndlp
, uint32_t ringno
);
254 extern void emlxs_node_open(emlxs_port_t
*port
,
255 NODELIST
*ndlp
, uint32_t ringno
);
256 extern void emlxs_node_close(emlxs_port_t
*port
,
257 NODELIST
*ndlp
, uint32_t ringno
,
259 extern NODELIST
*emlxs_node_find_did(emlxs_port_t
*port
,
261 extern NODELIST
*emlxs_node_find_rpi(emlxs_port_t
*port
,
263 extern void emlxs_node_destroy_all(emlxs_port_t
*port
);
264 extern NODELIST
*emlxs_node_find_mac(emlxs_port_t
*port
,
266 extern void emlxs_node_add(emlxs_port_t
*port
,
268 extern void emlxs_node_rm(emlxs_port_t
*port
,
270 extern NODELIST
*emlxs_node_find_wwpn(emlxs_port_t
*port
,
272 extern NODELIST
*emlxs_node_find_index(emlxs_port_t
*port
,
273 uint32_t index
, uint32_t nports_only
);
274 extern uint32_t emlxs_nport_count(emlxs_port_t
*port
);
276 /* Module emlxs_els.c External Routine Declarations */
277 extern int32_t emlxs_els_handle_event(emlxs_hba_t
*hba
,
278 RING
*rp
, IOCBQ
*temp
);
279 extern int32_t emlxs_els_handle_unsol_req(emlxs_port_t
*port
,
280 RING
*rp
, IOCBQ
*iocbq
, MATCHMAP
*mp
,
282 extern uint32_t emlxs_generate_rscn(emlxs_port_t
*port
,
284 extern int32_t emlxs_ct_handle_event(emlxs_hba_t
*hba
,
285 RING
*rp
, IOCBQ
*temp
);
286 extern int32_t emlxs_ct_handle_unsol_req(emlxs_port_t
*port
,
287 RING
*rp
, IOCBQ
*iocbq
, MATCHMAP
*mp
,
289 extern int32_t emlxs_els_reply(emlxs_port_t
*port
,
290 IOCBQ
*iocbq
, uint32_t type
,
291 uint32_t type2
, uint32_t reason
,
293 extern void emlxs_send_logo(emlxs_port_t
*port
,
295 extern void emlxs_reset_link_thread(void *arg
);
296 extern uint32_t emlxs_process_unsol_flogi(emlxs_port_t
*port
,
297 IOCBQ
*iocbq
, MATCHMAP
*mp
,
298 uint32_t size
, char *buffer
);
299 extern uint32_t emlxs_process_unsol_plogi(emlxs_port_t
*port
,
300 IOCBQ
*iocbq
, MATCHMAP
*mp
,
301 uint32_t size
, char *buffer
);
302 extern uint32_t emlxs_ub_send_login_acc(emlxs_port_t
*port
,
303 fc_unsol_buf_t
*ubp
);
306 extern int emlxs_menlo_handle_event(emlxs_hba_t
*hba
,
307 RING
*rp
, IOCBQ
*iocbq
);
308 #endif /* MENLO_SUPPORT */
310 /* Module emlxs_ip.c External Routine Declarations */
311 extern int32_t emlxs_ip_handle_event(emlxs_hba_t
*hba
,
312 RING
*rp
, IOCBQ
*temp
);
313 extern int emlxs_ip_handle_rcv_seq_list(emlxs_hba_t
*hba
,
314 RING
*rp
, IOCBQ
*saveq
);
315 extern int emlxs_ip_handle_unsol_req(emlxs_port_t
*port
,
316 RING
*rp
, IOCBQ
*iocbq
, MATCHMAP
*mp
,
318 extern int emlxs_create_xri(emlxs_port_t
*port
, RING
*rp
,
320 extern int emlxs_handle_create_xri(emlxs_hba_t
*hba
,
321 RING
*rp
, IOCBQ
*temp
);
322 extern int emlxs_handle_xri_aborted(emlxs_hba_t
*hba
,
323 RING
*rp
, IOCBQ
*temp
);
325 /* Module emlxs_mbox.c External Routine Declarations */
326 extern void emlxs_mb_config_msi(emlxs_hba_t
*hba
,
327 MAILBOX
*mb
, uint32_t *intr_map
,
328 uint32_t intr_count
);
329 extern void emlxs_mb_config_msix(emlxs_hba_t
*hba
,
330 MAILBOX
*mb
, uint32_t *intr_map
,
331 uint32_t intr_count
);
332 extern void emlxs_mb_read_lnk_stat(emlxs_hba_t
*hba
,
334 extern void emlxs_mb_config_link(emlxs_hba_t
*hba
,
336 extern void emlxs_mb_config_ring(emlxs_hba_t
*hba
,
337 int32_t ring
, MAILBOX
*mb
);
338 extern void emlxs_mb_init_link(emlxs_hba_t
*hba
,
339 MAILBOX
*mb
, uint32_t topology
,
341 extern void emlxs_mb_down_link(emlxs_hba_t
*hba
,
343 extern uint32_t emlxs_mb_read_la(emlxs_hba_t
*hba
,
345 extern void emlxs_mb_read_nv(emlxs_hba_t
*hba
,
347 extern void emlxs_mb_read_rev(emlxs_hba_t
*hba
,
348 MAILBOX
*mb
, uint32_t v3
);
349 extern uint32_t emlxs_mb_read_rpi(emlxs_hba_t
*hba
,
350 uint32_t rpi
, MAILBOX
*mb
,
352 extern uint32_t emlxs_mb_read_xri(emlxs_hba_t
*hba
,
353 uint32_t xri
, MAILBOX
*mb
,
355 extern uint32_t emlxs_mb_read_sparam(emlxs_hba_t
*hba
,
357 extern uint32_t emlxs_mb_reg_did(emlxs_port_t
*port
,
358 uint32_t did
, SERV_PARM
*param
,
359 emlxs_buf_t
*sbp
, fc_unsol_buf_t
*ubp
,
361 extern void emlxs_disable_tc(emlxs_hba_t
*hba
,
363 extern uint32_t emlxs_mb_run_biu_diag(emlxs_hba_t
*hba
,
364 MAILBOX
*mb
, uint64_t in
, uint64_t out
);
365 extern uint32_t emlxs_mb_unreg_rpi(emlxs_port_t
*port
,
366 uint32_t rpi
, emlxs_buf_t
*sbp
,
367 fc_unsol_buf_t
*ubp
, IOCBQ
*iocbq
);
368 extern uint32_t emlxs_mb_unreg_did(emlxs_port_t
*port
,
369 uint32_t did
, emlxs_buf_t
*sbp
,
370 fc_unsol_buf_t
*ubp
, IOCBQ
*iocbq
);
371 extern void emlxs_mb_dump_vpd(emlxs_hba_t
*hba
,
372 MAILBOX
*mb
, uint32_t offset
);
373 extern void emlxs_mb_config_farp(emlxs_hba_t
*hba
,
375 extern void emlxs_mb_read_config(emlxs_hba_t
*hba
,
377 extern void emlxs_mb_put(emlxs_hba_t
*hba
,
379 extern MAILBOXQ
*emlxs_mb_get(emlxs_hba_t
*hba
);
380 extern void emlxs_mb_clear_la(emlxs_hba_t
*hba
,
382 extern void emlxs_mb_set_var(emlxs_hba_t
*hba
,
383 MAILBOX
*mb
, uint32_t addr
,
385 extern void emlxs_mb_reset_ring(emlxs_hba_t
*hba
,
386 MAILBOX
*mb
, uint32_t ringno
);
387 extern char *emlxs_mb_cmd_xlate(uint8_t command
);
388 extern void emlxs_mb_read_status(emlxs_hba_t
*hba
,
390 extern uint32_t emlxs_mb_reg_vpi(emlxs_port_t
*port
);
391 extern uint32_t emlxs_mb_unreg_vpi(emlxs_port_t
*port
);
392 extern void emlxs_mb_fini(emlxs_hba_t
*hba
,
393 MAILBOX
*mb
, uint32_t mbxStatus
);
394 extern void emlxs_mb_heartbeat(emlxs_hba_t
*hba
,
396 extern void emlxs_mb_async_event(emlxs_hba_t
*hba
,
398 extern int32_t emlxs_mb_check_sparm(emlxs_hba_t
*hba
,
400 extern void emlxs_mb_dump(emlxs_hba_t
*hba
, MAILBOX
*mb
,
401 uint32_t offset
, uint32_t words
);
402 extern void emlxs_mb_retry(emlxs_hba_t
*hba
, MAILBOX
*mb
);
403 extern void emlxs_mb_init(emlxs_hba_t
*hba
, MAILBOXQ
*mbq
,
404 uint32_t flag
, uint32_t tmo
);
407 extern void emlxs_mb_config_hbq(emlxs_hba_t
*hba
,
408 MAILBOX
*mb
, int hbq_id
);
409 #endif /* SLI3_SUPPORT */
411 /* Module emlxs_mem.c External Routine Declarations */
412 extern MATCHMAP
*emlxs_mem_get_vaddr(emlxs_hba_t
*hba
,
413 RING
*rp
, uint64_t mapbp
);
414 extern uint8_t *emlxs_mem_get(emlxs_hba_t
*hba
,
416 extern uint8_t *emlxs_mem_put(emlxs_hba_t
*hba
,
417 uint32_t seg
, uint8_t *bp
);
418 extern int32_t emlxs_mem_free_buffer(emlxs_hba_t
*hba
);
419 extern int32_t emlxs_mem_alloc_buffer(emlxs_hba_t
*hba
);
420 extern void emlxs_mem_map_vaddr(emlxs_hba_t
*hba
,
421 RING
*rp
, MATCHMAP
*mp
, uint32_t *haddr
,
423 extern uint8_t *emlxs_mem_buf_alloc(emlxs_hba_t
*hba
);
424 extern uint8_t *emlxs_mem_buf_free(emlxs_hba_t
*hba
,
427 extern uint32_t emlxs_hbq_alloc(emlxs_hba_t
*hba
,
429 #endif /* SLI3_SUPPORT */
431 /* Module emlxs_hba.c External Routine Declarations */
432 extern int emlxs_ffinit(emlxs_hba_t
*hba
);
433 extern void emlxs_decode_firmware_rev(emlxs_hba_t
*hba
,
435 extern uint32_t emlxs_init_adapter_info(emlxs_hba_t
*hba
);
436 extern uint32_t emlxs_strtol(char *str
, uint32_t base
);
437 extern uint64_t emlxs_strtoll(char *str
, uint32_t base
);
438 extern void emlxs_decode_version(uint32_t version
,
440 extern char *emlxs_ffstate_xlate(uint32_t new_state
);
441 extern char *emlxs_ring_xlate(uint32_t ringno
);
442 extern void emlxs_proc_ring(emlxs_hba_t
*hba
,
443 RING
*rp
, void *arg2
);
444 extern void emlxs_pcix_mxr_update(emlxs_hba_t
*hba
,
446 extern void emlxs_restart_thread(void *arg
);
447 extern void emlxs_fw_show(emlxs_hba_t
*hba
);
448 extern void emlxs_proc_ring_event(emlxs_hba_t
*hba
,
449 RING
*rp
, IOCBQ
*iocbq
);
453 extern int32_t emlxs_msi_add(emlxs_hba_t
*hba
);
454 extern int32_t emlxs_msi_remove(emlxs_hba_t
*hba
);
455 extern int32_t emlxs_msi_init(emlxs_hba_t
*hba
, uint32_t max
);
456 extern int32_t emlxs_msi_uninit(emlxs_hba_t
*hba
);
457 #endif /* MSI_SUPPORT */
459 extern int32_t emlxs_intx_add(emlxs_hba_t
*hba
);
460 extern int32_t emlxs_intx_remove(emlxs_hba_t
*hba
);
461 extern int32_t emlxs_intx_init(emlxs_hba_t
*hba
, uint32_t max
);
462 extern int32_t emlxs_intx_uninit(emlxs_hba_t
*hba
);
464 /* Module emlxs_sli.c External Routine Declarations */
465 extern int emlxs_sli3_map_hdw(emlxs_hba_t
*hba
);
466 extern int emlxs_sli4_map_hdw(emlxs_hba_t
*hba
);
468 extern void emlxs_sli3_unmap_hdw(emlxs_hba_t
*hba
);
469 extern void emlxs_sli4_unmap_hdw(emlxs_hba_t
*hba
);
471 extern int32_t emlxs_sli3_online(emlxs_hba_t
*hba
);
472 extern int32_t emlxs_sli4_online(emlxs_hba_t
*hba
);
474 extern void emlxs_sli3_offline(emlxs_hba_t
*hba
);
475 extern void emlxs_sli4_offline(emlxs_hba_t
*hba
);
477 extern uint32_t emlxs_sli3_hba_reset(emlxs_hba_t
*hba
,
478 uint32_t restart
, uint32_t skip_post
);
479 extern uint32_t emlxs_sli4_hba_reset(emlxs_hba_t
*hba
,
480 uint32_t restart
, uint32_t skip_post
);
482 extern uint32_t emlxs_sli2_bde_setup(emlxs_port_t
*port
,
485 extern uint32_t emlxs_sli3_bde_setup(emlxs_port_t
*port
,
488 extern uint32_t emlxs_sli4_bde_setup(emlxs_port_t
*port
,
491 extern uint32_t emlxs_sli2_fct_bde_setup(emlxs_port_t
*port
,
493 extern uint32_t emlxs_sli3_fct_bde_setup(emlxs_port_t
*port
,
495 extern uint32_t emlxs_sli4_fct_bde_setup(emlxs_port_t
*port
,
498 extern void emlxs_sli3_issue_iocb_cmd(emlxs_hba_t
*hba
,
499 RING
*rp
, IOCBQ
*iocb_cmd
);
500 extern void emlxs_sli4_issue_iocb_cmd(emlxs_hba_t
*hba
,
501 RING
*rp
, IOCBQ
*iocb_cmd
);
503 extern uint32_t emlxs_sli3_issue_mbox_cmd(emlxs_hba_t
*hba
,
504 MAILBOX
*mb
, int32_t flg
, uint32_t tmo
);
505 extern uint32_t emlxs_sli4_issue_mbox_cmd(emlxs_hba_t
*hba
,
506 MAILBOX
*mb
, int32_t flg
, uint32_t tmo
);
509 extern uint32_t emlxs_sli3_prep_fct_iocb(emlxs_port_t
*port
,
510 emlxs_buf_t
*cmd_sbp
);
511 extern uint32_t emlxs_sli4_prep_fct_iocb(emlxs_port_t
*port
,
512 emlxs_buf_t
*cmd_sbp
);
513 #endif /* SFCT_SUPPORT */
515 extern uint32_t emlxs_sli3_prep_fcp_iocb(emlxs_port_t
*port
,
517 extern uint32_t emlxs_sli4_prep_fcp_iocb(emlxs_port_t
*port
,
520 extern uint32_t emlxs_sli3_prep_ip_iocb(emlxs_port_t
*port
,
522 extern uint32_t emlxs_sli4_prep_ip_iocb(emlxs_port_t
*port
,
525 extern uint32_t emlxs_sli3_prep_els_iocb(emlxs_port_t
*port
,
527 extern uint32_t emlxs_sli4_prep_els_iocb(emlxs_port_t
*port
,
530 extern uint32_t emlxs_sli3_prep_ct_iocb(emlxs_port_t
*port
,
532 extern uint32_t emlxs_sli4_prep_ct_iocb(emlxs_port_t
*port
,
535 extern void emlxs_sli3_poll_intr(emlxs_hba_t
*hba
,
537 extern void emlxs_sli4_poll_intr(emlxs_hba_t
*hba
,
539 extern int32_t emlxs_sli3_intx_intr(char *arg
);
540 extern int32_t emlxs_sli4_intx_intr(char *arg
);
542 extern uint32_t emlxs_sli3_msi_intr(char *arg1
, char *arg2
);
543 extern uint32_t emlxs_sli4_msi_intr(char *arg1
, char *arg2
);
544 #endif /* MSI_SUPPORT */
547 extern uint32_t emlxs_interlock(emlxs_hba_t
*hba
);
548 extern uint32_t emlxs_reset_ring(emlxs_hba_t
*hba
,
550 extern void emlxs_handle_ff_error(emlxs_hba_t
*hba
);
551 extern uint32_t emlxs_handle_mb_event(emlxs_hba_t
*hba
);
552 extern uint32_t emlxs_mb_issue_cmd(emlxs_hba_t
*hba
,
553 MAILBOX
*mb
, int32_t flag
,
555 extern void emlxs_timer_check_mbox(emlxs_hba_t
*hba
);
556 extern uint32_t emlxs_mb_config_port(emlxs_hba_t
*hba
,
557 MAILBOX
*mb
, uint32_t sli_mode
,
559 extern void emlxs_enable_latt(emlxs_hba_t
*hba
);
560 extern void emlxs_disable_intr(emlxs_hba_t
*hba
,
562 extern uint32_t emlxs_check_attention(emlxs_hba_t
*hba
);
563 extern uint32_t emlxs_get_attention(emlxs_hba_t
*hba
,
565 extern void emlxs_proc_attention(emlxs_hba_t
*hba
,
567 extern int emlxs_handle_rcv_seq(emlxs_hba_t
*hba
,
568 RING
*rp
, IOCBQ
*iocbq
);
569 extern void emlxs_intr_initialize(emlxs_hba_t
*hba
);
570 extern void emlxs_update_HBQ_index(emlxs_hba_t
*hba
,
572 extern void emlxs_hbq_free_all(emlxs_hba_t
*hba
,
574 extern uint32_t emlxs_hbq_setup(emlxs_hba_t
*hba
,
577 /* Module emlxs_diag.c External Routine Declarations */
578 extern uint32_t emlxs_diag_post_run(emlxs_hba_t
*hba
);
579 extern uint32_t emlxs_diag_biu_run(emlxs_hba_t
*hba
,
581 extern uint32_t emlxs_diag_pattern
[256];
582 extern uint32_t emlxs_diag_echo_run(emlxs_port_t
*port
,
583 uint32_t did
, uint32_t pattern
);
584 extern uint32_t emlxs_core_size(emlxs_hba_t
*hba
);
585 extern uint32_t emlxs_core_dump(emlxs_hba_t
*hba
,
586 char *buffer
, uint32_t size
);
588 /* Module emlxs_download.c External Routine Declarations */
589 extern int32_t emlxs_fw_download(emlxs_hba_t
*hba
,
590 caddr_t buffer
, uint32_t len
,
592 extern uint32_t emlxs_get_max_sram(emlxs_hba_t
*hba
,
593 uint32_t *MaxRbusSize
,
594 uint32_t *MaxIbusSize
);
595 extern uint32_t emlxs_get_load_list(emlxs_hba_t
*hba
,
597 extern uint32_t emlxs_read_wakeup_parms(emlxs_hba_t
*hba
,
598 PWAKE_UP_PARMS WakeUpParms
,
600 extern int32_t emlxs_cfl_download(emlxs_hba_t
*hba
,
601 uint32_t region
, caddr_t buffer
,
604 extern int32_t emlxs_boot_code_disable(emlxs_hba_t
*hba
);
605 extern int32_t emlxs_boot_code_enable(emlxs_hba_t
*hba
);
606 extern int32_t emlxs_boot_code_state(emlxs_hba_t
*hba
);
608 /* Module emlxs_fcp.c External Routine Declarations */
609 extern int emlxs_power_up(emlxs_hba_t
*hba
);
610 extern int emlxs_power_down(emlxs_hba_t
*hba
);
611 extern int emlxs_reset_link(emlxs_hba_t
*hba
,
613 extern emlxs_buf_t
*emlxs_unregister_pkt(RING
*rp
,
614 uint16_t iotag
, uint32_t forced
);
615 extern uint16_t emlxs_register_pkt(RING
*rp
,
618 extern IOCBQ
*emlxs_create_abort_xri_cn(emlxs_port_t
*port
,
619 NODELIST
*ndlp
, uint16_t iotag
,
620 RING
*rp
, uint8_t class, int32_t flag
);
621 extern IOCBQ
*emlxs_create_close_xri_cn(emlxs_port_t
*port
,
622 NODELIST
*ndlp
, uint16_t iotag
,
624 extern IOCBQ
*emlxs_create_abort_xri_cx(emlxs_port_t
*port
,
625 NODELIST
*ndlp
, uint16_t xid
, RING
*rp
,
626 uint8_t class, int32_t flag
);
627 extern IOCBQ
*emlxs_create_close_xri_cx(emlxs_port_t
*port
,
628 NODELIST
*ndlp
, uint16_t xid
, RING
*rp
);
629 extern void emlxs_abort_ct_exchange(emlxs_port_t
*port
,
632 extern emlxs_buf_t
*emlxs_chipq_get(RING
*rp
, uint16_t iotag
);
633 extern void emlxs_chipq_put(RING
*rp
, emlxs_buf_t
*sbp
);
634 extern uint32_t emlxs_chipq_node_flush(emlxs_port_t
*port
,
635 RING
*rp
, NODELIST
*ndlp
,
637 extern uint32_t emlxs_chipq_lun_flush(emlxs_port_t
*port
,
638 NODELIST
*ndlp
, uint32_t lun
,
640 extern uint32_t emlxs_chipq_node_check(emlxs_port_t
*port
,
641 RING
*ring
, NODELIST
*ndlp
);
643 extern IOCBQ
*emlxs_tx_get(RING
*rp
, uint32_t lock
);
644 extern void emlxs_tx_put(IOCBQ
*iocbq
, uint32_t lock
);
645 extern uint32_t emlxs_tx_node_check(emlxs_port_t
*port
,
646 NODELIST
*ndlp
, RING
*ring
);
647 extern uint32_t emlxs_tx_node_flush(emlxs_port_t
*port
,
648 NODELIST
*ndlp
, RING
*ring
,
649 uint32_t shutdown
, emlxs_buf_t
*fpkt
);
650 extern uint32_t emlxs_tx_lun_flush(emlxs_port_t
*port
,
651 NODELIST
*ndlp
, uint32_t lun
,
653 extern uint32_t emlxs_tx_ring_flush(emlxs_hba_t
*hba
,
654 RING
*rp
, emlxs_buf_t
*fpkt
);
656 extern void emlxs_linkdown(emlxs_hba_t
*hba
);
657 extern void emlxs_linkup(emlxs_hba_t
*hba
);
658 extern void emlxs_port_online(emlxs_port_t
*port
);
659 extern int32_t emlxs_port_offline(emlxs_port_t
*port
,
661 extern void emlxs_ffcleanup(emlxs_hba_t
*hba
);
662 extern int32_t emlxs_offline(emlxs_hba_t
*hba
);
663 extern int32_t emlxs_online(emlxs_hba_t
*hba
);
664 extern void emlxs_pcimem_bcopy(uint32_t *src
,
665 uint32_t *dest
, uint32_t cnt
);
666 extern int32_t emlxs_post_buffer(emlxs_hba_t
*hba
,
667 RING
*rp
, int16_t cnt
);
668 extern void emlxs_swap_bcopy(uint32_t *src
,
669 uint32_t *dest
, uint32_t cnt
);
670 extern void emlxs_ff_start(emlxs_hba_t
*hba
);
671 extern void emlxs_handle_fcp_event(emlxs_hba_t
*hba
,
672 RING
*rp
, IOCBQ
*temp
);
673 extern int emlxs_fct_handle_abort(emlxs_hba_t
*hba
,
674 RING
*rp
, IOCBQ
*iocbq
);
676 /* Module emlxs_thread.c External Routine Declarations */
677 extern void emlxs_taskq_destroy(emlxs_taskq_t
*taskq
);
678 extern void emlxs_taskq_create(emlxs_hba_t
*hba
,
679 emlxs_taskq_t
*taskq
);
680 extern uint32_t emlxs_taskq_dispatch(emlxs_taskq_t
*taskq
,
681 void (*func
) (), void *arg
);
682 extern void emlxs_thread_create(emlxs_hba_t
*hba
,
683 emlxs_thread_t
*ethread
);
684 extern void emlxs_thread_destroy(emlxs_thread_t
*ethread
);
685 extern void emlxs_thread_trigger1(emlxs_thread_t
*ethread
,
687 extern void emlxs_thread_trigger2(emlxs_thread_t
*ethread
,
688 void (*func
) (), RING
*rp
);
690 /* Module emlxs_dfc.c External Routine Declarations */
691 extern int32_t emlxs_dfc_manage(emlxs_hba_t
*hba
, void *dfc
,
693 extern int32_t emlxs_dfc_handle_event(emlxs_hba_t
*hba
,
694 RING
*rp
, IOCBQ
*temp
);
695 extern int emlxs_dfc_handle_unsol_req(emlxs_port_t
*port
,
696 RING
*rp
, IOCBQ
*iocbq
, MATCHMAP
*mp
,
698 extern void emlxs_fcoe_attention_thread(void *arg
);
699 extern uint32_t emlxs_set_hba_mode(emlxs_hba_t
*hba
, uint32_t mode
);
700 extern uint32_t emlxs_get_dump_region(emlxs_hba_t
*hba
, uint32_t region
,
701 uint8_t *buffer
, uint32_t *psize
);
702 extern int32_t emlxs_send_menlo_cmd(emlxs_hba_t
*hba
, uint8_t *cmd_buf
,
703 uint32_t cmd_size
, uint8_t *rsp_buf
,
707 /* Module emlxs_fct.c External Routine Declarations */
708 extern void emlxs_fct_link_down(emlxs_port_t
*port
);
709 extern void emlxs_fct_link_up(emlxs_port_t
*port
);
710 extern void emlxs_fct_init(emlxs_hba_t
*hba
);
711 extern void emlxs_fct_detach(emlxs_hba_t
*hba
);
712 extern int emlxs_fct_handle_unsol_els(emlxs_port_t
*port
,
713 RING
*rp
, IOCBQ
*iocbq
, MATCHMAP
*mp
,
715 extern int emlxs_fct_handle_unsol_req(emlxs_port_t
*port
,
716 RING
*rp
, IOCBQ
*iocbq
, MATCHMAP
*mp
,
718 extern int emlxs_fct_handle_fcp_event(emlxs_hba_t
*hba
,
719 RING
*rp
, IOCBQ
*iocbq
);
720 extern void emlxs_fct_bind_port(emlxs_port_t
*port
);
721 extern void emlxs_fct_unbind_port(emlxs_port_t
*port
);
722 extern void emlxs_fct_unsol_callback(emlxs_port_t
*port
,
724 extern void emlxs_fct_attach(emlxs_hba_t
*hba
);
725 extern int emlxs_fct_port_shutdown(emlxs_port_t
*port
);
726 extern int emlxs_fct_port_initialize(emlxs_port_t
*port
);
728 #ifdef MODSYM_SUPPORT
729 extern void emlxs_fct_modclose();
730 #endif /* MODSYM_SUPPORT */
733 extern void emlxs_fct_io_trace(emlxs_port_t
*,
734 fct_cmd_t
*, uint32_t);
735 #endif /* FCT_IO_TRACE */
736 #endif /* SFCT_SUPPORT */
738 #ifdef SAN_DIAG_SUPPORT
739 extern uint32_t emlxs_get_sd_event(emlxs_port_t
*port
,
740 emlxs_dfc_event_t
*dfc_event
,
742 extern void emlxs_log_sd_basic_els_event(emlxs_port_t
*port
,
743 uint32_t subcat
, HBA_WWN
*portname
,
745 extern void emlxs_log_sd_prlo_event(emlxs_port_t
*port
,
747 extern void emlxs_log_sd_lsrjt_event(emlxs_port_t
*port
,
748 HBA_WWN
*remoteport
, uint32_t orig_cmd
,
749 uint32_t reason
, uint32_t reason_expl
);
750 extern void emlxs_log_sd_fc_bsy_event(emlxs_port_t
*port
,
751 HBA_WWN
*remoteport
);
752 extern void emlxs_log_sd_fc_rdchk_event(emlxs_port_t
*port
,
753 HBA_WWN
*remoteport
, uint32_t lun
,
754 uint32_t opcode
, uint32_t fcp_param
);
755 extern void emlxs_log_sd_scsi_event(emlxs_port_t
*port
,
756 uint32_t type
, HBA_WWN
*remoteport
,
758 extern void emlxs_log_sd_scsi_check_event(
760 HBA_WWN
*remoteport
, uint32_t lun
,
761 uint32_t cmdcode
, uint32_t sensekey
,
762 uint32_t asc
, uint32_t ascq
);
763 #endif /* SAN_DIAG_SUPPORT */
767 /* Module emlxs_dump.c External Routine Declarations */
768 extern uint32_t emlxs_dump_drv_event(emlxs_hba_t
*hba
);
769 extern uint32_t emlxs_dump_user_event(emlxs_hba_t
*hba
);
770 extern uint32_t emlxs_dump_temp_event(emlxs_hba_t
*hba
,
771 uint32_t tempType
, uint32_t temp
);
772 extern void emlxs_dump_drv_thread(void *arg
);
773 extern void emlxs_dump_user_thread(void *arg
);
774 extern void emlxs_dump_temp_thread(void *arg
);
775 extern uint32_t emlxs_ftell(emlxs_file_t
*fp
);
776 extern uint32_t emlxs_get_dump(emlxs_hba_t
*hba
, uint8_t *buffer
,
778 extern void emlxs_dump_wait(emlxs_hba_t
*hba
);
779 extern void emlxs_dump(emlxs_hba_t
*hba
, uint32_t type
,
780 uint32_t temp_type
, uint32_t temp
);
782 #endif /* DUMP_SUPPORT */
788 #endif /* _EMLXS_EXTERN_H */