summaryrefslogtreecommitdiffstats
path: root/usr.sbin/mptutil
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2010-02-19 14:31:01 +0000
committerjhb <jhb@FreeBSD.org>2010-02-19 14:31:01 +0000
commite2e4685935bccf21629efeb6947f54dd998fc4c5 (patch)
tree89e668bd2772b26ebb59f22d3a30bf927c23ce57 /usr.sbin/mptutil
parented5edbc4c685113dee4262ddda3362382be54ba5 (diff)
downloadFreeBSD-src-e2e4685935bccf21629efeb6947f54dd998fc4c5.zip
FreeBSD-src-e2e4685935bccf21629efeb6947f54dd998fc4c5.tar.gz
- Don't emit a warning in 'show adapter' if the IOC2 or IOC6 pages are not
present. mpt(4) controllers that do not support RAID do not have an IOC6 page, for example. - Correct a check for a missing page error in a debug function. MFC after: 1 week
Diffstat (limited to 'usr.sbin/mptutil')
-rw-r--r--usr.sbin/mptutil/mpt_show.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/usr.sbin/mptutil/mpt_show.c b/usr.sbin/mptutil/mpt_show.c
index e0b6b74..5a2a946 100644
--- a/usr.sbin/mptutil/mpt_show.c
+++ b/usr.sbin/mptutil/mpt_show.c
@@ -78,6 +78,7 @@ show_adapter(int ac, char **av)
CONFIG_PAGE_MANUFACTURING_0 *man0;
CONFIG_PAGE_IOC_2 *ioc2;
CONFIG_PAGE_IOC_6 *ioc6;
+ U16 IOCStatus;
int fd, comma;
if (ac != 1) {
@@ -108,7 +109,7 @@ show_adapter(int ac, char **av)
free(man0);
- ioc2 = mpt_read_ioc_page(fd, 2, NULL);
+ ioc2 = mpt_read_ioc_page(fd, 2, &IOCStatus);
if (ioc2 != NULL) {
printf(" RAID Levels:");
comma = 0;
@@ -151,9 +152,11 @@ show_adapter(int ac, char **av)
printf(" none");
printf("\n");
free(ioc2);
- }
+ } else if ((IOCStatus & MPI_IOCSTATUS_MASK) !=
+ MPI_IOCSTATUS_CONFIG_INVALID_PAGE)
+ warnx("mpt_read_ioc_page(2): %s", mpt_ioc_status(IOCStatus));
- ioc6 = mpt_read_ioc_page(fd, 6, NULL);
+ ioc6 = mpt_read_ioc_page(fd, 6, &IOCStatus);
if (ioc6 != NULL) {
display_stripe_map(" RAID0 Stripes",
ioc6->SupportedStripeSizeMapIS);
@@ -172,7 +175,9 @@ show_adapter(int ac, char **av)
printf("-%u", ioc6->MaxDrivesIME);
printf("\n");
free(ioc6);
- }
+ } else if ((IOCStatus & MPI_IOCSTATUS_MASK) !=
+ MPI_IOCSTATUS_CONFIG_INVALID_PAGE)
+ warnx("mpt_read_ioc_page(6): %s", mpt_ioc_status(IOCStatus));
/* TODO: Add an ioctl to fetch IOC_FACTS and print firmware version. */
@@ -541,7 +546,8 @@ show_physdisks(int ac, char **av)
for (i = 0; i <= 0xff; i++) {
pinfo = mpt_pd_info(fd, i, &IOCStatus);
if (pinfo == NULL) {
- if (IOCStatus != MPI_IOCSTATUS_CONFIG_INVALID_PAGE)
+ if ((IOCStatus & MPI_IOCSTATUS_MASK) !=
+ MPI_IOCSTATUS_CONFIG_INVALID_PAGE)
warnx("mpt_pd_info(%d): %s", i,
mpt_ioc_status(IOCStatus));
continue;
OpenPOWER on IntegriCloud