isp_library.h revision 155704
1155228Smjacob/* $FreeBSD: head/sys/dev/isp/isp_library.h 155704 2006-02-15 00:31:48Z mjacob $ */ 2155228Smjacob/*- 3155228Smjacob * Qlogic Host Adapter Library Functions 4155228Smjacob * 5155228Smjacob * Copyright (c) 1999-2006 by Matthew Jacob 6155228Smjacob * All rights reserved. 7155228Smjacob * 8155228Smjacob * Redistribution and use in source and binary forms, with or without 9155228Smjacob * modification, are permitted provided that the following conditions 10155228Smjacob * are met: 11155228Smjacob * 1. Redistributions of source code must retain the above copyright 12155228Smjacob * notice immediately at the beginning of the file, without modification, 13155228Smjacob * this list of conditions, and the following disclaimer. 14155228Smjacob * 2. The name of the author may not be used to endorse or promote products 15155228Smjacob * derived from this software without specific prior written permission. 16155228Smjacob * 17155228Smjacob * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 18155228Smjacob * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 19155228Smjacob * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 20155228Smjacob * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR 21155228Smjacob * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22155228Smjacob * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23155228Smjacob * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24155228Smjacob * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25155228Smjacob * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26155228Smjacob * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27155228Smjacob * SUCH DAMAGE. 28155228Smjacob * 29155228Smjacob */ 30155228Smjacob#ifndef _ISP_LIBRARY_H 31155228Smjacob#define _ISP_LIBRARY_H 32155228Smjacob 33155704Smjacobextern int isp_save_xs(ispsoftc_t *, XS_T *, uint16_t *); 34155704Smjacobextern XS_T *isp_find_xs(ispsoftc_t *, uint16_t); 35155704Smjacobextern uint16_t isp_find_handle(ispsoftc_t *, XS_T *); 36155704Smjacobextern int isp_handle_index(uint16_t); 37155704Smjacobextern uint16_t isp_index_handle(int); 38155704Smjacobextern void isp_destroy_handle(ispsoftc_t *, uint16_t); 39155704Smjacobextern int isp_getrqentry(ispsoftc_t *, uint16_t *, uint16_t *, void **); 40155228Smjacobextern void isp_print_qentry (ispsoftc_t *, char *, int, void *); 41155228Smjacobextern void isp_print_bytes(ispsoftc_t *, char *, int, void *); 42155228Smjacobextern int isp_fc_runstate(ispsoftc_t *, int); 43155228Smjacobextern void isp_copy_out_hdr(ispsoftc_t *, isphdr_t *, isphdr_t *); 44155228Smjacobextern void isp_copy_in_hdr(ispsoftc_t *, isphdr_t *, isphdr_t *); 45155228Smjacobextern int isp_get_response_type(ispsoftc_t *, isphdr_t *); 46155228Smjacobextern void 47155228Smjacobisp_put_request(ispsoftc_t *, ispreq_t *, ispreq_t *); 48155228Smjacobextern void 49155228Smjacobisp_put_request_t2(ispsoftc_t *, ispreqt2_t *, ispreqt2_t *); 50155228Smjacobextern void 51155228Smjacobisp_put_request_t2e(ispsoftc_t *, ispreqt2e_t *, ispreqt2e_t *); 52155228Smjacobextern void 53155228Smjacobisp_put_request_t3(ispsoftc_t *, ispreqt3_t *, ispreqt3_t *); 54155228Smjacobextern void 55155228Smjacobisp_put_request_t3e(ispsoftc_t *, ispreqt3e_t *, ispreqt3e_t *); 56155228Smjacobextern void 57155228Smjacobisp_put_extended_request(ispsoftc_t *, ispextreq_t *, ispextreq_t *); 58155228Smjacobextern void 59155228Smjacobisp_put_cont_req(ispsoftc_t *, ispcontreq_t *, ispcontreq_t *); 60155228Smjacobextern void 61155228Smjacobisp_put_cont64_req(ispsoftc_t *, ispcontreq64_t *, ispcontreq64_t *); 62155228Smjacobextern void 63155228Smjacobisp_get_response(ispsoftc_t *, ispstatusreq_t *, ispstatusreq_t *); 64155228Smjacobextern void 65155228Smjacobisp_get_response_x(ispsoftc_t *, ispstatus_cont_t *, ispstatus_cont_t *); 66155228Smjacobextern void 67155228Smjacobisp_get_rio2(ispsoftc_t *, isp_rio2_t *, isp_rio2_t *); 68155228Smjacobextern void 69155228Smjacobisp_put_icb(ispsoftc_t *, isp_icb_t *, isp_icb_t *); 70155228Smjacobextern void 71155228Smjacobisp_get_pdb(ispsoftc_t *, isp_pdb_t *, isp_pdb_t *); 72155228Smjacobextern void 73155228Smjacobisp_get_ct_hdr(ispsoftc_t *isp, ct_hdr_t *, ct_hdr_t *); 74155228Smjacobextern void 75155228Smjacobisp_put_sns_request(ispsoftc_t *, sns_screq_t *, sns_screq_t *); 76155228Smjacobextern void 77155228Smjacobisp_put_gid_ft_request(ispsoftc_t *, sns_gid_ft_req_t *, 78155228Smjacob sns_gid_ft_req_t *); 79155228Smjacobextern void 80155228Smjacobisp_put_gxn_id_request(ispsoftc_t *, sns_gxn_id_req_t *, 81155228Smjacob sns_gxn_id_req_t *); 82155228Smjacobextern void 83155228Smjacobisp_get_sns_response(ispsoftc_t *, sns_scrsp_t *, sns_scrsp_t *, int); 84155228Smjacobextern void 85155228Smjacobisp_get_gid_ft_response(ispsoftc_t *, sns_gid_ft_rsp_t *, 86155228Smjacob sns_gid_ft_rsp_t *, int); 87155228Smjacobextern void 88155228Smjacobisp_get_gxn_id_response(ispsoftc_t *, sns_gxn_id_rsp_t *, 89155228Smjacob sns_gxn_id_rsp_t *); 90155228Smjacobextern void 91155228Smjacobisp_get_gff_id_response(ispsoftc_t *, sns_gff_id_rsp_t *, 92155228Smjacob sns_gff_id_rsp_t *); 93155228Smjacobextern void 94155228Smjacobisp_get_ga_nxt_response(ispsoftc_t *, sns_ga_nxt_rsp_t *, 95155228Smjacob sns_ga_nxt_rsp_t *); 96155228Smjacob 97155228Smjacob#ifdef ISP_TARGET_MODE 98155704Smjacob#if defined(__NetBSD__) || defined(__OpenBSD__) 99155704Smjacob#include <dev/ic/isp_target.h> 100155704Smjacob#elif defined(__FreeBSD__) 101155228Smjacob#include <dev/isp/isp_target.h> 102155704Smjacob#else 103155704Smjacob#include "isp_target.h" 104155704Smjacob#endif 105155228Smjacob 106155704Smjacobextern int isp_save_xs_tgt(ispsoftc_t *, void *, uint16_t *); 107155704Smjacobextern void *isp_find_xs_tgt(ispsoftc_t *, uint16_t); 108155704Smjacobextern uint16_t isp_find_tgt_handle(ispsoftc_t *, void *); 109155704Smjacobextern void isp_destroy_tgt_handle(ispsoftc_t *, uint16_t); 110155228Smjacob 111155228Smjacobextern void 112155228Smjacobisp_put_atio(ispsoftc_t *, at_entry_t *, at_entry_t *); 113155228Smjacobextern void 114155228Smjacobisp_get_atio(ispsoftc_t *, at_entry_t *, at_entry_t *); 115155228Smjacobextern void 116155228Smjacobisp_put_atio2(ispsoftc_t *, at2_entry_t *, at2_entry_t *); 117155228Smjacobextern void 118155228Smjacobisp_put_atio2e(ispsoftc_t *, at2e_entry_t *, at2e_entry_t *); 119155228Smjacobextern void 120155228Smjacobisp_get_atio2(ispsoftc_t *, at2_entry_t *, at2_entry_t *); 121155228Smjacobextern void 122155228Smjacobisp_get_atio2e(ispsoftc_t *, at2e_entry_t *, at2e_entry_t *); 123155228Smjacobextern void 124155228Smjacobisp_put_ctio(ispsoftc_t *, ct_entry_t *, ct_entry_t *); 125155228Smjacobextern void 126155228Smjacobisp_get_ctio(ispsoftc_t *, ct_entry_t *, ct_entry_t *); 127155228Smjacobextern void 128155228Smjacobisp_put_ctio2(ispsoftc_t *, ct2_entry_t *, ct2_entry_t *); 129155228Smjacobextern void 130155228Smjacobisp_put_ctio2e(ispsoftc_t *, ct2e_entry_t *, ct2e_entry_t *); 131155228Smjacobextern void 132155228Smjacobisp_get_ctio2(ispsoftc_t *, ct2_entry_t *, ct2_entry_t *); 133155228Smjacobextern void 134155228Smjacobisp_get_ctio2e(ispsoftc_t *, ct2e_entry_t *, ct2e_entry_t *); 135155228Smjacobextern void 136155228Smjacobisp_put_enable_lun(ispsoftc_t *, lun_entry_t *, lun_entry_t *); 137155228Smjacobextern void 138155228Smjacobisp_get_enable_lun(ispsoftc_t *, lun_entry_t *, lun_entry_t *); 139155228Smjacobextern void 140155228Smjacobisp_put_notify(ispsoftc_t *, in_entry_t *, in_entry_t *); 141155228Smjacobextern void 142155228Smjacobisp_get_notify(ispsoftc_t *, in_entry_t *, in_entry_t *); 143155228Smjacobextern void 144155228Smjacobisp_put_notify_fc(ispsoftc_t *, in_fcentry_t *, in_fcentry_t *); 145155228Smjacobextern void 146155228Smjacobisp_put_notify_fc_e(ispsoftc_t *, in_fcentry_e_t *, in_fcentry_e_t *); 147155228Smjacobextern void 148155228Smjacobisp_get_notify_fc(ispsoftc_t *, in_fcentry_t *, in_fcentry_t *); 149155228Smjacobextern void 150155228Smjacobisp_get_notify_fc_e(ispsoftc_t *, in_fcentry_e_t *, in_fcentry_e_t *); 151155228Smjacobextern void 152155228Smjacobisp_put_notify_ack(ispsoftc_t *, na_entry_t *, na_entry_t *); 153155228Smjacobextern void 154155228Smjacobisp_get_notify_ack(ispsoftc_t *, na_entry_t *, na_entry_t *); 155155228Smjacobextern void 156155228Smjacobisp_put_notify_ack_fc(ispsoftc_t *, na_fcentry_t *, na_fcentry_t *); 157155228Smjacobextern void 158155228Smjacobisp_put_notify_ack_fc_e(ispsoftc_t *, na_fcentry_e_t *, na_fcentry_e_t *); 159155228Smjacobextern void 160155228Smjacobisp_get_notify_ack_fc(ispsoftc_t *, na_fcentry_t *, na_fcentry_t *); 161155228Smjacobextern void 162155228Smjacobisp_get_notify_ack_fc_e(ispsoftc_t *, na_fcentry_e_t *, na_fcentry_e_t *); 163155228Smjacob#endif /* ISP_TARGET_MODE */ 164155228Smjacob#endif /* _ISP_LIBRARY_H */ 165