diff options
Diffstat (limited to 'sys/dev/arcmsr/arcmsr.c')
-rw-r--r-- | sys/dev/arcmsr/arcmsr.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/sys/dev/arcmsr/arcmsr.c b/sys/dev/arcmsr/arcmsr.c index b672176..9fde306 100644 --- a/sys/dev/arcmsr/arcmsr.c +++ b/sys/dev/arcmsr/arcmsr.c @@ -2714,16 +2714,20 @@ static void arcmsr_action(struct cam_sim * psim, union ccb * pccb) xpt_done(pccb); break; } - case XPT_CALC_GEOMETRY: { - struct ccb_calc_geometry *ccg; - u_int32_t size_mb; - u_int32_t secs_per_cylinder; - + case XPT_CALC_GEOMETRY: if(pccb->ccb_h.target_id == 16) { pccb->ccb_h.status |= CAM_FUNC_NOTAVAIL; xpt_done(pccb); break; } +#if __FreeBSD_version >= 500000 + cam_calc_geometry(&pccb->ccg, 1); +#else + { + struct ccb_calc_geometry *ccg; + u_int32_t size_mb; + u_int32_t secs_per_cylinder; + ccg= &pccb->ccg; if (ccg->block_size == 0) { pccb->ccb_h.status = CAM_REQ_INVALID; @@ -2746,9 +2750,10 @@ static void arcmsr_action(struct cam_sim * psim, union ccb * pccb) secs_per_cylinder=ccg->heads * ccg->secs_per_track; ccg->cylinders=ccg->volume_size / secs_per_cylinder; pccb->ccb_h.status |= CAM_REQ_CMP; + } +#endif xpt_done(pccb); break; - } default: pccb->ccb_h.status |= CAM_REQ_INVALID; xpt_done(pccb); |