Le Sun, Nov 10, 2002, � 01:15:36PM +0100, Henning Meier-Geinitz a �crit:
> Your scanner has the usual 2 endpoints (bulk-in and bulk-out), so
> there shouldn't be any problem with the scanner module.
As I said, in 2.4.x, it used to work (not perfectly, I frequently have
issues with "funky results", but there was no trouble with endpoints).
> "endpoint[ep_cnt]" looks suspicious to me, shouldn't that be something
> like:
>
> endpoint = &interface->endpoint;
>
> IS_EP_BULK_IN(endpoint[ep_cnt].desc))
I tried the patch you sent in the second message; it helped a lot. There was
one last missing bit, related to minor numbers allocation (I don't use
dynamic minors -- it's a road to hell unless devfs is used, at least until
hotplug(8) is in charge of building the device nodes)
I attach here a revised version which brought back under 2.5.46 the
functionality I had with 2.4.20. It looks like usb_register_dev() returns the
actual minor, while p_scn_table is indexed relative to SCN_BASE_MNR. The
result was that we modified stuff 48*sizeof(void*) too far, and then
open_scanner() was finding only a NULL at p_scn_table[0] (for minor 48).
Brian, can you review this patch and apply it if it looks sane to you?
> > I tried to follow that advice, but failed; I'll try again when there
> > is something vaguely resembling a decent documentation).
>
> As far as I know, the Epson backend has libusb support only in the
> SANE CVS version.
>
> > Does anyone has an idea, or can gently point me towards the properly written
> > fine manual to read?
>
> I don't have an Epson scanner, but as far as I can see, just compile
> libusb 0.1.6, get SANE CVS and install that. Some basic documentation
> about user-land is in man sane-usb and man sane-epson.
I'm not going to install SANE CVS, at least not at this moment. I do hope that
scanner.c doesn't vanish until all relevant USB backends are updated with
libusb and are released in a stable version of SANE...
Thanks a lot for your help!
-- Cyrille
--
30-10 !
diff -urNp --exclude-from kernel-dontdiff --minimal
linux-2.5.46-pristine/drivers/usb/image/scanner.c
linux-2.5.46/drivers/usb/image/scanner.c
--- linux-2.5.46-pristine/drivers/usb/image/scanner.c 2002-11-10 18:00:22.000000000
+0100
+++ linux-2.5.46/drivers/usb/image/scanner.c 2002-11-10 18:20:07.000000000 +0100
@@ -911,7 +911,6 @@ probe_scanner(struct usb_interface *intf
}
interface = intf->altsetting;
- endpoint = &interface->endpoint[0].desc;
/*
* Start checking for two bulk endpoints OR two bulk endpoints *and* one
@@ -930,21 +929,22 @@ probe_scanner(struct usb_interface *intf
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);
@@ -994,6 +994,8 @@ probe_scanner(struct usb_interface *intf
return -ENOMEM;
}
+ scn_minor -= SCN_BASE_MNR;
+
/* Check to make sure that the last slot isn't already taken */
if (p_scn_table[scn_minor]) {
err("probe_scanner: No more minor devices remaining.");