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.
This commit is contained in:
parent
9ed30b5853
commit
c7bbca402a
@ -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;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user