summaryrefslogtreecommitdiffstats
path: root/sys/cam
diff options
context:
space:
mode:
authormarius <marius@FreeBSD.org>2011-11-27 15:43:40 +0000
committermarius <marius@FreeBSD.org>2011-11-27 15:43:40 +0000
commit5846bf2bc16f98b448da1b644193426d20b75686 (patch)
tree9c333cc39dc8c37ec4d4b89793338c924eea94e4 /sys/cam
parent9687e68a24e9e23b15ba9ad35b4219d384ad81b7 (diff)
downloadFreeBSD-src-5846bf2bc16f98b448da1b644193426d20b75686.zip
FreeBSD-src-5846bf2bc16f98b448da1b644193426d20b75686.tar.gz
For sparc64 also adjust the geometry of da(4) driven disks to not overflow
the 16-bit cylinders field of the VTOC8 disk label (at around 502GB). The geometry chosen for disks above that limit allows to use disks up to 2TB, which is the limit of the extended VTOC8 format. The geometry used for disks smaller than the 16-bit cylinders limit stays the same as used by cam_calc_geometry(9) for extended translation. Thanks to Hans-Joerg Sirtl for providing hardware for testing this change. MFC after: 3 days
Diffstat (limited to 'sys/cam')
-rw-r--r--sys/cam/cam_xpt.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/cam/cam_xpt.c b/sys/cam/cam_xpt.c
index 04cc99a..8611848 100644
--- a/sys/cam/cam_xpt.c
+++ b/sys/cam/cam_xpt.c
@@ -66,7 +66,10 @@ __FBSDID("$FreeBSD$");
#include <cam/scsi/scsi_all.h>
#include <cam/scsi/scsi_message.h>
#include <cam/scsi/scsi_pass.h>
+
+#include <machine/md_var.h> /* geometry translation */
#include <machine/stdarg.h> /* for xpt_print below */
+
#include "opt_cam.h"
/*
@@ -2456,7 +2459,7 @@ xpt_action_default(union ccb *start_ccb)
start_ccb->ccb_h.status = CAM_REQ_CMP;
break;
}
-#ifdef PC98
+#if defined(PC98) || defined(__sparc64__)
/*
* In a PC-98 system, geometry translation depens on
* the "real" device geometry obtained from mode page 4.
@@ -2465,6 +2468,9 @@ xpt_action_default(union ccb *start_ccb)
* stored in host memory. If the translation is available
* in host memory, use it. If not, rely on the default
* translation the device driver performs.
+ * For sparc64, we may need adjust the geometry of large
+ * disks in order to fit the limitations of the 16-bit
+ * fields of the VTOC8 disk label.
*/
if (scsi_da_bios_params(&start_ccb->ccg) != 0) {
start_ccb->ccb_h.status = CAM_REQ_CMP;
OpenPOWER on IntegriCloud