Index: src/sys/dev/ic/aac.c =================================================================== RCS file: /cvsroot/src/sys/dev/ic/aac.c,v retrieving revision 1.40 diff -p -u -r1.40 aac.c --- src/sys/dev/ic/aac.c 8 Jun 2008 12:43:51 -0000 1.40 +++ src/sys/dev/ic/aac.c 22 Sep 2008 18:50:09 -0000 @@ -458,10 +458,8 @@ aac_check_firmware(struct aac_softc *sc) (sc->sc_if.aif_send_command != NULL)) { sc->sc_quirks |= AAC_QUIRK_NEW_COMM; } -#ifdef notyet if (opts & AAC_SUPPORTED_64BIT_ARRAYSIZE) sc->sc_quirks |= AAC_QUIRK_ARRAY_64BIT; -#endif } sc->sc_max_fibs = (sc->sc_quirks & AAC_QUIRK_256FIBS) ? 256 : 512; @@ -538,6 +536,16 @@ aac_check_firmware(struct aac_softc *sc) sc->sc_max_fibs_alloc = PAGE_SIZE / sc->sc_max_fib_size; + if (sc->sc_max_fib_size > sizeof(struct aac_fib)) { + sc->sc_quirks |= AAC_QUIRK_RAW_IO; + aprint_normal_dev(&sc->sc_dv, "Enable raw I/O\n"); + } + if ((sc->sc_quirks & AAC_QUIRK_RAW_IO) && + (sc->sc_quirks & AAC_QUIRK_ARRAY_64BIT)) { + sc->sc_quirks |= AAC_QUIRK_LBA_64BIT; + aprint_normal_dev(&sc->sc_dv, "Enable 64-bit array support\n"); + } + return (0); } @@ -632,10 +640,8 @@ aac_init(struct aac_softc *sc) */ ip = &sc->sc_common->ac_init; ip->InitStructRevision = htole32(AAC_INIT_STRUCT_REVISION); - if (sc->sc_max_fib_size > sizeof(struct aac_fib)) { + if (sc->sc_quirks & AAC_QUIRK_RAW_IO) ip->InitStructRevision = htole32(AAC_INIT_STRUCT_REVISION_4); - sc->sc_quirks |= AAC_QUIRK_RAW_IO; - } ip->MiniPortRevision = htole32(AAC_INIT_STRUCT_MINIPORT_REVISION); ip->AdapterFibsPhysicalAddress = htole32(sc->sc_common_seg.ds_addr + @@ -812,6 +818,7 @@ aac_startup(struct aac_softc *sc) struct aac_mntinforesponse mir; struct aac_drive *hd; u_int16_t rsize; + size_t ersize; int i; /* @@ -824,7 +831,15 @@ aac_startup(struct aac_softc *sc) * Request information on this container. */ memset(&mi, 0, sizeof(mi)); - mi.Command = htole32(VM_NameServe); + /* use 64-bit LBA if enabled */ + if (sc->sc_quirks & AAC_QUIRK_LBA_64BIT) { + mi.Command = htole32(VM_NameServe64); + ersize = sizeof(mir); + } else { + mi.Command = htole32(VM_NameServe); + ersize = sizeof(mir) - 4; + mir.MntTable[0].CapacityHigh = 0; + } mi.MntType = htole32(FT_FILESYS); mi.MntCount = htole32(i); if (aac_sync_fib(sc, ContainerCommand, 0, &mi, sizeof(mi), &mir, @@ -832,9 +847,9 @@ aac_startup(struct aac_softc *sc) aprint_error_dev(&sc->sc_dv, "error probing container %d\n", i); continue; } - if (rsize != sizeof(mir)) { + if (rsize != ersize) { aprint_error_dev(&sc->sc_dv, "container info response wrong size " - "(%d should be %zu)\n", rsize, sizeof(mir)); + "(%d should be %zu)\n", rsize, ersize); continue; } @@ -848,6 +863,9 @@ aac_startup(struct aac_softc *sc) hd->hd_present = 1; hd->hd_size = le32toh(mir.MntTable[0].Capacity); + if (sc->sc_quirks & AAC_QUIRK_LBA_64BIT) + hd->hd_size += (u_int64_t) + le32toh(mir.MntTable[0].CapacityHigh) << 32; hd->hd_devtype = le32toh(mir.MntTable[0].VolType); hd->hd_size &= ~0x1f; sc->sc_nunits++; Index: src/sys/dev/ic/aacreg.h =================================================================== RCS file: /cvsroot/src/sys/dev/ic/aacreg.h,v retrieving revision 1.12 diff -p -u -r1.12 aacreg.h --- src/sys/dev/ic/aacreg.h 8 Sep 2008 23:36:54 -0000 1.12 +++ src/sys/dev/ic/aacreg.h 22 Sep 2008 18:50:10 -0000 @@ -535,6 +535,7 @@ struct aac_mntobj { u_int32_t pad[8]; } ObjExtension; u_int32_t AlterEgoId; + u_int32_t CapacityHigh; } __packed; struct aac_mntinfo { Index: src/sys/dev/ic/aacvar.h =================================================================== RCS file: /cvsroot/src/sys/dev/ic/aacvar.h,v retrieving revision 1.12 diff -p -u -r1.12 aacvar.h --- src/sys/dev/ic/aacvar.h 28 Apr 2008 20:23:48 -0000 1.12 +++ src/sys/dev/ic/aacvar.h 22 Sep 2008 18:50:10 -0000 @@ -160,6 +160,7 @@ struct aac_softc; #define AAC_QUIRK_NEW_COMM (1 << 11) /* New comm. i/f supported */ #define AAC_QUIRK_RAW_IO (1 << 12) /* Raw I/O interface */ #define AAC_QUIRK_ARRAY_64BIT (1 << 13) /* 64-bit array size */ +#define AAC_QUIRK_LBA_64BIT (1 << 14) /* 64-bit LBA support */ /* @@ -284,7 +285,7 @@ struct aac_ccb { struct aac_drive { u_int hd_present; u_int hd_devtype; - u_int hd_size; + u_int64_t hd_size; }; /*