From ea1ca84312e2a8d2a9c99abe3678a2f10ea13fab Mon Sep 17 00:00:00 2001 From: njl Date: Sat, 14 Jun 2003 22:17:41 +0000 Subject: Merge common XPT_CALC_GEOMETRY functions into a single convenience function. Devices below may experience a change in geometry. * Due to a bug, aic(4) never used extended geometry. Changes all drives >1G to now use extended translation. * sbp(4) drives exactly 1 GB in size now no longer use extended geometry. * umass(4) drives exactly 1 GB in size now no longer use extended geometry. For all other controllers in this commit, this should be a no-op. Looked over by: scottl --- sys/pci/ncr.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) (limited to 'sys/pci/ncr.c') diff --git a/sys/pci/ncr.c b/sys/pci/ncr.c index df616c1..ca121f2 100644 --- a/sys/pci/ncr.c +++ b/sys/pci/ncr.c @@ -4334,30 +4334,11 @@ ncr_action (struct cam_sim *sim, union ccb *ccb) } case XPT_CALC_GEOMETRY: { - struct ccb_calc_geometry *ccg; - u_int32_t size_mb; - u_int32_t secs_per_cylinder; - int extended; - /* XXX JGibbs - I'm sure the NCR uses a different strategy, * but it should be able to deal with Adaptec * geometry too. */ - extended = 1; - ccg = &ccb->ccg; - size_mb = ccg->volume_size - / ((1024L * 1024L) / ccg->block_size); - - 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*/1); xpt_done(ccb); break; } -- cgit v1.1