]> git.hungrycats.org Git - linux/commitdiff
[PATCH] USB scanner.c endpoint detection fix
authorHenning Meier-Geinitz <henning@meier-geinitz.de>
Mon, 14 Apr 2003 03:25:40 +0000 (20:25 -0700)
committerGreg Kroah-Hartman <greg@kroah.com>
Mon, 14 Apr 2003 03:25:40 +0000 (20:25 -0700)
This patch fixes the endpoint numbers. They were numbered from 1 to n
but that assumption is not correct in all cases.

drivers/usb/image/scanner.c

index 84885a2379e59e15ec245ff508f49f5b8dacc4af..1f8b64fbc4a42cf95b951465f7336ed8e6212df1 100644 (file)
  *      is closed and disconnected. Avoids crashes when writing to a 
  *      disconnected device. (Thanks to Greg KH).
  *
+ * 0.4.12  2003-04-11
+ *    - Fixed endpoint detection. The endpoints were numbered from 1 to n but
+ *      that assumption is not correct in all cases.
+ *
  * TODO
  *    - Performance
  *    - Select/poll methods
@@ -957,7 +961,7 @@ probe_scanner(struct usb_interface *intf,
                                info ("probe_scanner: ignoring additional bulk_in_ep:%d", ep_cnt);
                                continue;
                        }
-                       have_bulk_in = ep_cnt;
+                       have_bulk_in = endpoint->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
                        dbg("probe_scanner: bulk_in_ep:%d", have_bulk_in);
                        continue;
                }
@@ -968,7 +972,7 @@ probe_scanner(struct usb_interface *intf,
                                info ("probe_scanner: ignoring additional bulk_out_ep:%d", ep_cnt);
                                continue;
                        }
-                       have_bulk_out = ep_cnt;
+                       have_bulk_out = endpoint->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
                        dbg("probe_scanner: bulk_out_ep:%d", have_bulk_out);
                        continue;
                }
@@ -979,7 +983,7 @@ probe_scanner(struct usb_interface *intf,
                                info ("probe_scanner: ignoring additional intr_ep:%d", ep_cnt);
                                continue;
                        }
-                       have_intr = ep_cnt;
+                       have_intr = endpoint->bEndpointAddress & USB_ENDPOINT_NUMBER_MASK;
                        dbg("probe_scanner: intr_ep:%d", have_intr);
                        continue;
                }