Re: More Canon scanners (usbdevs, uscanner.c)

Previous thread: cleanup pckbd_attach by Alexandr Shadchin on Tuesday, November 23, 2010 - 5:30 am. (1 message)

Next thread: Generadores Eléctricos by TBX Herramientas on Tuesday, November 23, 2010 - 8:32 pm. (1 message)
From: Mattieu Baptiste
Date: Tuesday, November 23, 2010 - 1:45 pm

Hi all,

Don't know what I drank at this time but it wasn't good at all for my brain.

I'd like to know if people are able to use their Canon scanner with
xsane via uscanner, because I can't with my Canon Lide 30.

So... if people have the same problems that I'm facing with Canon
scanners, I propose to completely revert the uscanner.c commit (rev
1.21).
Or if it's just with my device, I propose this patch which let me scan
content with xsane:


Index: uscanner.c
===================================================================
RCS file: /cvs/src/sys/dev/usb/uscanner.c,v
retrieving revision 1.43
diff -u -p -r1.43 uscanner.c
--- uscanner.c  24 Sep 2010 08:33:59 -0000      1.43
+++ uscanner.c  23 Nov 2010 20:36:35 -0000
@@ -94,7 +94,6 @@ static const struct uscan_info uscanner_
  {{ USB_VENDOR_CANON, USB_PRODUCT_CANON_N656U }, 0 },
  {{ USB_VENDOR_CANON, USB_PRODUCT_CANON_N670U }, 0 },
  {{ USB_VENDOR_CANON, USB_PRODUCT_CANON_N1220U }, 0 },
- {{ USB_VENDOR_CANON, USB_PRODUCT_CANON_N1240U }, 0 },

   /* Kye */
  {{ USB_VENDOR_KYE, USB_PRODUCT_KYE_VIVIDPRO }, 0 },



-- 
Mattieu Baptiste
"/earth is 102% full ... please delete anyone you can."

From: Miod Vallat
Date: Tuesday, November 23, 2010 - 2:51 pm

Could this be caused by changes in the kernel and/or in xsane? Did you
try e.g. an older xsane against a kernel which attaches your hardware as
uscanner, and against a kernel with the uscanner.c chunk reverted?

Miod

From: Mattieu Baptiste
Date: Tuesday, November 23, 2010 - 3:12 pm

In fact, if my memory serves me right, I've never been able to use my
scanner with uscanner (I have this device since years).

I always had to "disable uscanner" at boot time, let the device attach
as ugen, and run xsane. Then xsane works like a charm.

When this devices attaches as uscanner, xsane is not able to detect the scanner.

-- 
Mattieu Baptiste
"/earth is 102% full ... please delete anyone you can."

From: Antoine Jacoutot
Date: Tuesday, November 23, 2010 - 5:20 pm

<...>

Yes, this is the prefered way to do it. And xsane had nothing to do with 
it, libsane from sane-backends is what is accessing your device.

At one point, the best would be to remove uscanner entirely as it's 
impossible to keep track of all devices anyway. IIRC at least Linux and 
FreeBSD now use libusb with sane for scanning (which is what you are 
doing when you "disable uscanner").

Cheers!

-- 
Antoine

From: Mattieu Baptiste
Date: Wednesday, November 24, 2010 - 1:15 am

But is there any reason to keep these devices in uscanner? To my
knowledge, sane is the only tool to access such devices. Is there
other software that need uscanner?

And more generally, is there any reason to keep uscanner?

-- 
Mattieu Baptiste
"/earth is 102% full ... please delete anyone you can."

From: Antoine Jacoutot
Date: Wednesday, November 24, 2010 - 11:06 am

Well, I don't own many scanners. All I can say is that uscanner is 
deprecated in linux, they now use libusb. I also do so without issue 
but I cannot guess it'll be the same for all scanners around.
The expected scenario is that all usb scanners *should* work with libusb 
where only some will also work also uscanner.

This calls for testing from people who own such hardware. Personally I'd 
be happy to see uscanner move away, I wouldn't have to config(8) my 
kernel all the time.

-- 
Antoine

From: Stuart Henderson
Date: Wednesday, November 24, 2010 - 12:30 pm

How about removing uscanner from GENERIC for now, then if nobody
has a problem with it, remove the code at a later date? (I would
suggest picking that date in advance so it doesn't sit around for
ages).

From: David Coppa
Date: Wednesday, November 24, 2010 - 1:00 pm

seconded.

cheers,
david

From: Antoine Jacoutot
Date: Wednesday, November 24, 2010 - 1:04 pm

I'm all for it.
However, people using sane with uscanner will have to change their 
sane.d/<backend>.conf accordingly. That is no problem, just expect some 
whiners...

-- 
Antoine

From: Kenneth R Westerback
Date: Wednesday, November 24, 2010 - 1:37 pm

I'd rather nuke it completely. Putting it back is not much more difficult
than tweaking GENERIC and is more likely to flush out people actually
using it. Who will change GENERIC, not say anything, and then get upset
when the driver is removed. Just my 2 cents.

.... Ken

From: Mark Kettenis
Date: Thursday, November 25, 2010 - 6:28 am

Just nuke it.  It'll be sitting in the attick if anybody wants it back.

From: Mattieu Baptiste
Date: Thursday, November 25, 2010 - 8:28 am

On Thu, Nov 25, 2010 at 2:28 PM, Mark Kettenis <mark.kettenis@xs4all.nl>

Ok, here is a proposed diff that can also be found at:
http://www.brimbelle.org/mattieu/stuff/uscanner.diff

Compile tested on amd64.


Index: sys/dev/usb/uscanner.c
===================================================================
RCS file: sys/dev/usb/uscanner.c
diff -N sys/dev/usb/uscanner.c
--- sys/dev/usb/uscanner.c	24 Sep 2010 08:33:59 -0000	1.43
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,687 +0,0 @@
-/*	$OpenBSD: uscanner.c,v 1.43 2010/09/24 08:33:59 yuo Exp $ */
-/*	$NetBSD: uscanner.c,v 1.40 2003/01/27 00:32:44 wiz Exp $	*/
-
-/*
- * Copyright (c) 2000 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (lennart@augustsson.net) at
- * Carlstedt Research & Technology
- * and Nick Hibma (n_hibma@qubesoft.com).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) ...
From: Mattieu Baptiste
Date: Thursday, November 25, 2010 - 9:08 am

As noted by jasper, I forgot MAKEDEV, so here is another try...

Index: sys/dev/usb/uscanner.c
===================================================================
RCS file: sys/dev/usb/uscanner.c
diff -N sys/dev/usb/uscanner.c
--- sys/dev/usb/uscanner.c	24 Sep 2010 08:33:59 -0000	1.43
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,687 +0,0 @@
-/*	$OpenBSD: uscanner.c,v 1.43 2010/09/24 08:33:59 yuo Exp $ */
-/*	$NetBSD: uscanner.c,v 1.40 2003/01/27 00:32:44 wiz Exp $	*/
-
-/*
- * Copyright (c) 2000 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Lennart Augustsson (lennart@augustsson.net) at
- * Carlstedt Research & Technology
- * and Nick Hibma (n_hibma@qubesoft.com).
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
- * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ...
From: Miod Vallat
Date: Friday, November 26, 2010 - 1:15 pm

I have opted to keep uscanner in the kernel, but disabled by default,
for now. Thus ajacoutot won't need to `config -e' his kernels, and
should there be any lossage with uscanner not attaching, users can
report this and reenable the driver without having to recompile their
kernel.

Miod

Previous thread: cleanup pckbd_attach by Alexandr Shadchin on Tuesday, November 23, 2010 - 5:30 am. (1 message)

Next thread: Generadores Eléctricos by TBX Herramientas on Tuesday, November 23, 2010 - 8:32 pm. (1 message)