.\" -*- nroff -*- .\" .\" Copyright (c) 2016 M. Warner Losh .\" .\" All rights reserved. .\" .\" This program is free software. .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions .\" are met: .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" .\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. .\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .\" $FreeBSD$ .\" .Dd January 19, 2016 .Dt CAM_PERIPH_GETCCB 9 .Os .Sh NAME .Nm cam_periph_getccb .Nd allocate ccb from the periph's pool .Sh SYNOPSIS .In cam/cam_xpt_periph.h .Ft union ccb * .Fn cam_periph_getccb "struct cam_periph *periph" "u_int32_t priority" .Sh DESCRIPTION A periph CAM driver gets CCBs with the .Nm function call. It must be called with the periph lock held. It returns a CCB for the periph driver to use for its transaction. If there are CCBs of a different priority in the periph's .Va ccb_list , then this function will run the periph's alloc queue, as described in .Xr periph 9 . If the CCB is a lower priority one than the periph's .Va immediate_priority or if there's no free CCBs for this periph, .Nm will sleep until a suitable CCB is available. The CCB returned should be setup with .Xr xpt_setup_ccb 9 to set its priority. .Pp Should document what the heck the .Va ccb_list in the periph is, maybe in .Xr cam_periph 9 . Should document what the heck the running the allocq means in the periph is, maybe in .Xr periph 9 . .Sh SEE ALSO .Xr cam_periph 9 , .Xr xpt_release_ccb 9 , .Xr xpt_setup_cbb 9 .Sh AUTHORS This manual page was written by .An M. Warner Losh .