mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-26 16:18:31 +00:00
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
This commit is contained in:
parent
85a8a1ddff
commit
523da39bcc
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=177619
@ -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);
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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 {
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user