[sane-devel] Fujitsu USB scanner support working!

Ron Cemer ron@roncemer.com
Sat, 15 Feb 2003 10:31:58 -0800


This is a multi-part message in MIME format.
--------------030807050104050404010400
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Sure.  Here is the Epson patch.  It makes epson.conf work properly with 
lines formatted like "usb 0x04b8 0x011e" (where 0x04b8 is the vendor and 
0x011e is the product).

Henning, can you put this into the latest version?

The fujitsu patches are huge, since they also add USB support, and 
support for the fi-4220C scanner.  I've posted them before, and they are 
in the process of being reviewed.

Thanks!
Ron

Till Kamppeter wrote:

> Can you post a patch which fixes both the "fujitsu" and the "epson" 
> backend?
>
>    Till
>

--------------030807050104050404010400
Content-Type: text/plain;
 name="epson_usb_vendor_device.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="epson_usb_vendor_device.diff"

--- backend/epson.c.orig	2002-12-31 13:20:33.000000000 -0800
+++ backend/epson.c	2003-02-15 10:22:52.000000000 -0800
@@ -1709,16 +1709,6 @@
 	 */
 
 	/*
-	 * if the config file contains a line "usb /dev/usbscanner", then handle 
-	 * this here and use the USB device from now on.
-	 */
-	if (s->hw->connection == SANE_EPSON_USB)
-	{
-		/* we have a match for the USB string and adjust the device name */
-		sanei_usb_init();
-	}
-
-	/*
 	 *  if interface is SCSI do an inquiry.
 	 */
 
@@ -2215,6 +2205,8 @@
 	if( version_code != NULL)
 		*version_code = SANE_VERSION_CODE (V_MAJOR, V_MINOR, SANE_EPSON_BUILD);
 
+	sanei_usb_init();
+
 	/* default to /dev/scanner instead of insisting on config file */
 	if( (fp = sanei_config_open (EPSON_CONFIG_FILE)))
 	{
@@ -2231,7 +2223,7 @@
 			if( !len)
 				continue;			/* ignore empty lines */
 
-			if (sscanf(line, "usb %d %d", &vendor, &product) == 2)
+			if (sscanf(line, "usb %i %i", &vendor, &product) == 2)
 			{
 				sanei_usb_attach_matching_devices(line, attach_one_usb);
 			}

--------------030807050104050404010400--