summaryrefslogtreecommitdiffstats
path: root/sys/cam/cam_periph.h
diff options
context:
space:
mode:
authorscottl <scottl@FreeBSD.org>2007-04-15 08:49:19 +0000
committerscottl <scottl@FreeBSD.org>2007-04-15 08:49:19 +0000
commit7605c12c0f2bf784960d36288b7cb6e451b99a15 (patch)
tree010146772b36d16e6f98671b4bed7ce094acd633 /sys/cam/cam_periph.h
parent3e3198a9661d5d1c3e35abc313ad0d4688c6eea6 (diff)
downloadFreeBSD-src-7605c12c0f2bf784960d36288b7cb6e451b99a15.zip
FreeBSD-src-7605c12c0f2bf784960d36288b7cb6e451b99a15.tar.gz
Remove Giant from CAM. Drivers (SIMs) now register a mutex that CAM will
use to synchornize and protect all data objects that are used for that SIM. Drivers that are not yet MPSAFE register Giant and operate as usual. RIght now, no drivers are MPSAFE, though a few will be changed in the coming week as this work settles down. The driver API has changed, so all CAM drivers will need to be recompiled. The userland API has not changed, so tools like camcontrol do not need to be recompiled.
Diffstat (limited to 'sys/cam/cam_periph.h')
-rw-r--r--sys/cam/cam_periph.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/cam/cam_periph.h b/sys/cam/cam_periph.h
index c5d02fc..8a6c1eb 100644
--- a/sys/cam/cam_periph.h
+++ b/sys/cam/cam_periph.h
@@ -104,6 +104,7 @@ struct cam_periph {
char *periph_name;
struct cam_path *path; /* Compiled path to device */
void *softc;
+ struct cam_sim *sim;
u_int32_t unit_number;
cam_periph_type type;
u_int32_t flags;
@@ -113,6 +114,7 @@ struct cam_periph {
#define CAM_PERIPH_INVALID 0x08
#define CAM_PERIPH_NEW_DEV_FOUND 0x10
#define CAM_PERIPH_RECOVERY_INPROG 0x20
+#define CAM_PERIPH_POLLED 0x40
u_int32_t immediate_priority;
u_int32_t refcount;
SLIST_HEAD(, ccb_hdr) ccb_list; /* For "immediate" requests */
@@ -136,10 +138,12 @@ cam_status cam_periph_alloc(periph_ctor_t *periph_ctor,
char *name, cam_periph_type type, struct cam_path *,
ac_callback_t *, ac_code, void *arg);
struct cam_periph *cam_periph_find(struct cam_path *path, char *name);
-int cam_periph_lock(struct cam_periph *periph, int priority);
+void cam_periph_lock(struct cam_periph *periph);
void cam_periph_unlock(struct cam_periph *periph);
cam_status cam_periph_acquire(struct cam_periph *periph);
void cam_periph_release(struct cam_periph *periph);
+int cam_periph_hold(struct cam_periph *periph, int priority);
+void cam_periph_unhold(struct cam_periph *periph);
void cam_periph_invalidate(struct cam_periph *periph);
int cam_periph_mapmem(union ccb *ccb,
struct cam_periph_map_info *mapinfo);
OpenPOWER on IntegriCloud