Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 29 Jan 2012 01:40:38 +0000 (UTC)
From:      Marius Strobl <marius@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r230719 - in stable/9/sys/dev: arcmsr hptiop hptmv hptrr
Message-ID:  <201201290140.q0T1ecsY010631@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marius
Date: Sun Jan 29 01:40:37 2012
New Revision: 230719
URL: http://svn.freebsd.org/changeset/base/230719

Log:
  MFC: r227912
  
  - Just use cam_calc_geometry(9) on newer version of FreeBSD rather than
    duplicating it.
  - In hptmv(4) and hptrr(4) use __FBSDID and DEVMETHOD_END.

Modified:
  stable/9/sys/dev/arcmsr/arcmsr.c
  stable/9/sys/dev/hptiop/hptiop.c
  stable/9/sys/dev/hptmv/entry.c
  stable/9/sys/dev/hptrr/hptrr_osm_bsd.c
Directory Properties:
  stable/9/sys/   (props changed)
  stable/9/sys/amd64/include/xen/   (props changed)
  stable/9/sys/boot/   (props changed)
  stable/9/sys/boot/i386/efi/   (props changed)
  stable/9/sys/boot/ia64/efi/   (props changed)
  stable/9/sys/boot/ia64/ski/   (props changed)
  stable/9/sys/boot/powerpc/boot1.chrp/   (props changed)
  stable/9/sys/boot/powerpc/ofw/   (props changed)
  stable/9/sys/cddl/contrib/opensolaris/   (props changed)
  stable/9/sys/conf/   (props changed)
  stable/9/sys/contrib/dev/acpica/   (props changed)
  stable/9/sys/contrib/octeon-sdk/   (props changed)
  stable/9/sys/contrib/pf/   (props changed)
  stable/9/sys/contrib/x86emu/   (props changed)

Modified: stable/9/sys/dev/arcmsr/arcmsr.c
==============================================================================
--- stable/9/sys/dev/arcmsr/arcmsr.c	Sun Jan 29 01:35:14 2012	(r230718)
+++ stable/9/sys/dev/arcmsr/arcmsr.c	Sun Jan 29 01:40:37 2012	(r230719)
@@ -2714,16 +2714,20 @@ static void arcmsr_action(struct cam_sim
 			xpt_done(pccb);
 			break;
 		}
-	case XPT_CALC_GEOMETRY: {
-			struct ccb_calc_geometry *ccg;
-			u_int32_t size_mb;
-			u_int32_t secs_per_cylinder;
-	
+	case XPT_CALC_GEOMETRY:
 			if(pccb->ccb_h.target_id == 16) {
 				pccb->ccb_h.status |= CAM_FUNC_NOTAVAIL;
 				xpt_done(pccb);
 				break;
 			}
+#if __FreeBSD_version >= 500000
+			cam_calc_geometry(&pccb->ccg, 1);
+#else
+			{
+			struct ccb_calc_geometry *ccg;
+			u_int32_t size_mb;
+			u_int32_t secs_per_cylinder;
+
 			ccg= &pccb->ccg;
 			if (ccg->block_size == 0) {
 				pccb->ccb_h.status = CAM_REQ_INVALID;
@@ -2746,9 +2750,10 @@ static void arcmsr_action(struct cam_sim
 			secs_per_cylinder=ccg->heads * ccg->secs_per_track;
 			ccg->cylinders=ccg->volume_size / secs_per_cylinder;
 			pccb->ccb_h.status |= CAM_REQ_CMP;
+			}
+#endif
 			xpt_done(pccb);
 			break;
-		}
 	default:
 		pccb->ccb_h.status |= CAM_REQ_INVALID;
 		xpt_done(pccb);

Modified: stable/9/sys/dev/hptiop/hptiop.c
==============================================================================
--- stable/9/sys/dev/hptiop/hptiop.c	Sun Jan 29 01:35:14 2012	(r230718)
+++ stable/9/sys/dev/hptiop/hptiop.c	Sun Jan 29 01:40:37 2012	(r230719)
@@ -1813,11 +1813,15 @@ scsi_done:
 		break;
 
 	case XPT_CALC_GEOMETRY:
+#if __FreeBSD_version >= 500000
+		cam_calc_geometry(&ccb->ccg, 1);
+#else
 		ccb->ccg.heads = 255;
 		ccb->ccg.secs_per_track = 63;
 		ccb->ccg.cylinders = ccb->ccg.volume_size /
 				(ccb->ccg.heads * ccb->ccg.secs_per_track);
 		ccb->ccb_h.status = CAM_REQ_CMP;
+#endif
 		break;
 
 	case XPT_PATH_INQ:

Modified: stable/9/sys/dev/hptmv/entry.c
==============================================================================
--- stable/9/sys/dev/hptmv/entry.c	Sun Jan 29 01:35:14 2012	(r230718)
+++ stable/9/sys/dev/hptmv/entry.c	Sun Jan 29 01:40:37 2012	(r230719)
@@ -22,9 +22,10 @@
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
- *
- * $FreeBSD$
  */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
  
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -94,7 +95,7 @@ static device_method_t driver_methods[] 
 	DEVMETHOD(device_detach,	hpt_detach),
 
 	DEVMETHOD(device_shutdown,	hpt_shutdown),
-	{ 0, 0 }
+	DEVMETHOD_END
 };
 
 static driver_t hpt_pci_driver = {
@@ -2371,7 +2372,10 @@ hpt_action(struct cam_sim *sim, union cc
 			break;
 
 		case XPT_CALC_GEOMETRY:
-		{
+#if __FreeBSD_version >= 500000
+			cam_calc_geometry(&ccb->ccg, 1);
+#else
+			{
 			struct	  ccb_calc_geometry *ccg;
 			u_int32_t size_mb;
 			u_int32_t secs_per_cylinder;
@@ -2389,9 +2393,10 @@ hpt_action(struct cam_sim *sim, union cc
 			secs_per_cylinder = ccg->heads * ccg->secs_per_track;
 			ccg->cylinders = ccg->volume_size / secs_per_cylinder;
 			ccb->ccb_h.status = CAM_REQ_CMP;
+			}
+#endif
 			xpt_done(ccb);
 			break;
-		}
 
 		case XPT_PATH_INQ:		/* Path routing inquiry */
 		{

Modified: stable/9/sys/dev/hptrr/hptrr_osm_bsd.c
==============================================================================
--- stable/9/sys/dev/hptrr/hptrr_osm_bsd.c	Sun Jan 29 01:35:14 2012	(r230718)
+++ stable/9/sys/dev/hptrr/hptrr_osm_bsd.c	Sun Jan 29 01:40:37 2012	(r230719)
@@ -22,9 +22,11 @@
  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
- *
- * $FreeBSD$
  */
+
+#include <sys/cdefs.h>
+__FBSDID("$FreeBSD$");
+
 #include <dev/hptrr/hptrr_config.h>
 /* $Id: osm_bsd.c,v 1.27 2007/11/22 07:35:49 gmm Exp $
  *
@@ -795,10 +797,14 @@ static void hpt_action(struct cam_sim *s
 		break;
 
 	case XPT_CALC_GEOMETRY:
+#if __FreeBSD_version >= 500000
+		cam_calc_geometry(&ccb->ccg, 1);
+#else
 		ccb->ccg.heads = 255;
 		ccb->ccg.secs_per_track = 63;
 		ccb->ccg.cylinders = ccb->ccg.volume_size / (ccb->ccg.heads * ccb->ccg.secs_per_track);
 		ccb->ccb_h.status = CAM_REQ_CMP;
+#endif
 		break;
 
 	case XPT_PATH_INQ:
@@ -1250,7 +1256,7 @@ static device_method_t driver_methods[] 
 	DEVMETHOD(device_attach,	hpt_attach),
 	DEVMETHOD(device_detach,	hpt_detach),
 	DEVMETHOD(device_shutdown,	hpt_shutdown),
-	{ 0, 0 }
+	DEVMETHOD_END
 };
 
 static driver_t hpt_pci_driver = {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201201290140.q0T1ecsY010631>