diff options
author | njl <njl@FreeBSD.org> | 2003-06-14 22:40:08 +0000 |
---|---|---|
committer | njl <njl@FreeBSD.org> | 2003-06-14 22:40:08 +0000 |
commit | da91abf0c69688c093753f1b711c67b171bc9663 (patch) | |
tree | ef3238677c0d55c4c461d254f365ae961842906e | |
parent | dd7edaa4ded59a9144675c98792e8fe87774489d (diff) | |
download | FreeBSD-src-da91abf0c69688c093753f1b711c67b171bc9663.zip FreeBSD-src-da91abf0c69688c093753f1b711c67b171bc9663.tar.gz |
Merge common XPT_CALC_GEOMETRY functions into a single convenience function.
Devices below may experience a change in geometry.
* umass(4) drives exactly 1 GB in size now no longer use extended geometry.
-rw-r--r-- | sys/dev/usb/umass.c | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/sys/dev/usb/umass.c b/sys/dev/usb/umass.c index d76feb0..5d530f3 100644 --- a/sys/dev/usb/umass.c +++ b/sys/dev/usb/umass.c @@ -2456,25 +2456,7 @@ umass_cam_action(struct cam_sim *sim, union ccb *ccb) } case XPT_CALC_GEOMETRY: { - struct ccb_calc_geometry *ccg = &ccb->ccg; - u_int32_t size_mb; - u_int32_t secs_per_cylinder; - int extended = 1; - - 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; } |