Hi,

On Sun, Nov 10, 2002 at 01:15:36PM +0100, Henning Meier-Geinitz wrote:
> The endpoint detection code in 2.5.46 looks like this:
> 
> endpoint = &interface->endpoint[0].desc;
> [...]
> while (ep_cnt < interface->desc.bNumEndpoints) {
>   if (!have_bulk_in && IS_EP_BULK_IN(endpoint[ep_cnt])) {
>     ep_cnt++;
>     have_bulk_in = ep_cnt;
>     dbg("probe_scanner: bulk_in_ep:%d",       have_bulk_in);
>     continue;
>   }
> [...]                                                         
> 
> "endpoint[ep_cnt]" looks suspicious to me, shouldn't that be something
> like:
> 
> endpoint = &interface->endpoint;
> 
> IS_EP_BULK_IN(endpoint[ep_cnt].desc))
> 
> Otherwise the index [ep_cnt] is used for the descriptor (decs) not the
> endpoint.

The following patch gets my scanner detected again, i.e. it's in
/proc/bus/usb/devices with driver=usbscanner. I don't know, if it's
really sane. However, sane-find-scanner still doesn't find it
(open_scanner(0): Unable to access minor data). I can't test more,
2.5.46 is just too unstable.

--- /tmp/linux-2.5.46/drivers/usb/image/scanner.c       2002-11-04 23:30:16.000000000 
+0100
+++ linux-2.5.46/drivers/usb/image/scanner.c    2002-11-10 15:43:03.000000000 +0100
@@ -911,7 +911,6 @@
        }
 
        interface = intf->altsetting;
-       endpoint = &interface->endpoint[0].desc;
 
 /*
  * Start checking for two bulk endpoints OR two bulk endpoints *and* one
@@ -930,21 +929,23 @@
 
        while (ep_cnt < interface->desc.bNumEndpoints) {
 
-               if (!have_bulk_in && IS_EP_BULK_IN(endpoint[ep_cnt])) {
+               endpoint = &interface->endpoint[ep_cnt].desc;
+
+               if (!have_bulk_in && IS_EP_BULK_IN(*endpoint)) {
                        ep_cnt++;
                        have_bulk_in = ep_cnt;
                        dbg("probe_scanner: bulk_in_ep:%d", have_bulk_in);
                        continue;
                }
 
-               if (!have_bulk_out && IS_EP_BULK_OUT(endpoint[ep_cnt])) {
+               if (!have_bulk_out && IS_EP_BULK_OUT(*endpoint)) {
                        ep_cnt++;
                        have_bulk_out = ep_cnt;
                        dbg("probe_scanner: bulk_out_ep:%d", have_bulk_out);
                        continue;
                }
 
-               if (!have_intr && IS_EP_INTR(endpoint[ep_cnt])) {
+               if (!have_intr && IS_EP_INTR(*endpoint)) {
                        ep_cnt++;
                        have_intr = ep_cnt;
                        dbg("probe_scanner: intr_ep:%d", have_intr);


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to