summaryrefslogtreecommitdiffstats
path: root/sys/dev/aac
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2008-03-25 21:39:06 +0000
committeremaste <emaste@FreeBSD.org>2008-03-25 21:39:06 +0000
commit5e698c9f5e3fbe1e9ba5270ea8ca2057572a101b (patch)
tree63822c3479e4c0044262b91d27c852a0d6d29ccb /sys/dev/aac
parentf9c4823d641f4519d0d039d7ef6af59d23f561f0 (diff)
downloadFreeBSD-src-5e698c9f5e3fbe1e9ba5270ea8ca2057572a101b.zip
FreeBSD-src-5e698c9f5e3fbe1e9ba5270ea8ca2057572a101b.tar.gz
Add 64-bit array support for RAIDs > 2TB. This corresponds to ~ Adaptec
driver build 15317. Tested on: Adaptec 2230S, Firmware 4.2-0 (8205) ICP ICP5085BL, Firmware 5.2-0 (12814) Submitted by: Adaptec
Diffstat (limited to 'sys/dev/aac')
-rw-r--r--sys/dev/aac/aac.c9
-rw-r--r--sys/dev/aac/aac_disk.c9
-rw-r--r--sys/dev/aac/aacreg.h1
-rw-r--r--sys/dev/aac/aacvar.h3
4 files changed, 17 insertions, 5 deletions
diff --git a/sys/dev/aac/aac.c b/sys/dev/aac/aac.c
index 59c1a26..d77f91f 100644
--- a/sys/dev/aac/aac.c
+++ b/sys/dev/aac/aac.c
@@ -377,7 +377,9 @@ aac_get_container_info(struct aac_softc *sc, struct aac_fib *fib, int cid)
struct aac_mntinfo *mi;
mi = (struct aac_mntinfo *)&fib->data[0];
- mi->Command = VM_NameServe;
+ /* use 64-bit LBA if enabled */
+ mi->Command = (sc->flags & AAC_FLAGS_LBA_64BIT) ?
+ VM_NameServe64 : VM_NameServe;
mi->MntType = FT_FILESYS;
mi->MntCount = cid;
@@ -1802,6 +1804,11 @@ aac_check_firmware(struct aac_softc *sc)
sc->flags |= AAC_FLAGS_RAW_IO;
device_printf(sc->aac_dev, "Enable Raw I/O\n");
}
+ if ((sc->flags & AAC_FLAGS_RAW_IO) &&
+ (sc->flags & AAC_FLAGS_ARRAY_64BIT)) {
+ sc->flags |= AAC_FLAGS_LBA_64BIT;
+ device_printf(sc->aac_dev, "Enable 64-bit array\n");
+ }
return (0);
}
diff --git a/sys/dev/aac/aac_disk.c b/sys/dev/aac/aac_disk.c
index 24b0771..6568a0d 100644
--- a/sys/dev/aac/aac_disk.c
+++ b/sys/dev/aac/aac_disk.c
@@ -343,6 +343,9 @@ aac_disk_attach(device_t dev)
* disk!
*/
sc->ad_size = sc->ad_container->co_mntobj.Capacity;
+ if (sc->ad_controller->flags & AAC_FLAGS_LBA_64BIT)
+ sc->ad_size += (u_int64_t)
+ sc->ad_container->co_mntobj.CapacityHigh << 32;
if (sc->ad_size >= (2 * 1024 * 1024)) { /* 2GB */
sc->ad_heads = 255;
sc->ad_sectors = 63;
@@ -355,9 +358,9 @@ aac_disk_attach(device_t dev)
}
sc->ad_cylinders = (sc->ad_size / (sc->ad_heads * sc->ad_sectors));
- device_printf(dev, "%uMB (%u sectors)\n",
- sc->ad_size / ((1024 * 1024) / AAC_BLOCK_SIZE),
- sc->ad_size);
+ device_printf(dev, "%juMB (%ju sectors)\n",
+ (intmax_t)sc->ad_size / ((1024 * 1024) / AAC_BLOCK_SIZE),
+ (intmax_t)sc->ad_size);
/* attach a generic disk device to ourselves */
sc->unit = device_get_unit(dev);
diff --git a/sys/dev/aac/aacreg.h b/sys/dev/aac/aacreg.h
index dae21a4..5221bb2 100644
--- a/sys/dev/aac/aacreg.h
+++ b/sys/dev/aac/aacreg.h
@@ -1140,6 +1140,7 @@ struct aac_mntobj {
u_int32_t pad[8];
} ObjExtension;
u_int32_t AlterEgoId;
+ u_int32_t CapacityHigh;
} __packed;
struct aac_mntinfo {
diff --git a/sys/dev/aac/aacvar.h b/sys/dev/aac/aacvar.h
index c39d7c9..2b20472 100644
--- a/sys/dev/aac/aacvar.h
+++ b/sys/dev/aac/aacvar.h
@@ -133,7 +133,7 @@ struct aac_disk
int ad_cylinders;
int ad_heads;
int ad_sectors;
- u_int32_t ad_size;
+ u_int64_t ad_size;
int unit;
};
@@ -392,6 +392,7 @@ struct aac_softc
#define AAC_FLAGS_NEW_COMM (1 << 11) /* New comm. interface supported */
#define AAC_FLAGS_RAW_IO (1 << 12) /* Raw I/O interface */
#define AAC_FLAGS_ARRAY_64BIT (1 << 13) /* 64-bit array size */
+#define AAC_FLAGS_LBA_64BIT (1 << 14) /* 64-bit LBA support */
u_int32_t supported_options;
u_int32_t scsi_method_id;
OpenPOWER on IntegriCloud