diff -Nur mpt-status-1.2.0-RC7/contrib/mpt-status-1.0.diff mpt-status-1.2.0/contrib/mpt-status-1.0.diff --- mpt-status-1.2.0-RC7/contrib/mpt-status-1.0.diff 2006-04-24 19:29:45.000000000 +0200 +++ mpt-status-1.2.0/contrib/mpt-status-1.0.diff 1970-01-01 01:00:00.000000000 +0100 @@ -1,228 +0,0 @@ ---- mpt-status.c -+++ mpt-status.c -@@ -25,17 +25,14 @@ - #include - #include - #include --#include -+#include - #include - #include - #include - #include - --#include "mptctl.h" --#include "lsi/mpi_type.h" --#include "lsi/mpi.h" --#include "lsi/mpi_ioc.h" --#include "lsi/mpi_cnfg.h" -+#include -+#include "mpt-status.h" - - #define BIG 1024 - #define REALLYBIG 10240 ---- mpt-status.h -+++ mpt-status.h -@@ -0,0 +1,202 @@ -+#ifndef _MPT_STATUS_H_ -+#define _MPT_STATUS_H_ -+ -+#define MPI_FUNCTION_CONFIG (0x04) -+#define MPI_CONFIG_ACTION_PAGE_HEADER (0x00) -+#define MPI_CONFIG_PAGETYPE_RAID_VOLUME (0x08) -+#define MPI_CONFIG_ACTION_PAGE_READ_CURRENT (0x01) -+#define MPI_RAIDVOLPAGE0_PAGEVERSION (0x01) -+#define MPI_RAIDVOL0_STATUS_FLAG_ENABLED (0x01) -+#define MPI_RAIDVOL0_STATUS_FLAG_QUIESCED (0x02) -+#define MPI_RAIDVOL0_STATUS_FLAG_RESYNC_IN_PROGRESS (0x04) -+#define MPI_RAIDVOL0_STATUS_FLAG_VOLUME_INACTIVE (0x08) -+#define MPI_RAIDVOL0_STATUS_STATE_OPTIMAL (0x00) -+#define MPI_RAIDVOL0_STATUS_STATE_DEGRADED (0x01) -+#define MPI_RAIDVOL0_STATUS_STATE_FAILED (0x02) -+#define MPI_CONFIG_PAGETYPE_RAID_PHYSDISK (0x0A) -+#define MPI_RAIDPHYSDISKPAGE0_PAGEVERSION (0x00) -+#define MPI_PHYSDISK0_STATUS_FLAG_OUT_OF_SYNC (0x01) -+#define MPI_PHYSDISK0_STATUS_FLAG_QUIESCED (0x02) -+#define MPI_PHYSDISK0_STATUS_ONLINE (0x00) -+#define MPI_PHYSDISK0_STATUS_MISSING (0x01) -+#define MPI_PHYSDISK0_STATUS_NOT_COMPATIBLE (0x02) -+#define MPI_PHYSDISK0_STATUS_FAILED (0x03) -+#define MPI_PHYSDISK0_STATUS_FAILED_REQUESTED (0x06) -+#define MPI_PHYSDISK0_STATUS_INITIALIZING (0x04) -+#define MPI_PHYSDISK0_STATUS_OFFLINE_REQUESTED (0x05) -+#define MPI_PHYSDISK0_STATUS_FAILED_REQUESTED (0x06) -+#define MPI_PHYSDISK0_STATUS_OTHER_OFFLINE (0xFF) -+#define MPI_RAID_VOL_PAGE_0_PHYSDISK_MAX (1) -+ -+#define MPT_MAGIC_NUMBER 'm' -+#define MPTCOMMAND _IOWR(MPT_MAGIC_NUMBER,20,struct mpt_ioctl_command) -+ -+typedef struct ConfigPageHeader_t { -+ uint8_t PageVersion; /* 00h */ -+ uint8_t PageLength; /* 01h */ -+ uint8_t PageNumber; /* 02h */ -+ uint8_t PageType; /* 03h */ -+} ConfigPageHeader_t; -+ -+typedef struct SGESimpleUnion_t { -+ uint32_t FlagsLength; -+ union { -+ uint32_t Address32; -+ uint64_t Address64; -+ } u; -+} SGESimpleUnion_t; -+ -+typedef struct SGEChainUnion_t { -+ uint16_t Length; -+ uint8_t NextChainOffset; -+ uint8_t Flags; -+ union { -+ uint32_t Address32; -+ uint64_t Address64; -+ } u; -+} SGEChainUnion_t; -+ -+typedef struct SGEIOUnion_t { -+ union { -+ SGESimpleUnion_t Simple; -+ SGEChainUnion_t Chain; -+ } u; -+} SGEIOUnion_t; -+ -+typedef struct Config_t { -+ uint8_t Action; /* 00h */ -+ uint8_t Reserved; /* 01h */ -+ uint8_t ChainOffset; /* 02h */ -+ uint8_t Function; /* 03h */ -+ uint16_t ExtPageLength; /* 04h */ -+ uint8_t ExtPageType; /* 06h */ -+ uint8_t MsgFlags; /* 07h */ -+ uint32_t MsgContext; /* 08h */ -+ uint8_t Reserved2[8]; /* 0Ch */ -+ ConfigPageHeader_t Header; /* 14h */ -+ uint32_t PageAddress; /* 18h */ -+ SGEIOUnion_t PageBufferSGE; /* 1Ch */ -+} Config_t; -+ -+typedef struct ConfigReply_t { -+ uint8_t Action; /* 00h */ -+ uint8_t Reserved; /* 01h */ -+ uint8_t MsgLength; /* 02h */ -+ uint8_t Function; /* 03h */ -+ uint16_t ExtPageLength; /* 04h */ -+ uint8_t ExtPageType; /* 06h */ -+ uint8_t MsgFlags; /* 07h */ -+ uint32_t MsgContext; /* 08h */ -+ uint8_t Reserved2[2]; /* 0Ch */ -+ uint16_t IOCStatus; /* 0Eh */ -+ uint32_t IOCLogInfo; /* 10h */ -+ ConfigPageHeader_t Header; /* 14h */ -+} ConfigReply_t; -+ -+typedef struct RaidVol0Status_t { -+ uint8_t Flags; /* 00h */ -+ uint8_t State; /* 01h */ -+ uint16_t Reserved; /* 02h */ -+} RaidVol0Status_t; -+ -+typedef struct RaidVol0Settings { -+ uint16_t Settings; /* 00h */ -+ uint8_t HotSparePool; /* 01h *//* MPI_RAID_HOT_SPARE_POOL_ */ -+ uint8_t Reserved; /* 02h */ -+} RaidVol0Settings; -+ -+typedef struct RaidVol0PhysDisk_t { -+ uint16_t Reserved; /* 00h */ -+ uint8_t PhysDiskMap; /* 02h */ -+ uint8_t PhysDiskNum; /* 03h */ -+} RaidVol0PhysDisk_t; -+ -+typedef struct RaidVolumePage0_t { -+ ConfigPageHeader_t Header; /* 00h */ -+ uint8_t VolumeID; /* 04h */ -+ uint8_t VolumeBus; /* 05h */ -+ uint8_t VolumeIOC; /* 06h */ -+ uint8_t VolumeType; /* 07h *//* MPI_RAID_VOL_TYPE_ */ -+ RaidVol0Status_t VolumeStatus; /* 08h */ -+ RaidVol0Settings VolumeSettings; /* 0Ch */ -+ uint32_t MaxLBA; /* 10h */ -+ uint32_t Reserved1; /* 14h */ -+ uint32_t StripeSize; /* 18h */ -+ uint32_t Reserved2; /* 1Ch */ -+ uint32_t Reserved3; /* 20h */ -+ uint8_t NumPhysDisks; /* 24h */ -+ uint8_t Reserved4; /* 25h */ -+ uint16_t Reserved5; /* 26h */ -+ RaidVol0PhysDisk_t PhysDisk[MPI_RAID_VOL_PAGE_0_PHYSDISK_MAX]; /* 28h */ -+} RaidVolumePage0_t; -+ -+typedef struct RaidPhysDiskSettings_t { -+ uint8_t SepID; /* 00h */ -+ uint8_t SepBus; /* 01h */ -+ uint8_t HotSparePool; /* 02h *//* MPI_RAID_HOT_SPARE_POOL_ */ -+ uint8_t PhysDiskSettings; /* 03h */ -+} RaidPhysDiskSettings_t; -+ -+typedef struct RaidPhysDisk0InquiryData { -+ uint8_t VendorID[8]; /* 00h */ -+ uint8_t ProductID[16]; /* 08h */ -+ uint8_t ProductRevLevel[4]; /* 18h */ -+ uint8_t Info[32]; /* 1Ch */ -+} RaidPhysDisk0InquiryData; -+ -+typedef struct RaidPhysDiskStatus_t { -+ uint8_t Flags; /* 00h */ -+ uint8_t State; /* 01h */ -+ uint16_t Reserved; /* 02h */ -+} RaidPhysDiskStatus_t; -+ -+typedef struct RaidPhysDisk0ErrorData_t { -+ uint8_t ErrorCdbByte; /* 00h */ -+ uint8_t ErrorSenseKey; /* 01h */ -+ uint16_t Reserved; /* 02h */ -+ uint16_t ErrorCount; /* 04h */ -+ uint8_t ErrorASC; /* 06h */ -+ uint8_t ErrorASCQ; /* 07h */ -+ uint16_t SmartCount; /* 08h */ -+ uint8_t SmartASC; /* 0Ah */ -+ uint8_t SmartASCQ; /* 0Bh */ -+} RaidPhysDisk0ErrorData_t; -+ -+typedef struct RaidPhysDiskPage0_t { -+ ConfigPageHeader_t Header; /* 00h */ -+ uint8_t PhysDiskID; /* 04h */ -+ uint8_t PhysDiskBus; /* 05h */ -+ uint8_t PhysDiskIOC; /* 06h */ -+ uint8_t PhysDiskNum; /* 07h */ -+ RaidPhysDiskSettings_t PhysDiskSettings; /* 08h */ -+ uint32_t Reserved1; /* 0Ch */ -+ uint32_t Reserved2; /* 10h */ -+ uint32_t Reserved3; /* 14h */ -+ uint8_t DiskIdentifier[16]; /* 18h */ -+ RaidPhysDisk0InquiryData InquiryData; /* 28h */ -+ RaidPhysDiskStatus_t PhysDiskStatus; /* 64h */ -+ uint32_t MaxLBA; /* 68h */ -+ RaidPhysDisk0ErrorData_t ErrorData; /* 6Ch */ -+} RaidPhysDiskPage0_t; -+ -+typedef struct mpt_ioctl_header { -+ unsigned int iocnum; /* IOC unit number */ -+ unsigned int port; /* IOC port number */ -+ int maxDataSize; /* Maximum Num. bytes to transfer on read */ -+} mpt_ioctl_header; -+ -+struct mpt_ioctl_command { -+ mpt_ioctl_header hdr; -+ int timeout; /* optional (seconds) */ -+ char *replyFrameBufPtr; -+ char *dataInBufPtr; -+ char *dataOutBufPtr; -+ char *senseDataPtr; -+ int maxReplyBytes; -+ int dataInSize; -+ int dataOutSize; -+ int maxSenseBytes; -+ int dataSgeOffset; -+ char MF[1]; -+}; -+#endif /* _MPT_STATUS_H_ */ diff -Nur mpt-status-1.2.0-RC7/contrib/mpt-status.spec mpt-status-1.2.0/contrib/mpt-status.spec --- mpt-status-1.2.0-RC7/contrib/mpt-status.spec 1970-01-01 01:00:00.000000000 +0100 +++ mpt-status-1.2.0/contrib/mpt-status.spec 2006-07-01 00:21:41.000000000 +0200 @@ -0,0 +1,47 @@ +Summary: MPT Fusion based raid inquiry tool for LSI Logic HBAs +Name: mpt-status +Version: 1.2.0 +Release: 0 +License: GPL +Group: Applications/System +URL: http://www.drugphish.ch/~ratz/mpt-status/ + +Packager: Rich Edelman (rich.edelman@openwave.com) +Vendor: OpenWave Systems + +Source: mpt-status-%{version}.tar.bz2 + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root + +%description +mpt-status requests information about raid status for LSI Logic SCSI controllers. +%prep +%setup + +%build +%{__make} + +%install +%{__rm} -rf %{buildroot} +%{__install} -D -m0755 mpt-status %{buildroot}%{_sbindir}/mpt-status + +%clean +%{__rm} -rf %{buildroot} + +%files +%defattr(-, root, root, 0755) +%doc doc/* +%{_sbindir}/mpt-status + +%changelog +* Fri Jun 30 2006 Roberto Nibali (ratz@drugphish.ch) +- Changed release version + +* Fri Jun 30 2006 Rich Edelman (rich.edelman@openwave.com) +- Upgraded to version 1.2.0-RC7 +- Changed Makefile to use /lib/modules/`uname -r`/build as the KERNEL_PATH + directory, instead of /usr/src/linux. This should make building this package + across different distributions easier. (Patch mpt-status-fix-kernel-path.diff) + +* Thu Jul 14 2005 Jean-Philippe CIVADE - 1.1.3-0 +- Initial package. diff -Nur mpt-status-1.2.0-RC7/contrib/sizes.c mpt-status-1.2.0/contrib/sizes.c --- mpt-status-1.2.0-RC7/contrib/sizes.c 2006-04-24 19:29:45.000000000 +0200 +++ mpt-status-1.2.0/contrib/sizes.c 2006-10-25 10:24:52.000000000 +0200 @@ -1,6 +1,8 @@ #include #include +/* This was once used to help debugging 32/64 bit issues with mpt-status. */ + int main(void) { printf("int: %d\n" "char ptr: %d\n" diff -Nur mpt-status-1.2.0-RC7/doc/AUTHORS mpt-status-1.2.0/doc/AUTHORS --- mpt-status-1.2.0-RC7/doc/AUTHORS 2006-05-02 19:46:10.000000000 +0200 +++ mpt-status-1.2.0/doc/AUTHORS 2006-11-01 09:27:36.000000000 +0100 @@ -2,4 +2,4 @@ Matthew Braithwaite New author (see Changelog): -Roberto Nibali, ratz +Roberto Nibali, ratz diff -Nur mpt-status-1.2.0-RC7/doc/Changelog mpt-status-1.2.0/doc/Changelog --- mpt-status-1.2.0-RC7/doc/Changelog 2006-05-02 19:42:29.000000000 +0200 +++ mpt-status-1.2.0/doc/Changelog 2006-11-01 10:16:06.000000000 +0100 @@ -1,10 +1,58 @@ +2006-11-01, ratz [ratz@drugphish.ch]: + o man/mpt-status.8 + - merged contributions from Jean Delvare + - updated with missing sections + o doc/* + - merged misc documentation updates from Jean Delvare + - tidy up 64bit information since this problem is solved now + o mpt-status.c + - merged documentation updates from Jean Delvare + - removed MPT_STATUS_DEBUG, since this was an unfinished + duplicate version of --debug. + +2006-10-26, ratz [ratz@drugphish.ch]: + o man/{README,mpt-status.8} + - added man page written by Steffen Joeris for the Debian + project. + o Makefile + - integrated preliminary support for the man page installation + and uninstallation through make install, resp. make uninstall + - fixed once again the KERNEL_PATH stuff after Jean Delvare + from Suse mentioned that it broke Suse builds. This time it + should work for both, Suse and Redhat (Fedora). + o mpt-status.c + - added detection if no RAID is configured on HBA. This only + works with the "--newstyle" or "-n" option for safety reasons + and has not yet been tested. + +2006-10-25, ratz [ratz@drugphish.ch]: + o Makefile + - fixed brokenness due to previously applied patch by Rich :). + The point is that LSI-related headers are in the source and + not the include directory of the build symlink. + o mpt-status.c + - Suse packages are compiled with additional flags to detect + possibly problematic code. The checker complained about a call + to system() with unchecked return value in mpt-status. Applied + patch by Jean Delvare. + +2006-06-29, ratz [ratz@drugphish.ch]: + o Makefile + - applied patch from Rich Edelman to set KERNEL_PATH more + intelligently + o contrib/contrib/mpt-status.spec + - generic spec file from Rich Edelman with patch support + - changed quite a lot again actually regarding wording + and also removed the patch section + o contrib/*diff + - remove obsolete diff from tree regarding sanitation + 2006-04-20- 2006-05-02, ratz [ratz@drugphish.ch]: - * Version: 1.2.0-RC6 (not released), after 3 almost complete rewrites + * Version: 1.2.0-RC7 (not released), after 3 almost complete rewrites too many changes happened in between the last two weeks to list them properly. Kernel header sanitizing might not be possible after all. - o mpt-status.c - proper support for 64-bit nodes - added support for spare disk information @@ -25,14 +73,14 @@ 2006-03-09, ratz [ratz@drugphish.ch]: o mpt-status.c - Martin Hamant reported an issue regarding the IOC unit, which - did not work for more than 1 controler. Fix it, by setting + did not work for more than 1 controller. Fix it, by setting ioc_unit as part of the address unit passed over to readpage. 2006-03-06, ratz [ratz@drugphish.ch]: o mpt-status.c - removed SGE debugging lines - added checkForLibraryMode() which reads the __MPT_STATUS_LIB - environment variable and if set will initialise the library + environment variable and if set will initialize the library functionality of mpt-status. - changed the output to please Martin Hamant and to also ease up the scriptability. @@ -63,7 +111,7 @@ too many people complained about it and before the kernel headers are not sanitized, there is no point in trying to address this deficiency - - prelimiary work done for IOCpage5_t support (hotspare) + - preliminary work done for IOCpage5_t support (hotspare) - fixed missing signedness casts o contrib/sizes.c - added a little tool to check the machine's type sizes @@ -84,7 +132,7 @@ - moved print_status_only, id_of_primary_device, ioc_unit into global context, so there is no need to pass those variables through the stack all the time - - reorganised long_options and usage to be in alphabetical + - reorganized long_options and usage to be in alphabetical order - fixed read_page to actually work on LSI-SAS1064 controllers o doc/* @@ -114,7 +162,7 @@ - Added some more switches, check them out with --help The --nietzsche_kills switch is only so I won't forget how to use long options without short options. - - Reorganized include headers to have a legimit C code ;). + - Reorganized include headers to have a legitimate C code ;). --> Check news://comp.std.c for some crazy stuff on C - Style cleanup - Function prototypes are static now, since we're using it only @@ -217,7 +265,7 @@ 2005-05-18, ratz [ratz@tac.ch]: * Version: 1.1.0 o mpt-status.c - - impoved output handling + - improved output handling - documented scsi id issue for address parameter in read_page() - made main() ISO C91 standard compliant - switched position of state versus flags for easy shell parsing diff -Nur mpt-status-1.2.0-RC7/doc/DeveloperNotes mpt-status-1.2.0/doc/DeveloperNotes --- mpt-status-1.2.0-RC7/doc/DeveloperNotes 2006-05-02 19:47:30.000000000 +0200 +++ mpt-status-1.2.0/doc/DeveloperNotes 2006-11-01 09:26:29.000000000 +0100 @@ -57,7 +57,8 @@ Random Notes ------------ The includes pci.h, config.h, header.h are from pciutils. Most distros might -have a pciutils-devel package or somthing similar. +have a pciutils-devel package or something similar. + Directory structure ------------------- @@ -79,41 +80,6 @@ ./contrib/mpt-status.spec -Porting to 64bit ----------------- -The following is a working output of the 64bit ioctl access: - -open("/dev/mptctl", O_RDWR) = 3 -brk(0) = 0x502000 -brk(0x525000) = 0x525000 -ioctl(3, 0xc0486d14, 0x7fbfffc100) = 0 -ioctl(3, 0xc0486d14, 0x7fbfffc100) = 0 -fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0 -mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x2a9556c000 -write(1, "ioc0 vol 0 type IS, 0 phy, 0 GB,"..., 47ioc0 vol 0 type IS, 0 phy, 0 GB, state OPTIMAL -) = 47 -munmap(0x2a9556c000, 4096) = 0 -exit_group(0) = ? - -cpp9:/home/ratz # ltrace mpt-status -__libc_start_main(0x400b00, 1, 0x7fbffff698, 0x400ff0, 0x400fa0 -system("/sbin/modprobe mptctl" ---- SIGCHLD (Child exited) --- -<... system resumed> ) = 0 -open("/dev/mptctl", 2, 00) = 3 -calloc(10240, 1) = 0x502010 -memset(0x7fbfffc100, '\000', 10240) = 0x7fbfffc100 -memset(0x7fbfff9900, '\000', 10240) = 0x7fbfff9900 -memset(0x7fbfff7100, '\000', 10240) = 0x7fbfff7100 -ioctl(3, -1068995308, 0x7fbfffc100) = 0 -ioctl(3, -1068995308, 0x7fbfffc100) = 0 -printf("ioc%d vol %d type %s, %d phy, %d"..., 0, 0, "IS", 0, 0) = 31 -printf(", state") = 7 -printf(" OPTIMAL") = 8 -putchar(10, 0x401195, 0, 8, 0x2a95894b00ioc0 vol 0 type IS, 0 phy, 0 GB, state OPTIMAL -) = 10 -+++ exited (status 0) +++ - Kernel Header Sanitation ------------------------ ks_to_us_header() { @@ -129,5 +95,5 @@ } After having diffed the 2.4.x and 2.6.x kernel trees with regard to the MPT, -I'm quite convinved that a kernel header sanitation will not work in the end. +I'm quite convinced that a kernel header sanitation will not work in the end. diff -Nur mpt-status-1.2.0-RC7/doc/FAQ mpt-status-1.2.0/doc/FAQ --- mpt-status-1.2.0-RC7/doc/FAQ 2006-04-24 19:29:45.000000000 +0200 +++ mpt-status-1.2.0/doc/FAQ 2006-11-01 09:24:48.000000000 +0100 @@ -28,11 +28,11 @@ Excellent. The next version of mpt-status should guide you and detect the slot id (you have id 1) automatically. > Here are my questions. -> 1) Could you tell me from example #1, #2 and #3 where can you see the Raid Level of each hard disk ? +> 1) Could you tell me from example #1, #2 and #3 where can you see the Raid Level of each hard disk? The raid level is not visible, would you like to get this information as well? Or do you want to extract the health state of each disk? -> 2) Could you give the meaning of these abreviations ? +> 2) Could you give the meaning of these abbreviations? Maybe: diff -Nur mpt-status-1.2.0-RC7/doc/INSTALL mpt-status-1.2.0/doc/INSTALL --- mpt-status-1.2.0-RC7/doc/INSTALL 2006-05-02 19:59:09.000000000 +0200 +++ mpt-status-1.2.0/doc/INSTALL 2006-10-26 08:57:27.000000000 +0200 @@ -44,6 +44,12 @@ /var/tmp/package/usr/sbin/mpt-status +You can now also install the man page by invoking + + make install_doc + +This will install the mpt-status.8 man page. + How can I uninstall mpt-status ------------------------------ @@ -65,6 +71,12 @@ make -n uninstall | sh +You can now also uninstall the man page by invoking + + make uninstall_doc + +This will uninstall the mpt-status.8 man page. + If you don't have the kernel sources package installed (Redhat based info) -------------------------------------------------------------------------- diff -Nur mpt-status-1.2.0-RC7/doc/ReleaseNotes mpt-status-1.2.0/doc/ReleaseNotes --- mpt-status-1.2.0-RC7/doc/ReleaseNotes 2006-05-02 19:55:20.000000000 +0200 +++ mpt-status-1.2.0/doc/ReleaseNotes 2006-11-01 12:06:19.000000000 +0100 @@ -1,11 +1,18 @@ -Release Notes mpt-status 1.2.0 (2006-mm-dd) +Release Notes mpt-status 1.2.0 (2006-11-03) ============================== -Codename: +Codename: + +[True master of soccer. If you don't know anything about him, read up on him at +http://en.wikipedia.org/wiki/Zinedine_Zidane. Despite the fact that I'm Italian +and I'm proud that we have won the championship, I'd like to dedicate this +release to my hard-working French contributors. Merci beaucoup et tout est bien +qui finit bien.] + About ----- The mpt-status software is a query tool to access the running configuration and -status of LSI SCSI HBAs. This is a heavily modified version of the original +status of LSI SCSI HBAs. This is a completely version of the original mpt-status-1.0 tool written by Matt Braithwaite. mpt-status allows you to monitor the health and status of your RAID setup. @@ -13,6 +20,8 @@ LSI 1030 SCSI RAID storage controller LSI SAS1064 SCSI RAID storage controller +LSI SAS1068 SCSI RAID storage controller +LSI SAS 3442-R SCSI RAID storage controller Since the tool is using the MPI (message passing interface) changes are high that the basic information regarding RAID status will be available for all @@ -29,15 +38,45 @@ General Information ------------------- - +This is the first release with proper 64bit support and mostly clean interface +querying. On top of that numerous contributions have been merged, please see +the Changelog for further information. As a last minute addition I've decided +to bundle the mpt-status.8 man page into the release drop. This was written +and contributed by Steffen Joeris, the Debian maintainer for mpt-status. + +Preliminary work has been done on integrating S.M.A.R.T information in the +report output. This would allow one to monitor for failing hardware and +preemptively replace it without business interruption. This information can +be queried via the --newstyle/-n parameter. The new style parameter also +provides you with the percentage status of the synchronisation after a +degradation. Problems -------- +None. + + +Reported working hardware configuration +--------------------------------------- +Sun Fire X4100 +Sun Fire X4200 +Sun Fire V20z +Sun Fire V40z +Dell PE2600 +Intel Server with SE7520BD2S boards +HP ProLiant DL320 G4 +IBM eServer BladeCenter LS20 Upgrade ------- +You can upgrade mpt-status without any problems. This has been widely tested +by a broad user base. Outlook ------- +I will take another look at the output format and see if I can improve it. +The other thing is to take a look at integrating more LSI related products +or give better indication on how to use the closed-source CLI tools. + diff -Nur mpt-status-1.2.0-RC7/doc/THANKS mpt-status-1.2.0/doc/THANKS --- mpt-status-1.2.0-RC7/doc/THANKS 2006-05-02 20:03:26.000000000 +0200 +++ mpt-status-1.2.0/doc/THANKS 2006-11-01 09:47:46.000000000 +0100 @@ -2,6 +2,7 @@ specific order or preference, it's only a little tool anyway ;). ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Klaus Ade Johnstad: - Offered me remote access to hardware to develop and test mpt-status. Jean-Philippe Civade: - Various little fixes regarding Redhat based distros @@ -20,7 +21,15 @@ his nodes. Steffen Joeris: - Support for the KFreeBSD project Leandro Santi: - Added support for meaningful exit status +Rich Edelman: - Improved KERNEL_PATH to be distro independent & + added generic RPM spec file support +Jean Delvare: - Provided cleanup patch to quieten possible problematic + code. + - Helpful Suse Contact for mpt-status integration into + SLES and OpenSuse. + - Documentation cleanups and valuable man page additions ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -If I have forgotten you, please drop me an email and I will add you to this -hall of fame list. +If I have forgotten you or to list any of your contribution, please drop me an +email and I will add you to this hall of fame list. diff -Nur mpt-status-1.2.0-RC7/Makefile mpt-status-1.2.0/Makefile --- mpt-status-1.2.0-RC7/Makefile 2006-05-02 20:01:54.000000000 +0200 +++ mpt-status-1.2.0/Makefile 2006-10-26 09:11:03.000000000 +0200 @@ -1,12 +1,18 @@ PROG := mpt-status PREFIX := /usr KERNEL_PATH := /usr/src/linux -CFLAGS := -Iincl -Wall -W -O2 -I${KERNEL_PATH}/drivers/message/fusion +KERNEL_PATH_B := /lib/modules/`uname -r`/build +KERNEL_PATH_S := /lib/modules/`uname -r`/source +CFLAGS := -Iincl -Wall -W -O2 \ + -I${KERNEL_PATH}/drivers/message/fusion \ + -I${KERNEL_PATH_B}/drivers/message/fusion \ + -I${KERNEL_PATH_S}/drivers/message/fusion DFLAGS := #-DSANITIZED_KERNEL_HEADERS LDFLAGS := DESTDIR := +MANDIR := /usr/share/man CC := gcc -INSTALL := install +INSTALL := install -D ARCH := $(shell uname -m) ifeq "${ARCH}" "sparc64" @@ -18,14 +24,23 @@ ${CC} ${DFLAGS} ${CFLAGS} -o $@ $< ${LDFLAGS} install: ${PROG} - ${INSTALL} -s -o root -g root -m 0500 $< ${DESTDIR}${PREFIX}/sbin + ${INSTALL} -s -o root -g root -m 0500 $< \ + ${DESTDIR}${PREFIX}/sbin + +install_doc: man/${PROG}.8 + ${INSTALL} -o root -g root -m 0644 $< \ + ${DESTDIR}${MANDIR}/man8 + gzip -9 ${DESTDIR}${MANDIR}/man8 uninstall: \rm -f ${DESTDIR}${PREFIX}/sbin/${PROG} +uninstall_doc: + \rm -f ${DESTDIR}${MANDIR}/man8/${PROG}.8.gz + clean: \rm -f ${PROG} distclean: clean - \rm -f core* + \rm -f core* *~ diff -Nur mpt-status-1.2.0-RC7/man/mpt-status.8 mpt-status-1.2.0/man/mpt-status.8 --- mpt-status-1.2.0-RC7/man/mpt-status.8 1970-01-01 01:00:00.000000000 +0100 +++ mpt-status-1.2.0/man/mpt-status.8 2006-11-01 10:28:19.000000000 +0100 @@ -0,0 +1,99 @@ +.\" Hey, EMACS: -*- nroff -*- +.\" First parameter, NAME, should be all caps +.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection +.\" other parameters are allowed: see man(7), man(1) +.TH MPT-STATUS 8 "November 2006" + +.SH NAME +mpt-status \- retrieve configuration and health status from LSI hardware RAID controllers + +.SH SYNOPSIS +.B mpt-status [ options ] + +.SH DESCRIPTION +The mpt-status software is a query tool to access the running +configuration and status of LSI SCSI HBAs. mpt-status allows you to +monitor the health and status of your RAID setup. + +.SH OPTIONS +.TP +.B \~ \^ \-\-autoload +This will try to automatically load the mptctl kernel module. +.TP +.B \-u \-\-controller +Set the IOC unit (controller). +.TP +.B \-h \-\-help +Print some help information. +.TP +.B \-n \-\-newstyle +Use the new style output. This parameter was introduced to retain +backwards compatibility. If not set, you get the old style output. +It is very likely that the output of the newstyle format is changing +heavily in future, so do not count on it when writing plugins for +monitoring software, for example. +.TP +.B \-i \-\-set_id +Set id of primary device (check README). +.TP +.B \-p \-\-probe_id +Use this to probe SCSI id's when not on id 0. +.TP +.B \-q \-\-quiet +Do not display any warnings. +.TP +.B \-s \-\-status_only +Only print the status information. This can +be used for easy scripting +.TP +.B \-v \-\-verbose +Print verbose information, such as warnings +.TP +.B \-V \-\-version +Print version information +.TP +.B \-d \-\-debug [] +Enable debugging and set level optionally. +NOTE: This is not fully implemented yet. + +.SH DIAGNOSTICS +The program's exit(2) status is meant to be interpreted as a bit +mask. If everything went well, zero is returned. If not (i.e. if +for example an error or unknown condition is detected), the bits +of the return value shall be interpreted as: +.TS +r r l +___ +r r l. +Bit Value Meaning +0 1 Abnormal condition / unknown error +1 2 A logical volume has failed +2 4 A logical volume is degraded +3 8 A logical volume is resyncing +4 16 At least one physical disk failed +5 32 At least one physical disk is in warning condition +.TE + +.SH REPORTING BUGS +Report bugs to your linux distribution or software vendor, if mpt-status +was bundled on your installation. If you have been compiling mpt-status +from the vanilla sources and experience problems, redirect them to +preferably or . + +.SH BUGS +Besides design bugs, gross software engineering and missing features, +this software is considered pretty stable and can be used in production +environments. + +.SH FILES +.I /dev/mptctl + +.SH SEE ALSO +LSI Logic provides CLI tools for megaraid controllers which you can find +on their webpage. + +.SH AUTHOR +mpt-status was written by Roberto Nibali . +.PP +This manual page was written by Steffen Joeris , +for the Debian project (but may be used by others). diff -Nur mpt-status-1.2.0-RC7/man/README mpt-status-1.2.0/man/README --- mpt-status-1.2.0-RC7/man/README 1970-01-01 01:00:00.000000000 +0100 +++ mpt-status-1.2.0/man/README 2006-10-26 08:55:19.000000000 +0200 @@ -0,0 +1,12 @@ +This is the man page written by Steffen Joeris for the Debian project. +I have shamelessly taken this from his patchset against mpt-status, +which can be found here: + + http://packages.debian.org/unstable/admin/mpt-status + +The reasons I've done this, is that according to the man page I'm allowed +to do so and there's absolutely no point in some other distribution not +having a man page. It's all about the marginal unity of the distributions. + +I'd like to thank Steffen Joeris for his work (because the last time I've +written a man page was probably in 1996). Files mpt-status-1.2.0-RC7/mpt-status and mpt-status-1.2.0/mpt-status differ diff -Nur mpt-status-1.2.0-RC7/mpt-status.c mpt-status-1.2.0/mpt-status.c --- mpt-status-1.2.0-RC7/mpt-status.c 2006-05-11 21:39:00.000000000 +0200 +++ mpt-status-1.2.0/mpt-status.c 2006-11-01 10:13:35.000000000 +0100 @@ -92,23 +92,7 @@ " You can write ``-o arg'' or ``--option arg'' or ``--option=arg''\n" " Note that for some parameters only the long format is supported.\n" "\n" - " The program's exit(2) status is meant to be interpreted as a bit\n" - " mask. If everything went well, zero is returned. If not (i.e. if\n" - " for example an error or unknown condition is detected), the eight\n" - " different bits of the return value shall be interpreded as:\n" - "\n" - " Bit 0: Abnormal condition detected. This includes -but it's not\n" - " limited to- unknown error conditions.\n" - " Bit 1: A logical volume has failed.\n" - " Bit 2: A logical volume is degraded.\n" - " Bit 3: A logical volume is resyncing.\n" - " Bit 4: At least one physical disk failed.\n" - " Bit 5: At least one physical disk is in warning condition.\n" - "\n" - " Setting the MPT_STATUS_DEBUG environment variable will enable the\n" - " internal debugging and help the author further improve this tool.\n" - " Example: ``MPT_STATUS_DEBUG=42 ./mpt-status'' will enable debug and\n" - " set the debug level to 42.\n" + " For more information, please refer to mpt-status(8).\n" "\n" "\n"; @@ -134,6 +118,7 @@ static void print_usage(const char *); static void print_version(void); static int read_page2(uint); +//static int hasVolume(void); static void GetVolumeInfo(void); static void GetPhysDiskInfo(RaidVol0PhysDisk_t *, int); static void GetHotSpareInfo(void); @@ -142,25 +127,11 @@ static void do_init(void); /* internal-functions declaration */ static void __check_endianess(void); -static void __check_for_debug_mode(void); static void __print_volume_advanced(RaidVolumePage0_t *); static void __print_volume_classic(RaidVolumePage0_t *); static void __print_physdisk_advanced(RaidPhysDiskPage0_t *, int); static void __print_physdisk_classic(RaidPhysDiskPage0_t *); -static void __check_for_debug_mode(void) { - char *env; - - env = getenv("MPT_STATUS_DEBUG"); - if (env != NULL) { - debug = 1; - debug_level = strtol(env, NULL, 10); - mpt_printf("Setting DEBUG mode with debug_level = %d\n", - debug_level); - free(env); - } -} - static void __check_endianess(void) { int i = 1; @@ -293,7 +264,10 @@ } static void print_version(void) { - mpt_printf("Version: %s\n", VERSION); + mpt_printf("mpt-status version : %s\n", VERSION); + /* Next version (needs mptbase.h) + mpt_printf("Driver header version: %s\n", MPT_LINUX_VERSION_COMMON); + */ } static int __probe_scsi_id2(void) { @@ -382,6 +356,62 @@ return status; } +/* Will be needed for detecting if a HBA has its SCSI disks configured as RAID +static int hasVolume(void) { + Config_t *ConfigRequest; + ConfigReply_t *pReply = NULL; + IOCPage2_t *pIOC2 = NULL; + uint numBytes; + uint numVolumes = 0; + int status; + unsigned bus = id_of_primary_device; + + numBytes = (sizeof(Config_t) - sizeof(SGE_IO_UNION)) + + sizeof(SGESimple64_t); + if ((mpiBlkPtr = allocIoctlBlk(numBytes)) == NULL) { + return numVolumes; + } + + ConfigRequest = (Config_t *) mpiBlkPtr->MF; + mpiBlkPtr->dataInSize = mpiBlkPtr->dataOutSize = 0; + mpiBlkPtr->dataInBufPtr = mpiBlkPtr->dataOutBufPtr = NULL; + mpiBlkPtr->dataSgeOffset = (sizeof (Config_t) - sizeof(SGE_IO_UNION))/4; + + pReply = (ConfigReply_t *)mpiBlkPtr->replyFrameBufPtr; + + ConfigRequest->Action = MPI_CONFIG_ACTION_PAGE_HEADER; + ConfigRequest->Function = MPI_FUNCTION_CONFIG; + ConfigRequest->MsgContext = -1; + ConfigRequest->Header.PageType = MPI_CONFIG_PAGETYPE_IOC; + ConfigRequest->Header.PageNumber = ioc_unit; + ConfigRequest->PageAddress = bus; + + status = read_page2(MPT_FLAGS_KEEP_MEM); + if (status != 0 || pReply->Header.PageLength == 0) { + freeMem(); + return numVolumes; + } + mpiBlkPtr->dataInSize = pReply->Header.PageLength * 4; + if (allocDataFrame(DATA_DIR_IN)) { + mpt_printf("Increase data buffer size"); + freeMem(); + return numVolumes; + } + ConfigRequest->Action = MPI_CONFIG_ACTION_PAGE_READ_CURRENT; + ConfigRequest->Header.PageVersion = pReply->Header.PageVersion; + ConfigRequest->Header.PageLength = pReply->Header.PageLength; + ConfigRequest->PageAddress = bus; + status = read_page2(MPT_FLAGS_KEEP_MEM); + + pIOC2 = (IOCPage2_t *) mpiBlkPtr->dataInBufPtr; + if (status == 0){ + numVolumes = pIOC2->NumActiveVolumes; + } + freeMem(); + return numVolumes; +} +*/ + /* This function is only written to get the information of Volume 0 */ static void GetVolumeInfo(void) { Config_t *ConfigRequest; @@ -1062,9 +1092,14 @@ static void do_init(void) { int save_errno; + int status; if (auto_load > 0) { - system("/sbin/modprobe mptctl"); + status = system("/sbin/modprobe mptctl"); + if (status < 0 || 0 != WEXITSTATUS(status)) { + mpt_fprintf(stderr, "Failed to load mptctl\n"); + mpt_exit(MPT_EXIT_UNKNOWN|MPT_EXIT_NOCLOSE); + } } m = open("/dev/mptctl", O_RDWR); if (-1 == m) { @@ -1143,13 +1178,20 @@ } } while (next_option != -1); - __check_for_debug_mode(); do_init(); if (newstyle > 0) { __check_endianess(); if (probe_id > 0) { id_of_primary_device = __probe_scsi_id2(); } + /* This will be enabled and properly coded after the release + if (hasVolume() > 0) { + GetVolumeInfo(); + } else { + mpt_printf("No RAID is configured\n"); + mpt_exit(MPT_EXIT_UNKNOWN); + } + */ GetVolumeInfo(); } else { /* this is the old style setup */ diff -Nur mpt-status-1.2.0-RC7/mpt-status.h mpt-status-1.2.0/mpt-status.h --- mpt-status-1.2.0-RC7/mpt-status.h 2006-05-02 18:53:57.000000000 +0200 +++ mpt-status-1.2.0/mpt-status.h 2006-10-26 10:06:52.000000000 +0200 @@ -20,13 +20,12 @@ #include "lsi/mpi.h" #include "lsi/mpi_ioc.h" #include "lsi/mpi_cnfg.h" -//#include "lsi/mpi_init.h" #include "lsi/mpi_raid.h" -//#include "lsi/mpi_tool.h" #include "mptctl.h" +//#include "mptbase.h" #endif // SANITIZED_KERNEL_HEADERS -#define VERSION "1.2.0-RC7" +#define VERSION "1.2.0" #define BIG 1024 #define REALLYBIG 10240