1144966Svkashyap/*
2169400Sscottl * Copyright (c) 2004-07 Applied Micro Circuits Corporation.
3144966Svkashyap * Copyright (c) 2004-05 Vinod Kashyap.
4144966Svkashyap * All rights reserved.
5144966Svkashyap *
6144966Svkashyap * Redistribution and use in source and binary forms, with or without
7144966Svkashyap * modification, are permitted provided that the following conditions
8144966Svkashyap * are met:
9144966Svkashyap * 1. Redistributions of source code must retain the above copyright
10144966Svkashyap *    notice, this list of conditions and the following disclaimer.
11144966Svkashyap * 2. Redistributions in binary form must reproduce the above copyright
12144966Svkashyap *    notice, this list of conditions and the following disclaimer in the
13144966Svkashyap *    documentation and/or other materials provided with the distribution.
14144966Svkashyap *
15144966Svkashyap * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16144966Svkashyap * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17144966Svkashyap * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18144966Svkashyap * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19144966Svkashyap * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20144966Svkashyap * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21144966Svkashyap * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22144966Svkashyap * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23144966Svkashyap * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24144966Svkashyap * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25144966Svkashyap * SUCH DAMAGE.
26144966Svkashyap *
27144966Svkashyap *	$FreeBSD: releng/10.3/sys/dev/twa/tw_osl_externs.h 208969 2010-06-09 21:40:38Z delphij $
28144966Svkashyap */
29144966Svkashyap
30144966Svkashyap/*
31144966Svkashyap * AMCC'S 3ware driver for 9000 series storage controllers.
32144966Svkashyap *
33144966Svkashyap * Author: Vinod Kashyap
34169400Sscottl * Modifications by: Adam Radford
35144966Svkashyap */
36144966Svkashyap
37144966Svkashyap
38144966Svkashyap
39144966Svkashyap#ifndef TW_OSL_EXTERNS_H
40144966Svkashyap
41144966Svkashyap#define TW_OSL_EXTERNS_H
42144966Svkashyap
43144966Svkashyap
44144966Svkashyap/*
45144966Svkashyap * Data structures and functions global to the OS Layer.
46144966Svkashyap */
47144966Svkashyap
48144966Svkashyap
49144966Svkashyap/* External data structures. */
50144966Svkashyap
51144966Svkashyapextern int	mp_ncpus;
52144966Svkashyap
53144966Svkashyap
54144966Svkashyap
55144966Svkashyap/* Functions in tw_osl_freebsd.c */
56144966Svkashyap
57144966Svkashyap/* Build a firmware passthru cmd pkt, and submit it to CL. */
58144966Svkashyapextern TW_INT32	tw_osli_fw_passthru(struct twa_softc *sc, TW_INT8 *buf);
59144966Svkashyap
60144966Svkashyap/* Get an OSL internal request context packet. */
61144966Svkashyapextern struct tw_osli_req_context *tw_osli_get_request(struct twa_softc *sc);
62144966Svkashyap
63144966Svkashyap/* Map data to DMA'able memory. */
64144966Svkashyapextern TW_INT32	tw_osli_map_request(struct tw_osli_req_context *req);
65144966Svkashyap
66144966Svkashyap/* Undo mapping. */
67144966Svkashyapextern TW_VOID	tw_osli_unmap_request(struct tw_osli_req_context *req);
68144966Svkashyap
69144966Svkashyap
70144966Svkashyap
71144966Svkashyap/* Functions in tw_osl_cam.c */
72144966Svkashyap
73144966Svkashyap/* Attach to CAM. */
74144966Svkashyapextern TW_INT32	tw_osli_cam_attach(struct twa_softc *sc);
75144966Svkashyap
76144966Svkashyap/* Detach from CAM. */
77144966Svkashyapextern TW_VOID	tw_osli_cam_detach(struct twa_softc *sc);
78144966Svkashyap
79144966Svkashyap/* Request CAM for a bus scan. */
80144966Svkashyapextern TW_INT32	tw_osli_request_bus_scan(struct twa_softc *sc);
81144966Svkashyap
82144966Svkashyap/* Freeze ccb flow from CAM. */
83208969Sdelphijextern TW_VOID	tw_osli_disallow_new_requests(struct twa_softc *sc,
84208969Sdelphij	struct tw_cl_req_handle *req_handle);
85144966Svkashyap
86144966Svkashyap/* OSL's completion routine for SCSI I/O's. */
87144966Svkashyapextern TW_VOID	tw_osl_complete_io(struct tw_cl_req_handle *req_handle);
88144966Svkashyap
89144966Svkashyap/* OSL's completion routine for passthru requests. */
90144966Svkashyapextern TW_VOID	tw_osl_complete_passthru(struct tw_cl_req_handle *req_handle);
91144966Svkashyap
92144966Svkashyap
93144966Svkashyap
94144966Svkashyap#endif /* TW_OSL_EXTERNS_H */
95