PATCH: merge calc geometry calls into convenience function
Nate Lawson
nate at root.org
Fri May 16 10:57:08 PDT 2003
Left out of this are aha(4) and bt(4) although they probably should be
added. They use a 2G/1G/<1G scheme.
---
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.
---
Index: sys/cam/cam.c
===================================================================
RCS file: /home/ncvs/src/sys/cam/cam.c,v
retrieving revision 1.5
diff -u -r1.5 cam.c
--- sys/cam/cam.c 9 Jan 2002 03:38:58 -0000 1.5
+++ sys/cam/cam.c 14 May 2003 22:16:17 -0000
@@ -358,3 +358,28 @@
}
#endif /* _KERNEL/!_KERNEL */
+
+/*
+ * Common calculate geometry fuction
+ *
+ * Caller should set ccg->volume_size and block_size.
+ * The extended parameter should be zero if extended translation
+ * should not be used.
+ */
+void
+cam_calc_geometry(struct ccb_calc_geometry *ccg, int extended)
+{
+ uint32_t size_mb, secs_per_cylinder;
+
+ 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;
+ ccg->ccb_h.status = CAM_REQ_CMP;
+}
Index: sys/cam/cam_ccb.h
===================================================================
RCS file: /home/ncvs/src/sys/cam/cam_ccb.h,v
retrieving revision 1.23
diff -u -r1.23 cam_ccb.h
--- sys/cam/cam_ccb.h 29 Apr 2003 13:35:58 -0000 1.23
+++ sys/cam/cam_ccb.h 14 May 2003 22:46:49 -0000
@@ -794,6 +794,7 @@
u_int8_t heads;
u_int8_t secs_per_track;
};
+void cam_calc_geometry(struct ccb_calc_geometry *ccg, int extended);
/*
* Rescan the given bus, or bus/target/lun
Index: sys/cam/scsi/scsi_low.c
===================================================================
RCS file: /home/ncvs/src/sys/cam/scsi/scsi_low.c,v
retrieving revision 1.19
diff -u -r1.19 scsi_low.c
--- sys/cam/scsi/scsi_low.c 8 Mar 2003 08:01:26 -0000 1.19
+++ sys/cam/scsi/scsi_low.c 16 May 2003 01:45:45 -0000
@@ -1282,26 +1282,7 @@
}
case XPT_CALC_GEOMETRY: { /* not yet HN2 */
- struct ccb_calc_geometry *ccg;
- u_int32_t size_mb;
- u_int32_t secs_per_cylinder;
- int extended;
-
- 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;
}
Index: sys/dev/advansys/advansys.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/advansys/advansys.c,v
retrieving revision 1.23
diff -u -r1.23 advansys.c
--- sys/dev/advansys/advansys.c 10 Apr 2003 23:50:05 -0000 1.23
+++ sys/dev/advansys/advansys.c 16 May 2003 01:46:37 -0000
@@ -431,26 +431,10 @@
}
case XPT_CALC_GEOMETRY:
{
- struct ccb_calc_geometry *ccg;
- u_int32_t size_mb;
- u_int32_t secs_per_cylinder;
int extended;
- ccg = &ccb->ccg;
- size_mb = ccg->volume_size
- / ((1024L * 1024L) / ccg->block_size);
extended = (adv->control & ADV_CNTL_BIOS_GT_1GB) != 0;
-
- 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);
xpt_done(ccb);
break;
}
Index: sys/dev/advansys/adwcam.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/advansys/adwcam.c,v
retrieving revision 1.14
diff -u -r1.14 adwcam.c
--- sys/dev/advansys/adwcam.c 10 Apr 2003 23:50:05 -0000 1.14
+++ sys/dev/advansys/adwcam.c 16 May 2003 01:47:03 -0000
@@ -724,30 +724,11 @@
}
case XPT_CALC_GEOMETRY:
{
- struct ccb_calc_geometry *ccg;
- u_int32_t size_mb;
- u_int32_t secs_per_cylinder;
- int extended;
-
/*
* XXX Use Adaptec translation until I find out how to
* get this information from the card.
*/
- ccg = &ccb->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;
- ccb->ccb_h.status = CAM_REQ_CMP;
+ cam_calc_geometry(&ccb->ccg, /*extended*/1);
xpt_done(ccb);
break;
}
Index: sys/dev/ahb/ahb.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/ahb/ahb.c,v
retrieving revision 1.27
diff -u -r1.27 ahb.c
--- sys/dev/ahb/ahb.c 10 Apr 2003 23:50:05 -0000 1.27
+++ sys/dev/ahb/ahb.c 16 May 2003 07:36:31 -0000
@@ -1171,24 +1171,7 @@
}
case XPT_CALC_GEOMETRY:
{
- struct ccb_calc_geometry *ccg;
- u_int32_t size_mb;
- u_int32_t secs_per_cylinder;
-
- ccg = &ccb->ccg;
- size_mb = ccg->volume_size
- / ((1024L * 1024L) / ccg->block_size);
-
- if (size_mb > 1024 && (ahb->extended_trans != 0)) {
- 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, ahb->extended_trans);
xpt_done(ccb);
break;
}
Index: sys/dev/aic/aic.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/aic/aic.c,v
retrieving revision 1.18
diff -u -r1.18 aic.c
--- sys/dev/aic/aic.c 28 Sep 2002 17:14:21 -0000 1.18
+++ sys/dev/aic/aic.c 16 May 2003 07:53:15 -0000
@@ -254,25 +254,7 @@
}
case XPT_CALC_GEOMETRY:
{
- struct ccb_calc_geometry *ccg;
- u_int32_t size_mb;
- u_int32_t secs_per_cylinder;
- int extended = 0;
-
- 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;
}
Index: sys/dev/aic7xxx/aic79xx_osm.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/aic7xxx/aic79xx_osm.c,v
retrieving revision 1.10
diff -u -r1.10 aic79xx_osm.c
--- sys/dev/aic7xxx/aic79xx_osm.c 10 Apr 2003 23:50:05 -0000 1.10
+++ sys/dev/aic7xxx/aic79xx_osm.c 16 May 2003 01:49:46 -0000
@@ -550,26 +550,10 @@
}
case XPT_CALC_GEOMETRY:
{
- struct ccb_calc_geometry *ccg;
- uint32_t size_mb;
- uint32_t secs_per_cylinder;
int extended;
- ccg = &ccb->ccg;
- size_mb = ccg->volume_size
- / ((1024L * 1024L) / ccg->block_size);
extended = ahd->flags & AHD_EXTENDED_TRANS_A;
-
- 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);
xpt_done(ccb);
break;
}
Index: sys/dev/aic7xxx/aic7xxx_osm.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/aic7xxx/aic7xxx_osm.c,v
retrieving revision 1.33
diff -u -r1.33 aic7xxx_osm.c
--- sys/dev/aic7xxx/aic7xxx_osm.c 10 Apr 2003 23:50:05 -0000 1.33
+++ sys/dev/aic7xxx/aic7xxx_osm.c 14 May 2003 22:16:43 -0000
@@ -819,28 +819,12 @@
}
case XPT_CALC_GEOMETRY:
{
- struct ccb_calc_geometry *ccg;
- uint32_t size_mb;
- uint32_t secs_per_cylinder;
int extended;
- ccg = &ccb->ccg;
- size_mb = ccg->volume_size
- / ((1024L * 1024L) / ccg->block_size);
extended = SIM_IS_SCSIBUS_B(ahc, sim)
? ahc->flags & AHC_EXTENDED_TRANS_B
: ahc->flags & AHC_EXTENDED_TRANS_A;
-
- 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);
xpt_done(ccb);
break;
}
Index: sys/dev/amr/amr_cam.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/amr/amr_cam.c,v
retrieving revision 1.7
diff -u -r1.7 amr_cam.c
--- sys/dev/amr/amr_cam.c 1 Apr 2003 15:06:22 -0000 1.7
+++ sys/dev/amr/amr_cam.c 16 May 2003 01:51:17 -0000
@@ -265,22 +265,7 @@
case XPT_CALC_GEOMETRY:
{
- struct ccb_calc_geometry *ccg = &ccb->ccg;
- u_int32_t size_in_mb;
- u_int32_t secs_per_cylinder;
-
- size_in_mb = ccg->volume_size / ((1024L * 1024L) / ccg->block_size);
-
- if (size_in_mb > 1024) {
- 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);
break;
}
Index: sys/dev/ata/atapi-cam.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/ata/atapi-cam.c,v
retrieving revision 1.15
diff -u -r1.15 atapi-cam.c
--- sys/dev/ata/atapi-cam.c 8 Mar 2003 08:01:28 -0000 1.15
+++ sys/dev/ata/atapi-cam.c 16 May 2003 01:52:04 -0000
@@ -323,26 +323,8 @@
}
case XPT_CALC_GEOMETRY: {
- struct ccb_calc_geometry *ccg;
- unsigned int size_mb;
- unsigned int secs_per_cylinder;
- int extended;
-
CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_SUBTRACE, ("CALC_GEOMETRY\n"));
- ccg = &ccb->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;
- ccb->ccb_h.status = CAM_REQ_CMP;
+ cam_calc_geometry(&ccb->ccg, /*extended*/1);
xpt_done(ccb);
return;
}
Index: sys/dev/dpt/dpt_scsi.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/dpt/dpt_scsi.c,v
retrieving revision 1.41
diff -u -r1.41 dpt_scsi.c
--- sys/dev/dpt/dpt_scsi.c 10 Apr 2003 23:50:05 -0000 1.41
+++ sys/dev/dpt/dpt_scsi.c 16 May 2003 01:53:27 -0000
@@ -1034,30 +1034,11 @@
}
case XPT_CALC_GEOMETRY:
{
- struct ccb_calc_geometry *ccg;
- u_int32_t size_mb;
- u_int32_t secs_per_cylinder;
- int extended;
-
/*
* XXX Use Adaptec translation until I find out how to
* get this information from the card.
*/
- ccg = &ccb->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;
- ccb->ccb_h.status = CAM_REQ_CMP;
+ cam_calc_geometry(&ccb->ccg, /*extended*/1);
xpt_done(ccb);
break;
}
Index: sys/dev/firewire/sbp.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/firewire/sbp.c,v
retrieving revision 1.43
diff -u -r1.43 sbp.c
--- sys/dev/firewire/sbp.c 24 Apr 2003 15:27:06 -0000 1.43
+++ sys/dev/firewire/sbp.c 16 May 2003 01:54:46 -0000
@@ -2222,11 +2222,8 @@
case XPT_CALC_GEOMETRY:
{
struct ccb_calc_geometry *ccg;
- u_int32_t size_mb;
- u_int32_t secs_per_cylinder;
- int extended = 1;
- ccg = &ccb->ccg;
+ ccg = &ccb->ccg;
if (ccg->block_size == 0) {
printf("sbp_action1: block_size is 0.\n");
ccb->ccb_h.status = CAM_REQ_INVALID;
@@ -2241,19 +2238,7 @@
ccg->volume_size);
END_DEBUG
- 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(ccg, /*extended*/1);
xpt_done(ccb);
break;
}
Index: sys/dev/isp/isp_freebsd.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/isp/isp_freebsd.c,v
retrieving revision 1.89
diff -u -r1.89 isp_freebsd.c
--- sys/dev/isp/isp_freebsd.c 3 Mar 2003 12:15:42 -0000 1.89
+++ sys/dev/isp/isp_freebsd.c 16 May 2003 07:48:13 -0000
@@ -2532,8 +2532,6 @@
case XPT_CALC_GEOMETRY:
{
struct ccb_calc_geometry *ccg;
- u_int32_t secs_per_cylinder;
- u_int32_t size_mb;
ccg = &ccb->ccg;
if (ccg->block_size == 0) {
@@ -2544,17 +2542,7 @@
xpt_done(ccb);
break;
}
- size_mb = ccg->volume_size /((1024L * 1024L) / ccg->block_size);
- if (size_mb > 1024) {
- 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(ccg, /*extended*/1);
xpt_done(ccb);
break;
}
Index: sys/dev/mpt/mpt_freebsd.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/mpt/mpt_freebsd.c,v
retrieving revision 1.9
diff -u -r1.9 mpt_freebsd.c
--- sys/dev/mpt/mpt_freebsd.c 10 Apr 2003 23:50:06 -0000 1.9
+++ sys/dev/mpt/mpt_freebsd.c 16 May 2003 01:55:52 -0000
@@ -1399,8 +1399,6 @@
case XPT_CALC_GEOMETRY:
{
struct ccb_calc_geometry *ccg;
- u_int32_t secs_per_cylinder;
- u_int32_t size_mb;
ccg = &ccb->ccg;
if (ccg->block_size == 0) {
@@ -1409,17 +1407,7 @@
break;
}
- size_mb = ccg->volume_size /((1024L * 1024L) / ccg->block_size);
- if (size_mb > 1024) {
- 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(ccg, /*extended*/1);
xpt_done(ccb);
break;
}
Index: sys/dev/trm/trm.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/trm/trm.c,v
retrieving revision 1.7
diff -u -r1.7 trm.c
--- sys/dev/trm/trm.c 10 Apr 2003 23:50:06 -0000 1.7
+++ sys/dev/trm/trm.c 16 May 2003 01:57:06 -0000
@@ -984,29 +984,10 @@
* 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");
Index: sys/dev/amd/amd.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/amd/amd.c,v
retrieving revision 1.17
diff -u -r1.17 amd.c
--- sys/dev/amd/amd.c 10 Apr 2003 23:50:05 -0000 1.17
+++ sys/dev/amd/amd.c 16 May 2003 07:39:05 -0000
@@ -680,25 +680,10 @@
}
case XPT_CALC_GEOMETRY:
{
- struct ccb_calc_geometry *ccg;
- u_int32_t size_mb;
- u_int32_t secs_per_cylinder;
int extended;
- ccg = &pccb->ccg;
- size_mb = ccg->volume_size/((1024L * 1024L)/ccg->block_size);
extended = (amd->eepromBuf[EE_MODE2] & GREATER_1G) != 0;
-
- 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);
xpt_done(pccb);
break;
}
Index: sys/dev/sym/sym_hipd.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/sym/sym_hipd.c,v
retrieving revision 1.40
diff -u -r1.40 sym_hipd.c
--- sys/dev/sym/sym_hipd.c 10 Apr 2003 23:50:06 -0000 1.40
+++ sys/dev/sym/sym_hipd.c 16 May 2003 01:59:46 -0000
@@ -8554,28 +8554,7 @@
}
case XPT_CALC_GEOMETRY:
{
- struct ccb_calc_geometry *ccg;
- u32 size_mb;
- u32 secs_per_cylinder;
- int extended;
-
- /*
- * Silly DOS geometry.
- */
- ccg = &ccb->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;
+ cam_calc_geometry(&ccb->ccg, /*extended*/1);
sym_xpt_done2(np, ccb, CAM_REQ_CMP);
break;
}
Index: sys/dev/usb/umass.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/usb/umass.c,v
retrieving revision 1.81
diff -u -r1.81 umass.c
--- sys/dev/usb/umass.c 11 May 2003 23:55:27 -0000 1.81
+++ sys/dev/usb/umass.c 16 May 2003 01:59:09 -0000
@@ -2458,25 +2457,7 @@
}
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;
}
More information about the freebsd-scsi
mailing list