xref: /dragonfly/sys/dev/raid/twa/tw_osl_externs.h (revision 1e0dd9dd)
1df54c2f9SSascha Wildner /*
2df54c2f9SSascha Wildner  * Copyright (c) 2004-07 Applied Micro Circuits Corporation.
3df54c2f9SSascha Wildner  * Copyright (c) 2004-05 Vinod Kashyap.
4df54c2f9SSascha Wildner  * All rights reserved.
5df54c2f9SSascha Wildner  *
6df54c2f9SSascha Wildner  * Redistribution and use in source and binary forms, with or without
7df54c2f9SSascha Wildner  * modification, are permitted provided that the following conditions
8df54c2f9SSascha Wildner  * are met:
9df54c2f9SSascha Wildner  * 1. Redistributions of source code must retain the above copyright
10df54c2f9SSascha Wildner  *    notice, this list of conditions and the following disclaimer.
11df54c2f9SSascha Wildner  * 2. Redistributions in binary form must reproduce the above copyright
12df54c2f9SSascha Wildner  *    notice, this list of conditions and the following disclaimer in the
13df54c2f9SSascha Wildner  *    documentation and/or other materials provided with the distribution.
14df54c2f9SSascha Wildner  *
15df54c2f9SSascha Wildner  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16df54c2f9SSascha Wildner  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17df54c2f9SSascha Wildner  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18df54c2f9SSascha Wildner  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19df54c2f9SSascha Wildner  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20df54c2f9SSascha Wildner  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21df54c2f9SSascha Wildner  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22df54c2f9SSascha Wildner  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23df54c2f9SSascha Wildner  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24df54c2f9SSascha Wildner  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25df54c2f9SSascha Wildner  * SUCH DAMAGE.
26df54c2f9SSascha Wildner  *
27*1e0dd9ddSSascha Wildner  *	$FreeBSD: head/sys/dev/twa/tw_osl_externs.h 208969 2010-06-09 21:40:38Z delphij $
28df54c2f9SSascha Wildner  */
29df54c2f9SSascha Wildner 
30df54c2f9SSascha Wildner /*
31df54c2f9SSascha Wildner  * AMCC'S 3ware driver for 9000 series storage controllers.
32df54c2f9SSascha Wildner  *
33df54c2f9SSascha Wildner  * Author: Vinod Kashyap
34df54c2f9SSascha Wildner  * Modifications by: Adam Radford
35df54c2f9SSascha Wildner  */
36df54c2f9SSascha Wildner 
37df54c2f9SSascha Wildner 
38df54c2f9SSascha Wildner 
39df54c2f9SSascha Wildner #ifndef TW_OSL_EXTERNS_H
40df54c2f9SSascha Wildner 
41df54c2f9SSascha Wildner #define TW_OSL_EXTERNS_H
42df54c2f9SSascha Wildner 
43df54c2f9SSascha Wildner 
44df54c2f9SSascha Wildner /*
45df54c2f9SSascha Wildner  * Data structures and functions global to the OS Layer.
46df54c2f9SSascha Wildner  */
47df54c2f9SSascha Wildner 
48df54c2f9SSascha Wildner 
49df54c2f9SSascha Wildner /* Functions in tw_osl_freebsd.c */
50df54c2f9SSascha Wildner 
51df54c2f9SSascha Wildner /* Build a firmware passthru cmd pkt, and submit it to CL. */
52df54c2f9SSascha Wildner extern TW_INT32	tw_osli_fw_passthru(struct twa_softc *sc, TW_INT8 *buf);
53df54c2f9SSascha Wildner 
54df54c2f9SSascha Wildner /* Get an OSL internal request context packet. */
55df54c2f9SSascha Wildner extern struct tw_osli_req_context *tw_osli_get_request(struct twa_softc *sc);
56df54c2f9SSascha Wildner 
57df54c2f9SSascha Wildner /* Map data to DMA'able memory. */
58df54c2f9SSascha Wildner extern TW_INT32	tw_osli_map_request(struct tw_osli_req_context *req);
59df54c2f9SSascha Wildner 
60df54c2f9SSascha Wildner /* Undo mapping. */
61df54c2f9SSascha Wildner extern TW_VOID	tw_osli_unmap_request(struct tw_osli_req_context *req);
62df54c2f9SSascha Wildner 
63df54c2f9SSascha Wildner 
64df54c2f9SSascha Wildner 
65df54c2f9SSascha Wildner /* Functions in tw_osl_cam.c */
66df54c2f9SSascha Wildner 
67df54c2f9SSascha Wildner /* Attach to CAM. */
68df54c2f9SSascha Wildner extern TW_INT32	tw_osli_cam_attach(struct twa_softc *sc);
69df54c2f9SSascha Wildner 
70df54c2f9SSascha Wildner /* Detach from CAM. */
71df54c2f9SSascha Wildner extern TW_VOID	tw_osli_cam_detach(struct twa_softc *sc);
72df54c2f9SSascha Wildner 
73df54c2f9SSascha Wildner /* Request CAM for a bus scan. */
74df54c2f9SSascha Wildner extern TW_INT32	tw_osli_request_bus_scan(struct twa_softc *sc);
75df54c2f9SSascha Wildner 
76df54c2f9SSascha Wildner /* Freeze ccb flow from CAM. */
77df54c2f9SSascha Wildner extern TW_VOID	tw_osli_disallow_new_requests(struct twa_softc *sc,
78df54c2f9SSascha Wildner 	struct tw_cl_req_handle *req_handle);
79df54c2f9SSascha Wildner 
80df54c2f9SSascha Wildner /* OSL's completion routine for SCSI I/O's. */
81df54c2f9SSascha Wildner extern TW_VOID	tw_osl_complete_io(struct tw_cl_req_handle *req_handle);
82df54c2f9SSascha Wildner 
83df54c2f9SSascha Wildner /* OSL's completion routine for passthru requests. */
84df54c2f9SSascha Wildner extern TW_VOID	tw_osl_complete_passthru(struct tw_cl_req_handle *req_handle);
85df54c2f9SSascha Wildner 
86df54c2f9SSascha Wildner 
87df54c2f9SSascha Wildner 
88df54c2f9SSascha Wildner #endif /* TW_OSL_EXTERNS_H */
89