rpms/openhpi/devel openhpi-2.8.1-snmp_bc_discover.patch, NONE, 1.1 openhpi.spec, 1.52, 1.53
Phil Knirsch (pknirsch)
fedora-extras-commits at redhat.com
Tue Jul 17 13:46:31 UTC 2007
Author: pknirsch
Update of /cvs/pkgs/rpms/openhpi/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv29156
Modified Files:
openhpi.spec
Added Files:
openhpi-2.8.1-snmp_bc_discover.patch
Log Message:
- Fixed a bug where the snmp_bc plugin didn't work in IBM BC (#247280)
openhpi-2.8.1-snmp_bc_discover.patch:
--- NEW FILE openhpi-2.8.1-snmp_bc_discover.patch ---
--- openhpi-2.8.1/plugins/snmp_bc/snmp_bc_discover_bc.c.orig 2007-06-21 12:30:59.000000000 +0300
+++ openhpi-2.8.1/plugins/snmp_bc/snmp_bc_discover_bc.c 2007-06-21 12:31:13.000000000 +0300
@@ -399,6 +399,41 @@ char *bladeexpansiondesc[] = {
"Blade PCI I/O Expansion, PEU"
};
+#define get_dualmode_object2(strOID, maskOID, getintvalue) \
+do { \
+ err = snmp_bc_snmp_get(custom_handle, maskOID, &getintvalue, SAHPI_TRUE); \
+ if (err == SA_ERR_HPI_NOT_PRESENT) { \
+ getintvalue.type = ASN_INTEGER; \
+ getintvalue.integer = 0; \
+ } else if (err != SA_OK) { \
+ trace("Cannot get OID=%s; Received Type=%d; Error=%s.", \
+ maskOID, getintvalue.type, oh_lookup_error(err)); \
+ dbg("Cannot get OID=%s ('%s' info)", maskOID, strOID); \
+ } else { \
+ if (getintvalue.type == ASN_OCTET_STR) { \
+ getintvalue.integer = atoi(getintvalue.string); \
+ } else if (getintvalue.type == ASN_INTEGER) { \
+ if (getintvalue.integer == 1) getintvalue.integer = 10; \
+ } \
+ } \
+} while(0)
+
+#define get_installed_mask2(strOID, maskOID, getvalue) \
+do { \
+ err = snmp_bc_snmp_get(custom_handle, maskOID, &getvalue, SAHPI_TRUE); \
+ if (err || getvalue.type != ASN_OCTET_STR) { \
+ trace("Cannot get OID=%s; Received Type=%d; Error=%s.", \
+ maskOID, getvalue.type, oh_lookup_error(err)); \
+ dbg("Cannot get OID=%s ('%s' info)", maskOID, strOID); \
+ } else if (err == SA_ERR_HPI_NOT_PRESENT) { \
+ getvalue.type = ASN_OCTET_STR; \
+ memset(&getvalue.string, '0', SNMP_BC_MAX_RESOURCES_MASK); \
+ getvalue.string[SNMP_BC_MAX_RESOURCES_MASK -1] = '\0'; \
+ } else { \
+ return(SA_ERR_HPI_INTERNAL_ERROR); \
+ } \
+} while(0)
+
/**
* snmp_bc_discover:
* @handler: Pointer to handler's data.
@@ -468,26 +503,31 @@ SaErrorT snmp_bc_discover(struct oh_hand
/* Fetch filter (front bezel) installed vector */
- get_dualmode_object(SNMP_BC_FILTER_INSTALLED, get_value_filter);
-
+ // get_dualmode_object(SNMP_BC_FILTER_INSTALLED, get_value_filter);
+ get_dualmode_object2("FILTER", SNMP_BC_FILTER_INSTALLED, get_value_filter);
+
/* Fetch blower installed vector */
get_installed_mask(SNMP_BC_BLOWER_INSTALLED, get_value_blower);
-
+
/* Fetch telco-alarm-panel installed vector */
- get_installed_mask(SNMP_BC_AP_INSTALLED, get_value_tap);
-
+ // get_installed_mask(SNMP_BC_AP_INSTALLED, get_value_tap);
+ get_installed_mask2("TELCO-ALARM-PANEL", SNMP_BC_AP_INSTALLED, get_value_tap);
+
/* Fetch network-clock-card installed vector */
- get_installed_mask(SNMP_BC_NC_INSTALLED, get_value_nc);
-
+ // get_installed_mask(SNMP_BC_NC_INSTALLED, get_value_nc);
+ get_installed_mask2("NETWORK-CLOCK-CARD", SNMP_BC_AP_INSTALLED, get_value_tap);
+
/* Fetch mux-card installed vector */
- get_installed_mask(SNMP_BC_MX_INSTALLED, get_value_mx);
+ // get_installed_mask(SNMP_BC_MX_INSTALLED, get_value_mx);
+ get_installed_mask2("MUX-CARD", SNMP_BC_MX_INSTALLED, get_value_mx);
/* Fetch switch interposer-card installed vector */
get_installed_mask(SNMP_BC_SMI_INSTALLED, get_value_smi);
/* Fetch mm interposer-card installed vector */
- get_installed_mask(SNMP_BC_MMI_INSTALLED, get_value_mmi);
-
+ // get_installed_mask(SNMP_BC_MMI_INSTALLED, get_value_mmi);
+ get_installed_mask2("INTERPOSER-CARD", SNMP_BC_MMI_INSTALLED, get_value_mmi);
+
if ( (g_ascii_strncasecmp(get_value_blade.string, custom_handle->installed_pb_mask, get_value_blade.str_len) == 0) &&
(g_ascii_strncasecmp(get_value_blower.string, custom_handle->installed_blower_mask, get_value_blower.str_len) == 0) &&
(g_ascii_strncasecmp(get_value_power_module.string, custom_handle->installed_pm_mask, get_value_power_module.str_len) == 0) &&
Index: openhpi.spec
===================================================================
RCS file: /cvs/pkgs/rpms/openhpi/devel/openhpi.spec,v
retrieving revision 1.52
retrieving revision 1.53
diff -u -r1.52 -r1.53
--- openhpi.spec 4 Jun 2007 12:37:18 -0000 1.52
+++ openhpi.spec 17 Jul 2007 13:45:59 -0000 1.53
@@ -1,12 +1,13 @@
Summary: openhpi Hardware Platform Interface (HPI) library and tools
Name: openhpi
Version: 2.8.1
-Release: 2%{?dist}
+Release: 3%{?dist}
License: BSD
Group: System Environment/Base
Source: http://prdownloads.sourceforge.net/openhpi/%{name}-%{version}.tar.gz
Source1: openhpi.conf
Patch1: openhpi-2.8.0-werror.patch
+Patch2: openhpi-2.8.1-snmp_bc_discover.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: libsysfs-devel, net-snmp-devel, OpenIPMI-devel, glib2-devel
BuildRequires: elfutils-devel, rpm-devel, libtool-ltdl-devel, bzip2-devel
@@ -40,6 +41,7 @@
%prep
%setup -q
%patch1 -p1 -b .werror
+%patch2 -p1 -b .snmp_bc_discover
%build
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
@@ -90,6 +92,9 @@
%changelog
+* Tue Jul 17 2007 Phil Knirsch <pknirsch at redhat.com> - 2.8.1-3
+- Fixed a bug where the snmp_bc plugin didn't work in IBM BC (#247280)
+
* Mon Jun 04 2007 Phil Knirsch <pknirsch at redhat.com> - 2.8.1-2.fc7
- Fixed missing e2fsprogs-devel and openssl-devel build requires
More information about the scm-commits
mailing list