Bug#539747:

2010-02-07 Thread Charles Lepple
This should be fixed in the next 2.4.x release of NUT.

From Arjen de Korte:

There are two solutions in the driver:

1) Use the automatically detected 'phoenix' subdriver that flushes the
input before sending a command (similar to the patch submitted and also
similar to the megatec_usb driver). Bad side effect is the mandatory wait
for the input to timeout, so I'm not to thrilled about that.

2) Use the 'ippon' subdriver (configured in 'ups.conf') that reads in one
big 64-byte chunk, which seems to be a better match for this specific USB
to serial controller (see recent activity on the upsdev mailinglist).





--
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of unsubscribe. Trouble? Contact listmas...@lists.debian.org



Bug#539747: nut: Driver patch for Ippon BCP800 (06da/0003) to work with blazer_usb

2009-08-03 Thread Danya Alexeyevsky
Package: nut
Version: 2.4.1-3
Severity: normal
Tags: patch


Attached patch makes phoenix subdriver of blazer_usb useable for Ippon BCP800

I also sent the patch directly to upstream mailing list: 
http://lists.alioth.debian.org/pipermail/nut-upsdev/2009-August/003976.html

Cheers,
-- Danya

-- System Information:
Debian Release: squeeze/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'unstable'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.30-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=C, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages nut depends on:
ii  adduser  3.110   add and remove users and groups
ii  debconf  1.5.27  Debian configuration management sy
ii  libc62.9-12  GNU C Library: Shared libraries
ii  libupsclient12.4.1-3 network UPS tools - client library
ii  libusb-0.1-4 2:0.1.12-13 userspace USB programming library
ii  libwrap0 7.6.q-18Wietse Venema's TCP wrappers libra
ii  lsb-base 3.2-22  Linux Standard Base 3.2 init scrip
ii  udev 0.141-1 /dev/ and hotplug management daemo

Versions of packages nut recommends:
ii  bash-completion   1:1.0-3programmable completion for the ba

Versions of packages nut suggests:
pn  nut-cgi   none (no description available)
pn  nut-dev   none (no description available)
pn  nut-snmp  none (no description available)
pn  nut-xml   none (no description available)

-- debconf information:
  nut/major_upstream_changes:
--- nut-2.4.1.orig/drivers/blazer_usb.c	2009-02-17 12:20:48.0 +0300
+++ nut-2.4.1/drivers/blazer_usb.c	2009-08-01 20:39:46.128727718 +0400
@@ -47,6 +47,23 @@
 static int (*subdriver_command)(const char *cmd, char *buf, size_t buflen) = NULL;
 
 
+static int phoenix_flush_io()
+{
+	static 
+	char buf[SMALLBUF+1];
+	int i, ret;
+	upsdebugx(3, phoenix_flush_io);
+	for(i = 0; i  10; i++) {
+		memset(buf, 0, sizeof(buf));
+		/* ret = usb-get_interrupt(udev, (unsigned char *)buf, 8, 1000); */
+		ret = usb_interrupt_read(udev, 0x81, buf, SMALLBUF, 1000);
+		upsdebugx(4, flush(%d,%d) - '%s', ret, strlen(buf), buf);
+		if (ret  1)
+			break;
+	}
+	return 0;
+}
+
 static int phoenix_command(const char *cmd, char *buf, size_t buflen)
 {
 	char	tmp[SMALLBUF];
@@ -56,6 +73,7 @@
 	memset(tmp, 0, sizeof(tmp));
 	snprintf(tmp, sizeof(tmp), %s, cmd);
 
+	phoenix_flush_io();
 	for (i = 0; i  strlen(tmp); i += ret) {
 
 		/* Write data in 8-byte chunks */