1fcf3ce44SJohn Forte /*
2fcf3ce44SJohn Forte  * CDDL HEADER START
3fcf3ce44SJohn Forte  *
4fcf3ce44SJohn Forte  * The contents of this file are subject to the terms of the
5fcf3ce44SJohn Forte  * Common Development and Distribution License (the "License").
6fcf3ce44SJohn Forte  * You may not use this file except in compliance with the License.
7fcf3ce44SJohn Forte  *
8*8f23e9faSHans Rosenfeld  * You can obtain a copy of the license at
9*8f23e9faSHans Rosenfeld  * http://www.opensource.org/licenses/cddl1.txt.
10fcf3ce44SJohn Forte  * See the License for the specific language governing permissions
11fcf3ce44SJohn Forte  * and limitations under the License.
12fcf3ce44SJohn Forte  *
13fcf3ce44SJohn Forte  * When distributing Covered Code, include this CDDL HEADER in each
14fcf3ce44SJohn Forte  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15fcf3ce44SJohn Forte  * If applicable, add the following below this CDDL HEADER, with the
16fcf3ce44SJohn Forte  * fields enclosed by brackets "[]" replaced with your own identifying
17fcf3ce44SJohn Forte  * information: Portions Copyright [yyyy] [name of copyright owner]
18fcf3ce44SJohn Forte  *
19fcf3ce44SJohn Forte  * CDDL HEADER END
20fcf3ce44SJohn Forte  */
21fcf3ce44SJohn Forte 
22fcf3ce44SJohn Forte /*
23*8f23e9faSHans Rosenfeld  * Copyright (c) 2004-2011 Emulex. All rights reserved.
2482527734SSukumar Swaminathan  * Use is subject to license terms.
25fcf3ce44SJohn Forte  */
26fcf3ce44SJohn Forte 
27fcf3ce44SJohn Forte #ifndef _EMLXS_EXTERN_H
28fcf3ce44SJohn Forte #define	_EMLXS_EXTERN_H
29fcf3ce44SJohn Forte 
30fcf3ce44SJohn Forte #ifdef	__cplusplus
31fcf3ce44SJohn Forte extern "C" {
32fcf3ce44SJohn Forte #endif
33fcf3ce44SJohn Forte 
34291a2b48SSukumar Swaminathan extern void			*emlxs_soft_state;
35291a2b48SSukumar Swaminathan extern uint32_t			emlxs_instance[MAX_FC_BRDS];
36291a2b48SSukumar Swaminathan extern uint32_t			emlxs_instance_count;
37291a2b48SSukumar Swaminathan extern char			emlxs_revision[32];
38291a2b48SSukumar Swaminathan extern char			emlxs_version[32];
39291a2b48SSukumar Swaminathan extern char			emlxs_name[64];
40291a2b48SSukumar Swaminathan extern char			emlxs_label[64];
41291a2b48SSukumar Swaminathan 
42291a2b48SSukumar Swaminathan extern emlxs_device_t		emlxs_device;
43291a2b48SSukumar Swaminathan extern uint32_t			emlxs_instance[MAX_FC_BRDS];
44291a2b48SSukumar Swaminathan extern uint32_t			emlxs_instance_count;
45291a2b48SSukumar Swaminathan 
46291a2b48SSukumar Swaminathan extern ddi_device_acc_attr_t	emlxs_data_acc_attr;
47291a2b48SSukumar Swaminathan extern ddi_device_acc_attr_t	emlxs_dev_acc_attr;
48291a2b48SSukumar Swaminathan extern ddi_dma_lim_t		emlxs_dma_lim;
49291a2b48SSukumar Swaminathan extern emlxs_config_t		emlxs_cfg[];
50291a2b48SSukumar Swaminathan extern ddi_dma_attr_t		emlxs_dma_attr;
51291a2b48SSukumar Swaminathan extern ddi_dma_attr_t		emlxs_dma_attr_ro;
52291a2b48SSukumar Swaminathan extern ddi_dma_attr_t		emlxs_dma_attr_fcip_rsp;
53291a2b48SSukumar Swaminathan extern ddi_dma_attr_t		emlxs_dma_attr_1sg;
54fcf3ce44SJohn Forte 
55fcf3ce44SJohn Forte /* Module emlxs_msg.c External Routine Declarations */
56291a2b48SSukumar Swaminathan extern void			emlxs_msg_printf(emlxs_port_t *port,
57291a2b48SSukumar Swaminathan 					const uint32_t fileno,
58291a2b48SSukumar Swaminathan 					const uint32_t line,
59291a2b48SSukumar Swaminathan 					emlxs_msg_t *msg,
60291a2b48SSukumar Swaminathan 					const char *fmt, ...);
61291a2b48SSukumar Swaminathan extern uint32_t			emlxs_msg_log_create(emlxs_hba_t *hba);
62a9800bebSGarrett D'Amore extern void			emlxs_msg_lock_reinit(emlxs_hba_t *hba);
63a9800bebSGarrett D'Amore extern void			emlxs_msg_log_destroy(emlxs_hba_t *hba);
64291a2b48SSukumar Swaminathan extern uint32_t			emlxs_msg_log_get(emlxs_hba_t *hba,
65291a2b48SSukumar Swaminathan 					emlxs_log_req_t *req,
66291a2b48SSukumar Swaminathan 					emlxs_log_resp_t *resp);
6782527734SSukumar Swaminathan 
6882527734SSukumar Swaminathan /* Module emlxs_event.c External Routine Declarations */
69*8f23e9faSHans Rosenfeld extern uint32_t			emlxs_flush_ct_event(emlxs_port_t *port,
70*8f23e9faSHans Rosenfeld 					uint32_t rxid);
7182527734SSukumar Swaminathan extern void			emlxs_timer_check_events(emlxs_hba_t *hba);
7282527734SSukumar Swaminathan 
7382527734SSukumar Swaminathan extern uint32_t			emlxs_event_queue_create(emlxs_hba_t *hba);
7482527734SSukumar Swaminathan 
7582527734SSukumar Swaminathan extern void			emlxs_event_queue_destroy(emlxs_hba_t *hba);
7682527734SSukumar Swaminathan 
7782527734SSukumar Swaminathan extern void			emlxs_event(emlxs_port_t *port,
7882527734SSukumar Swaminathan 					emlxs_event_t *evt, void *bp,
7982527734SSukumar Swaminathan 					uint32_t size);
80291a2b48SSukumar Swaminathan extern void			emlxs_log_dump_event(emlxs_port_t *port,
81291a2b48SSukumar Swaminathan 					uint8_t *buffer, uint32_t size);
82291a2b48SSukumar Swaminathan extern void			emlxs_log_link_event(emlxs_port_t *port);
8382527734SSukumar Swaminathan 
84291a2b48SSukumar Swaminathan extern uint32_t			emlxs_log_ct_event(emlxs_port_t *port,
85291a2b48SSukumar Swaminathan 					uint8_t *payload, uint32_t size,
86291a2b48SSukumar Swaminathan 					uint32_t rxid);
87291a2b48SSukumar Swaminathan extern void			emlxs_log_rscn_event(emlxs_port_t *port,
88291a2b48SSukumar Swaminathan 					uint8_t *payload, uint32_t size);
89291a2b48SSukumar Swaminathan extern void			emlxs_log_vportrscn_event(emlxs_port_t *port,
90291a2b48SSukumar Swaminathan 					uint8_t *payload, uint32_t size);
91*8f23e9faSHans Rosenfeld extern void			emlxs_get_dfc_event(emlxs_port_t *port,
92291a2b48SSukumar Swaminathan 					emlxs_dfc_event_t *dfc_event,
93291a2b48SSukumar Swaminathan 					uint32_t sleep);
94291a2b48SSukumar Swaminathan extern uint32_t			emlxs_kill_dfc_event(emlxs_port_t *port,
95291a2b48SSukumar Swaminathan 					emlxs_dfc_event_t *dfc_event);
96291a2b48SSukumar Swaminathan extern uint32_t			emlxs_get_dfc_eventinfo(emlxs_port_t *port,
97291a2b48SSukumar Swaminathan 					HBA_EVENTINFO *eventinfo,
98291a2b48SSukumar Swaminathan 					uint32_t *eventcount,
99291a2b48SSukumar Swaminathan 					uint32_t *missed);
100291a2b48SSukumar Swaminathan extern void			emlxs_log_temp_event(emlxs_port_t *port,
101291a2b48SSukumar Swaminathan 					uint32_t type, uint32_t temp);
102291a2b48SSukumar Swaminathan extern void			emlxs_log_fcoe_event(emlxs_port_t *port,
103291a2b48SSukumar Swaminathan 					menlo_init_rsp_t *init_rsp);
104291a2b48SSukumar Swaminathan extern void			emlxs_log_async_event(emlxs_port_t *port,
105291a2b48SSukumar Swaminathan 					IOCB *iocb);
106fcf3ce44SJohn Forte 
10782527734SSukumar Swaminathan #ifdef SAN_DIAG_SUPPORT
108*8f23e9faSHans Rosenfeld extern void			emlxs_get_sd_event(emlxs_port_t *port,
10982527734SSukumar Swaminathan 					emlxs_dfc_event_t *dfc_event,
11082527734SSukumar Swaminathan 					uint32_t sleep);
11182527734SSukumar Swaminathan extern void			emlxs_log_sd_basic_els_event(emlxs_port_t *port,
11282527734SSukumar Swaminathan 					uint32_t subcat, HBA_WWN *portname,
11382527734SSukumar Swaminathan 					HBA_WWN *nodename);
11482527734SSukumar Swaminathan extern void			emlxs_log_sd_prlo_event(emlxs_port_t *port,
11582527734SSukumar Swaminathan 					HBA_WWN *portname);
11682527734SSukumar Swaminathan extern void			emlxs_log_sd_lsrjt_event(emlxs_port_t *port,
11782527734SSukumar Swaminathan 					HBA_WWN *remoteport, uint32_t orig_cmd,
11882527734SSukumar Swaminathan 					uint32_t reason, uint32_t reason_expl);
11982527734SSukumar Swaminathan extern void			emlxs_log_sd_fc_bsy_event(emlxs_port_t *port,
12082527734SSukumar Swaminathan 					HBA_WWN *remoteport);
12182527734SSukumar Swaminathan extern void			emlxs_log_sd_fc_rdchk_event(emlxs_port_t *port,
12282527734SSukumar Swaminathan 					HBA_WWN *remoteport, uint32_t lun,
12382527734SSukumar Swaminathan 					uint32_t opcode, uint32_t fcp_param);
12482527734SSukumar Swaminathan extern void			emlxs_log_sd_scsi_event(emlxs_port_t *port,
12582527734SSukumar Swaminathan 					uint32_t type, HBA_WWN *remoteport,
12682527734SSukumar Swaminathan 					int32_t lun);
12782527734SSukumar Swaminathan extern void			emlxs_log_sd_scsi_check_event(
12882527734SSukumar Swaminathan 					emlxs_port_t *port,
12982527734SSukumar Swaminathan 					HBA_WWN *remoteport, uint32_t lun,
13082527734SSukumar Swaminathan 					uint32_t cmdcode, uint32_t sensekey,
13182527734SSukumar Swaminathan 					uint32_t asc, uint32_t ascq);
13282527734SSukumar Swaminathan #endif  /* SAN_DIAG_SUPPORT */
13382527734SSukumar Swaminathan 
134fcf3ce44SJohn Forte /* Module emlxs_solaris.c External Routine Declarations */
135*8f23e9faSHans Rosenfeld 
136*8f23e9faSHans Rosenfeld extern void			emlxs_fca_link_up(emlxs_port_t *port);
137*8f23e9faSHans Rosenfeld 
138*8f23e9faSHans Rosenfeld extern void			emlxs_fca_link_down(emlxs_port_t *port);
139*8f23e9faSHans Rosenfeld 
140*8f23e9faSHans Rosenfeld extern void 			emlxs_ulp_unsol_cb(emlxs_port_t *port,
141*8f23e9faSHans Rosenfeld 					fc_unsol_buf_t *ubp);
142*8f23e9faSHans Rosenfeld extern void			emlxs_ulp_statec_cb(emlxs_port_t *port,
143*8f23e9faSHans Rosenfeld 					uint32_t statec);
144a9800bebSGarrett D'Amore extern int32_t			emlxs_fca_reset(opaque_t fca_port_handle,
145*8f23e9faSHans Rosenfeld 					uint32_t cmd);
146a9800bebSGarrett D'Amore extern int32_t			emlxs_fca_pkt_abort(opaque_t fca_port_handle,
147291a2b48SSukumar Swaminathan 					fc_packet_t *pkt, int32_t sleep);
148291a2b48SSukumar Swaminathan extern char			*emlxs_state_xlate(uint8_t state);
149291a2b48SSukumar Swaminathan extern char			*emlxs_error_xlate(uint8_t errno);
150291a2b48SSukumar Swaminathan extern void			emlxs_mem_free(emlxs_hba_t *hba,
151291a2b48SSukumar Swaminathan 					MBUF_INFO *buf_info);
152291a2b48SSukumar Swaminathan extern uint8_t			*emlxs_mem_alloc(emlxs_hba_t *hba,
153291a2b48SSukumar Swaminathan 					MBUF_INFO *buf_info);
154291a2b48SSukumar Swaminathan extern int			emlxs_map_bus(emlxs_hba_t *hba);
155291a2b48SSukumar Swaminathan extern void			emlxs_unmap_bus(emlxs_hba_t *hba);
156291a2b48SSukumar Swaminathan extern fc_unsol_buf_t		*emlxs_ub_find(emlxs_port_t *port,
157291a2b48SSukumar Swaminathan 					uint32_t token);
158291a2b48SSukumar Swaminathan extern fc_unsol_buf_t		*emlxs_ub_get(emlxs_port_t *port, uint32_t size,
159291a2b48SSukumar Swaminathan 					uint32_t type, uint32_t resv);
160291a2b48SSukumar Swaminathan extern int32_t			emlxs_log_printf(int32_t f, int32_t type,
161291a2b48SSukumar Swaminathan 					int32_t num, int32_t brdno,
162291a2b48SSukumar Swaminathan 					const char *fmt, ...);
163291a2b48SSukumar Swaminathan extern void			emlxs_set_pkt_state(emlxs_buf_t *sbp,
164291a2b48SSukumar Swaminathan 					uint32_t iostat, uint8_t localstat,
165291a2b48SSukumar Swaminathan 					uint32_t lock);
166291a2b48SSukumar Swaminathan extern char			*emlxs_elscmd_xlate(uint32_t cmd);
167291a2b48SSukumar Swaminathan extern char			*emlxs_ctcmd_xlate(uint32_t cmd);
168291a2b48SSukumar Swaminathan extern char			*emlxs_rmcmd_xlate(uint32_t cmd);
169*8f23e9faSHans Rosenfeld extern char			*emlxs_wwn_xlate(char *buffer, size_t len,
170*8f23e9faSHans Rosenfeld 					uint8_t *wwn);
171*8f23e9faSHans Rosenfeld extern int32_t			emlxs_wwn_cmp(uint8_t *wwn1, uint8_t *wwn2);
172a9800bebSGarrett D'Amore extern int32_t			emlxs_fca_transport(opaque_t fca_port_handle,
173291a2b48SSukumar Swaminathan 					fc_packet_t *pkt);
174a9800bebSGarrett D'Amore extern int32_t			emlxs_fca_pkt_uninit(opaque_t fca_port_handle,
175291a2b48SSukumar Swaminathan 					fc_packet_t *pkt);
176a9800bebSGarrett D'Amore extern int32_t			emlxs_fca_pkt_init(opaque_t fca_port_handle,
177291a2b48SSukumar Swaminathan 					fc_packet_t *pkt, int32_t sleep);
178291a2b48SSukumar Swaminathan extern void			emlxs_pkt_complete(emlxs_buf_t *sbp,
179291a2b48SSukumar Swaminathan 					uint32_t iostat, uint8_t localstat,
180291a2b48SSukumar Swaminathan 					uint32_t doneq);
181291a2b48SSukumar Swaminathan 
182291a2b48SSukumar Swaminathan #ifdef SAN_DIAG_SUPPORT
183291a2b48SSukumar Swaminathan extern void			emlxs_update_sd_bucket(emlxs_buf_t *sbp);
184291a2b48SSukumar Swaminathan #endif /* SAN_DIAG_SUPPORT */
185291a2b48SSukumar Swaminathan 
186291a2b48SSukumar Swaminathan extern uint32_t			emlxs_get_instance(int32_t ddiinst);
187291a2b48SSukumar Swaminathan extern char			*emlxs_mscmd_xlate(uint16_t cmd);
1886a573d82SSukumar Swaminathan extern int32_t			emlxs_reset(emlxs_port_t *port, uint32_t cmd);
189291a2b48SSukumar Swaminathan extern void			emlxs_swap_service_params(SERV_PARM *sp);
190291a2b48SSukumar Swaminathan extern void			emlxs_swap_fcp_pkt(emlxs_buf_t *sbp);
191291a2b48SSukumar Swaminathan extern void			emlxs_swap_ct_pkt(emlxs_buf_t *sbp);
192291a2b48SSukumar Swaminathan extern void			emlxs_swap_els_pkt(emlxs_buf_t *sbp);
193a9800bebSGarrett D'Amore extern int			emlxs_fca_ub_release(opaque_t fca_port_handle,
194291a2b48SSukumar Swaminathan 					uint32_t count, uint64_t tokens[]);
195291a2b48SSukumar Swaminathan extern void			emlxs_swap_els_ub(fc_unsol_buf_t *ubp);
196291a2b48SSukumar Swaminathan extern void			emlxs_unswap_pkt(emlxs_buf_t *sbp);
19782527734SSukumar Swaminathan extern uint32_t			emlxs_get_key(emlxs_hba_t *hba, MAILBOXQ *mbq);
198291a2b48SSukumar Swaminathan extern int			emlxs_pm_busy_component(dev_info_t *dip);
199291a2b48SSukumar Swaminathan extern int			emlxs_pm_idle_component(dev_info_t *dip);
200291a2b48SSukumar Swaminathan extern void			emlxs_pm_idle_timer(dev_info_t *dip);
201bb63f56eSSukumar Swaminathan extern void			emlxs_shutdown_thread(emlxs_hba_t *hba,
202bb63f56eSSukumar Swaminathan 					void *arg1, void *arg2);
203291a2b48SSukumar Swaminathan extern uint32_t			emlxs_set_parm(emlxs_hba_t *hba, uint32_t index,
204291a2b48SSukumar Swaminathan 					uint32_t new_value);
205291a2b48SSukumar Swaminathan extern void			emlxs_ub_destroy(emlxs_port_t *port,
206291a2b48SSukumar Swaminathan 					emlxs_unsol_buf_t *pool);
207291a2b48SSukumar Swaminathan extern void			emlxs_ub_callback(emlxs_port_t *port,
208291a2b48SSukumar Swaminathan 					fc_unsol_buf_t *ubp);
209291a2b48SSukumar Swaminathan extern void			emlxs_ub_flush(emlxs_port_t *port);
210291a2b48SSukumar Swaminathan extern uint32_t			emlxs_check_parm(emlxs_hba_t *hba,
211291a2b48SSukumar Swaminathan 					uint32_t index, uint32_t new_value);
212a9800bebSGarrett D'Amore extern int32_t			emlxs_fca_port_manage(opaque_t fca_port_handle,
213291a2b48SSukumar Swaminathan 					fc_fca_pm_t *pm);
214291a2b48SSukumar Swaminathan extern void			emlxs_port_init(emlxs_port_t *port);
215291a2b48SSukumar Swaminathan extern void			emlxs_get_fcode_version(emlxs_hba_t *hba);
216fcf3ce44SJohn Forte 
21782527734SSukumar Swaminathan extern void			emlxs_swap32_buffer(uint8_t *buffer,
21882527734SSukumar Swaminathan 					uint32_t size);
21982527734SSukumar Swaminathan extern void			emlxs_swap32_bcopy(uint8_t *src,
22082527734SSukumar Swaminathan 					uint8_t *dst, uint32_t size);
22182527734SSukumar Swaminathan 
222*8f23e9faSHans Rosenfeld extern char 			*emlxs_strtoupper(char *str);
223*8f23e9faSHans Rosenfeld 
224*8f23e9faSHans Rosenfeld extern void			emlxs_mode_set(emlxs_hba_t *hba);
225*8f23e9faSHans Rosenfeld 
226*8f23e9faSHans Rosenfeld extern char			*emlxs_mode_xlate(uint32_t mode);
227*8f23e9faSHans Rosenfeld 
228fcf3ce44SJohn Forte #ifdef MENLO_SUPPORT
229291a2b48SSukumar Swaminathan extern char			*emlxs_menlo_cmd_xlate(uint32_t cmd);
230291a2b48SSukumar Swaminathan extern char			*emlxs_menlo_rsp_xlate(uint32_t rsp);
231291a2b48SSukumar Swaminathan #endif /* MENLO_SUPPORT */
232291a2b48SSukumar Swaminathan 
233291a2b48SSukumar Swaminathan #ifdef FMA_SUPPORT
234291a2b48SSukumar Swaminathan extern void			emlxs_fm_init(emlxs_hba_t *hba);
235291a2b48SSukumar Swaminathan extern void			emlxs_fm_fini(emlxs_hba_t *hba);
236bb63f56eSSukumar Swaminathan extern int			emlxs_fm_check_acc_handle(emlxs_hba_t *hba,
237291a2b48SSukumar Swaminathan 					ddi_acc_handle_t handle);
238bb63f56eSSukumar Swaminathan extern int			emlxs_fm_check_dma_handle(emlxs_hba_t *hba,
239291a2b48SSukumar Swaminathan 					ddi_dma_handle_t handle);
240291a2b48SSukumar Swaminathan extern void			emlxs_fm_ereport(emlxs_hba_t *hba,
241291a2b48SSukumar Swaminathan 					char *detail);
242bb63f56eSSukumar Swaminathan extern void			emlxs_fm_service_impact(emlxs_hba_t *hba,
243bb63f56eSSukumar Swaminathan 					int impact);
244291a2b48SSukumar Swaminathan extern int			emlxs_fm_error_cb(dev_info_t *dip,
245291a2b48SSukumar Swaminathan 					ddi_fm_error_t *err,
246291a2b48SSukumar Swaminathan 					const void *impl_data);
247b3660a96SSukumar Swaminathan extern void			emlxs_check_dma(emlxs_hba_t *hba,
248b3660a96SSukumar Swaminathan 					emlxs_buf_t *sbp);
249291a2b48SSukumar Swaminathan #endif	/* FMA_SUPPORT */
250fcf3ce44SJohn Forte 
251fcf3ce44SJohn Forte /* Module emlxs_pkt.c External Routine Declarations */
252291a2b48SSukumar Swaminathan extern int32_t			emlxs_pkt_send(fc_packet_t *pkt, uint32_t now);
253291a2b48SSukumar Swaminathan extern void			emlxs_pkt_free(fc_packet_t *pkt);
254291a2b48SSukumar Swaminathan extern void			emlxs_pkt_callback(fc_packet_t *pkt);
255291a2b48SSukumar Swaminathan extern fc_packet_t		*emlxs_pkt_alloc(emlxs_port_t *port,
256291a2b48SSukumar Swaminathan 					uint32_t cmdlen, uint32_t rsplen,
257291a2b48SSukumar Swaminathan 					uint32_t datalen, int32_t sleep);
258fcf3ce44SJohn Forte 
259fcf3ce44SJohn Forte /* Module emlxs_clock.c External Routine Declarations */
260291a2b48SSukumar Swaminathan extern void			emlxs_timer_checks(emlxs_hba_t *hba);
261291a2b48SSukumar Swaminathan extern void			emlxs_timer_start(emlxs_hba_t *hba);
262291a2b48SSukumar Swaminathan extern void			emlxs_timer_stop(emlxs_hba_t *hba);
263291a2b48SSukumar Swaminathan extern void			emlxs_link_timeout(emlxs_hba_t *hba);
264291a2b48SSukumar Swaminathan extern clock_t			emlxs_timeout(emlxs_hba_t *hba,
265291a2b48SSukumar Swaminathan 					uint32_t timeout);
266*8f23e9faSHans Rosenfeld extern void			emlxs_timer_cancel_clean_address(
267*8f23e9faSHans Rosenfeld 					emlxs_port_t *port);
268fcf3ce44SJohn Forte 
269fcf3ce44SJohn Forte /* Module emlxs_dhchap.c External Routine Declarations */
270fcf3ce44SJohn Forte #ifdef DHCHAP_SUPPORT
271291a2b48SSukumar Swaminathan extern int			emlxs_dhchap_state_machine(emlxs_port_t *port,
27282527734SSukumar Swaminathan 					CHANNEL *cp, IOCBQ *iocbq,
27382527734SSukumar Swaminathan 					MATCHMAP *mp, NODELIST *node, int evt);
274291a2b48SSukumar Swaminathan 
275291a2b48SSukumar Swaminathan extern void			emlxs_dhc_attach(emlxs_hba_t *hba);
276291a2b48SSukumar Swaminathan extern void			emlxs_dhc_detach(emlxs_hba_t *hba);
277291a2b48SSukumar Swaminathan extern void			emlxs_dhc_authrsp_timeout(emlxs_port_t *port,
278291a2b48SSukumar Swaminathan 					void *node, void *null);
279291a2b48SSukumar Swaminathan extern void			emlxs_dhc_reauth_timeout(emlxs_port_t *port,
280291a2b48SSukumar Swaminathan 					void *newtimeout, void *node);
281291a2b48SSukumar Swaminathan extern void			emlxs_dhc_auth_stop(emlxs_port_t *port,
282291a2b48SSukumar Swaminathan 					emlxs_node_t *node);
283291a2b48SSukumar Swaminathan extern int			emlxs_dhc_auth_start(emlxs_port_t *port,
284291a2b48SSukumar Swaminathan 					emlxs_node_t *node, uint8_t *sbp,
285291a2b48SSukumar Swaminathan 					uint8_t *ubp);
286291a2b48SSukumar Swaminathan extern void			emlxs_dhc_init_sp(emlxs_port_t *port,
287291a2b48SSukumar Swaminathan 					uint32_t did, SERV_PARM *sp,
288291a2b48SSukumar Swaminathan 					char **msg);
289291a2b48SSukumar Swaminathan extern uint32_t			emlxs_dhc_verify_login(emlxs_port_t *port,
290291a2b48SSukumar Swaminathan 					uint32_t sid, SERV_PARM *sp);
291291a2b48SSukumar Swaminathan extern void			emlxs_dhc_status(emlxs_port_t *port,
292291a2b48SSukumar Swaminathan 					emlxs_node_t *ndlp, uint32_t reason,
293291a2b48SSukumar Swaminathan 					uint32_t explaination);
294291a2b48SSukumar Swaminathan extern void			emlxs_dhc_state(emlxs_port_t *port,
295291a2b48SSukumar Swaminathan 					emlxs_node_t *ndlp, uint32_t state,
296291a2b48SSukumar Swaminathan 					uint32_t reason,
297291a2b48SSukumar Swaminathan 					uint32_t explaination);
298291a2b48SSukumar Swaminathan extern uint32_t			emlxs_dhc_init_auth(emlxs_hba_t *hba,
299291a2b48SSukumar Swaminathan 					uint8_t *lwwpn, uint8_t *rwwpn);
300291a2b48SSukumar Swaminathan extern uint32_t			emlxs_dhc_get_auth_cfg(emlxs_hba_t *hba,
301291a2b48SSukumar Swaminathan 					dfc_fcsp_config_t *fcsp_cfg);
302291a2b48SSukumar Swaminathan extern uint32_t			emlxs_dhc_get_auth_key(emlxs_hba_t *hba,
303291a2b48SSukumar Swaminathan 					dfc_auth_password_t *dfc_auth_pwd);
304291a2b48SSukumar Swaminathan extern uint32_t			emlxs_dhc_add_auth_cfg(emlxs_hba_t *hba,
305291a2b48SSukumar Swaminathan 					dfc_fcsp_config_t *fcsp_cfg,
306291a2b48SSukumar Swaminathan 					dfc_password_t *dfc_pwd);
307291a2b48SSukumar Swaminathan extern uint32_t			emlxs_dhc_delete_auth_cfg(emlxs_hba_t *hba,
308291a2b48SSukumar Swaminathan 					dfc_fcsp_config_t *fcsp_cfg,
309291a2b48SSukumar Swaminathan 					dfc_password_t *dfc_pwd);
310291a2b48SSukumar Swaminathan extern uint32_t			emlxs_dhc_set_auth_key(emlxs_hba_t *hba,
311291a2b48SSukumar Swaminathan 					dfc_auth_password_t *dfc_pwd);
312291a2b48SSukumar Swaminathan extern uint32_t			emlxs_dhc_get_auth_status(emlxs_hba_t *hba,
313291a2b48SSukumar Swaminathan 					dfc_auth_status_t *fcsp_status);
314291a2b48SSukumar Swaminathan extern uint32_t			emlxs_dhc_get_auth_cfg_table(emlxs_hba_t *hba,
315291a2b48SSukumar Swaminathan 					dfc_fcsp_config_t *fcsp_cfg);
316291a2b48SSukumar Swaminathan extern uint32_t			emlxs_dhc_get_auth_key_table(emlxs_hba_t *hba,
317291a2b48SSukumar Swaminathan 					dfc_auth_password_t *auth_pwd);
318fcf3ce44SJohn Forte #endif	/* DHCHAP_SUPPORT */
319fcf3ce44SJohn Forte 
320fcf3ce44SJohn Forte /* Module emlxs_node.c External Routine Declarations */
321*8f23e9faSHans Rosenfeld extern void 			emlxs_node_throttle_set(emlxs_port_t *port,
322*8f23e9faSHans Rosenfeld 					NODELIST *node);
323a9800bebSGarrett D'Amore extern NODELIST *		emlxs_node_create(emlxs_port_t *port,
324a9800bebSGarrett D'Amore 					uint32_t did, uint32_t rpi,
325a9800bebSGarrett D'Amore 					SERV_PARM *sp);
326291a2b48SSukumar Swaminathan extern void			emlxs_node_timeout(emlxs_port_t *port,
327291a2b48SSukumar Swaminathan 					NODELIST *ndlp, uint32_t ringno);
328291a2b48SSukumar Swaminathan extern void			emlxs_node_open(emlxs_port_t *port,
329291a2b48SSukumar Swaminathan 					NODELIST *ndlp, uint32_t ringno);
330291a2b48SSukumar Swaminathan extern void			emlxs_node_close(emlxs_port_t *port,
331291a2b48SSukumar Swaminathan 					NODELIST *ndlp, uint32_t ringno,
332291a2b48SSukumar Swaminathan 					int32_t timeout);
333291a2b48SSukumar Swaminathan extern NODELIST			*emlxs_node_find_did(emlxs_port_t *port,
334*8f23e9faSHans Rosenfeld 					uint32_t did, uint32_t lock);
335291a2b48SSukumar Swaminathan extern NODELIST			*emlxs_node_find_rpi(emlxs_port_t *port,
336291a2b48SSukumar Swaminathan 					uint32_t rpi);
337291a2b48SSukumar Swaminathan extern void			emlxs_node_destroy_all(emlxs_port_t *port);
338291a2b48SSukumar Swaminathan extern NODELIST			*emlxs_node_find_mac(emlxs_port_t *port,
339291a2b48SSukumar Swaminathan 					uint8_t *mac);
340291a2b48SSukumar Swaminathan extern void			emlxs_node_rm(emlxs_port_t *port,
341291a2b48SSukumar Swaminathan 					NODELIST *ndlp);
342291a2b48SSukumar Swaminathan extern NODELIST			*emlxs_node_find_wwpn(emlxs_port_t *port,
343*8f23e9faSHans Rosenfeld 					uint8_t *wwpn, uint32_t lock);
344291a2b48SSukumar Swaminathan extern NODELIST			*emlxs_node_find_index(emlxs_port_t *port,
345291a2b48SSukumar Swaminathan 					uint32_t index, uint32_t nports_only);
346291a2b48SSukumar Swaminathan extern uint32_t			emlxs_nport_count(emlxs_port_t *port);
347fcf3ce44SJohn Forte 
348fcf3ce44SJohn Forte /* Module emlxs_els.c External Routine Declarations */
349291a2b48SSukumar Swaminathan extern int32_t			emlxs_els_handle_event(emlxs_hba_t *hba,
35082527734SSukumar Swaminathan 					CHANNEL *cp, IOCBQ *temp);
351291a2b48SSukumar Swaminathan extern int32_t			emlxs_els_handle_unsol_req(emlxs_port_t *port,
35282527734SSukumar Swaminathan 					CHANNEL *cp, IOCBQ *iocbq,
35382527734SSukumar Swaminathan 					MATCHMAP *mp, uint32_t size);
354291a2b48SSukumar Swaminathan extern uint32_t			emlxs_generate_rscn(emlxs_port_t *port,
355291a2b48SSukumar Swaminathan 					uint32_t d_id);
356291a2b48SSukumar Swaminathan extern int32_t			emlxs_ct_handle_event(emlxs_hba_t *hba,
35782527734SSukumar Swaminathan 					CHANNEL *cp, IOCBQ *temp);
358291a2b48SSukumar Swaminathan extern int32_t			emlxs_ct_handle_unsol_req(emlxs_port_t *port,
35982527734SSukumar Swaminathan 					CHANNEL *cp, IOCBQ *iocbq,
36082527734SSukumar Swaminathan 					MATCHMAP *mp, uint32_t size);
361291a2b48SSukumar Swaminathan extern int32_t			emlxs_els_reply(emlxs_port_t *port,
362291a2b48SSukumar Swaminathan 					IOCBQ *iocbq, uint32_t type,
363291a2b48SSukumar Swaminathan 					uint32_t type2, uint32_t reason,
364291a2b48SSukumar Swaminathan 					uint32_t explain);
365291a2b48SSukumar Swaminathan extern void			emlxs_send_logo(emlxs_port_t *port,
366291a2b48SSukumar Swaminathan 					uint32_t d_id);
367bb63f56eSSukumar Swaminathan extern void			emlxs_reset_link_thread(emlxs_hba_t *hba,
368bb63f56eSSukumar Swaminathan 					void *arg1, void *arg2);
369291a2b48SSukumar Swaminathan extern uint32_t			emlxs_process_unsol_flogi(emlxs_port_t *port,
370291a2b48SSukumar Swaminathan 					IOCBQ *iocbq, MATCHMAP *mp,
371*8f23e9faSHans Rosenfeld 					uint32_t size, char *buffer,
372*8f23e9faSHans Rosenfeld 					size_t len);
373291a2b48SSukumar Swaminathan extern uint32_t			emlxs_process_unsol_plogi(emlxs_port_t *port,
374291a2b48SSukumar Swaminathan 					IOCBQ *iocbq, MATCHMAP *mp,
375*8f23e9faSHans Rosenfeld 					uint32_t size, char *buffer,
376*8f23e9faSHans Rosenfeld 					size_t len);
377291a2b48SSukumar Swaminathan extern uint32_t			emlxs_ub_send_login_acc(emlxs_port_t *port,
378291a2b48SSukumar Swaminathan 					fc_unsol_buf_t *ubp);
379fcf3ce44SJohn Forte 
380fcf3ce44SJohn Forte #ifdef MENLO_SUPPORT
381291a2b48SSukumar Swaminathan extern int			emlxs_menlo_handle_event(emlxs_hba_t *hba,
38282527734SSukumar Swaminathan 					CHANNEL *cp, IOCBQ *iocbq);
383291a2b48SSukumar Swaminathan #endif /* MENLO_SUPPORT */
384fcf3ce44SJohn Forte 
385fcf3ce44SJohn Forte /* Module emlxs_ip.c External Routine Declarations */
386291a2b48SSukumar Swaminathan extern int32_t			emlxs_ip_handle_event(emlxs_hba_t *hba,
38782527734SSukumar Swaminathan 					CHANNEL *cp, IOCBQ *temp);
388291a2b48SSukumar Swaminathan extern int			emlxs_ip_handle_rcv_seq_list(emlxs_hba_t *hba,
38982527734SSukumar Swaminathan 					CHANNEL *cp, IOCBQ *saveq);
390291a2b48SSukumar Swaminathan extern int			emlxs_ip_handle_unsol_req(emlxs_port_t *port,
39182527734SSukumar Swaminathan 					CHANNEL *cp, IOCBQ *iocbq, MATCHMAP *mp,
392291a2b48SSukumar Swaminathan 					uint32_t size);
39382527734SSukumar Swaminathan extern int			emlxs_create_xri(emlxs_port_t *port,
39482527734SSukumar Swaminathan 					CHANNEL *cp, NODELIST *ndlp);
395291a2b48SSukumar Swaminathan extern int			emlxs_handle_create_xri(emlxs_hba_t *hba,
39682527734SSukumar Swaminathan 					CHANNEL *cp, IOCBQ *temp);
397291a2b48SSukumar Swaminathan extern int			emlxs_handle_xri_aborted(emlxs_hba_t *hba,
39882527734SSukumar Swaminathan 					CHANNEL *cp, IOCBQ *temp);
399fcf3ce44SJohn Forte 
400fcf3ce44SJohn Forte /* Module emlxs_mbox.c External Routine Declarations */
401*8f23e9faSHans Rosenfeld extern void			emlxs_mb_get_port_name(emlxs_hba_t *hba,
402*8f23e9faSHans Rosenfeld 					MAILBOXQ *mbq);
403*8f23e9faSHans Rosenfeld extern void			emlxs_mb_get_extents_info(emlxs_hba_t *hba,
404*8f23e9faSHans Rosenfeld 					MAILBOXQ *mbq, uint16_t type);
405*8f23e9faSHans Rosenfeld extern void			emlxs_mb_get_extents(emlxs_hba_t *hba,
406*8f23e9faSHans Rosenfeld 					MAILBOXQ *mbq, uint16_t type);
407*8f23e9faSHans Rosenfeld extern void			emlxs_mb_dealloc_extents(emlxs_hba_t *hba,
408*8f23e9faSHans Rosenfeld 					MAILBOXQ *mbq, uint16_t type);
409*8f23e9faSHans Rosenfeld extern void			emlxs_mb_alloc_extents(emlxs_hba_t *hba,
410*8f23e9faSHans Rosenfeld 					MAILBOXQ *mbq, uint16_t type,
411*8f23e9faSHans Rosenfeld 					uint16_t count);
412*8f23e9faSHans Rosenfeld extern void			emlxs_mb_get_sli4_params(emlxs_hba_t *hba,
413*8f23e9faSHans Rosenfeld 					MAILBOXQ *mbq);
414*8f23e9faSHans Rosenfeld extern char			*emlxs_mb_xlate_status(uint32_t status);
415*8f23e9faSHans Rosenfeld 
416291a2b48SSukumar Swaminathan extern void			emlxs_mb_config_msi(emlxs_hba_t *hba,
41782527734SSukumar Swaminathan 					MAILBOXQ *mbq, uint32_t *intr_map,
418291a2b48SSukumar Swaminathan 					uint32_t intr_count);
419291a2b48SSukumar Swaminathan extern void			emlxs_mb_config_msix(emlxs_hba_t *hba,
42082527734SSukumar Swaminathan 					MAILBOXQ *mbq, uint32_t *intr_map,
421291a2b48SSukumar Swaminathan 					uint32_t intr_count);
422291a2b48SSukumar Swaminathan extern void			emlxs_mb_read_lnk_stat(emlxs_hba_t *hba,
42382527734SSukumar Swaminathan 					MAILBOXQ *mbq);
424291a2b48SSukumar Swaminathan extern void			emlxs_mb_config_link(emlxs_hba_t *hba,
42582527734SSukumar Swaminathan 					MAILBOXQ *mbq);
426291a2b48SSukumar Swaminathan extern void			emlxs_mb_config_ring(emlxs_hba_t *hba,
42782527734SSukumar Swaminathan 					int32_t ring, MAILBOXQ *mbq);
428291a2b48SSukumar Swaminathan extern void			emlxs_mb_init_link(emlxs_hba_t *hba,
42982527734SSukumar Swaminathan 					MAILBOXQ *mbq, uint32_t topology,
430291a2b48SSukumar Swaminathan 					uint32_t linkspeed);
431291a2b48SSukumar Swaminathan extern void			emlxs_mb_down_link(emlxs_hba_t *hba,
43282527734SSukumar Swaminathan 					MAILBOXQ *mbq);
433