From owner-freebsd-questions@FreeBSD.ORG Sun Aug 22 15:15:49 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 4354616A4CE for ; Sun, 22 Aug 2004 15:15:49 +0000 (GMT) Received: from wonkity.com (wonkity.com [65.173.111.5]) by mx1.FreeBSD.org (Postfix) with ESMTP id C57DC43D53 for ; Sun, 22 Aug 2004 15:15:48 +0000 (GMT) (envelope-from wblock@wonkity.com) Received: from wonkity.com (localhost [127.0.0.1]) by wonkity.com (8.13.1/8.13.1) with ESMTP id i7MFFiFK017042; Sun, 22 Aug 2004 09:15:44 -0600 (MDT) (envelope-from wblock@wonkity.com) Received: from localhost (wblock@localhost) by wonkity.com (8.13.1/8.13.1/Submit) with ESMTP id i7MFFd1Z017039; Sun, 22 Aug 2004 09:15:39 -0600 (MDT) (envelope-from wblock@wonkity.com) Date: Sun, 22 Aug 2004 09:15:39 -0600 (MDT) From: Warren Block To: Ian Moore In-Reply-To: <200408222217.04232.imoore@picknowl.com.au> Message-ID: <20040822091151.T16695@wonkity.com> References: <411E9639.2070609@spintech.ro> <20040814172955.S12990@wonkity.com> <200408222217.04232.imoore@picknowl.com.au> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-1.5.6 (wonkity.com [127.0.0.1]); Sun, 22 Aug 2004 09:15:44 -0600 (MDT) cc: freebsd-questions@freebsd.org Subject: Re: FreeBSD scanners X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Aug 2004 15:15:49 -0000 On Sun, 22 Aug 2004, Ian Moore wrote: > I have a DiamondView DV650U scanner that is supported by SANE, but I always > assumed that because FBSD doesn't detect it as a uscanner device, just a > ugen, it wouldn't work. How would I edit uscanner.c & rebuild whatever to see > if it works? > > usbdevs -v gives the following: > -- Controller /dev/usb2: > addr 1: full speed, self powered, config 1, UHCI root hub(0x0000), > VIA(0x0000), rev 1.00 > port 1 addr 2: full speed, self powered, config 1, FlatbedScanner 22(0x20b0), > Color(0x04a5), rev 1.20 > port 2 powered I've been meaning to write this up, so here's a first pass, and I used your specific scanner as the example. Feedback welcome... Making FreeBSD Recognize A USB Scanner That Shows As "ugen" 1. Install FreeBSD source 2. Find the new device's product and vendor codes # usbdevs -v -- Controller /dev/usb2: addr 1: full speed, self powered, config 1, UHCI root hub(0x0000), VIA(0x0000), rev 1.00 port 1 addr 2: full speed, self powered, config 1, FlatbedScanner 22(0x20b0), Color(0x04a5), rev 1.20 port 2 powered The product code is shown first, then the vendor, so this is product 0x20b0 from vendor 0x04a5. 3. Add product and vendor codes to USB modules # cd /usr/src/sys/dev/usb Add vendor and product codes to /usr/src/sys/dev/usb/usbdevs. For example, the vendor code (0x04a5) shows that this "DiamondView DV650U" is really an Acer scanner. According to http://www.sane-project.org it is a rebadged Acer 4300, and Acer is now called Benq, so device names can be somewhat variable. We'll just call it an Acerscan 4300. /usr/src/sys/dev/usb/usbdevs already has ACERP 0x04a5 as a vendor, so we just have to add the product code for this scanner. Search down in the file for the list of ACERP products, copy and paste the line for one of the other scanners, and change it: product ACERP ACERSCAN_4300 0x20b0 Acerscan 4300 Following the instructions at the top of the file, use make to generate the other USB source files: # make -f Makefile.usbdevs 4. Add scanner string to uscanner.c Now we need to add the new device to /usr/src/sys/dev/usb/uscanner.c. Find the ACERP section and copy one of the existing lines, modifying to match the new device: {{ USB_VENDOR_ACERP, USB_PRODUCT_ACERP_ACERSCAN_4300 }, 0 }, 5. Install # cd /usr/src/sys/modules/usb # make all install 6. Submit PR After you've got the new device recognized and showing "uscanner" on connection rather than "ugen", use send-pr to submit the changes you've made to usbdevs and uscanner.c. Notes It's been a while since I've done this; if any steps are missing or incorrect, please let me know. This procedure only gets FreeBSD to recognize the scanner. SANE configuration is still required to use it with that program. A cvsup of your source files will overwrite these changes. That's why step 6 is important. Once the changes have been committed to the FreeBSD source tree, they will be permanent improvements to FreeBSD's scanner support. -Warren Block * Rapid City, South Dakota USA