isp_library.h revision 155228
197403Sobrien/* $FreeBSD: head/sys/dev/isp/isp_library.h 155228 2006-02-02 21:31:34Z mjacob $ */ 297403Sobrien/*- 397403Sobrien * Qlogic Host Adapter Library Functions 497403Sobrien * 597403Sobrien * Copyright (c) 1999-2006 by Matthew Jacob 697403Sobrien * All rights reserved. 797403Sobrien * 897403Sobrien * Redistribution and use in source and binary forms, with or without 997403Sobrien * modification, are permitted provided that the following conditions 1097403Sobrien * are met: 1197403Sobrien * 1. Redistributions of source code must retain the above copyright 1297403Sobrien * notice immediately at the beginning of the file, without modification, 1397403Sobrien * this list of conditions, and the following disclaimer. 1497403Sobrien * 2. The name of the author may not be used to endorse or promote products 1597403Sobrien * derived from this software without specific prior written permission. 1697403Sobrien * 1797403Sobrien * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 1897403Sobrien * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1997403Sobrien * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 2097403Sobrien * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR 2197403Sobrien * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 2297403Sobrien * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2397403Sobrien * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2497403Sobrien * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2597403Sobrien * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2697403Sobrien * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2797403Sobrien * SUCH DAMAGE. 2897403Sobrien * 2997403Sobrien */ 3097403Sobrien#ifndef _ISP_LIBRARY_H 3197403Sobrien#define _ISP_LIBRARY_H 3297403Sobrien 3397403Sobrienextern int isp_save_xs(ispsoftc_t *, XS_T *, u_int16_t *); 3497403Sobrienextern XS_T *isp_find_xs(ispsoftc_t *, u_int16_t); 3597403Sobrienextern u_int16_t isp_find_handle(ispsoftc_t *, XS_T *); 3697403Sobrienextern int isp_handle_index(u_int16_t); 3797403Sobrienextern u_int16_t isp_index_handle(int); 3897403Sobrienextern void isp_destroy_handle(ispsoftc_t *, u_int16_t); 3997403Sobrienextern int isp_getrqentry(ispsoftc_t *, u_int16_t *, u_int16_t *, void **); 4097403Sobrienextern void isp_print_qentry (ispsoftc_t *, char *, int, void *); 4197403Sobrienextern void isp_print_bytes(ispsoftc_t *, char *, int, void *); 4297403Sobrienextern int isp_fc_runstate(ispsoftc_t *, int); 4397403Sobrienextern void isp_copy_out_hdr(ispsoftc_t *, isphdr_t *, isphdr_t *); 4497403Sobrienextern void isp_copy_in_hdr(ispsoftc_t *, isphdr_t *, isphdr_t *); 4597403Sobrienextern int isp_get_response_type(ispsoftc_t *, isphdr_t *); 4697403Sobrienextern void 4797403Sobrienisp_put_request(ispsoftc_t *, ispreq_t *, ispreq_t *); 4897403Sobrienextern void 4997403Sobrienisp_put_request_t2(ispsoftc_t *, ispreqt2_t *, ispreqt2_t *); 5097403Sobrienextern void 5197403Sobrienisp_put_request_t2e(ispsoftc_t *, ispreqt2e_t *, ispreqt2e_t *); 5297403Sobrienextern void 5397403Sobrienisp_put_request_t3(ispsoftc_t *, ispreqt3_t *, ispreqt3_t *); 5497403Sobrienextern void 5597403Sobrienisp_put_request_t3e(ispsoftc_t *, ispreqt3e_t *, ispreqt3e_t *); 5697403Sobrienextern void 5797403Sobrienisp_put_extended_request(ispsoftc_t *, ispextreq_t *, ispextreq_t *); 5897403Sobrienextern void 5997403Sobrienisp_put_cont_req(ispsoftc_t *, ispcontreq_t *, ispcontreq_t *); 6097403Sobrienextern void 6197403Sobrienisp_put_cont64_req(ispsoftc_t *, ispcontreq64_t *, ispcontreq64_t *); 6297403Sobrienextern void 6397403Sobrienisp_get_response(ispsoftc_t *, ispstatusreq_t *, ispstatusreq_t *); 6497403Sobrienextern void 6597403Sobrienisp_get_response_x(ispsoftc_t *, ispstatus_cont_t *, ispstatus_cont_t *); 6697403Sobrienextern void 6797403Sobrienisp_get_rio2(ispsoftc_t *, isp_rio2_t *, isp_rio2_t *); 6897403Sobrienextern void 6997403Sobrienisp_put_icb(ispsoftc_t *, isp_icb_t *, isp_icb_t *); 7097403Sobrienextern void 7197403Sobrienisp_get_pdb(ispsoftc_t *, isp_pdb_t *, isp_pdb_t *); 7297403Sobrienextern void 7397403Sobrienisp_get_ct_hdr(ispsoftc_t *isp, ct_hdr_t *, ct_hdr_t *); 7497403Sobrienextern void 7597403Sobrienisp_put_sns_request(ispsoftc_t *, sns_screq_t *, sns_screq_t *); 7697403Sobrienextern void 7797403Sobrienisp_put_gid_ft_request(ispsoftc_t *, sns_gid_ft_req_t *, 7897403Sobrien sns_gid_ft_req_t *); 7997403Sobrienextern void 8097403Sobrienisp_put_gxn_id_request(ispsoftc_t *, sns_gxn_id_req_t *, 8197403Sobrien sns_gxn_id_req_t *); 8297403Sobrienextern void 8397403Sobrienisp_get_sns_response(ispsoftc_t *, sns_scrsp_t *, sns_scrsp_t *, int); 8497403Sobrienextern void 8597403Sobrienisp_get_gid_ft_response(ispsoftc_t *, sns_gid_ft_rsp_t *, 8697403Sobrien sns_gid_ft_rsp_t *, int); 8797403Sobrienextern void 8897403Sobrienisp_get_gxn_id_response(ispsoftc_t *, sns_gxn_id_rsp_t *, 8997403Sobrien sns_gxn_id_rsp_t *); 9097403Sobrienextern void 9197403Sobrienisp_get_gff_id_response(ispsoftc_t *, sns_gff_id_rsp_t *, 9297403Sobrien sns_gff_id_rsp_t *); 9397403Sobrienextern void 9497403Sobrienisp_get_ga_nxt_response(ispsoftc_t *, sns_ga_nxt_rsp_t *, 9597403Sobrien sns_ga_nxt_rsp_t *); 9697403Sobrien 9797403Sobrien#ifdef ISP_TARGET_MODE 9897403Sobrien#include <dev/isp/isp_target.h> 9997403Sobrien 10097403Sobrienextern int isp_save_xs_tgt(ispsoftc_t *, void *, u_int16_t *); 10197403Sobrienextern void *isp_find_xs_tgt(ispsoftc_t *, u_int16_t); 10297403Sobrienextern u_int16_t isp_find_tgt_handle(ispsoftc_t *, void *); 10397403Sobrienextern void isp_destroy_tgt_handle(ispsoftc_t *, u_int16_t); 10497403Sobrien 10597403Sobrienextern void 10697403Sobrienisp_put_atio(ispsoftc_t *, at_entry_t *, at_entry_t *); 10797403Sobrienextern void 10897403Sobrienisp_get_atio(ispsoftc_t *, at_entry_t *, at_entry_t *); 10997403Sobrienextern void 11097403Sobrienisp_put_atio2(ispsoftc_t *, at2_entry_t *, at2_entry_t *); 11197403Sobrienextern void 11297403Sobrienisp_put_atio2e(ispsoftc_t *, at2e_entry_t *, at2e_entry_t *); 11397403Sobrienextern void 11497403Sobrienisp_get_atio2(ispsoftc_t *, at2_entry_t *, at2_entry_t *); 11597403Sobrienextern void 11697403Sobrienisp_get_atio2e(ispsoftc_t *, at2e_entry_t *, at2e_entry_t *); 11797403Sobrienextern void 11897403Sobrienisp_put_ctio(ispsoftc_t *, ct_entry_t *, ct_entry_t *); 11997403Sobrienextern void 12097403Sobrienisp_get_ctio(ispsoftc_t *, ct_entry_t *, ct_entry_t *); 12197403Sobrienextern void 12297403Sobrienisp_put_ctio2(ispsoftc_t *, ct2_entry_t *, ct2_entry_t *); 12397403Sobrienextern void 12497403Sobrienisp_put_ctio2e(ispsoftc_t *, ct2e_entry_t *, ct2e_entry_t *); 12597403Sobrienextern void 12697403Sobrienisp_get_ctio2(ispsoftc_t *, ct2_entry_t *, ct2_entry_t *); 12797403Sobrienextern void 12897403Sobrienisp_get_ctio2e(ispsoftc_t *, ct2e_entry_t *, ct2e_entry_t *); 12997403Sobrienextern void 13097403Sobrienisp_put_enable_lun(ispsoftc_t *, lun_entry_t *, lun_entry_t *); 13197403Sobrienextern void 13297403Sobrienisp_get_enable_lun(ispsoftc_t *, lun_entry_t *, lun_entry_t *); 13397403Sobrienextern void 13497403Sobrienisp_put_notify(ispsoftc_t *, in_entry_t *, in_entry_t *); 13597403Sobrienextern void 13697403Sobrienisp_get_notify(ispsoftc_t *, in_entry_t *, in_entry_t *); 13797403Sobrienextern void 13897403Sobrienisp_put_notify_fc(ispsoftc_t *, in_fcentry_t *, in_fcentry_t *); 13997403Sobrienextern void 14097403Sobrienisp_put_notify_fc_e(ispsoftc_t *, in_fcentry_e_t *, in_fcentry_e_t *); 14197403Sobrienextern void 14297403Sobrienisp_get_notify_fc(ispsoftc_t *, in_fcentry_t *, in_fcentry_t *); 14397403Sobrienextern void 14497403Sobrienisp_get_notify_fc_e(ispsoftc_t *, in_fcentry_e_t *, in_fcentry_e_t *); 14597403Sobrienextern void 14697403Sobrienisp_put_notify_ack(ispsoftc_t *, na_entry_t *, na_entry_t *); 14797403Sobrienextern void 14897403Sobrienisp_get_notify_ack(ispsoftc_t *, na_entry_t *, na_entry_t *); 14997403Sobrienextern void 15097403Sobrienisp_put_notify_ack_fc(ispsoftc_t *, na_fcentry_t *, na_fcentry_t *); 15197403Sobrienextern void 15297403Sobrienisp_put_notify_ack_fc_e(ispsoftc_t *, na_fcentry_e_t *, na_fcentry_e_t *); 15397403Sobrienextern void 15497403Sobrienisp_get_notify_ack_fc(ispsoftc_t *, na_fcentry_t *, na_fcentry_t *); 15597403Sobrienextern void 15697403Sobrienisp_get_notify_ack_fc_e(ispsoftc_t *, na_fcentry_e_t *, na_fcentry_e_t *); 15797403Sobrien#endif /* ISP_TARGET_MODE */ 15897403Sobrien#endif /* _ISP_LIBRARY_H */ 15997403Sobrien