xref: /freebsd/sys/dev/isp/isp_library.h (revision 53af7d226e5da532f1557cf6b3479d736326e21c)
153af7d22SMatt Jacob /* $FreeBSD$ */
253af7d22SMatt Jacob /*-
353af7d22SMatt Jacob  * Qlogic Host Adapter Library Functions
453af7d22SMatt Jacob  *
553af7d22SMatt Jacob  * Copyright (c) 1999-2006 by Matthew Jacob
653af7d22SMatt Jacob  * All rights reserved.
753af7d22SMatt Jacob  *
853af7d22SMatt Jacob  * Redistribution and use in source and binary forms, with or without
953af7d22SMatt Jacob  * modification, are permitted provided that the following conditions
1053af7d22SMatt Jacob  * are met:
1153af7d22SMatt Jacob  * 1. Redistributions of source code must retain the above copyright
1253af7d22SMatt Jacob  *    notice immediately at the beginning of the file, without modification,
1353af7d22SMatt Jacob  *    this list of conditions, and the following disclaimer.
1453af7d22SMatt Jacob  * 2. The name of the author may not be used to endorse or promote products
1553af7d22SMatt Jacob  *    derived from this software without specific prior written permission.
1653af7d22SMatt Jacob  *
1753af7d22SMatt Jacob  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1853af7d22SMatt Jacob  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1953af7d22SMatt Jacob  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2053af7d22SMatt Jacob  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
2153af7d22SMatt Jacob  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2253af7d22SMatt Jacob  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2353af7d22SMatt Jacob  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2453af7d22SMatt Jacob  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2553af7d22SMatt Jacob  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2653af7d22SMatt Jacob  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2753af7d22SMatt Jacob  * SUCH DAMAGE.
2853af7d22SMatt Jacob  *
2953af7d22SMatt Jacob  */
3053af7d22SMatt Jacob #ifndef	_ISP_LIBRARY_H
3153af7d22SMatt Jacob #define	_ISP_LIBRARY_H
3253af7d22SMatt Jacob 
3353af7d22SMatt Jacob extern int isp_save_xs(ispsoftc_t *, XS_T *, u_int16_t *);
3453af7d22SMatt Jacob extern XS_T *isp_find_xs(ispsoftc_t *, u_int16_t);
3553af7d22SMatt Jacob extern u_int16_t isp_find_handle(ispsoftc_t *, XS_T *);
3653af7d22SMatt Jacob extern int isp_handle_index(u_int16_t);
3753af7d22SMatt Jacob extern u_int16_t isp_index_handle(int);
3853af7d22SMatt Jacob extern void isp_destroy_handle(ispsoftc_t *, u_int16_t);
3953af7d22SMatt Jacob extern int isp_getrqentry(ispsoftc_t *, u_int16_t *, u_int16_t *, void **);
4053af7d22SMatt Jacob extern void isp_print_qentry (ispsoftc_t *, char *, int, void *);
4153af7d22SMatt Jacob extern void isp_print_bytes(ispsoftc_t *, char *, int, void *);
4253af7d22SMatt Jacob extern int isp_fc_runstate(ispsoftc_t *, int);
4353af7d22SMatt Jacob extern void isp_copy_out_hdr(ispsoftc_t *, isphdr_t *, isphdr_t *);
4453af7d22SMatt Jacob extern void isp_copy_in_hdr(ispsoftc_t *, isphdr_t *, isphdr_t *);
4553af7d22SMatt Jacob extern int isp_get_response_type(ispsoftc_t *, isphdr_t *);
4653af7d22SMatt Jacob extern void
4753af7d22SMatt Jacob isp_put_request(ispsoftc_t *, ispreq_t *, ispreq_t *);
4853af7d22SMatt Jacob extern void
4953af7d22SMatt Jacob isp_put_request_t2(ispsoftc_t *, ispreqt2_t *, ispreqt2_t *);
5053af7d22SMatt Jacob extern void
5153af7d22SMatt Jacob isp_put_request_t2e(ispsoftc_t *, ispreqt2e_t *, ispreqt2e_t *);
5253af7d22SMatt Jacob extern void
5353af7d22SMatt Jacob isp_put_request_t3(ispsoftc_t *, ispreqt3_t *, ispreqt3_t *);
5453af7d22SMatt Jacob extern void
5553af7d22SMatt Jacob isp_put_request_t3e(ispsoftc_t *, ispreqt3e_t *, ispreqt3e_t *);
5653af7d22SMatt Jacob extern void
5753af7d22SMatt Jacob isp_put_extended_request(ispsoftc_t *, ispextreq_t *, ispextreq_t *);
5853af7d22SMatt Jacob extern void
5953af7d22SMatt Jacob isp_put_cont_req(ispsoftc_t *, ispcontreq_t *, ispcontreq_t *);
6053af7d22SMatt Jacob extern void
6153af7d22SMatt Jacob isp_put_cont64_req(ispsoftc_t *, ispcontreq64_t *, ispcontreq64_t *);
6253af7d22SMatt Jacob extern void
6353af7d22SMatt Jacob isp_get_response(ispsoftc_t *, ispstatusreq_t *, ispstatusreq_t *);
6453af7d22SMatt Jacob extern void
6553af7d22SMatt Jacob isp_get_response_x(ispsoftc_t *, ispstatus_cont_t *, ispstatus_cont_t *);
6653af7d22SMatt Jacob extern void
6753af7d22SMatt Jacob isp_get_rio2(ispsoftc_t *, isp_rio2_t *, isp_rio2_t *);
6853af7d22SMatt Jacob extern void
6953af7d22SMatt Jacob isp_put_icb(ispsoftc_t *, isp_icb_t *, isp_icb_t *);
7053af7d22SMatt Jacob extern void
7153af7d22SMatt Jacob isp_get_pdb(ispsoftc_t *, isp_pdb_t *, isp_pdb_t *);
7253af7d22SMatt Jacob extern void
7353af7d22SMatt Jacob isp_get_ct_hdr(ispsoftc_t *isp, ct_hdr_t *, ct_hdr_t *);
7453af7d22SMatt Jacob extern void
7553af7d22SMatt Jacob isp_put_sns_request(ispsoftc_t *, sns_screq_t *, sns_screq_t *);
7653af7d22SMatt Jacob extern void
7753af7d22SMatt Jacob isp_put_gid_ft_request(ispsoftc_t *, sns_gid_ft_req_t *,
7853af7d22SMatt Jacob     sns_gid_ft_req_t *);
7953af7d22SMatt Jacob extern void
8053af7d22SMatt Jacob isp_put_gxn_id_request(ispsoftc_t *, sns_gxn_id_req_t *,
8153af7d22SMatt Jacob     sns_gxn_id_req_t *);
8253af7d22SMatt Jacob extern void
8353af7d22SMatt Jacob isp_get_sns_response(ispsoftc_t *, sns_scrsp_t *, sns_scrsp_t *, int);
8453af7d22SMatt Jacob extern void
8553af7d22SMatt Jacob isp_get_gid_ft_response(ispsoftc_t *, sns_gid_ft_rsp_t *,
8653af7d22SMatt Jacob     sns_gid_ft_rsp_t *, int);
8753af7d22SMatt Jacob extern void
8853af7d22SMatt Jacob isp_get_gxn_id_response(ispsoftc_t *, sns_gxn_id_rsp_t *,
8953af7d22SMatt Jacob     sns_gxn_id_rsp_t *);
9053af7d22SMatt Jacob extern void
9153af7d22SMatt Jacob isp_get_gff_id_response(ispsoftc_t *, sns_gff_id_rsp_t *,
9253af7d22SMatt Jacob     sns_gff_id_rsp_t *);
9353af7d22SMatt Jacob extern void
9453af7d22SMatt Jacob isp_get_ga_nxt_response(ispsoftc_t *, sns_ga_nxt_rsp_t *,
9553af7d22SMatt Jacob     sns_ga_nxt_rsp_t *);
9653af7d22SMatt Jacob 
9753af7d22SMatt Jacob #ifdef	ISP_TARGET_MODE
9853af7d22SMatt Jacob #include <dev/isp/isp_target.h>
9953af7d22SMatt Jacob 
10053af7d22SMatt Jacob extern int isp_save_xs_tgt(ispsoftc_t *, void *, u_int16_t *);
10153af7d22SMatt Jacob extern void *isp_find_xs_tgt(ispsoftc_t *, u_int16_t);
10253af7d22SMatt Jacob extern u_int16_t isp_find_tgt_handle(ispsoftc_t *, void *);
10353af7d22SMatt Jacob extern void isp_destroy_tgt_handle(ispsoftc_t *, u_int16_t);
10453af7d22SMatt Jacob 
10553af7d22SMatt Jacob extern void
10653af7d22SMatt Jacob isp_put_atio(ispsoftc_t *, at_entry_t *, at_entry_t *);
10753af7d22SMatt Jacob extern void
10853af7d22SMatt Jacob isp_get_atio(ispsoftc_t *, at_entry_t *, at_entry_t *);
10953af7d22SMatt Jacob extern void
11053af7d22SMatt Jacob isp_put_atio2(ispsoftc_t *, at2_entry_t *, at2_entry_t *);
11153af7d22SMatt Jacob extern void
11253af7d22SMatt Jacob isp_put_atio2e(ispsoftc_t *, at2e_entry_t *, at2e_entry_t *);
11353af7d22SMatt Jacob extern void
11453af7d22SMatt Jacob isp_get_atio2(ispsoftc_t *, at2_entry_t *, at2_entry_t *);
11553af7d22SMatt Jacob extern void
11653af7d22SMatt Jacob isp_get_atio2e(ispsoftc_t *, at2e_entry_t *, at2e_entry_t *);
11753af7d22SMatt Jacob extern void
11853af7d22SMatt Jacob isp_put_ctio(ispsoftc_t *, ct_entry_t *, ct_entry_t *);
11953af7d22SMatt Jacob extern void
12053af7d22SMatt Jacob isp_get_ctio(ispsoftc_t *, ct_entry_t *, ct_entry_t *);
12153af7d22SMatt Jacob extern void
12253af7d22SMatt Jacob isp_put_ctio2(ispsoftc_t *, ct2_entry_t *, ct2_entry_t *);
12353af7d22SMatt Jacob extern void
12453af7d22SMatt Jacob isp_put_ctio2e(ispsoftc_t *, ct2e_entry_t *, ct2e_entry_t *);
12553af7d22SMatt Jacob extern void
12653af7d22SMatt Jacob isp_get_ctio2(ispsoftc_t *, ct2_entry_t *, ct2_entry_t *);
12753af7d22SMatt Jacob extern void
12853af7d22SMatt Jacob isp_get_ctio2e(ispsoftc_t *, ct2e_entry_t *, ct2e_entry_t *);
12953af7d22SMatt Jacob extern void
13053af7d22SMatt Jacob isp_put_enable_lun(ispsoftc_t *, lun_entry_t *, lun_entry_t *);
13153af7d22SMatt Jacob extern void
13253af7d22SMatt Jacob isp_get_enable_lun(ispsoftc_t *, lun_entry_t *, lun_entry_t *);
13353af7d22SMatt Jacob extern void
13453af7d22SMatt Jacob isp_put_notify(ispsoftc_t *, in_entry_t *, in_entry_t *);
13553af7d22SMatt Jacob extern void
13653af7d22SMatt Jacob isp_get_notify(ispsoftc_t *, in_entry_t *, in_entry_t *);
13753af7d22SMatt Jacob extern void
13853af7d22SMatt Jacob isp_put_notify_fc(ispsoftc_t *, in_fcentry_t *, in_fcentry_t *);
13953af7d22SMatt Jacob extern void
14053af7d22SMatt Jacob isp_put_notify_fc_e(ispsoftc_t *, in_fcentry_e_t *, in_fcentry_e_t *);
14153af7d22SMatt Jacob extern void
14253af7d22SMatt Jacob isp_get_notify_fc(ispsoftc_t *, in_fcentry_t *, in_fcentry_t *);
14353af7d22SMatt Jacob extern void
14453af7d22SMatt Jacob isp_get_notify_fc_e(ispsoftc_t *, in_fcentry_e_t *, in_fcentry_e_t *);
14553af7d22SMatt Jacob extern void
14653af7d22SMatt Jacob isp_put_notify_ack(ispsoftc_t *, na_entry_t *, na_entry_t *);
14753af7d22SMatt Jacob extern void
14853af7d22SMatt Jacob isp_get_notify_ack(ispsoftc_t *, na_entry_t *, na_entry_t *);
14953af7d22SMatt Jacob extern void
15053af7d22SMatt Jacob isp_put_notify_ack_fc(ispsoftc_t *, na_fcentry_t *, na_fcentry_t *);
15153af7d22SMatt Jacob extern void
15253af7d22SMatt Jacob isp_put_notify_ack_fc_e(ispsoftc_t *, na_fcentry_e_t *, na_fcentry_e_t *);
15353af7d22SMatt Jacob extern void
15453af7d22SMatt Jacob isp_get_notify_ack_fc(ispsoftc_t *, na_fcentry_t *, na_fcentry_t *);
15553af7d22SMatt Jacob extern void
15653af7d22SMatt Jacob isp_get_notify_ack_fc_e(ispsoftc_t *, na_fcentry_e_t *, na_fcentry_e_t *);
15753af7d22SMatt Jacob #endif	/* ISP_TARGET_MODE */
15853af7d22SMatt Jacob #endif	/* _ISP_LIBRARY_H */
159