diff options
author | njl <njl@FreeBSD.org> | 2003-06-14 22:17:41 +0000 |
---|---|---|
committer | njl <njl@FreeBSD.org> | 2003-06-14 22:17:41 +0000 |
commit | ea1ca84312e2a8d2a9c99abe3678a2f10ea13fab (patch) | |
tree | 366938aa2e5b41ac39ddf11517f3ef5a83c02a20 /sys/dev/trm/trm.c | |
parent | b184633199beba93ad13f46cf12a67fbaa20ad06 (diff) | |
download | FreeBSD-src-ea1ca84312e2a8d2a9c99abe3678a2f10ea13fab.zip FreeBSD-src-ea1ca84312e2a8d2a9c99abe3678a2f10ea13fab.tar.gz |
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
Diffstat (limited to 'sys/dev/trm/trm.c')
-rw-r--r-- | sys/dev/trm/trm.c | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/sys/dev/trm/trm.c b/sys/dev/trm/trm.c index 6e3fb7a..dda9e87 100644 --- a/sys/dev/trm/trm.c +++ b/sys/dev/trm/trm.c @@ -984,29 +984,10 @@ trm_action(struct cam_sim *psim, union ccb *pccb) * Calculate the geometry parameters for a device give * the sector size and volume size. */ - case XPT_CALC_GEOMETRY: { - struct ccb_calc_geometry *ccg; - u_int32_t size_mb; - u_int32_t secs_per_cylinder; - int extended; - + case XPT_CALC_GEOMETRY: TRM_DPRINTF(" XPT_CALC_GEOMETRY \n"); - ccg = &pccb->ccg; - size_mb = ccg->volume_size / - ((1024L * 1024L) / ccg->block_size); - extended = 1; - 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; - pccb->ccb_h.status = CAM_REQ_CMP; + cam_calc_geometry(&pccb->ccg, /*extended*/1); xpt_done(pccb); - } break; case XPT_ENG_INQ: TRM_DPRINTF(" XPT_ENG_INQ \n"); |