summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rwxr-xr-xconfigure20
-rw-r--r--configure.ac2
-rw-r--r--debpkg/changelog12
-rw-r--r--doc/Makefile28
-rw-r--r--doc/UserGuide2
-rw-r--r--doc/ipmiutil.spec3
-rw-r--r--lib/Makefile28
-rw-r--r--lib/libipmiutil.pc2
-rw-r--r--scripts/Makefile28
-rwxr-xr-xscripts/ipmi.init.basic12
-rwxr-xr-xsetver2
-rw-r--r--util/ievents.c2
-rw-r--r--util/ifru.c76
-rw-r--r--util/ifruset.c5
-rw-r--r--util/ilan.c232
-rw-r--r--util/ipmiutil.c2
17 files changed, 230 insertions, 230 deletions
diff --git a/ChangeLog b/ChangeLog
index 798485c..894361c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4317,3 +4317,7 @@ wdt.8 iwdt.8 (ipmiutil wdt)
04/17/2018 ARCress ipmiutil-3.1.0 changes (iver 3.10)
util/ievents.c - add decode_mem_default routine for AMI,HP mem events
not handled by existing oem routines (SFBug#32)
+
+05/15/2018 ARCress ipmiutil-3.1.1 changes (iver 3.11)
+ scripts/ipmi.init.basic - add acpi_ipmi module handling
+ util/ifru.c - if C5, get reservation again on retry (SFBug#33)
diff --git a/configure b/configure
index cdc8287..f04afa9 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.63 for ipmiutil 3.1.0.
+# Generated by GNU Autoconf 2.63 for ipmiutil 3.1.1.
#
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
@@ -743,8 +743,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='ipmiutil'
PACKAGE_TARNAME='ipmiutil'
-PACKAGE_VERSION='3.1.0'
-PACKAGE_STRING='ipmiutil 3.1.0'
+PACKAGE_VERSION='3.1.1'
+PACKAGE_STRING='ipmiutil 3.1.1'
PACKAGE_BUGREPORT=''
ac_unique_file="util/ipmiutil.c"
@@ -1503,7 +1503,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures ipmiutil 3.1.0 to adapt to many kinds of systems.
+\`configure' configures ipmiutil 3.1.1 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1573,7 +1573,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of ipmiutil 3.1.0:";;
+ short | recursive ) echo "Configuration of ipmiutil 3.1.1:";;
esac
cat <<\_ACEOF
@@ -1683,7 +1683,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-ipmiutil configure 3.1.0
+ipmiutil configure 3.1.1
generated by GNU Autoconf 2.63
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1697,7 +1697,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by ipmiutil $as_me 3.1.0, which was
+It was created by ipmiutil $as_me 3.1.1, which was
generated by GNU Autoconf 2.63. Invocation command line was
$ $0 $@
@@ -2551,7 +2551,7 @@ fi
# Define the identity of the package.
PACKAGE='ipmiutil'
- VERSION='3.1.0'
+ VERSION='3.1.1'
cat >>confdefs.h <<_ACEOF
@@ -13957,7 +13957,7 @@ exec 6>&1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by ipmiutil $as_me 3.1.0, which was
+This file was extended by ipmiutil $as_me 3.1.1, which was
generated by GNU Autoconf 2.63. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -14020,7 +14020,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
-ipmiutil config.status 3.1.0
+ipmiutil config.status 3.1.1
configured by $0, generated by GNU Autoconf 2.63,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff --git a/configure.ac b/configure.ac
index 6b03203..edd4d56 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script.
-AC_INIT(ipmiutil,3.1.0)
+AC_INIT(ipmiutil,3.1.1)
AC_CONFIG_SRCDIR(util/ipmiutil.c)
echo "ipmiutil version ${PACKAGE_VERSION}"
AC_CONFIG_HEADERS(config.h)
diff --git a/debpkg/changelog b/debpkg/changelog
index c9082cf..9e8a8e7 100644
--- a/debpkg/changelog
+++ b/debpkg/changelog
@@ -1,3 +1,15 @@
+ipmiutil (3.1.1-1) unstable; urgency=low
+
+ * New upstream version.
+
+ -- Andy Cress <arcress@users.sourceforge.net> Mon, 14 May 2018 17:08:08 -0400
+
+ipmiutil (3.1.1-1) unstable; urgency=low
+
+ * New upstream version.
+
+ -- Andy Cress <arcress@users.sourceforge.net> Mon, 14 May 2018 17:07:55 -0400
+
ipmiutil (3.1.0-1) unstable; urgency=low
* New upstream version.
diff --git a/doc/Makefile b/doc/Makefile
index 6bedc71..8486cb1 100644
--- a/doc/Makefile
+++ b/doc/Makefile
@@ -46,12 +46,12 @@ CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = ${SHELL} /usr/dev/ipmiutil-3.1.0/missing --run aclocal-1.11
-AMTAR = ${SHELL} /usr/dev/ipmiutil-3.1.0/missing --run tar
+ACLOCAL = ${SHELL} /usr/dev/ipmiutil-3.1.1/missing --run aclocal-1.11
+AMTAR = ${SHELL} /usr/dev/ipmiutil-3.1.1/missing --run tar
AR = ar
-AUTOCONF = ${SHELL} /usr/dev/ipmiutil-3.1.0/missing --run autoconf
-AUTOHEADER = ${SHELL} /usr/dev/ipmiutil-3.1.0/missing --run autoheader
-AUTOMAKE = ${SHELL} /usr/dev/ipmiutil-3.1.0/missing --run automake-1.11
+AUTOCONF = ${SHELL} /usr/dev/ipmiutil-3.1.1/missing --run autoconf
+AUTOHEADER = ${SHELL} /usr/dev/ipmiutil-3.1.1/missing --run autoheader
+AUTOMAKE = ${SHELL} /usr/dev/ipmiutil-3.1.1/missing --run automake-1.11
AWK = gawk
CC = gcc
CCDEPMODE = depmode=gcc3
@@ -99,7 +99,7 @@ LIB_DIR = /usr/lib64
LIPO =
LN_S = ln -s
LTLIBOBJS =
-MAKEINFO = ${SHELL} /usr/dev/ipmiutil-3.1.0/missing --run makeinfo
+MAKEINFO = ${SHELL} /usr/dev/ipmiutil-3.1.1/missing --run makeinfo
MKDIR_P = /bin/mkdir -p
NM = /usr/bin/nm -B
NMEDIT =
@@ -113,9 +113,9 @@ OTOOL64 =
PACKAGE = ipmiutil
PACKAGE_BUGREPORT =
PACKAGE_NAME = ipmiutil
-PACKAGE_STRING = ipmiutil 3.1.0
+PACKAGE_STRING = ipmiutil 3.1.1
PACKAGE_TARNAME = ipmiutil
-PACKAGE_VERSION = 3.1.0
+PACKAGE_VERSION = 3.1.1
PATH_SEPARATOR = :
PKG_DIR = /root/rpmbuild
RANLIB = ranlib
@@ -127,11 +127,11 @@ SHR_LINK = libipmiutil.so.1
STRIP = strip
SUBDIR_S = doc scripts lib util
SYSTEMD_DIR = /usr/share/ipmiutil
-VERSION = 3.1.0
-abs_builddir = /usr/dev/ipmiutil-3.1.0/doc
-abs_srcdir = /usr/dev/ipmiutil-3.1.0/doc
-abs_top_builddir = /usr/dev/ipmiutil-3.1.0
-abs_top_srcdir = /usr/dev/ipmiutil-3.1.0
+VERSION = 3.1.1
+abs_builddir = /usr/dev/ipmiutil-3.1.1/doc
+abs_srcdir = /usr/dev/ipmiutil-3.1.1/doc
+abs_top_builddir = /usr/dev/ipmiutil-3.1.1
+abs_top_srcdir = /usr/dev/ipmiutil-3.1.1
ac_ct_CC = gcc
ac_ct_DUMPBIN =
am__include = include
@@ -159,7 +159,7 @@ host_vendor = redhat
htmldir = ${docdir}
includedir = ${prefix}/include
infodir = ${datarootdir}/info
-install_sh = ${SHELL} /usr/dev/ipmiutil-3.1.0/install-sh
+install_sh = ${SHELL} /usr/dev/ipmiutil-3.1.1/install-sh
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
localedir = ${datarootdir}/locale
diff --git a/doc/UserGuide b/doc/UserGuide
index d4286f2..7f7b705 100644
--- a/doc/UserGuide
+++ b/doc/UserGuide
@@ -1,6 +1,6 @@
IPMIUTIL USER GUIDE
- VERSION 3.1.0
+ VERSION 3.1.1
An easy-to-use IPMI server management utility
diff --git a/doc/ipmiutil.spec b/doc/ipmiutil.spec
index cbca232..27b4b67 100644
--- a/doc/ipmiutil.spec
+++ b/doc/ipmiutil.spec
@@ -3,7 +3,7 @@
# Copyright (c) 2012 Andy Cress
#
Name: ipmiutil
-Version: 3.1.0
+Version: 3.1.1
Release: 1%{?dist}
Summary: Easy-to-use IPMI server management utilities
License: BSD
@@ -279,6 +279,7 @@ else
IPMIret=1
which dmidecode >/dev/null 2>&1 && IPMIret=0
if [ $IPMIret -eq 0 ]; then
+ IPMIret=1
%{_sbindir}/dmidecode |grep -q IPMI && IPMIret=0
if [ $IPMIret -eq 0 ]; then
if [ -d %{_sysconfdir}/cron.daily ]; then
diff --git a/lib/Makefile b/lib/Makefile
index 9f6e3fc..00489fb 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -47,12 +47,12 @@ CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = ${SHELL} /usr/dev/ipmiutil-3.1.0/missing --run aclocal-1.11
-AMTAR = ${SHELL} /usr/dev/ipmiutil-3.1.0/missing --run tar
+ACLOCAL = ${SHELL} /usr/dev/ipmiutil-3.1.1/missing --run aclocal-1.11
+AMTAR = ${SHELL} /usr/dev/ipmiutil-3.1.1/missing --run tar
AR = ar
-AUTOCONF = ${SHELL} /usr/dev/ipmiutil-3.1.0/missing --run autoconf
-AUTOHEADER = ${SHELL} /usr/dev/ipmiutil-3.1.0/missing --run autoheader
-AUTOMAKE = ${SHELL} /usr/dev/ipmiutil-3.1.0/missing --run automake-1.11
+AUTOCONF = ${SHELL} /usr/dev/ipmiutil-3.1.1/missing --run autoconf
+AUTOHEADER = ${SHELL} /usr/dev/ipmiutil-3.1.1/missing --run autoheader
+AUTOMAKE = ${SHELL} /usr/dev/ipmiutil-3.1.1/missing --run automake-1.11
AWK = gawk
CC = gcc
CCDEPMODE = depmode=gcc3
@@ -101,7 +101,7 @@ LIB_DIR = /usr/lib64
LIPO =
LN_S = ln -s
LTLIBOBJS =
-MAKEINFO = ${SHELL} /usr/dev/ipmiutil-3.1.0/missing --run makeinfo
+MAKEINFO = ${SHELL} /usr/dev/ipmiutil-3.1.1/missing --run makeinfo
MKDIR_P = /bin/mkdir -p
NM = /usr/bin/nm -B
NMEDIT =
@@ -115,9 +115,9 @@ OTOOL64 =
PACKAGE = ipmiutil
PACKAGE_BUGREPORT =
PACKAGE_NAME = ipmiutil
-PACKAGE_STRING = ipmiutil 3.1.0
+PACKAGE_STRING = ipmiutil 3.1.1
PACKAGE_TARNAME = ipmiutil
-PACKAGE_VERSION = 3.1.0
+PACKAGE_VERSION = 3.1.1
PATH_SEPARATOR = :
PKG_DIR = /root/rpmbuild
RANLIB = ranlib
@@ -129,11 +129,11 @@ SHR_LINK = libipmiutil.so.1
STRIP = strip
SUBDIR_S = doc scripts lib util
SYSTEMD_DIR = /usr/share/ipmiutil
-VERSION = 3.1.0
-abs_builddir = /usr/dev/ipmiutil-3.1.0/lib
-abs_srcdir = /usr/dev/ipmiutil-3.1.0/lib
-abs_top_builddir = /usr/dev/ipmiutil-3.1.0
-abs_top_srcdir = /usr/dev/ipmiutil-3.1.0
+VERSION = 3.1.1
+abs_builddir = /usr/dev/ipmiutil-3.1.1/lib
+abs_srcdir = /usr/dev/ipmiutil-3.1.1/lib
+abs_top_builddir = /usr/dev/ipmiutil-3.1.1
+abs_top_srcdir = /usr/dev/ipmiutil-3.1.1
ac_ct_CC = gcc
ac_ct_DUMPBIN =
am__include = include
@@ -161,7 +161,7 @@ host_vendor = redhat
htmldir = ${docdir}
includedir = ${prefix}/include
infodir = ${datarootdir}/info
-install_sh = ${SHELL} /usr/dev/ipmiutil-3.1.0/install-sh
+install_sh = ${SHELL} /usr/dev/ipmiutil-3.1.1/install-sh
libdir = $(iprefix)/lib
libexecdir = ${exec_prefix}/libexec
localedir = ${datarootdir}/locale
diff --git a/lib/libipmiutil.pc b/lib/libipmiutil.pc
index 54373d5..97613b6 100644
--- a/lib/libipmiutil.pc
+++ b/lib/libipmiutil.pc
@@ -8,6 +8,6 @@ nutuser=@RUN_AS_USER@
Name: libipmiutil
Description: Library for ipmiutil
-Version: 3.1.0
+Version: 3.1.1
Libs: -L${libdir} -lipmi_lanplus
Cflags: -I${includedir}
diff --git a/scripts/Makefile b/scripts/Makefile
index a2b013c..36c3148 100644
--- a/scripts/Makefile
+++ b/scripts/Makefile
@@ -46,12 +46,12 @@ CONFIG_CLEAN_VPATH_FILES =
SOURCES =
DIST_SOURCES =
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
-ACLOCAL = ${SHELL} /usr/dev/ipmiutil-3.1.0/missing --run aclocal-1.11
-AMTAR = ${SHELL} /usr/dev/ipmiutil-3.1.0/missing --run tar
+ACLOCAL = ${SHELL} /usr/dev/ipmiutil-3.1.1/missing --run aclocal-1.11
+AMTAR = ${SHELL} /usr/dev/ipmiutil-3.1.1/missing --run tar
AR = ar
-AUTOCONF = ${SHELL} /usr/dev/ipmiutil-3.1.0/missing --run autoconf
-AUTOHEADER = ${SHELL} /usr/dev/ipmiutil-3.1.0/missing --run autoheader
-AUTOMAKE = ${SHELL} /usr/dev/ipmiutil-3.1.0/missing --run automake-1.11
+AUTOCONF = ${SHELL} /usr/dev/ipmiutil-3.1.1/missing --run autoconf
+AUTOHEADER = ${SHELL} /usr/dev/ipmiutil-3.1.1/missing --run autoheader
+AUTOMAKE = ${SHELL} /usr/dev/ipmiutil-3.1.1/missing --run automake-1.11
AWK = gawk
CC = gcc
CCDEPMODE = depmode=gcc3
@@ -99,7 +99,7 @@ LIB_DIR = /usr/lib64
LIPO =
LN_S = ln -s
LTLIBOBJS =
-MAKEINFO = ${SHELL} /usr/dev/ipmiutil-3.1.0/missing --run makeinfo
+MAKEINFO = ${SHELL} /usr/dev/ipmiutil-3.1.1/missing --run makeinfo
MKDIR_P = /bin/mkdir -p
NM = /usr/bin/nm -B
NMEDIT =
@@ -113,9 +113,9 @@ OTOOL64 =
PACKAGE = ipmiutil
PACKAGE_BUGREPORT =
PACKAGE_NAME = ipmiutil
-PACKAGE_STRING = ipmiutil 3.1.0
+PACKAGE_STRING = ipmiutil 3.1.1
PACKAGE_TARNAME = ipmiutil
-PACKAGE_VERSION = 3.1.0
+PACKAGE_VERSION = 3.1.1
PATH_SEPARATOR = :
PKG_DIR = /root/rpmbuild
RANLIB = ranlib
@@ -127,11 +127,11 @@ SHR_LINK = libipmiutil.so.1
STRIP = strip
SUBDIR_S = doc scripts lib util
SYSTEMD_DIR = /usr/share/ipmiutil
-VERSION = 3.1.0
-abs_builddir = /usr/dev/ipmiutil-3.1.0/scripts
-abs_srcdir = /usr/dev/ipmiutil-3.1.0/scripts
-abs_top_builddir = /usr/dev/ipmiutil-3.1.0
-abs_top_srcdir = /usr/dev/ipmiutil-3.1.0
+VERSION = 3.1.1
+abs_builddir = /usr/dev/ipmiutil-3.1.1/scripts
+abs_srcdir = /usr/dev/ipmiutil-3.1.1/scripts
+abs_top_builddir = /usr/dev/ipmiutil-3.1.1
+abs_top_srcdir = /usr/dev/ipmiutil-3.1.1
ac_ct_CC = gcc
ac_ct_DUMPBIN =
am__include = include
@@ -159,7 +159,7 @@ host_vendor = redhat
htmldir = ${docdir}
includedir = ${prefix}/include
infodir = ${datarootdir}/info
-install_sh = ${SHELL} /usr/dev/ipmiutil-3.1.0/install-sh
+install_sh = ${SHELL} /usr/dev/ipmiutil-3.1.1/install-sh
libdir = ${exec_prefix}/lib
libexecdir = ${exec_prefix}/libexec
localedir = ${datarootdir}/locale
diff --git a/scripts/ipmi.init.basic b/scripts/ipmi.init.basic
index bff8e55..3321183 100755
--- a/scripts/ipmi.init.basic
+++ b/scripts/ipmi.init.basic
@@ -21,6 +21,8 @@
#=====
#
rv=0
+kver=`uname -r`
+moddir=/lib/modules/$kver/kernel/drivers
start() {
lsmod |grep ipmi_dev >/dev/null
@@ -29,14 +31,14 @@ start() {
# load the ipmi modules, if not already loaded or builtin
cat /proc/kallsyms |grep ipmi_init_msghandler >/dev/null 2>&1
if [ $? -ne 0 ]; then
- modprobe ipmi_msghandler
+ modprobe ipmi_msghandler
fi
cat /proc/kallsyms |grep init_ipmi_si >/dev/null 2>&1
if [ $? -ne 0 ]; then
modprobe ipmi_si
rv=$?
if [ $rv -ne 0 ]; then
- modprobe ipmi_si_drv # try old module name
+ modprobe ipmi_si_drv # try old module name
fi
fi
modprobe ipmi_devintf
@@ -45,6 +47,10 @@ start() {
if [ $? -ne 0 ]; then
modprobe ipmi_watchdog 2>/dev/null
fi
+ if [ -f $moddir/acpi/acpi_ipmi.ko ]; then
+ modprobe acpi_ipmi
+ modprobe power_meter
+ fi
fi
maj=$(cat /proc/devices | awk '/ipmidev/{print $1}')
@@ -58,6 +64,8 @@ stop() {
lsmod |grep ipmi_msghandler >/dev/null
if [ $? -eq 0 ]; then
echo "Stopping OpenIPMI driver ..."
+ rmmod power_meter 2>/dev/null
+ rmmod acpi_ipmi 2>/dev/null
rmmod ipmi_poweroff 2>/dev/null
rmmod ipmi_watchdog 2>/dev/null
rmmod ipmi_devintf 2>/dev/null
diff --git a/setver b/setver
index aa9c119..b0b5cfe 100755
--- a/setver
+++ b/setver
@@ -6,7 +6,7 @@
# [doinc?] is 'n'.
# if [doinc?] is 'r', reverse increment (decrement).
#
-ver=3.1.0
+ver=3.1.1
rel=1
tmped=/tmp/edver.tmp
tmpspec=/tmp/edspec.tmp
diff --git a/util/ievents.c b/util/ievents.c
index d37d5fd..bb3a81f 100644
--- a/util/ievents.c
+++ b/util/ievents.c
@@ -80,7 +80,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
extern char *progver; /*from ipmiutil.c*/
static char * progname = "ipmiutil events";
#else
-static char *progver = "3.08";
+static char *progver = "3.11";
static char *progname = "ievents";
#endif
static char fsensdesc = 0; /* 1= get extended sensor descriptions*/
diff --git a/util/ifru.c b/util/ifru.c
index effa9b7..86e47bf 100644
--- a/util/ifru.c
+++ b/util/ifru.c
@@ -116,7 +116,7 @@ extern int ipmi_kontronoem_main(void * intf, int argc, char ** argv);
extern char *progver; /*from ipmiutil.c*/
static char *progname = "ipmiutil fru";
#else
-static char *progver = "3.08";
+static char *progver = "3.11";
static char *progname = "ifru";
#endif
@@ -200,7 +200,7 @@ static int sdr_get_reservation(uchar *res_id, int fdev) { return(-1); }
#define STRING_DATA_TYPE_SIX_BIT_ASCII 0x02
#define STRING_DATA_TYPE_LANG_DEPENDENT 0x03
-#define FRUCHUNK_SZ 16
+#define FRUCHUNK_SZ 16 /* optimal chunk = 16 bytes */
#define FRU_END 0xC1
#define FRU_EMPTY_FIELD 0xC0
#define FRU_TYPE_MASK 0xC0
@@ -270,7 +270,7 @@ int
load_fru(uchar sa, uchar frudev, uchar frutype, uchar **pfrubuf)
{
int ret = 0;
- uchar indata[16];
+ uchar indata[FRUCHUNK_SZ+9];
uchar resp[18];
int sresp;
uchar cc;
@@ -282,6 +282,7 @@ load_fru(uchar sa, uchar frudev, uchar frutype, uchar **pfrubuf)
if (pfrubuf == NULL) return(ERR_BAD_PARAM);
*pfrubuf = NULL;
+ memset(indata, 0, sizeof(indata));
indata[0] = frudev;
sresp = sizeof(resp);
if (fdebug) printf("load_fru: sa=%02x, frudev=%02x, addrtype=%d\n",
@@ -315,14 +316,14 @@ load_fru(uchar sa, uchar frudev, uchar frutype, uchar **pfrubuf)
}
indata[1] = fruoff & 0x00FF;
indata[2] = (fruoff & 0xFF00) >> 8;
- sresp = sizeof(resp);
+ sresp = sizeof(resp);
ret = ipmi_cmd_mc(READ_FRU_DATA,indata,4,resp,&sresp,&cc,fdebug);
- if (ret != 0) break;
- else if (cc != 0) {
- if (i == 0) ret = cc & 0x00ff;
- if (fdebug) printf("read_fru[%d]: ret = %d cc = %x\n",i,ret,cc);
- break;
- }
+ if (ret != 0) break;
+ else if (cc != 0) {
+ if (i == 0) ret = cc & 0x00ff;
+ if (fdebug) printf("read_fru[%d]: ret = %d cc = %x\n",i,ret,cc);
+ break;
+ }
memcpy(&frubuf[i],&resp[1],chunk);
}
@@ -338,16 +339,16 @@ load_fru(uchar sa, uchar frudev, uchar frutype, uchar **pfrubuf)
if (fdebug) printf("get_SystemGuid: ret = %d\n",rv);
}
if (rv == 0 && cc == 0) {
- if (fdebug) {
- printf("system guid (%d): ",sresp);
- for (i=0; i<16; i++) printf("%02x ",resp[i]);
- printf("\n");
- }
- memcpy(&guid,&resp,16);
- guid[16] = 0;
+ if (fdebug) {
+ printf("system guid (%d): ",sresp);
+ for (i=0; i<16; i++) printf("%02x ",resp[i]);
+ printf("\n");
+ }
+ memcpy(&guid,&resp,16);
+ guid[16] = 0;
} else {
- printf("WARNING: GetSystemGuid error %d, %s\n",rv,decode_rv(rv));
- /*do not pass this error upstream*/
+ printf("WARNING: GetSystemGuid error %d, %s\n",rv,decode_rv(rv));
+ /*do not pass this error upstream*/
}
} /*endif*/
return(ret);
@@ -1077,8 +1078,8 @@ int write_fru_data(uchar id, ushort offset, uchar *data, int dlen, char fdebug)
int ret = -1;
int chunk;
ushort fruoff;
- uchar req[25];
- uchar resp[16];
+ uchar req[FRUCHUNK_SZ+9];
+ uchar resp[FRUCHUNK_SZ];
int sresp;
uchar cc;
int i, j;
@@ -1880,25 +1881,26 @@ int i_fru(int argc, char **argv)
recid = 0;
while (recid != LAST_REC)
{
- if (do_reserve) {
+ if (do_reserve) {
/* reserve the SDR repository */
ret = sdr_get_reservation((uchar *)&rsvid,fdevsdrs);
if (fdebug) printf("sdr_get_reservation ret=%d\n",ret);
- if (ret == 0) do_reserve = 0;
- }
-
- len = sizeof(sdr); /*sizeof(sdr); get 32 sdr bytes*/
- ret = get_sdr(recid,rsvid,&nextid,sdr,&len,&cc);
- if ((ret != 0) || (cc != 0)) {
- printf("SDR[%04x] error %d ccode = %x\n",recid,ret,cc);
- if ((cc == 0xC5) || (cc == 0x83)) ; /*do not stop (ARC)*/
- else break; /*stop if errors*/
- }
- if (len >= MIN_SDR_SZ) {
- if ((sdr[3] == 0x11) || (sdr[3] == 0x12)) /*SDR FRU or IPMB type*/
- ret = get_show_fru(recid, sdr,len);
- do_reserve = 1;
- } /*endif get_show_fru */
+ if (ret == 0) do_reserve = 0;
+ }
+
+ len = sizeof(sdr); /*sizeof(sdr); get 32 sdr bytes*/
+ ret = get_sdr(recid,rsvid,&nextid,sdr,&len,&cc);
+ if ((ret != 0) || (cc != 0)) {
+ printf("SDR[%04x] error %d ccode = %x\n",recid,ret,cc);
+ if (cc == 0xC5) do_reserve = 1; /*retry w reserve*/
+ if (cc == 0x83) os_usleep(0,100); /*busy, retry*/
+ else break; /*stop if errors*/
+ }
+ if (len >= MIN_SDR_SZ) {
+ if ((sdr[3] == 0x11) || (sdr[3] == 0x12)) /*SDR FRU or IPMB type*/
+ ret = get_show_fru(recid, sdr,len);
+ do_reserve = 1;
+ } /*endif get_show_fru */
#ifdef PICMG_CHILD
/*
* Special logic for blade child MCs in PICMG ATCA systems
diff --git a/util/ifruset.c b/util/ifruset.c
index fbde21e..b2f8b66 100644
--- a/util/ifruset.c
+++ b/util/ifruset.c
@@ -245,7 +245,7 @@ int
load_fru(uchar sa, uchar frudev, uchar frutype)
{
int ret = 0;
- uchar indata[16];
+ uchar indata[FRUCHUNK_SZ];
uchar resp[18];
int sresp;
uchar cc;
@@ -255,6 +255,7 @@ load_fru(uchar sa, uchar frudev, uchar frutype)
int i;
int chunk;
+ memset(indata, 0, sizeof(indata));
indata[0] = frudev;
sresp = sizeof(resp);
if (fdebug) printf("load_fru: sa = %02x, frudev = %02x\n",sa,frudev);
@@ -923,7 +924,7 @@ write_fru_data(uchar id, ushort offset, uchar *data, int dlen, char fdebug)
int ret = -1;
int chunk;
ushort fruoff;
- uchar req[25];
+ uchar req[FRUCHUNK_SZ+9];
uchar resp[16];
int sresp;
uchar cc;
diff --git a/util/ilan.c b/util/ilan.c
index 8364c88..635a22a 100644
--- a/util/ilan.c
+++ b/util/ilan.c
@@ -4098,7 +4098,8 @@ main(int argc, char **argv)
while ((c =
getopt (argc, argv,
"a:b:cdef:gh:i:j:klm:n:op:q:rstu:v:w:xy:z#::A:B:C:DEF:G:H:I:J:K:L:M:N:OP:Q:R:S:T:U:V:X:YZ:?"))
- != EOF) {
+ != EOF)
+ {
switch (c) {
case 'a': /* alert dest number (usu 1 thru 4) */
alertnum = atob (optarg);
@@ -4126,12 +4127,11 @@ main(int argc, char **argv)
break;
case 'f':
i = atoi (optarg); /*set arp_ctl */
- if (i < 0 || i > 3)
- printf ("Invalid ARP control %d\n", i);
+ if (i < 0 || i > 3) printf ("Invalid ARP control %d\n", i);
else {
- arp_ctl = i;
- fsetarp = 1;
- j++;
+ arp_ctl = i;
+ fsetarp = 1;
+ j++;
}
break;
case 'l':
@@ -4143,39 +4143,34 @@ main(int argc, char **argv)
case 'h': /* VLAN ID */
i = atoi (optarg);
if (i > 4095)
- vlan_enable = 0;
+ vlan_enable = 0;
else {
- vlan_enable = 1;
- vlan_id = (ushort) i;
+ vlan_enable = 1;
+ vlan_id = (ushort) i;
}
j++;
break;
case 'y': /* OEM LAN Failover enable/disable */
i = atoi (optarg);
- if (i < 0)
- printf ("Failover(-y) parameter is negative\n");
- else
- failover_enable = i;
+ if (i < 0) printf ("Failover(-y) parameter is negative\n");
+ else failover_enable = i;
j++;
break;
case 'Q': /* VLAN Priority */
i = atoi (optarg);
- if (i > 7 || i < 0)
- vlan_enable = 0;
+ if (i > 7 || i < 0) vlan_enable = 0;
else {
- vlan_enable = 1;
- vlan_prio = (uchar) i;
+ vlan_enable = 1;
+ vlan_prio = (uchar) i;
}
j++;
break;
case 'i': /* eth interface (ifname) */
fsetifn = 1;
i = sizeof (ifname);
- if (strlen (optarg) > (uint) i)
- optarg[i] = 0;
+ if (strlen (optarg) > (uint) i) optarg[i] = 0;
strcpy (ifname, optarg);
- if (fdebug)
- printf ("ifname = %s\n", ifname);
+ if (fdebug) printf ("ifname = %s\n", ifname);
j++;
break;
case 'j':
@@ -4194,15 +4189,15 @@ main(int argc, char **argv)
custPEF[8] = htoi (&optarg[16]); /*data1offset */
custPEF[9] = htoi (&optarg[18]); /*data1mask */
if (optarg[20] != 0) {
- /* optionally get 8 extra PEF entry bytes */
- custPEF[10] = htoi (&optarg[20]); /*data1cmp1 */
- custPEF[11] = htoi (&optarg[22]); /*data1cmp2 */
- custPEF[12] = htoi (&optarg[24]); /*data2mask */
- custPEF[13] = htoi (&optarg[26]); /*data2cmp1 */
- custPEF[14] = htoi (&optarg[28]); /*data2cmp2 */
- custPEF[15] = htoi (&optarg[30]); /*data3mask */
- custPEF[16] = htoi (&optarg[32]); /*data3cmp1 */
- custPEF[17] = htoi (&optarg[34]); /*data3cmp2 */
+ /* optionally get 8 extra PEF entry bytes */
+ custPEF[10] = htoi (&optarg[20]); /*data1cmp1 */
+ custPEF[11] = htoi (&optarg[22]); /*data1cmp2 */
+ custPEF[12] = htoi (&optarg[24]); /*data2mask */
+ custPEF[13] = htoi (&optarg[26]); /*data2cmp1 */
+ custPEF[14] = htoi (&optarg[28]); /*data2cmp2 */
+ custPEF[15] = htoi (&optarg[30]); /*data3mask */
+ custPEF[16] = htoi (&optarg[32]); /*data3cmp1 */
+ custPEF[17] = htoi (&optarg[34]); /*data3cmp2 */
}
j++;
break;
@@ -4217,11 +4212,11 @@ main(int argc, char **argv)
fpefenable = 1;
pefnum = atob (optarg);
if (pefnum >= MAXPEF) {
- pefnum = MAXPEF - 1;
- fAdjustPefNum = 1;
+ pefnum = MAXPEF - 1;
+ fAdjustPefNum = 1;
}
else
- fUserPefNum = 1;
+ fUserPefNum = 1;
j++;
break;
case 'o':
@@ -4242,18 +4237,14 @@ main(int argc, char **argv)
break;
case 'v': /* user access privilege level */
i = atoi (optarg);
- if (valid_priv (i))
- lan_access = i & 0x0f;
- else
- printf ("Invalid privilege -v %d, using Admin\n", i);
+ if (valid_priv (i)) lan_access = i & 0x0f;
+ else printf ("Invalid privilege -v %d, using Admin\n", i);
j++;
break;
case 'w':
i = atoi (optarg); /*set grat arp interval, in #sec */
- if (i >= 0 && i < 256)
- arp_interval = i * 2;
- else
- printf ("Invalid arp interval -w %d, skipping\n", i);
+ if (i >= 0 && i < 256) arp_interval = i * 2;
+ else printf ("Invalid arp interval -w %d, skipping\n", i);
break;
case 'x':
fdebug = 1;
@@ -4276,8 +4267,7 @@ main(int argc, char **argv)
break;
case 'M': /* My BMC MAC Address */
atomac (rgmymac, optarg);
- if (!MacIsValid (rgmymac))
- printf ("Invalid MAC for -M\n");
+ if (!MacIsValid (rgmymac)) printf ("Invalid MAC for -M\n");
j++;
break;
case 'S': /* Subnet IP Address */
@@ -4296,8 +4286,7 @@ main(int argc, char **argv)
break;
case 'H': /* Gateway MAC Address */
atomac (rggwymac, optarg);
- if (!MacIsValid (rggwymac))
- printf ("Invalid MAC for -H\n");
+ if (!MacIsValid (rggwymac)) printf ("Invalid MAC for -H\n");
j++;
break;
case 'B': /* SOL Baud rate */
@@ -4314,8 +4303,7 @@ main(int argc, char **argv)
break;
case 'X': /* Alert Dest MAC Address */
atomac (rgdestmac, optarg);
- if (!MacIsValid (rgdestmac))
- printf ("Invalid MAC for -X\n");
+ if (!MacIsValid (rgdestmac)) printf ("Invalid MAC for -X\n");
fpefenable = 1; /* PEF is implied here */
j++;
break;
@@ -4329,8 +4317,7 @@ main(int argc, char **argv)
case 'C': /* Community String */
fsetcommunity = 1;
i = sizeof (rgcommunity); /*usu 18 */
- if (strlen (optarg) > (uint) i)
- optarg[i] = 0;
+ if (strlen (optarg) > (uint) i) optarg[i] = 0;
strcpy (rgcommunity, optarg);
fpefenable = 1; /* PEF is implied here */
j++;
@@ -4344,8 +4331,7 @@ main(int argc, char **argv)
if (strlen (optarg) > PSW_MAX)
optarg[PSW_MAX] = 0;
strcpy (passwordData, optarg);
- if (fdebug)
- printf ("Password = %s\n", passwordData);
+ if (fdebug) printf ("Password = %s\n", passwordData);
/* Hide password from 'ps' */
memset (optarg, ' ', strlen (optarg));
j++;
@@ -4353,16 +4339,15 @@ main(int argc, char **argv)
case 'q':
case '#':
usernum = atob (optarg);
- if (usernum > 15)
- usernum = 0; /*MAX_IPMI_USERS = 15 */
+ if (usernum > 15) usernum = 0; /*MAX_IPMI_USERS = 15 */
j++;
break;
case 'L':
if (strcmp (optarg, "list") == 0)
- fshowchan = 1;
+ fshowchan = 1;
lan_ch_parm = atob (optarg);
if (lan_ch_parm > MAXCHAN)
- lan_ch_parm = PARM_INIT; /*invalid */
+ lan_ch_parm = PARM_INIT; /*invalid */
break;
case 'V': /* priv level */
fprivset = 1;
@@ -4474,90 +4459,78 @@ main(int argc, char **argv)
pefmax = 20; /*default Intel PEF */
switch (prod_id) {
case 0x4311: /* Intel NSI2U w SE7520JR23 */
- fmBMC = 1; /* Intel miniBMC */
- if (pefnum == 12)
- pefnum = 14; /* change CritStop pefnum */
- pefdesc = &pefdesc2[0]; /*mini-BMC PEF */
- pefmax = 30;
- fsharedMAC = 1; /* shared-MAC BMC LAN port, same MAC */
- break;
+ fmBMC = 1; /* Intel miniBMC */
+ if (pefnum == 12) pefnum = 14; /* change CritStop pefnum */
+ pefdesc = &pefdesc2[0]; /*mini-BMC PEF */
+ pefmax = 30;
+ fsharedMAC = 1; /* shared-MAC BMC LAN port, same MAC */
+ break;
case 0x0022: /* Intel TIGI2U w SE7520JR23 +IMM */
- fsharedMAC = 1; /* shared-MAC BMC LAN port, same MAC */
- gcm_ch = 3; /* IMM GCM port, dedicated MAC */
- show_users = 4;
- break;
+ fsharedMAC = 1; /* shared-MAC BMC LAN port, same MAC */
+ gcm_ch = 3; /* IMM GCM port, dedicated MAC */
+ show_users = 4;
+ break;
case 0x000C: /*TSRLT2 */
case 0x001B: /*TIGPR2U */
- /* fmBMC=0; Intel Sahalee BMC */
- fsharedMAC = 1; /* shared-MAC BMC LAN port, same MAC */
- break;
+ /* fmBMC=0; Intel Sahalee BMC */
+ fsharedMAC = 1; /* shared-MAC BMC LAN port, same MAC */
+ break;
case 0x0026: /*S5000 Bridgeport */
case 0x0028: /*S5000PAL Alcolu */
case 0x0029: /*S5000PSL StarLake */
case 0x0811: /*S5000PHB TIGW1U */
- /* fmBMC=0; Intel Sahalee ESB2 BMC */
- fsharedMAC = 0; /* not-shared BMC LAN port, separate MAC */
- gcm_ch = 3;
- parm7 = &iparm7[0]; /*TTL=30 */
- break;
+ /* fmBMC=0; Intel Sahalee ESB2 BMC */
+ fsharedMAC = 0; /* not-shared BMC LAN port, separate MAC */
+ gcm_ch = 3;
+ parm7 = &iparm7[0]; /*TTL=30 */
+ break;
case 0x003E: /*NSN2U or CG2100 Urbanna */
- fiBMC = 1; /* Intel iBMC */
- fsharedMAC = 0; /* not-shared BMC LAN port, separate MAC */
- // gcm_ch = 3;
- parm7 = &iparm7[0]; /*TTL=30 */
- if (fsetarp == 0)
- arp_ctl = 0x02; /*grat arp disabled, arp resp enabled */
- arp_interval = 0x00; /*0 sec, since grat arp disabled */
- sol_accum[0] = 0x0c; /*Intel defaults */
- sol_accum[1] = 0x60; /*Intel defaults */
- sol_retry[0] = 0x07; /*Intel defaults */
- sol_retry[1] = 0x32; /*Intel defaults */
- set_max_kcs_loops (URNLOOPS); /*longer for SetLan cmds (default 300) */
- break;
+ fiBMC = 1; /* Intel iBMC */
+ fsharedMAC = 0; /* not-shared BMC LAN port, separate MAC */
+ // gcm_ch = 3;
+ parm7 = &iparm7[0]; /*TTL=30 */
+ if (fsetarp == 0) arp_ctl = 0x02; /*grat arp disabled,arp resp enabled*/
+ arp_interval = 0x00; /*0 sec, since grat arp disabled */
+ sol_accum[0] = 0x0c; /*Intel defaults */
+ sol_accum[1] = 0x60; /*Intel defaults */
+ sol_retry[0] = 0x07; /*Intel defaults */
+ sol_retry[1] = 0x32; /*Intel defaults */
+ set_max_kcs_loops (URNLOOPS); /*longer for SetLan cmds (default 300)*/
+ break;
case 0x0107: /* Intel Caneland */
- fsharedMAC = 0; /* not-shared BMC LAN port, separate MAC */
- gcm_ch = 3;
- break;
+ fsharedMAC = 0; /* not-shared BMC LAN port, separate MAC */
+ gcm_ch = 3;
+ break;
case 0x0100: /*Tiger2 ia64 */
- /* for ia64 set chan_pefon, chan_pefoff accordingly */
- chan_pefon = CHAN_ACC_PEFON64;
- chan_pefoff = CHAN_ACC_PEFOFF64;
- /* fall through */
+ /* for ia64 set chan_pefon, chan_pefoff accordingly */
+ chan_pefon = CHAN_ACC_PEFON64;
+ chan_pefoff = CHAN_ACC_PEFOFF64;
+ /* fall through */
default: /* else other Intel */
- /* fmBMC = 0; * Intel Sahalee BMC */
- if (fIPMI20)
- fsharedMAC = 0; /* recent, not-shared BMC MAC */
- else
- fsharedMAC = 1; /* usu IPMI 1.x has shared BMC MAC */
- break;
+ /* fmBMC = 0; * Intel Sahalee BMC */
+ if (fIPMI20) fsharedMAC = 0; /* recent, not-shared BMC MAC */
+ else fsharedMAC = 1; /* usu IPMI 1.x has shared BMC MAC */
+ break;
} /*end switch */
- if (is_romley (vend_id, prod_id))
- fRomley = 1;
- if (is_grantley (vend_id, prod_id))
- fGrantley = 1;
+ if (is_romley(vend_id, prod_id)) fRomley = 1;
+ if (is_grantley(vend_id, prod_id)) fGrantley = 1;
if (fRomley) {
- fiBMC = 1; /* Intel iBMC */
- fsharedMAC = 0; /* not-shared BMC LAN port, separate MAC */
- set_max_kcs_loops (URNLOOPS); /*longer for SetLan (default 300) */
- fipv6 = 1;
- if (fsetarp == 0)
- arp_ctl = 0x03; /*default to both for Romley */
+ fiBMC = 1; /* Intel iBMC */
+ fsharedMAC = 0; /* not-shared BMC LAN port, separate MAC */
+ set_max_kcs_loops (URNLOOPS); /*longer for SetLan (default 300) */
+ fipv6 = 1;
+ if (fsetarp == 0) arp_ctl = 0x03; /*default to both for Romley */
}
}
else { /* else other vendors */
- if (fIPMI20)
- fsharedMAC = 0; /* recent, not-shared BMC MAC */
- else
- fsharedMAC = 1; /* usu IPMI 1.x has shared BMC MAC */
+ if (fIPMI20) fsharedMAC = 0; /* recent, not-shared BMC MAC */
+ else fsharedMAC = 1; /* usu IPMI 1.x has shared BMC MAC */
pefdesc = NULL; /* unknown, see PefDesc() */
- if (pefnum == 12)
- pefnum = 15; /* change CritStop pefnum to 15? */
+ if (pefnum == 12) pefnum = 15; /* change CritStop pefnum to 15? */
pefmax = 20;
- if (!fUserPefNum)
- fAdjustPefNum = 1;
+ if (!fUserPefNum) fAdjustPefNum = 1;
}
- if (fmBMC)
- show_users = 1; /* mBMC doesn't support more than 1 user */
+ if (fmBMC) show_users = 1; /* mBMC doesn't support more than 1 user */
}
if (fshowchan) {
@@ -4583,16 +4556,15 @@ main(int argc, char **argv)
i = 0; /* default to eth0, lan_ch set already. */
if (vend_id == VENDOR_INTEL) {
if ((prod_id == 0x001B) || (prod_id == 0x000c)) {
- /* Intel TIGPR2U or TSRLT2 defaults are special */
- if (lan_ch_parm == 6) {
- i = 0;
- lan_ch = 6;
- }
- else {
- i = 1;
- lan_ch = 7;
- }
- ser_ch = 1;
+ /* Intel TIGPR2U or TSRLT2 defaults are special */
+ if (lan_ch_parm == 6) {
+ i = 0;
+ lan_ch = 6;
+ } else {
+ i = 1;
+ lan_ch = 7;
+ }
+ ser_ch = 1;
}
}
}
diff --git a/util/ipmiutil.c b/util/ipmiutil.c
index e2a23d4..eea67d0 100644
--- a/util/ipmiutil.c
+++ b/util/ipmiutil.c
@@ -57,7 +57,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "ipmiutil.h"
static char *progname = "ipmiutil";
-char *progver = "3.10";
+char *progver = "3.11";
// static char fdebug = 0;
/*int ipmiutil(int argc, char **argv); */