From 1b526f4392b6f5cbb719fed0bc2a79425273b610 Mon Sep 17 00:00:00 2001 From: pavalos Date: Tue, 3 Jul 2007 20:55:42 +0000 Subject: [PATCH] Convert to use cam_calc_geometry(). Obtained-from: FreeBSD --- sys/dev/disk/aic7xxx/aic79xx_osm.c | 22 +++------------------- sys/dev/disk/aic7xxx/aic7xxx_osm.c | 22 +++------------------- 2 files changed, 6 insertions(+), 38 deletions(-) diff --git a/sys/dev/disk/aic7xxx/aic79xx_osm.c b/sys/dev/disk/aic7xxx/aic79xx_osm.c index 69a0431595..9d20c67dc8 100644 --- a/sys/dev/disk/aic7xxx/aic79xx_osm.c +++ b/sys/dev/disk/aic7xxx/aic79xx_osm.c @@ -31,8 +31,8 @@ * * $Id: //depot/aic7xxx/freebsd/dev/aic7xxx/aic79xx_osm.c#27 $ * - * $FreeBSD: src/sys/dev/aic7xxx/aic79xx_osm.c,v 1.3.2.4 2003/06/10 03:26:07 gibbs Exp $ - * $DragonFly: src/sys/dev/disk/aic7xxx/aic79xx_osm.c,v 1.13 2007/06/04 17:21:55 dillon Exp $ + * $FreeBSD: src/sys/dev/aic7xxx/aic79xx_osm.c,v 1.14 2003/06/14 22:17:39 njl Exp $ + * $DragonFly: src/sys/dev/disk/aic7xxx/aic79xx_osm.c,v 1.14 2007/07/03 20:55:42 pavalos Exp $ */ #include "aic79xx_osm.h" @@ -539,26 +539,10 @@ ahd_action(struct cam_sim *sim, union ccb *ccb) } case XPT_CALC_GEOMETRY: { - struct ccb_calc_geometry *ccg; - uint32_t size_mb; - uint32_t secs_per_cylinder; int extended; - ccg = &ccb->ccg; - size_mb = ccg->volume_size - / ((1024L * 1024L) / ccg->block_size); extended = ahd->flags & AHD_EXTENDED_TRANS_A; - - if (size_mb > 1024 && extended) { - ccg->heads = 255; - ccg->secs_per_track = 63; - } else { - ccg->heads = 64; - ccg->secs_per_track = 32; - } - secs_per_cylinder = ccg->heads * ccg->secs_per_track; - ccg->cylinders = ccg->volume_size / secs_per_cylinder; - ccb->ccb_h.status = CAM_REQ_CMP; + cam_calc_geometry(&ccb->ccg, extended); xpt_done(ccb); break; } diff --git a/sys/dev/disk/aic7xxx/aic7xxx_osm.c b/sys/dev/disk/aic7xxx/aic7xxx_osm.c index 1fa47e104b..822c853c82 100644 --- a/sys/dev/disk/aic7xxx/aic7xxx_osm.c +++ b/sys/dev/disk/aic7xxx/aic7xxx_osm.c @@ -30,8 +30,8 @@ * * $Id: //depot/aic7xxx/freebsd/dev/aic7xxx/aic7xxx_osm.c#13 $ * - * $FreeBSD: src/sys/dev/aic7xxx/aic7xxx_osm.c,v 1.27.2.6 2003/06/10 03:26:09 gibbs Exp $ - * $DragonFly: src/sys/dev/disk/aic7xxx/aic7xxx_osm.c,v 1.13 2007/06/04 17:21:55 dillon Exp $ + * $FreeBSD: src/sys/dev/aic7xxx/aic7xxx_osm.c,v 1.37 2003/06/14 22:17:39 njl Exp $ + * $DragonFly: src/sys/dev/disk/aic7xxx/aic7xxx_osm.c,v 1.14 2007/07/03 20:55:42 pavalos Exp $ */ #include "aic7xxx_osm.h" @@ -807,28 +807,12 @@ ahc_action(struct cam_sim *sim, union ccb *ccb) } case XPT_CALC_GEOMETRY: { - struct ccb_calc_geometry *ccg; - uint32_t size_mb; - uint32_t secs_per_cylinder; int extended; - ccg = &ccb->ccg; - size_mb = ccg->volume_size - / ((1024L * 1024L) / ccg->block_size); extended = SIM_IS_SCSIBUS_B(ahc, sim) ? ahc->flags & AHC_EXTENDED_TRANS_B : ahc->flags & AHC_EXTENDED_TRANS_A; - - if (size_mb > 1024 && extended) { - ccg->heads = 255; - ccg->secs_per_track = 63; - } else { - ccg->heads = 64; - ccg->secs_per_track = 32; - } - secs_per_cylinder = ccg->heads * ccg->secs_per_track; - ccg->cylinders = ccg->volume_size / secs_per_cylinder; - ccb->ccb_h.status = CAM_REQ_CMP; + cam_calc_geometry(&ccb->ccg, extended); xpt_done(ccb); break; } -- 2.11.4.GIT