summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/ic/mpt.c108
-rw-r--r--sys/dev/ic/mpt_openbsd.h19
2 files changed, 100 insertions, 27 deletions
diff --git a/sys/dev/ic/mpt.c b/sys/dev/ic/mpt.c
index 4a883d9e828..dff8adfa0c6 100644
--- a/sys/dev/ic/mpt.c
+++ b/sys/dev/ic/mpt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpt.c,v 1.10 2004/10/26 04:43:59 marco Exp $ */
+/* $OpenBSD: mpt.c,v 1.11 2004/10/28 02:58:33 marco Exp $ */
/* $NetBSD: mpt.c,v 1.4 2003/11/02 11:07:45 wiz Exp $ */
/*
@@ -732,6 +732,9 @@ mpt_read_cfg_page(mpt_softc_t *mpt, int PageAddress, fCONFIG_PAGE_HEADER *hdr)
} else if (cfgp->Header.PageType == MPI_CONFIG_PAGETYPE_RAID_VOLUME &&
cfgp->Header.PageNumber == 0) {
amt = sizeof (fCONFIG_PAGE_RAID_VOL_0);
+ } else if (cfgp->Header.PageType == MPI_CONFIG_PAGETYPE_RAID_PHYSDISK &&
+ cfgp->Header.PageNumber == 0) {
+ amt = sizeof (fCONFIG_PAGE_RAID_PHYS_DISK_0);
}
bcopy(((caddr_t)req->req_vbuf)+CFG_DATA_OFF, hdr, amt);
@@ -968,45 +971,108 @@ mpt_read_config_info_raid(mpt_softc_t *mpt)
{
int rv, i;
- /* retrieve raid headers */
+ /* retrieve raid volume headers */
rv = mpt_read_cfg_header(mpt, MPI_CONFIG_PAGETYPE_RAID_VOLUME, 0,
- 0, &mpt->mpt_raid_page0.Header);
+ 0, &mpt->mpt_raidvol_page0.Header);
if (rv) {
- mpt_prt(mpt, "Could not retrieve RAID Volume Page 0 Header.");
+ mpt_prt(mpt, "Could not retrieve RAID Volume Page 0 Header");
return (-1);
} else if (mpt->verbose > 1) {
mpt_print_header(mpt, "RAID Volume Header Page",
- &mpt->mpt_raid_page0.Header);
+ &mpt->mpt_raidvol_page0.Header);
}
/* retrieve raid volume page using retrieved headers */
- rv = mpt_read_cfg_page(mpt, 0, &mpt->mpt_raid_page0.Header);
+ rv = mpt_read_cfg_page(mpt, 0, &mpt->mpt_raidvol_page0.Header);
if (rv) {
mpt_prt(mpt, "Could not retrieve RAID Volume Page 0");
return (-1);
}
- /* mpt->verbose = 2; */
+ /* retrieve raid physical disk header */
+ rv = mpt_read_cfg_header(mpt, MPI_CONFIG_PAGETYPE_RAID_PHYSDISK, 0,
+ 0, &mpt->mpt_raidphys_page0.Header);
+ if (rv) {
+ mpt_prt(mpt, "Could not retrieve RAID Phys Disk Page 0 Header");
+ return (-1);
+ } else if (mpt->verbose > 1) {
+ mpt_print_header(mpt, "RAID Volume Physical Disk Page",
+ &mpt->mpt_raidphys_page0.Header);
+ }
+
+ /* retrieve raid physical disk page using retrieved headers */
+ rv = mpt_read_cfg_page(mpt, 0, &mpt->mpt_raidphys_page0.Header);
+ if (rv) {
+ mpt_prt(mpt, "Could not retrieve RAID Phys Disk Page 0");
+ return (-1);
+ }
+
if (mpt->verbose > 1) {
mpt_prt(mpt, "RAID Volume Page 0 data: %x %x %x %x %x"
"%x %x %x %x",
- mpt->mpt_raid_page0.VolumeType,
- mpt->mpt_raid_page0.VolumeIOC,
- mpt->mpt_raid_page0.VolumeBus,
- mpt->mpt_raid_page0.VolumeID,
- mpt->mpt_raid_page0.VolumeStatus,
- mpt->mpt_raid_page0.VolumeSettings,
- mpt->mpt_raid_page0.MaxLBA,
- mpt->mpt_raid_page0.StripeSize,
- mpt->mpt_raid_page0.NumPhysDisks);
-
- for (i = 0; i < mpt->mpt_raid_page0.NumPhysDisks; i++) {
+ mpt->mpt_raidvol_page0.VolumeType,
+ mpt->mpt_raidvol_page0.VolumeIOC,
+ mpt->mpt_raidvol_page0.VolumeBus,
+ mpt->mpt_raidvol_page0.VolumeID,
+ mpt->mpt_raidvol_page0.VolumeStatus,
+ mpt->mpt_raidvol_page0.VolumeSettings,
+ mpt->mpt_raidvol_page0.MaxLBA,
+ mpt->mpt_raidvol_page0.StripeSize,
+ mpt->mpt_raidvol_page0.NumPhysDisks);
+
+ for (i = 0; i < mpt->mpt_raidvol_page0.NumPhysDisks; i++) {
mpt_prt(mpt, "RAID Volume Page 0 Physical Disk: %x %x",
- mpt->mpt_raid_page0.PhysDisk[i].PhysDiskNum,
- mpt->mpt_raid_page0.PhysDisk[i].PhysDiskMap);
+ mpt->mpt_raidvol_page0.PhysDisk[i].PhysDiskNum,
+ mpt->mpt_raidvol_page0.PhysDisk[i].PhysDiskMap);
}
+ printf("\n");
+ }
+
+ if (mpt->verbose > 1) {
+ mpt_prt(mpt, "RAID Phyical Disk Page 0 data: %x %x %x %x %x"
+ "%x %x %x",
+ mpt->mpt_raidphys_page0.PhysDiskNum,
+ mpt->mpt_raidphys_page0.PhysDiskIOC,
+ mpt->mpt_raidphys_page0.PhysDiskBus,
+ mpt->mpt_raidphys_page0.PhysDiskID,
+ mpt->mpt_raidphys_page0.PhysDiskSettings.SepID,
+ mpt->mpt_raidphys_page0.PhysDiskSettings.SepBus,
+ mpt->mpt_raidphys_page0.PhysDiskSettings.HotSparePool,
+ mpt->mpt_raidphys_page0.PhysDiskSettings.PhysDiskSettings);
+
+ for (i = 0;
+ i < sizeof(mpt->mpt_raidphys_page0.DiskIdentifier); i++) {
+ printf("%02x ",
+ mpt->mpt_raidphys_page0.DiskIdentifier[i]);
+ }
+
+ /* does them all */
+ printf("\n");
+ mpt_prt(mpt, "RAID Phyical Disk Page 0 data: %s",
+ mpt->mpt_raidphys_page0.InquiryData.VendorID);
+
+ for (i = 0;
+ i < sizeof(mpt->mpt_raidphys_page0.InquiryData.Info); i++) {
+ printf("%02x ",
+ mpt->mpt_raidphys_page0.InquiryData.Info[i]);
+ }
+
+ printf("\n");
+ mpt_prt(mpt, "RAID Phyical Disk Page 0 data: %x %x %x"
+ "%x %x %x %x %x %x %x %x",
+ mpt->mpt_raidphys_page0.PhysDiskStatus.Flags,
+ mpt->mpt_raidphys_page0.PhysDiskStatus.State,
+ mpt->mpt_raidphys_page0.MaxLBA,
+ mpt->mpt_raidphys_page0.ErrorData.ErrorSenseKey,
+ mpt->mpt_raidphys_page0.ErrorData.ErrorCdbByte,
+ mpt->mpt_raidphys_page0.ErrorData.ErrorASCQ,
+ mpt->mpt_raidphys_page0.ErrorData.ErrorASC,
+ mpt->mpt_raidphys_page0.ErrorData.ErrorCount,
+ mpt->mpt_raidphys_page0.ErrorData.SmartASCQ,
+ mpt->mpt_raidphys_page0.ErrorData.SmartASC,
+ mpt->mpt_raidphys_page0.ErrorData.SmartCount
+ );
}
- /* mpt->verbose = 1; */
return (0);
}
diff --git a/sys/dev/ic/mpt_openbsd.h b/sys/dev/ic/mpt_openbsd.h
index 41ca4a3ccb8..758a9f77cca 100644
--- a/sys/dev/ic/mpt_openbsd.h
+++ b/sys/dev/ic/mpt_openbsd.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: mpt_openbsd.h,v 1.11 2004/10/26 04:43:59 marco Exp $ */
+/* $OpenBSD: mpt_openbsd.h,v 1.12 2004/10/28 02:58:33 marco Exp $ */
/* $NetBSD: mpt_netbsd.h,v 1.2 2003/04/16 23:02:14 thorpej Exp $ */
/*
@@ -221,7 +221,6 @@ typedef struct mpt_softc {
uint16_t mpt_ini_id;
/* Device configuration information */
- /* union { is this right? */
struct {
struct mpt_spi_cfg {
fCONFIG_PAGE_SCSI_PORT_0 _port_page0;
@@ -254,8 +253,16 @@ typedef struct mpt_softc {
struct mpt_mfg_cfg {
fCONFIG_PAGE_MANUFACTURING_0 _mfg_page0;
+ fCONFIG_PAGE_MANUFACTURING_1 _mfg_page1;
+ fCONFIG_PAGE_MANUFACTURING_2 _mfg_page2;
+ fCONFIG_PAGE_MANUFACTURING_3 _mfg_page3;
+ fCONFIG_PAGE_MANUFACTURING_4 _mfg_page4;
} mfg;
#define mpt_mfg_page0 cfg.mfg._mfg_page0
+#define mpt_mfg_page1 cfg.mfg._mfg_page1
+#define mpt_mfg_page2 cfg.mfg._mfg_page2
+#define mpt_mfg_page3 cfg.mfg._mfg_page3
+#define mpt_mfg_page4 cfg.mfg._mfg_page4
struct mpt_ioc_cfg {
fCONFIG_PAGE_IOC_0 _ioc_page0;
@@ -271,11 +278,11 @@ typedef struct mpt_softc {
#define mpt_ioc_page4 cfg.ioc._ioc_page4
struct mpt_raid_cfg {
- fCONFIG_PAGE_RAID_VOL_0 _raid_page0;
+ fCONFIG_PAGE_RAID_VOL_0 _raidvol_page0;
+ fCONFIG_PAGE_RAID_PHYS_DISK_0 _raidphys_page0;
} raid;
-#define mpt_raid_page0 cfg.raid._raid_page0
-
-
+#define mpt_raidvol_page0 cfg.raid._raidvol_page0
+#define mpt_raidphys_page0 cfg.raid._raidphys_page0
} cfg;
bus_space_tag_t sc_st;