On Thu, 23 Aug 2007, Daniel O'Connor wrote:
> Would someone be able to test it? I don't have a USB UPS here at the
> moment, it requires patching your kernel and reloading ugen.ko (at
> least, probably need to reboot if it's in your kernel)
>
> Note that the diff is against HEAD but should be easy to apply
> manually.

Actually that patch is wrong, try this one..

-- 
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C
Index: dev/usb/ugen.c
===================================================================
RCS file: /usr/CVS-Repository/src/sys/dev/usb/ugen.c,v
retrieving revision 1.111
diff -u -r1.111 ugen.c
--- dev/usb/ugen.c	28 Jun 2007 06:22:40 -0000	1.111
+++ dev/usb/ugen.c	23 Aug 2007 05:17:42 -0000
@@ -1008,7 +1008,8 @@
 	/*struct ugen_softc *sc = sce->sc;*/
 	u_int32_t count;
 	u_char *ibuf;
-
+	int i;
+	
 	if (status == USBD_CANCELLED)
 		return;
 
@@ -1027,7 +1028,12 @@
 	DPRINTFN(5, ("          data = %02x %02x %02x\n",
 		     ibuf[0], ibuf[1], ibuf[2]));
 
-	(void)b_to_q(ibuf, count, &sce->q);
+	if ((i = b_to_q(ibuf, count, &sce->q)) > 0) {
+	    printf("ugenintr: Unable to copy %d of %d bytes onto clist, unputc'ing\n", i, count);
+	    count -= i;
+	    while (count-- > 0)
+		(void)unputc(&sce->q);
+	}
 
 	if (sce->state & UGEN_ASLP) {
 		sce->state &= ~UGEN_ASLP;

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
Nut-upsuser mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser

Reply via email to