From b08dfaad7874d09ba5825120786ce98c32dde9a7 Mon Sep 17 00:00:00 2001 From: Nils Philippsen Date: Fri, 15 Jun 2007 13:23:56 +0000 Subject: [PATCH] call usb_reset() prior to usb_close() to workaround hanging USB hardware (#149027, #186766) --- sane-backends-1.0.18-usb_reset.patch | 12 ++++++++++++ sane-backends.spec | 8 +++++++- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 sane-backends-1.0.18-usb_reset.patch diff --git a/sane-backends-1.0.18-usb_reset.patch b/sane-backends-1.0.18-usb_reset.patch new file mode 100644 index 0000000..343abd6 --- /dev/null +++ b/sane-backends-1.0.18-usb_reset.patch @@ -0,0 +1,12 @@ +--- sane-backends-1.0.18/sanei/sanei_usb.c.usb_reset 2006-05-26 21:38:46.000000000 +0200 ++++ sane-backends-1.0.18/sanei/sanei_usb.c 2007-06-15 15:16:50.000000000 +0200 +@@ -1255,6 +1255,9 @@ sanei_usb_close (SANE_Int dn) + usb_resetep (devices[dn].libusb_handle, devices[dn].bulk_out_ep); + usb_resetep (devices[dn].libusb_handle, devices[dn].iso_in_ep); + #endif ++ /* Hack to work around hanging USB hardware */ ++ usb_reset (devices[dn].libusb_handle); ++ + usb_release_interface (devices[dn].libusb_handle, + devices[dn].interface_nr); + usb_close (devices[dn].libusb_handle); diff --git a/sane-backends.spec b/sane-backends.spec index cb543b7..74d2388 100644 --- a/sane-backends.spec +++ b/sane-backends.spec @@ -18,7 +18,7 @@ Summary: Scanner access software Name: sane-backends Version: 1.0.18 -Release: 6%{?dist} +Release: 7%{?dist} License: GPL (programs), relaxed LGPL (libraries), and public domain (docs) Group: System Environment/Libraries Source0: ftp://ftp.sane-project.org/pub/sane/%{name}-%{version}/%{name}-%{version}.tar.gz @@ -28,6 +28,7 @@ Patch2: sane-backends-1.0.12-badcode.patch Patch3: sane-backends-multilib.patch Patch4: sane-backends-1.0.17-pkgconfig.patch Patch5: sane-backends-1.0.18-logical_vs_binary.patch +Patch6: sane-backends-1.0.18-usb_reset.patch URL: http://www.sane-project.org BuildRoot: %{_tmppath}/%{name}-%{version}-root-%(%__id_u -n) BuildRequires: tetex-latex libusb-devel libieee1284-devel libjpeg-devel @@ -108,6 +109,7 @@ want to access digital cameras. %patch3 -p1 -b .multilib %patch4 -p1 -b .pkgconfig %patch5 -p1 -b .logical_vs_binary +%patch6 -p1 -b .usb_reset # Fix bug #62847. perl -pi -e 's,/dev/usbscanner0?,/dev/usb/scanner0,' backend/*.conf @@ -230,6 +232,10 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/sane-backends.pc %changelog +* Fri Jun 15 2007 Nils Philippsen - 1.0.18-7 +- call usb_reset() prior to usb_close() to workaround hanging USB hardware + (#149027, #186766) + * Tue Apr 24 2007 Nils Philippsen - 1.0.18-6 - don't erroneously use logical "&&" instead of binary "&" at some places in the canon driver