Subject: kern/26117: need ioctl so that sane can identify scanner
To: None <gnats-bugs@gnats.netbsd.org>
From: Dieter <netbsd@sopwith.solgatos.com>
List: netbsd-bugs
Date: 06/29/2004 19:58:25
>Number: 26117
>Category: kern
>Synopsis: Sane needs to identify the make/model of scanner.
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: kern-bug-people
>State: open
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Tue Jun 29 20:19:00 UTC 2004
>Closed-Date:
>Last-Modified:
>Originator: Dieter
>Release: NetBSD 1.6.2
>Organization:
>Environment:
System: NetBSD sopwith.uucp 1.6.2 NetBSD 1.6.2 (ALPHA-$Revision: 1.4 $) #11: Tue Jun 29 12:05:05 PDT 2004 root@sopwith.uucp:/usr/src/sys/arch/alpha/compile/SOPWITH alpha
Architecture: alpha
Machine: alpha
>Description:
Sane(1) needs to know the make and model of scanner it is talking to.
The easy and obvious fix appears to be to implement the USB_GET_DEVICEINFO
ioctl, as found in the ugen driver. (Note that there is also a USB_DEVICEINFO
ioctl, in usb.c, which fills in the same structure. I'm not sure why there is
both a USB_DEVICEINFO and a USB_GET_DEVICEINFO.)
>How-To-Repeat:
Build a kernel with the uscanner driver. Connect a usb scanner.
Attempt to get sane-backends-1.0.14 working. kernel_get_vendor_product()
in sanei/sanei_usb.c needs a way to determine the make and model of scanner.
>Fix:
(Note: the Epson 2400 line is already in CVS, but didn't make it into 1.6.2.
The diff is against 1.6.2)
===================================================================
RCS file: RCS/uscanner.c,v
retrieving revision 1.1
diff -r1.1 uscanner.c
186a187
> {{ USB_VENDOR_EPSON, USB_PRODUCT_EPSON_2400 }, 0 },
694c695,708
< return (EINVAL);
---
> struct uscanner_softc *sc;
> int error;
>
> error = 0;
> USB_GET_SC(uscanner, USCANNERUNIT(dev), sc);
>
> switch (cmd) {
> case USB_GET_DEVICEINFO:
> usbd_fill_deviceinfo(sc->sc_udev, (struct usb_device_info *)addr, 1);
> break;
> default:
> error = EINVAL;
> }
> return (error);
>Release-Note:
>Audit-Trail:
>Unformatted: