From f9bec2f06c17815b66ca1f6afd8b9587a97febab Mon Sep 17 00:00:00 2001 From: Oliver Schirrmeister Date: Fri, 6 Jun 2003 09:47:24 +0000 Subject: [PATCH] remove SP15 code sane_open acturally opens the device you request --- ChangeLog | 7 +++++ backend/fujitsu.c | 48 ++++++++++++++++++++--------------- backend/fujitsu.h | 4 --- doc/descriptions/fujitsu.desc | 4 +-- 4 files changed, 35 insertions(+), 28 deletions(-) diff --git a/ChangeLog b/ChangeLog index 531e5f78a..d1a6bc24f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2003-06-06 Oliver Schirrmeister + + * backend/fujitsu.h backend/fujitsu.c doc/descriptions/fujitsu.desc + path from anoah@pfeiffer.edu: + remove SP15 code + sane_open actually opens the device you request + 2003-06-05 Henning Meier-Geinitz * backend/gt68xx.c doc/descriptions/gt68xx.desc diff --git a/backend/fujitsu.c b/backend/fujitsu.c index f8b8777d8..13828f3b2 100644 --- a/backend/fujitsu.c +++ b/backend/fujitsu.c @@ -55,7 +55,7 @@ Section 4 - generic private routines with a lot of model-specific code Section 5 - private routines for the M3091 Section 6 - private routines for the M3096 - Section 7 - private routines for the SP15C + Section 7 - private routines for the EVPD-capable scanners Section 8 - private routines for the M3092 ... @@ -98,6 +98,9 @@ V 1.9 04-Jun-2003 - separated the 4120 and 4220 into another model (anoah@pfeiffer.edu) - color support for the 4x20 (anoah@pfeiffer.edu) + V 1.10 04-Jun-2003 + - removed SP15 code (anoah@pfeiffer.edu) + - sane_open actually opens the device you request (anoah@pfeiffer.edu) SANE FLOW DIAGRAM @@ -572,15 +575,32 @@ sane_get_devices (const SANE_Device *** device_list, SANE_Bool local_only) SANE_Status sane_open (SANE_String_Const name, SANE_Handle * handle) { - /** this is too simple to be right - FIXME */ - struct fujitsu *scanner = (struct fujitsu *) first_dev; - *handle = scanner; - - DBG (10, "sane_open %s\n", name); + struct fujitsu *dev = NULL; + struct fujitsu *scanner = NULL; + + if(name[0] == 0){ + DBG (10, "sane_open: no device requested, using default\n"); + scanner = (struct fujitsu *) first_dev; + DBG (10, "sane_open: device %s found\n", first_dev->sane.name); + } + else{ + DBG (10, "sane_open: device %s requested\n", name); + + for (dev = first_dev; dev; dev = dev->next) + { + if (strcmp (dev->sane.name, name) == 0) + { + DBG (10, "sane_open: device %s found\n", name); + scanner = (struct fujitsu *) dev; + } + } + } if (!scanner) return SANE_STATUS_INVAL; + *handle = scanner; + /* * Determine which SANE options are available with this scanner. * Since many options are identical for all models, handle them @@ -7403,24 +7423,10 @@ setMode3096 (struct fujitsu *scanner, int mode) return (SANE_STATUS_INVAL); } - /* - * @@ Section 7 - SP15C specific internal routines + * @@ Section 7 - EVPD specific internal routines */ -static void -setDefaultsSP15 (struct fujitsu *scanner) -{ - - setDefaults3096 (scanner); /* todo: add real sp15 defaults */ -} - -static SANE_Status -setModeSP15 (struct fujitsu *scanner, int mode) -{ - return setMode3096 (scanner, mode); /* todo: what is different in the sp15? */ -} - /* * @@ Section 8 - M3092 specific internal routines */ diff --git a/backend/fujitsu.h b/backend/fujitsu.h index 30e55c877..1fab1e199 100644 --- a/backend/fujitsu.h +++ b/backend/fujitsu.h @@ -359,8 +359,6 @@ struct fujitsu #define MODEL_3091 1 /** Fujitsu M3096 (400x400dpi grayscale, simplex, FB and optional ADF) */ #define MODEL_3096 2 -/** Fujitsu ScanPartner 15C (....) */ -#define MODEL_SP15 3 /** 3093 */ #define MODEL_3093 4 /** 4097 */ @@ -577,12 +575,10 @@ static int modelMatch (const char *product); static void setDefaults3091 (struct fujitsu *scanner); static void setDefaults3092 (struct fujitsu *scanner); static void setDefaults3096 (struct fujitsu *scanner); -static void setDefaultsSP15 (struct fujitsu *scanner); static SANE_Status setMode3091 (struct fujitsu *scanner, int mode); static SANE_Status setMode3092 (struct fujitsu *scanner, int mode); static SANE_Status setMode3096 (struct fujitsu *scanner, int mode); -static SANE_Status setModeSP15 (struct fujitsu *scanner, int mode); static void calculateDerivedValues (struct fujitsu *scanner); diff --git a/doc/descriptions/fujitsu.desc b/doc/descriptions/fujitsu.desc index cc4e3f073..befa9e81b 100644 --- a/doc/descriptions/fujitsu.desc +++ b/doc/descriptions/fujitsu.desc @@ -38,9 +38,7 @@ :model "M4097" :interface "SCSI" :model "fi-4120C" -:interface "USB SCSI" -:status :untested -:comment "Probably similar to fi-4220C?" +:interface "SCSI USB" :model "fi-4220C" :interface "SCSI USB" :model "fi-4340C"