USB scanner (2.5.4x) Fail to access minor

From: Jonathan Hudson (jonathan@daria.co.uk)
Date: Fri Oct 25 2002 - 17:09:15 EST


I built scanner.o with DEBUG (having applied the following trival
patch)

--- linux-2.5/drivers/usb/image/scanner.c~ Sun Sep 22 05:25:04 2002
+++ linux-2.5/drivers/usb/image/scanner.c Fri Oct 25 22:36:53 2002
@@ -841,7 +841,7 @@
         }
 
         dbg("probe_scanner: USB dev address:%p", dev);
- dbg("probe_scanner: ifnum:%u", ifnum);
+// dbg("probe_scanner: ifnum:%u", ifnum);
 
 /*
  * 1. Check Vendor/Product

The probing finds the minor 48, but the USB_SCN_MINOR() macro in open
results in the minor transposed to 0. This obviously causes the
!p_scn_table[scn_minor] test to fail, dmesg follows:
(/dev/usbscanner0 is 180,48)

drivers/usb/image/scanner.c: probe_scanner: Allocated minor:48
drivers/usb/image/scanner.c: probe_scanner(48): Address of scn:df97ef40
drivers/usb/image/scanner.c: probe_scanner(48): obuf address:da05a000
drivers/usb/image/scanner.c: probe_scanner(48): ibuf address:de598000
drivers/usb/image/scanner.c: scanner48: device node registration failed
drivers/usb/core/usb.c: registered new driver usbscanner
drivers/usb/image/scanner.c: 0.4.6:USB Scanner Driver
drivers/usb/image/scanner.c: open_scanner: scn_minor:0
drivers/usb/image/scanner.c: open_scanner(0): Unable to access minor data
drivers/usb/image/scanner.c: open_scanner: scn_minor:0
drivers/usb/image/scanner.c: open_scanner(0): Unable to access minor data

The follow 'fixes' the symptoms: Please can a USB literate provide the
proper fix!

--- linux-2.5/drivers/usb/image/scanner.h.orig Sun Sep 22 05:25:07 2002
+++ linux-2.5/drivers/usb/image/scanner.h Fri Oct 25 23:04:01 2002
@@ -216,7 +216,7 @@
 #define IS_EP_BULK_OUT(ep) (IS_EP_BULK(ep) && ((ep).bEndpointAddress & USB_ENDPOINT_DIR_MASK) == USB_DIR_OUT)
 #define IS_EP_INTR(ep) ((ep).bmAttributes == USB_ENDPOINT_XFER_INT ? 1 : 0)
 
-#define USB_SCN_MINOR(X) minor((X)->i_rdev) - SCN_BASE_MNR
+#define USB_SCN_MINOR(X) minor((X)->i_rdev)
 
 #ifdef DEBUG
 #define SCN_DEBUG(X) X

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Oct 31 2002 - 22:00:29 EST