All of lore.kernel.org
 help / color / mirror / Atom feed
* USB scanner (2.5.4x) Fail to access minor
@ 2002-10-25 22:09 Jonathan Hudson
  2002-10-25 22:21 ` Greg KH
  0 siblings, 1 reply; 2+ messages in thread
From: Jonathan Hudson @ 2002-10-25 22:09 UTC (permalink / raw)
  To: linux-kernel

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: USB scanner (2.5.4x) Fail to access minor
  2002-10-25 22:09 USB scanner (2.5.4x) Fail to access minor Jonathan Hudson
@ 2002-10-25 22:21 ` Greg KH
  0 siblings, 0 replies; 2+ messages in thread
From: Greg KH @ 2002-10-25 22:21 UTC (permalink / raw)
  To: Jonathan Hudson; +Cc: linux-kernel

On Fri, Oct 25, 2002 at 10:09:15PM +0000, Jonathan Hudson wrote:
> 
> 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)

A bit better patch was posted to linux-usb-devel a week or so ago.  It
hasn't been applied as there is some other work going on in this area to
clean up a lot of common code, but until then, you should grab it.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-10-25 22:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-10-25 22:09 USB scanner (2.5.4x) Fail to access minor Jonathan Hudson
2002-10-25 22:21 ` Greg KH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.