1/*-
2 * Data structures and definitions for CAM peripheral ("type") drivers.
3 *
4 * Copyright (c) 1997, 1998 Justin T. Gibbs.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
--- 11 unchanged lines hidden (view full) ---
20 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
28 * $FreeBSD: head/sys/cam/cam_periph.h 168752 2007-04-15 08:49:19Z scottl $
29 */
30
31#ifndef _CAM_CAM_PERIPH_H
32#define _CAM_CAM_PERIPH_H 1
33
34#include <sys/queue.h>
35
36#ifdef _KERNEL
--- 62 unchanged lines hidden (view full) ---
99struct cam_periph {
100 cam_pinfo pinfo;
101 periph_start_t *periph_start;
102 periph_oninv_t *periph_oninval;
103 periph_dtor_t *periph_dtor;
104 char *periph_name;
105 struct cam_path *path; /* Compiled path to device */
106 void *softc;
107 struct cam_sim *sim;
108 u_int32_t unit_number;
109 cam_periph_type type;
110 u_int32_t flags;
111#define CAM_PERIPH_RUNNING 0x01
112#define CAM_PERIPH_LOCKED 0x02
113#define CAM_PERIPH_LOCK_WANTED 0x04
114#define CAM_PERIPH_INVALID 0x08
115#define CAM_PERIPH_NEW_DEV_FOUND 0x10
116#define CAM_PERIPH_RECOVERY_INPROG 0x20
117#define CAM_PERIPH_POLLED 0x40
118 u_int32_t immediate_priority;
119 u_int32_t refcount;
120 SLIST_HEAD(, ccb_hdr) ccb_list; /* For "immediate" requests */
121 SLIST_ENTRY(cam_periph) periph_links;
122 TAILQ_ENTRY(cam_periph) unit_links;
123 ac_callback_t *deferred_callback;
124 ac_code deferred_ac;
125};
--- 7 unchanged lines hidden (view full) ---
133
134cam_status cam_periph_alloc(periph_ctor_t *periph_ctor,
135 periph_oninv_t *periph_oninvalidate,
136 periph_dtor_t *periph_dtor,
137 periph_start_t *periph_start,
138 char *name, cam_periph_type type, struct cam_path *,
139 ac_callback_t *, ac_code, void *arg);
140struct cam_periph *cam_periph_find(struct cam_path *path, char *name);
141void cam_periph_lock(struct cam_periph *periph);
142void cam_periph_unlock(struct cam_periph *periph);
143cam_status cam_periph_acquire(struct cam_periph *periph);
144void cam_periph_release(struct cam_periph *periph);
145int cam_periph_hold(struct cam_periph *periph, int priority);
146void cam_periph_unhold(struct cam_periph *periph);
147void cam_periph_invalidate(struct cam_periph *periph);
148int cam_periph_mapmem(union ccb *ccb,
149 struct cam_periph_map_info *mapinfo);
150void cam_periph_unmapmem(union ccb *ccb,
151 struct cam_periph_map_info *mapinfo);
152union ccb *cam_periph_getccb(struct cam_periph *periph,
153 u_int32_t priority);
154void cam_periph_ccbwait(union ccb *ccb);
--- 27 unchanged lines hidden ---
2 * Data structures and definitions for CAM peripheral ("type") drivers.
3 *
4 * Copyright (c) 1997, 1998 Justin T. Gibbs.
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions
--- 11 unchanged lines hidden (view full) ---
20 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 *
28 * $FreeBSD: head/sys/cam/cam_periph.h 168752 2007-04-15 08:49:19Z scottl $
29 */
30
31#ifndef _CAM_CAM_PERIPH_H
32#define _CAM_CAM_PERIPH_H 1
33
34#include <sys/queue.h>
35
36#ifdef _KERNEL
--- 62 unchanged lines hidden (view full) ---
99struct cam_periph {
100 cam_pinfo pinfo;
101 periph_start_t *periph_start;
102 periph_oninv_t *periph_oninval;
103 periph_dtor_t *periph_dtor;
104 char *periph_name;
105 struct cam_path *path; /* Compiled path to device */
106 void *softc;
107 struct cam_sim *sim;
108 u_int32_t unit_number;
109 cam_periph_type type;
110 u_int32_t flags;
111#define CAM_PERIPH_RUNNING 0x01
112#define CAM_PERIPH_LOCKED 0x02
113#define CAM_PERIPH_LOCK_WANTED 0x04
114#define CAM_PERIPH_INVALID 0x08
115#define CAM_PERIPH_NEW_DEV_FOUND 0x10
116#define CAM_PERIPH_RECOVERY_INPROG 0x20
117#define CAM_PERIPH_POLLED 0x40
118 u_int32_t immediate_priority;
119 u_int32_t refcount;
120 SLIST_HEAD(, ccb_hdr) ccb_list; /* For "immediate" requests */
121 SLIST_ENTRY(cam_periph) periph_links;
122 TAILQ_ENTRY(cam_periph) unit_links;
123 ac_callback_t *deferred_callback;
124 ac_code deferred_ac;
125};
--- 7 unchanged lines hidden (view full) ---
133
134cam_status cam_periph_alloc(periph_ctor_t *periph_ctor,
135 periph_oninv_t *periph_oninvalidate,
136 periph_dtor_t *periph_dtor,
137 periph_start_t *periph_start,
138 char *name, cam_periph_type type, struct cam_path *,
139 ac_callback_t *, ac_code, void *arg);
140struct cam_periph *cam_periph_find(struct cam_path *path, char *name);
141void cam_periph_lock(struct cam_periph *periph);
142void cam_periph_unlock(struct cam_periph *periph);
143cam_status cam_periph_acquire(struct cam_periph *periph);
144void cam_periph_release(struct cam_periph *periph);
145int cam_periph_hold(struct cam_periph *periph, int priority);
146void cam_periph_unhold(struct cam_periph *periph);
147void cam_periph_invalidate(struct cam_periph *periph);
148int cam_periph_mapmem(union ccb *ccb,
149 struct cam_periph_map_info *mapinfo);
150void cam_periph_unmapmem(union ccb *ccb,
151 struct cam_periph_map_info *mapinfo);
152union ccb *cam_periph_getccb(struct cam_periph *periph,
153 u_int32_t priority);
154void cam_periph_ccbwait(union ccb *ccb);
--- 27 unchanged lines hidden ---