[Nut-upsdev] bcmxcp: get right firmware version

Henning Brauer hb-nut at bsws.de
Wed Aug 23 11:11:49 UTC 2006


at least for an HP R3000XR with the 6-cereal card, the first CPU is 
said 6-port card, not the inverter. so get the firmware version from 
the last CPU, not the first.
I wonder wether it makes more sense to store them all, aka 
ups.firmware.cpu0 etc.

$OpenBSD$
--- drivers/bcmxcp.c.orig	Wed Aug 23 11:16:01 2006
+++ drivers/bcmxcp.c	Wed Aug 23 11:21:26 2006
@@ -742,10 +742,7 @@ void upsdrv_initinfo(void)
 				(unsigned char)answer[iIndex]);
 			iIndex += 2;
 			len--;
-		} while ((strcmp("00.00", dstate_getinfo("ups.firmware")) == 0) && len > 0);
-
-		/* Increment index to point at end of CPU bytes. */
-		iIndex += len * 2;
+		} while (len > 0);
 	}
 
 	/* Get rating in kVA, if present */

-- 
Henning Brauer, hb at bsws.de, henning at openbsd.org
BS Web Services, http://bsws.de
OpenBSD-based Webhosting, Mail Services, Managed Servers, ...



More information about the Nut-upsdev mailing list