PERFORCE change 119301 for review

Matt Jacob mjacob at FreeBSD.org
Sat May 5 20:14:51 UTC 2007


http://perforce.freebsd.org/chv.cgi?CH=119301

Change 119301 by mjacob at mjexp on 2007/05/05 20:14:46

	Make this a multi-release (RELENG_4 through -current) again.

Affected files ...

.. //depot/projects/mjexp/sys/dev/mpt/mpt.h#12 edit
.. //depot/projects/mjexp/sys/dev/mpt/mpt_cam.c#21 edit
.. //depot/projects/mjexp/sys/dev/mpt/mpt_cam.h#4 edit
.. //depot/projects/mjexp/sys/dev/mpt/mpt_raid.c#6 edit

Differences ...

==== //depot/projects/mjexp/sys/dev/mpt/mpt.h#12 (text+ko) ====

@@ -109,6 +109,7 @@
 #include <sys/kernel.h>
 #include <sys/queue.h>
 #include <sys/malloc.h>
+#include <sys/devicestat.h>
 #else
 #include <sys/lock.h>
 #include <sys/kernel.h>
@@ -795,6 +796,13 @@
 	return (error);
 }
 
+#define mpt_req_timeout(req, ticks, func, arg) \
+	callout_reset(&(req)->callout, (ticks), (func), (arg));
+#define mpt_req_untimeout(req, func, arg) \
+	callout_stop(&(req)->callout)
+#define mpt_req_timeout_init(req) \
+	callout_init(&(req)->callout)
+
 #else
 #if 1
 #define	MPT_IFLAGS		INTR_TYPE_CAM | INTR_ENTROPY | INTR_MPSAFE

==== //depot/projects/mjexp/sys/dev/mpt/mpt_cam.c#21 (text+ko) ====

@@ -317,8 +317,8 @@
 	/*
 	 * Construct our SIM entry.
 	 */
-	mpt->sim = cam_sim_alloc(mpt_action, mpt_poll, "mpt", mpt,
-	    mpt->unit, &mpt->mpt_lock, 1, maxq, devq);
+	mpt->sim =
+	    mpt_sim_alloc(mpt_action, mpt_poll, "mpt", mpt, 1, maxq, devq);
 	if (mpt->sim == NULL) {
 		mpt_prt(mpt, "Unable to allocate CAM SIM!\n");
 		cam_simq_free(devq);
@@ -357,8 +357,8 @@
 	/*
 	 * Create a "bus" to export all hidden disks to CAM.
 	 */
-	mpt->phydisk_sim = cam_sim_alloc(mpt_action, mpt_poll, "mpt", mpt,
-	    mpt->unit, &mpt->mpt_lock, 1, maxq, devq);
+	mpt->phydisk_sim =
+	    mpt_sim_alloc(mpt_action, mpt_poll, "mpt", mpt, 1, maxq, devq);
 	if (mpt->phydisk_sim == NULL) {
 		mpt_prt(mpt, "Unable to allocate Physical Disk CAM SIM!\n");
 		error = ENOMEM;

==== //depot/projects/mjexp/sys/dev/mpt/mpt_cam.h#4 (text+ko) ====

@@ -143,4 +143,12 @@
 	wakeup(mpt);
 }
 
+/************************** Version Compatibility *************************/
+#if	__FreeBSD_version < 700031
+#define	mpt_sim_alloc(a, b, c, mpt, e, f, g)	\
+	cam_sim_alloc(a, b, c, mpt, (mpt)->unit, e, f, g)
+#else
+#define	mpt_sim_alloc(a, b, c, mpt, e, f, g)	\
+	cam_sim_alloc(a, b, c, mpt, (mpt)->unit, &(mpt)->mpt_lock, e, f, g)
+#endif
 #endif /*_MPT_CAM_H_ */

==== //depot/projects/mjexp/sys/dev/mpt/mpt_raid.c#6 (text+ko) ====

@@ -116,12 +116,14 @@
 static void mpt_enable_vol(struct mpt_softc *mpt,
 			   struct mpt_raid_volume *mpt_vol, int enable);
 #endif
-static void mpt_verify_mwce(struct mpt_softc *mpt,
-			    struct mpt_raid_volume *mpt_vol);
-static void mpt_adjust_queue_depth(struct mpt_softc *mpt,
-				   struct mpt_raid_volume *mpt_vol,
-				   struct cam_path *path);
-static void mpt_raid_sysctl_attach(struct mpt_softc *mpt);
+static void mpt_verify_mwce(struct mpt_softc *, struct mpt_raid_volume *);
+static void mpt_adjust_queue_depth(struct mpt_softc *, struct mpt_raid_volume *,
+    struct cam_path *);
+#if __FreeBSD_version < 500000
+#define	mpt_raid_sysctl_attach(x)	do { } while (0)
+#else
+static void mpt_raid_sysctl_attach(struct mpt_softc *);
+#endif
 
 static uint32_t raid_handler_id = MPT_HANDLER_ID_NONE;
 
@@ -1604,6 +1606,7 @@
 	mpt->raid_max_disks =  0;
 }
 
+#if __FreeBSD_version >= 500000
 static int
 mpt_raid_set_vol_resync_rate(struct mpt_softc *mpt, u_int rate)
 {
@@ -1717,7 +1720,6 @@
 	MPT_UNLOCK(mpt);
 	return (0);
 }
-
 const char *mpt_vol_mwce_strs[] =
 {
 	"On",
@@ -1806,7 +1808,6 @@
 static void
 mpt_raid_sysctl_attach(struct mpt_softc *mpt)
 {
-#if __FreeBSD_version >= 500000
 	struct sysctl_ctx_list *ctx = device_get_sysctl_ctx(mpt->dev);
 	struct sysctl_oid *tree = device_get_sysctl_tree(mpt->dev);
 
@@ -1828,5 +1829,5 @@
 			"nonoptimal_volumes", CTLFLAG_RD,
 			&mpt->raid_nonopt_volumes, 0,
 			"number of nonoptimal volumes");
+}
 #endif
-}


More information about the p4-projects mailing list