cam_xpt.c (bb6087e5bb8f633ed2a1a09397a7a4a873779cc1) cam_xpt.c (3c68dd1aec3ed8f50d4a69db309a62fa708c5db5)
1/*
2 * Implementation of the Common Access Method Transport (XPT) layer.
3 *
4 * Copyright (c) 1997, 1998 Justin T. Gibbs.
5 * Copyright (c) 1997, 1998 Kenneth D. Merry.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 12 unchanged lines hidden (view full) ---

21 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
1/*
2 * Implementation of the Common Access Method Transport (XPT) layer.
3 *
4 * Copyright (c) 1997, 1998 Justin T. Gibbs.
5 * Copyright (c) 1997, 1998 Kenneth D. Merry.
6 * All rights reserved.
7 *
8 * Redistribution and use in source and binary forms, with or without

--- 12 unchanged lines hidden (view full) ---

21 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE.
28 *
29 * $Id: cam_xpt.c,v 1.29 1998/12/10 04:05:49 gibbs Exp $
29 * $Id: cam_xpt.c,v 1.30 1998/12/15 08:13:10 gibbs Exp $
30 */
31#include <sys/param.h>
32#include <sys/systm.h>
33#include <sys/types.h>
34#include <sys/malloc.h>
35#include <sys/device.h>
36#include <sys/kernel.h>
37#include <sys/conf.h>

--- 37 unchanged lines hidden (view full) ---

75 u_int32_t event_enable; /* Async Event enables */
76 void (*callback)(void *arg, u_int32_t code,
77 struct cam_path *path, void *args);
78 void *callback_arg;
79};
80
81SLIST_HEAD(async_list, async_node);
82SLIST_HEAD(periph_list, cam_periph);
30 */
31#include <sys/param.h>
32#include <sys/systm.h>
33#include <sys/types.h>
34#include <sys/malloc.h>
35#include <sys/device.h>
36#include <sys/kernel.h>
37#include <sys/conf.h>

--- 37 unchanged lines hidden (view full) ---

75 u_int32_t event_enable; /* Async Event enables */
76 void (*callback)(void *arg, u_int32_t code,
77 struct cam_path *path, void *args);
78 void *callback_arg;
79};
80
81SLIST_HEAD(async_list, async_node);
82SLIST_HEAD(periph_list, cam_periph);
83STAILQ_HEAD(highpowerlist, ccb_hdr) highpowerq;
83static STAILQ_HEAD(highpowerlist, ccb_hdr) highpowerq;
84
85/*
86 * This is the maximum number of high powered commands (e.g. start unit)
87 * that can be outstanding at a particular time.
88 */
89#ifndef CAM_MAX_HIGHPOWER
90#define CAM_MAX_HIGHPOWER 4
91#endif

--- 331 unchanged lines hidden (view full) ---

423static struct xpt_softc xsoftc;
424
425/* Queues for our software interrupt handler */
426typedef TAILQ_HEAD(cam_isrq, ccb_hdr) cam_isrq_t;
427static cam_isrq_t cam_bioq;
428static cam_isrq_t cam_netq;
429
430/* "Pool" of inactive ccbs managed by xpt_alloc_ccb and xpt_free_ccb */
84
85/*
86 * This is the maximum number of high powered commands (e.g. start unit)
87 * that can be outstanding at a particular time.
88 */
89#ifndef CAM_MAX_HIGHPOWER
90#define CAM_MAX_HIGHPOWER 4
91#endif

--- 331 unchanged lines hidden (view full) ---

423static struct xpt_softc xsoftc;
424
425/* Queues for our software interrupt handler */
426typedef TAILQ_HEAD(cam_isrq, ccb_hdr) cam_isrq_t;
427static cam_isrq_t cam_bioq;
428static cam_isrq_t cam_netq;
429
430/* "Pool" of inactive ccbs managed by xpt_alloc_ccb and xpt_free_ccb */
431SLIST_HEAD(,ccb_hdr) ccb_freeq;
431static SLIST_HEAD(,ccb_hdr) ccb_freeq;
432static u_int xpt_max_ccbs; /*
433 * Maximum size of ccb pool. Modified as
434 * devices are added/removed or have their
435 * opening counts changed.
436 */
437static u_int xpt_ccb_count; /* Current count of allocated ccbs */
438
439static struct cam_periph *xpt_periph;

--- 44 unchanged lines hidden (view full) ---

484 /*d_flags*/ 0,
485 /*d_maxio*/ 0,
486 /*b_maj*/ -1
487};
488
489static struct intr_config_hook *xpt_config_hook;
490
491/* Registered busses */
432static u_int xpt_max_ccbs; /*
433 * Maximum size of ccb pool. Modified as
434 * devices are added/removed or have their
435 * opening counts changed.
436 */
437static u_int xpt_ccb_count; /* Current count of allocated ccbs */
438
439static struct cam_periph *xpt_periph;

--- 44 unchanged lines hidden (view full) ---

484 /*d_flags*/ 0,
485 /*d_maxio*/ 0,
486 /*b_maj*/ -1
487};
488
489static struct intr_config_hook *xpt_config_hook;
490
491/* Registered busses */
492TAILQ_HEAD(,cam_eb) xpt_busses;
492static TAILQ_HEAD(,cam_eb) xpt_busses;
493static u_int bus_generation;
494
495/* Storage for debugging datastructures */
496#ifdef CAMDEBUG
497struct cam_path *cam_dpath;
498u_int32_t cam_dflags;
499#endif
500

--- 5281 unchanged lines hidden (view full) ---

5782
5783/*
5784 * Should only be called by the machine interrupt dispatch routines,
5785 * so put these prototypes here instead of in the header.
5786 *
5787 * XXX we should really have a way to dynamically register SWI handlers.
5788 */
5789
493static u_int bus_generation;
494
495/* Storage for debugging datastructures */
496#ifdef CAMDEBUG
497struct cam_path *cam_dpath;
498u_int32_t cam_dflags;
499#endif
500

--- 5281 unchanged lines hidden (view full) ---

5782
5783/*
5784 * Should only be called by the machine interrupt dispatch routines,
5785 * so put these prototypes here instead of in the header.
5786 *
5787 * XXX we should really have a way to dynamically register SWI handlers.
5788 */
5789
5790void
5790static void
5791swi_camnet()
5792{
5793 camisr(&cam_netq);
5794}
5795
5791swi_camnet()
5792{
5793 camisr(&cam_netq);
5794}
5795
5796void
5796static void
5797swi_cambio()
5798{
5799 camisr(&cam_bioq);
5800}
5801
5802static void
5803camisr(cam_isrq_t *queue)
5804{

--- 97 unchanged lines hidden ---
5797swi_cambio()
5798{
5799 camisr(&cam_bioq);
5800}
5801
5802static void
5803camisr(cam_isrq_t *queue)
5804{

--- 97 unchanged lines hidden ---