diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ic/mpt.c | 90 | ||||
-rw-r--r-- | sys/dev/ic/mpt_mpilib.h | 18 |
2 files changed, 89 insertions, 19 deletions
diff --git a/sys/dev/ic/mpt.c b/sys/dev/ic/mpt.c index dff8adfa0c6..e1628246dcc 100644 --- a/sys/dev/ic/mpt.c +++ b/sys/dev/ic/mpt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpt.c,v 1.11 2004/10/28 02:58:33 marco Exp $ */ +/* $OpenBSD: mpt.c,v 1.12 2004/10/30 18:07:06 marco Exp $ */ /* $NetBSD: mpt.c,v 1.4 2003/11/02 11:07:45 wiz Exp $ */ /* @@ -845,20 +845,86 @@ mpt_print_header(mpt_softc_t *mpt, char *s, fCONFIG_PAGE_HEADER *phdr) int mpt_read_config_info_mfg(mpt_softc_t *mpt) { - int rv; + int rv, i; + fCONFIG_PAGE_HEADER *phdr[5] = { + phdr[0] = &mpt->mpt_mfg_page0.Header, + phdr[1] = &mpt->mpt_mfg_page1.Header, + phdr[2] = &mpt->mpt_mfg_page2.Header, + phdr[3] = &mpt->mpt_mfg_page3.Header, + phdr[4] = &mpt->mpt_mfg_page4.Header + }; - /* retrieve manufacturing headers */ - rv = mpt_read_cfg_header(mpt, MPI_CONFIG_PAGETYPE_MANUFACTURING, 0, - 0, &mpt->mpt_mfg_page0.Header); - if (rv) { - mpt_prt(mpt, "Could not retrieve Manufacturing Page 0 Header."); - return (-1); - } else if (mpt->verbose > 1) { - mpt_print_header(mpt, "Manufacturing Header Page", - &mpt->mpt_mfg_page0.Header); + for (i = 0; i < 5 /* 5 pages total */; i++) { + /* retrieve MFG headers */ + rv = mpt_read_cfg_header(mpt, + MPI_CONFIG_PAGETYPE_MANUFACTURING, i, 0, phdr[i]); + if (rv) { + mpt_prt(mpt, "Could not retrieve Manufacturing Page " + "%i Header.", i); + return (-1); + } else if (mpt->verbose > 1) { + mpt_print_header(mpt, "Manufacturing Header Page", + phdr[i]); + } + + /* retrieve MFG config pages using retrieved headers */ + rv = mpt_read_cfg_page(mpt, i, phdr[i]); + if (rv) { + mpt_prt(mpt, "Could not retrieve manufacturing Page" + " %i", i); + return (-1); + } } - /* retrieve manufacturing config pages using retrieved headers */ + /* mpt->verbose = 2; */ + if (mpt->verbose > 1) { + mpt_prt(mpt, "Manufacturing Page 0 data: %s %s %s %s %s", + mpt->mpt_mfg_page0.ChipName, + mpt->mpt_mfg_page0.ChipRevision, + mpt->mpt_mfg_page0.BoardName, + mpt->mpt_mfg_page0.BoardAssembly, + mpt->mpt_mfg_page0.BoardTracerNumber); + + mpt_prt(mpt, "Manufacturing Page 1 data:"); + for (i = 0; + i < ((mpt->mpt_mfg_page1.Header.PageLength - 1)<< 2); i++) { + printf("%02x ", mpt->mpt_mfg_page1.VPD[i]); + } + printf("\n"); + + mpt_prt(mpt, "Manufacturing Page 2 data: %x %x", + mpt->mpt_mfg_page2.ChipId.PCIRevisionID, + mpt->mpt_mfg_page2.ChipId.DeviceID); + for (i = 0; + i < (mpt->mpt_mfg_page2.Header.PageLength - 2); i++) { + printf("%08x ", mpt->mpt_mfg_page2.HwSettings[i]); + } + printf("\n"); + + mpt_prt(mpt, "Manufacturing Page 3 data: %x %x", + mpt->mpt_mfg_page3.ChipId.PCIRevisionID, + mpt->mpt_mfg_page3.ChipId.DeviceID); + for (i = 0; + i < (mpt->mpt_mfg_page3.Header.PageLength - 2); i++) { + printf("%08x ", mpt->mpt_mfg_page3.Info[i]); + } + printf("\n"); + + mpt_prt(mpt, "Manufacturing Page 4 data: %x %x %x %x %x", + mpt->mpt_mfg_page4.InfoSize1, + mpt->mpt_mfg_page4.InfoOffset1, + mpt->mpt_mfg_page4.InfoSize0, + mpt->mpt_mfg_page4.InfoOffset0, + mpt->mpt_mfg_page4.InquirySize, + mpt->mpt_mfg_page4.ISVolumeSettings, + mpt->mpt_mfg_page4.IMEVolumeSettings, + mpt->mpt_mfg_page4.IMVolumeSettings); + for (i = 0; i < sizeof(mpt->mpt_mfg_page4.InquiryData); i++) { + printf("%02x ", mpt->mpt_mfg_page4.InquiryData[i]); + } + printf("\n"); + } + /* mpt->verbose = 1; */ return (0); } diff --git a/sys/dev/ic/mpt_mpilib.h b/sys/dev/ic/mpt_mpilib.h index 1b799d765cf..9fbf867d9d0 100644 --- a/sys/dev/ic/mpt_mpilib.h +++ b/sys/dev/ic/mpt_mpilib.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mpt_mpilib.h,v 1.2 2004/10/26 04:43:59 marco Exp $ */ +/* $OpenBSD: mpt_mpilib.h,v 1.3 2004/10/30 18:07:06 marco Exp $ */ /* $NetBSD: mpt_mpilib.h,v 1.2 2003/04/16 23:24:01 thorpej Exp $ */ /* @@ -1097,7 +1097,7 @@ typedef struct _MSG_CONFIG_REPLY typedef struct _CONFIG_PAGE_MANUFACTURING_0 { - fCONFIG_PAGE_HEADER Header; /* 00h */ + fCONFIG_PAGE_HEADER Header; /* 00h */ U8 ChipName[16]; /* 04h */ U8 ChipRevision[8]; /* 14h */ U8 BoardName[16]; /* 1Ch */ @@ -1112,7 +1112,7 @@ typedef struct _CONFIG_PAGE_MANUFACTURING_0 typedef struct _CONFIG_PAGE_MANUFACTURING_1 { - fCONFIG_PAGE_HEADER Header; /* 00h */ + fCONFIG_PAGE_HEADER Header; /* 00h */ U8 VPD[256]; /* 04h */ } fCONFIG_PAGE_MANUFACTURING_1, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_1, ManufacturingPage1_t, MPI_POINTER pManufacturingPage1_t; @@ -1134,12 +1134,14 @@ typedef struct _MPI_CHIP_REVISION_ID * one and check Header.PageLength at runtime. */ #ifndef MPI_MAN_PAGE_2_HW_SETTINGS_WORDS -#define MPI_MAN_PAGE_2_HW_SETTINGS_WORDS (1) +/*#define MPI_MAN_PAGE_2_HW_SETTINGS_WORDS (1)*/ +/* MP: is this right? */ +#define MPI_MAN_PAGE_2_HW_SETTINGS_WORDS (16) #endif typedef struct _CONFIG_PAGE_MANUFACTURING_2 { - fCONFIG_PAGE_HEADER Header; /* 00h */ + fCONFIG_PAGE_HEADER Header; /* 00h */ MPI_CHIP_REVISION_ID ChipId; /* 04h */ U32 HwSettings[MPI_MAN_PAGE_2_HW_SETTINGS_WORDS];/* 08h */ } fCONFIG_PAGE_MANUFACTURING_2, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_2, @@ -1153,12 +1155,14 @@ typedef struct _CONFIG_PAGE_MANUFACTURING_2 * one and check Header.PageLength at runtime. */ #ifndef MPI_MAN_PAGE_3_INFO_WORDS -#define MPI_MAN_PAGE_3_INFO_WORDS (1) +/*#define MPI_MAN_PAGE_3_INFO_WORDS (1)*/ +/* MP: is this right? */ +#define MPI_MAN_PAGE_3_INFO_WORDS (16) #endif typedef struct _CONFIG_PAGE_MANUFACTURING_3 { - fCONFIG_PAGE_HEADER Header; /* 00h */ + fCONFIG_PAGE_HEADER Header; /* 00h */ MPI_CHIP_REVISION_ID ChipId; /* 04h */ U32 Info[MPI_MAN_PAGE_3_INFO_WORDS];/* 08h */ } fCONFIG_PAGE_MANUFACTURING_3, MPI_POINTER PTR_CONFIG_PAGE_MANUFACTURING_3, |