On Wed, 17 Oct 2007, Charles Lepple wrote:
> On 10/16/07, Dan Rich <[EMAIL PROTECTED]> wrote:
> >  Does anyone have any thoughts as to the magic incantation to get
> > this working?
>
> I believe you need to recompile the kernel to not include the "uhid"
> driver, so that the UPS is available as a ugen device. (In FreeBSD,
> this should not affect the use of a USB HID keyboard or mouse.)

Even so I doubt it will be very reliable :(

I did create a diff that might help but noone tested it (and I don't 
have an MGE UPS handy at the moment to test it myself)

Note that while this will still cause data to be dropped it should a) 
log the fact, and b) do it in a way that doesn't cause the UPS driver 
to get out of sync.

ugen should really be fixed to not use clist buffers but that can wait 
for another day :)

-- 
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
Nut-upsuser@lists.alioth.debian.org
http://lists.alioth.debian.org/mailman/listinfo/nut-upsuser

Reply via email to