JE, please apply



oops, forgot to attach the patchfile

On Thu, 7 Jun 2001, Steve Tell wrote:

> 
> Greetings from Chapel Hill, North Carolina, USA...
> 
> I recently bought a USB parallel-port adaptor cable and discovered that is
> used a Lucent uss720 chip.  Naturaly I had to get it working with your
> driver module for general-purpose bit-fiddling.
> 
> The result is this little patch.
> 
> - Adds the product and vendor ID for this adaptor, a Belkin inc. model
> "F5U002" 
> 
> - Fixes get_1284_register() so that reads of the status register
> work properly.  The old code was assuming that usb_control_msg() returned
> 0 on success, when apparently it (now) returns the message length.
> 
> This has been tested with both 2.4.2 (RedHat 7.1) and 2.4.5 (plain kernel
> distribution).
> 
> One remaining oddity: the nFault signal (status register bit 3) seems to
> be stuck at 1 regardless of the state of the external pin.  The other
> status bits do work.
> 
> 
> I hope you can consider incorporating this patch or a variation into
> the standard linux-usb sources.
> 
> regards,
> Steve
> 
> 
> 
> --
> Steve Tell  [EMAIL PROTECTED] 
> 
> 
> 

-- 
--
Steve Tell  [EMAIL PROTECTED] 

--- linux-2.4.2-sgt/drivers/usb/uss720.c        Thu Jan  4 16:15:32 2001
+++ linux-2.4.2/drivers/usb/uss720.c    Thu Jun  7 01:25:46 2001
@@ -67,9 +67,10 @@
        if (!usbdev)
                return -1;
        ret = usb_control_msg(usbdev, usb_rcvctrlpipe(usbdev,0), 3, 0xc0, ((unsigned 
int)reg) << 8, 0, priv->reg, 7, HZ);
-       if (ret) {
-               printk(KERN_DEBUG "uss720: get_1284_register(%d) failed, status 
0x%x\n",
+       if (ret != 7) {
+               printk(KERN_DEBUG "uss720: get_1284_register(%d) failed, status 0x%x 
+expected 7\n",
                       (unsigned int)reg, ret);
+               ret = -1;
        } else {
 #if 0
                printk(KERN_DEBUG "uss720: get_1284_register(%d) return %02x %02x %02x 
%02x %02x %02x %02x\n",
@@ -80,6 +81,7 @@
                /* if nAck interrupts are enabled and we have an interrupt, call the 
interrupt procedure */
                if (priv->reg[2] & priv->reg[1] & 0x10)
                        parport_generic_irq(0, pp, NULL);
+               ret = 0;
        }
        if (val)
                *val = priv->reg[(reg >= 9) ? 0 : regindex[reg]];
@@ -628,6 +630,7 @@
        { USB_DEVICE(0x047e, 0x1001) },
        { USB_DEVICE(0x0557, 0x2001) },
        { USB_DEVICE(0x0729, 0x1284) },
+       { USB_DEVICE(0x1293, 0x0002) },
        { }                                             /* Terminating entry */
 };
 


Reply via email to