From owner-freebsd-current@FreeBSD.ORG Sun Sep 13 11:33:02 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0D20C106568B; Sun, 13 Sep 2009 11:33:02 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe13.tele2.se [212.247.155.129]) by mx1.freebsd.org (Postfix) with ESMTP id 0B9CF8FC1E; Sun, 13 Sep 2009 11:33:00 +0000 (UTC) X-Cloudmark-Score: 0.000000 [] X-Cloudmark-Analysis: v=1.0 c=1 a=AxGrTs15rZoA:10 a=MnI1ikcADjEx7bvsp0jZvQ==:17 a=HLRrEp-HAAAA:8 a=mKnAReVhxpKE07FCF8kA:9 a=XUy30tngSY_rRMWByIwA:7 a=6eyLef2KSXW-B11VaAhj006gsKUA:4 Received: from [188.126.201.140] (account mc467741@c2i.net HELO laptop.adsl.tele2.no) by mailfe13.swip.net (CommuniGate Pro SMTP 5.2.13) with ESMTPA id 918592820; Sun, 13 Sep 2009 13:32:57 +0200 From: Hans Petter Selasky To: freebsd-current@freebsd.org Date: Sun, 13 Sep 2009 13:33:23 +0200 User-Agent: KMail/1.11.4 (FreeBSD/9.0-CURRENT; KDE/4.2.4; i386; ; ) References: <20090913093706.GA82285@FreeBSD.org> In-Reply-To: <20090913093706.GA82285@FreeBSD.org> X-Face: (%:6u[ldzJ`0qjD7sCkfdMmD*RxpOwEEQ+KWt[{J#x6ow~JO:,zwp.(t; @Aq :4:&nFCgDb8[3oIeTb^'",;u{5{}C9>"PuY\)!=#\u9SSM-nz8+SR~B\!qBv MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-2" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200909131333.25960.hselasky@c2i.net> Cc: "Wojciech A. Koszek" , current@freebsd.org Subject: Re: [libusb] Problems with USB-based scanner X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 13 Sep 2009 11:33:02 -0000 On Sunday 13 September 2009 11:37:06 Wojciech A. Koszek wrote: > Hi, > > Recently, I updated my laptop to the newest sources: > > FreeBSD laptop.freebsd.czest.pl 9.0-CURRENT FreeBSD 9.0-CURRENT #0 > r197059M: Thu Sep 10 19:08:58 UTC 2009 > > This is the very first time I tried to use my Canon CanoScan 1220u > scanner: > > [..] > ugen0.4: at usbus0, cfg=0 md=HOST spd=FULL (12Mbps) pwr=ON > > bLength = 0x0012 > bDescriptorType = 0x0001 > bcdUSB = 0x0100 > bDeviceClass = 0x0000 > bDeviceSubClass = 0x0000 > bDeviceProtocol = 0x0000 > bMaxPacketSize0 = 0x0008 > idVendor = 0x04a9 > idProduct = 0x2207 > bcdDevice = 0x0100 > iManufacturer = 0x0040 > iProduct = 0x004d > iSerialNumber = 0x0000 > bNumConfigurations = 0x0001 > > since uscanner(4) removal. It worked without a problem with > the old driver and I could use scanimage(8) with no effort: > > http://freebsd.czest.pl/~wkoszek/wlog/0/ > > Right now I'm getting segmentation fault from plustek driver (and pretty > much any other driver, if I comment "plustek" in dll.conf and add necessary > quirk to other driver): Hi, This is a fault in the plustek driver, because it does not refresh the device pointer after a USB-rescan! /usr/ports/graphics/sane-backends/work/sane-backends-1.0.20/sanei Try the following patch: --- sanei_usb.c.orig 2009-09-13 13:27:29.000000000 +0200 +++ sanei_usb.c 2009-09-13 13:29:32.000000000 +0200 @@ -337,6 +337,16 @@ && devices[i].vendor == device.vendor && devices[i].product == device.product) { + /* + * Need to update the LibUSB device pointer, hence it might + * have changed after the latest USB scan. + */ +#ifdef HAVE_LIBUSB + devices[i].libusb_device = device.libusb_device; +#endif +#ifdef HAVE_LIBUSB_1_0 + devices[i].lu_device = device.lu_device; +#endif devices[i].missing=0; DBG (3, "store_device: not storing device %s\n", device.devname); return; If it works, are you able to get this patch committed to the SANE project? --HPS