From owner-p4-projects@FreeBSD.ORG Sat May 5 20:14:51 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 7D65116A46C; Sat, 5 May 2007 20:14:51 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 2C43716A4EE for ; Sat, 5 May 2007 20:14:51 +0000 (UTC) (envelope-from mjacob@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.freebsd.org (Postfix) with ESMTP id 1C81713C447 for ; Sat, 5 May 2007 20:14:51 +0000 (UTC) (envelope-from mjacob@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.8/8.13.8) with ESMTP id l45KEofF082888 for ; Sat, 5 May 2007 20:14:51 GMT (envelope-from mjacob@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.13.8/8.13.8/Submit) id l45KEoMf082884 for perforce@freebsd.org; Sat, 5 May 2007 20:14:50 GMT (envelope-from mjacob@freebsd.org) Date: Sat, 5 May 2007 20:14:50 GMT Message-Id: <200705052014.l45KEoMf082884@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to mjacob@freebsd.org using -f From: Matt Jacob To: Perforce Change Reviews Cc: Subject: PERFORCE change 119301 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 05 May 2007 20:14:51 -0000 http://perforce.freebsd.org/chv.cgi?CH=119301 Change 119301 by mjacob@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 #include #include +#include #else #include #include @@ -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 -}