xref: /freebsd/sys/cam/cam_xpt_sim.h (revision bec9534d1d180ff06c240db7bbd809764a6a8f6f)
1898b0535SWarner Losh /*-
28b8a9b1dSJustin T. Gibbs  * Data structures and definitions for dealing with the
38b8a9b1dSJustin T. Gibbs  * Common Access Method Transport (xpt) layer.
48b8a9b1dSJustin T. Gibbs  *
5*bec9534dSPedro F. Giffuni  * SPDX-License-Identifier: BSD-2-Clause-FreeBSD
6*bec9534dSPedro F. Giffuni  *
78b8a9b1dSJustin T. Gibbs  * Copyright (c) 1997 Justin T. Gibbs.
88b8a9b1dSJustin T. Gibbs  * All rights reserved.
98b8a9b1dSJustin T. Gibbs  *
108b8a9b1dSJustin T. Gibbs  * Redistribution and use in source and binary forms, with or without
118b8a9b1dSJustin T. Gibbs  * modification, are permitted provided that the following conditions
128b8a9b1dSJustin T. Gibbs  * are met:
138b8a9b1dSJustin T. Gibbs  * 1. Redistributions of source code must retain the above copyright
148b8a9b1dSJustin T. Gibbs  *    notice, this list of conditions, and the following disclaimer,
158b8a9b1dSJustin T. Gibbs  *    without modification, immediately at the beginning of the file.
168b8a9b1dSJustin T. Gibbs  * 2. The name of the author may not be used to endorse or promote products
178b8a9b1dSJustin T. Gibbs  *    derived from this software without specific prior written permission.
188b8a9b1dSJustin T. Gibbs  *
198b8a9b1dSJustin T. Gibbs  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
208b8a9b1dSJustin T. Gibbs  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
218b8a9b1dSJustin T. Gibbs  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
228b8a9b1dSJustin T. Gibbs  * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
238b8a9b1dSJustin T. Gibbs  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
248b8a9b1dSJustin T. Gibbs  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
258b8a9b1dSJustin T. Gibbs  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
268b8a9b1dSJustin T. Gibbs  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
278b8a9b1dSJustin T. Gibbs  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
288b8a9b1dSJustin T. Gibbs  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
298b8a9b1dSJustin T. Gibbs  * SUCH DAMAGE.
308b8a9b1dSJustin T. Gibbs  *
31c3aac50fSPeter Wemm  * $FreeBSD$
328b8a9b1dSJustin T. Gibbs  */
338b8a9b1dSJustin T. Gibbs 
348b8a9b1dSJustin T. Gibbs #ifndef _CAM_CAM_XPT_SIM_H
358b8a9b1dSJustin T. Gibbs #define _CAM_CAM_XPT_SIM_H 1
368b8a9b1dSJustin T. Gibbs 
378b8a9b1dSJustin T. Gibbs #include <cam/cam_xpt.h>
388b8a9b1dSJustin T. Gibbs #include <cam/cam_queue.h>
398b8a9b1dSJustin T. Gibbs 
408b8a9b1dSJustin T. Gibbs /* Functions accessed by SIM drivers */
41c4473420SPeter Wemm #ifdef _KERNEL
42b50569b7SScott Long int32_t		xpt_bus_register(struct cam_sim *sim, device_t parent,
43b50569b7SScott Long 				 u_int32_t bus);
44434bbf6eSJustin T. Gibbs int32_t		xpt_bus_deregister(path_id_t path_id);
458b8a9b1dSJustin T. Gibbs u_int32_t	xpt_freeze_simq(struct cam_sim *sim, u_int count);
468b8a9b1dSJustin T. Gibbs void		xpt_release_simq(struct cam_sim *sim, int run_queue);
478b8a9b1dSJustin T. Gibbs u_int32_t	xpt_freeze_devq(struct cam_path *path, u_int count);
4883c5d981SAlexander Motin void		xpt_release_devq(struct cam_path *path,
4983c5d981SAlexander Motin 		    u_int count, int run_queue);
50d1dc9ab1SJustin T. Gibbs void		xpt_done(union ccb *done_ccb);
51227d67aaSAlexander Motin void		xpt_done_direct(union ccb *done_ccb);
52c4473420SPeter Wemm #endif
538b8a9b1dSJustin T. Gibbs 
548b8a9b1dSJustin T. Gibbs #endif /* _CAM_CAM_XPT_SIM_H */
558b8a9b1dSJustin T. Gibbs 
56