From owner-freebsd-current@FreeBSD.ORG Sun Sep 13 13:44:16 2009 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 821A1106566B; Sun, 13 Sep 2009 13:44:16 +0000 (UTC) (envelope-from wkoszek@freebsd.czest.pl) Received: from freebsd.czest.pl (l95h.icis.pcz.pl [212.87.224.105]) by mx1.freebsd.org (Postfix) with ESMTP id E9FF98FC13; Sun, 13 Sep 2009 13:44:14 +0000 (UTC) Received: from freebsd.czest.pl (l95h.icis.pcz.pl [212.87.224.105]) by freebsd.czest.pl (8.14.2/8.14.2) with ESMTP id n8DDpxNx000291; Sun, 13 Sep 2009 15:51:59 +0200 (CEST) (envelope-from wkoszek@freebsd.czest.pl) Received: (from wkoszek@localhost) by freebsd.czest.pl (8.14.2/8.14.2/Submit) id n8DDpwdP000290; Sun, 13 Sep 2009 15:51:59 +0200 (CEST) (envelope-from wkoszek) Date: Sun, 13 Sep 2009 15:51:58 +0200 From: "Wojciech A. Koszek" To: Hans Petter Selasky Message-ID: <20090913135158.GC82285@FreeBSD.org> Mail-Followup-To: Hans Petter Selasky , freebsd-current@freebsd.org, current@freebsd.org References: <20090913093706.GA82285@FreeBSD.org> <200909131333.25960.hselasky@c2i.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline In-Reply-To: <200909131333.25960.hselasky@c2i.net> User-Agent: Mutt/1.5.17 (2007-11-01) X-Greylist: Sender DNS name whitelisted, not delayed by milter-greylist-3.0 (freebsd.czest.pl [212.87.224.105]); Sun, 13 Sep 2009 15:51:59 +0200 (CEST) Cc: freebsd-current@freebsd.org, 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 13:44:16 -0000 On Sun, Sep 13, 2009 at 01:33:23PM +0200, Hans Petter Selasky wrote: > 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? > It seems to fix my problem. Thanks. I'll write a post to sane-devel@ and provide links to this report. -- Wojciech A. Koszek wkoszek@FreeBSD.org http://FreeBSD.czest.pl/~wkoszek/