]> pere.pagekite.me Git - homepage.git/blob - linux/sane/agfa-snapscan-1236-2.diff
New post on DD orphaned packages.
[homepage.git] / linux / sane / agfa-snapscan-1236-2.diff
1 diff -ru /store/store/joseph/sane/src-pre1.01r3/ChangeLog src-pre1.01r3-allarchs/ChangeLog
2 --- /store/store/joseph/sane/src-pre1.01r3/ChangeLog Fri Mar 5 07:20:00 1999
3 +++ src-pre1.01r3-allarchs/ChangeLog Sat Mar 13 15:37:48 1999
4 @@ -1,3 +1,14 @@
5 +1999-03-10 Petter Reinholdtsen <pere@td.org.uit.no>
6 +
7 + * backend/snapscan.c (add_device init_options inquiry
8 + sane_snapscan_get_parameters sane_snapscan_start
9 + sane_snapscan_set_io_mode sane_snapscan_read) backend/snapscan.h
10 + backend/snapscan.desc: Rewrote scanner detection code to loop over
11 + array of supported SCSI names. Added AGFA SnapScan 1236 support.
12 + It seems to be compatible with SnapScan 600.
13 + Make sure to not add the same device more then once to the device
14 + list. Bugfix in sane_snapscan_read() triggered on EOF.
15 +
16 1999-03-04 David Mosberger-Tang <David.Mosberger@acm.org>
17
18 * backend/canon.c (adjust_hilo_points): Print values of type
19 diff -ru /store/store/joseph/sane/src-pre1.01r3/backend/snapscan.c src-pre1.01r3-allarchs/backend/snapscan.c
20 --- /store/store/joseph/sane/src-pre1.01r3/backend/snapscan.c Sun Feb 28 21:34:05 1999
21 +++ src-pre1.01r3-allarchs/backend/snapscan.c Fri Mar 12 20:17:16 1999
22 @@ -111,6 +111,8 @@
23
24 /*----- internal scanner operations -----*/
25
26 +#define DEFAULT_DEVICE "/dev/scanner" /* Check this if config is missing */
27 +
28 /* hardware configuration byte masks */
29
30 #define HCFG_ADC 0x80 /* AD converter 1 ==> 10bit, 0 ==> 8bit */
31 @@ -161,7 +163,6 @@
32 #define DEFAULT_BRX (x_range.max)
33 #define DEFAULT_BRY (y_range.max)
34
35 -
36 #ifdef INOPERATIVE
37 static const SANE_Range percent_range =
38 {
39 @@ -339,6 +340,7 @@
40 {
41 case SNAPSCAN310:
42 case SNAPSCAN600:
43 + case SNAPSCAN1236:
44 case VUEGO310S: /* WG changed */
45 po[OPT_MODE].constraint.string_list = names_310;
46 break;
47 @@ -370,6 +372,7 @@
48 {
49 case SNAPSCAN310:
50 case SNAPSCAN600:
51 + case SNAPSCAN1236:
52 case VUEGO310S: /* WG changed */
53 po[OPT_PREVIEW_MODE].constraint.string_list = names_310;
54 break;
55 @@ -995,6 +998,7 @@
56 {
57 case SNAPSCAN310:
58 case SNAPSCAN600:
59 + case SNAPSCAN1236:
60 case VUEGO310S: /* WG changed */
61 rgb_buf_set_diff (pss,
62 pss->buf[INQUIRY_G2R_DIFF],
63 @@ -1530,6 +1534,15 @@
64 static SnapScan_Device *first_device = NULL; /* device list head */
65 static int n_devices = 0; /* the device count */
66
67 +static SANE_Bool
68 +device_already_in_list(SnapScan_Device *current, SANE_String_Const name)
69 +{
70 + for ( ;NULL != current; current = current->pnext )
71 + if (0 == strcmp(name, current->dev.name))
72 + return SANE_TRUE;
73 + return SANE_FALSE;
74 +}
75 +
76 static SANE_Status
77 add_device (SANE_String_Const name)
78 {
79 @@ -1537,10 +1550,16 @@
80 static const char me[] = "add_device";
81 SANE_Status status;
82 SnapScan_Device *pd;
83 - SnapScan_Model model_num;
84 + SnapScan_Model model_num = UNKNOWN;
85 char vendor[8], model[17];
86 + int i, vendor_ok = 0;
87
88 - DBG (DL_CALL_TRACE, "%s\n", me);
89 + DBG (DL_CALL_TRACE, "%s(%s)\n", me, name);
90 +
91 + /* Avoid adding the same device more then once */
92 + if (device_already_in_list(first_device, name)) {
93 + return SANE_STATUS_GOOD;
94 + }
95
96 vendor[0] = model[0] = '\0';
97
98 @@ -1561,38 +1580,38 @@
99 return status;
100 }
101
102 - if ((strncasecmp (vendor, SNAPSCAN_VENDOR, strlen (SNAPSCAN_VENDOR)) == 0)
103 - ||
104 - (strncasecmp (vendor, VUEGO_VENDOR, strlen (VUEGO_VENDOR)) == 0)) /* WG changed */
105 - {
106 - /* original SnapScan */
107 - if (strncasecmp (model, SNAPSCAN_MODEL310,
108 - strlen (SNAPSCAN_MODEL310)) == 0)
109 - model_num = SNAPSCAN310;
110 - else if (strncasecmp (model, SNAPSCAN_MODEL600,
111 - strlen (SNAPSCAN_MODEL600)) == 0)
112 - model_num = SNAPSCAN600;
113 - else if (strncasecmp (model, SNAPSCAN_MODEL300,
114 - strlen (SNAPSCAN_MODEL300)) == 0)
115 - model_num = SNAPSCAN300;
116 - else if (strncasecmp (model, VUEGO_MODEL310S, /* WG changed */
117 - strlen (VUEGO_MODEL310S)) == 0)
118 - model_num = VUEGO310S;
119 - else
120 + /* check if this is one of our supported vendors */
121 + for (i = 0; i < known_vendors; i++)
122 + if (0 == strncasecmp (vendor, vendors[i], strlen(vendors[i])))
123 + {
124 + vendor_ok = 1;
125 + break;
126 + }
127 + if (!vendor_ok)
128 + {
129 + DBG (DL_MINOR_ERROR, "%s: \"%s %s\" is not an %s\n",
130 + me, vendor, model,
131 + "AGFA SnapScan model 300, 310, 600 and 1236"
132 + " or VUEGO model 310S"); /* WG changed */
133 + sanei_scsi_close (fd);
134 + return SANE_STATUS_INVAL;
135 + }
136 +
137 + /* Known vendor. Check if it is one of our supported models */
138 + for (i = 0; i < known_scanners; i++)
139 + {
140 + if (0 == strncasecmp (model, scanners[i].scsi_name,
141 + strlen(scanners[i].scsi_name)))
142 {
143 - DBG (DL_INFO, "%s: sorry, model %s is not supported.\n"
144 - "Currently supported models are the SnapScan 300 and 310.\n",
145 - me, model);
146 - sanei_scsi_close (fd);
147 - return SANE_STATUS_INVAL;
148 + model_num = scanners[i].id;
149 + break;
150 }
151 }
152 - else
153 + if (UNKNOWN == model_num)
154 {
155 - DBG (DL_MINOR_ERROR, "%s: \"%s %s\" is not an %s %s\n",
156 - me, vendor, model,
157 - SNAPSCAN_VENDOR,
158 - "AGFA SnapScan model 300, 310, and 600 or VUEGO model 310S"); /* WG changed */
159 + DBG (DL_INFO, "%s: sorry, model %s is not supported.\n"
160 + "Currently supported models are the SnapScan 300 and 310.\n",
161 + me, model);
162 sanei_scsi_close (fd);
163 return SANE_STATUS_INVAL;
164 }
165 @@ -1706,10 +1725,10 @@
166 if (!fp)
167 {
168 DBG (DL_INFO,
169 - "%s: configuration file not found, defaulting to /dev/scanner.\n",
170 - me);
171 + "%s: configuration file not found, defaulting to %s.\n",
172 + me, DEFAULT_DEVICE);
173 /* default to /dev/scanner instead of insisting on config file */
174 - status = add_device ("/dev/scanner");
175 + status = add_device (DEFAULT_DEVICE);
176 if (status != SANE_STATUS_GOOD)
177 {
178 DBG (DL_MINOR_ERROR, "%s: failed to add device \"%s\"\n",
179 @@ -2673,6 +2692,7 @@
180 {
181 case SNAPSCAN310:
182 case SNAPSCAN600:
183 + case SNAPSCAN1236:
184 case VUEGO310S: /* WG changed */
185 if (!pss->preview)
186 {
187 @@ -2699,6 +2719,7 @@
188 {
189 case SNAPSCAN310:
190 case SNAPSCAN600:
191 + case SNAPSCAN1236:
192 case VUEGO310S: /* WG changed */
193 pss->lines += line_offset;
194 p->lines -= line_offset;
195 @@ -3114,6 +3135,7 @@
196 {
197 case SNAPSCAN310:
198 case SNAPSCAN600:
199 + case SNAPSCAN1236:
200 case VUEGO310S: /* WG changed */
201 if (SANE_STATUS_GOOD != rgb_buf_init (pss))
202 return SANE_STATUS_NO_MEM;
203 @@ -3134,6 +3156,7 @@
204 {
205 case SNAPSCAN310:
206 case SNAPSCAN600:
207 + case SNAPSCAN1236:
208 case VUEGO310S: /* WG changed */
209 rgb_buf_clean (pss);
210 break;
211 @@ -3153,6 +3176,7 @@
212 {
213 case SNAPSCAN310:
214 case SNAPSCAN600:
215 + case SNAPSCAN1236:
216 case VUEGO310S: /* WG changed */
217 transfer_data_diff (other_buf, pss);
218 break;
219 @@ -3186,6 +3210,7 @@
220 {
221 case SNAPSCAN310:
222 case SNAPSCAN600:
223 + case SNAPSCAN1236:
224 case VUEGO310S: /* WG changed */
225 rgb_buf_clean (pss);
226 break;
227 @@ -3231,13 +3256,14 @@
228 pss->bytes_per_line / pss->ms_per_line);
229
230 /* allocate and initialize rgb ring buffer if the device is
231 - a snapscan 310 or 600 model, in colour mode */
232 + a snapscan 310, 600 or 1236 model, in colour mode */
233 if (colour)
234 {
235 switch (pss->pdev->model)
236 {
237 case SNAPSCAN310:
238 case SNAPSCAN600:
239 + case SNAPSCAN1236:
240 case VUEGO310S: /* WG changed */
241 rgb_buf_init (pss);
242 break;
243 @@ -3279,6 +3305,8 @@
244 DBG (DL_CALL_TRACE, "%s (%p, %p, %ld, %p)\n",
245 me, (void *) h, (void *) buf, (long) maxlen, (void *) plen);
246
247 + *plen = 0;
248 +
249 if (!pss->expected_data_len)
250 {
251 if (pss->child > 0)
252 @@ -3292,8 +3320,6 @@
253 return SANE_STATUS_EOF;
254 }
255
256 - *plen = 0;
257 -
258 if (pss->preview)
259 mode = pss->preview_mode;
260
261 @@ -3413,6 +3444,7 @@
262 {
263 case SNAPSCAN310:
264 case SNAPSCAN600:
265 + case SNAPSCAN1236:
266 case VUEGO310S: /* WG changed */
267 transferred_bytes = transfer_data_diff (buf, pss);
268 break;
269 @@ -3486,6 +3518,7 @@
270 {
271 case SNAPSCAN310:
272 case SNAPSCAN600:
273 + case SNAPSCAN1236:
274 case VUEGO310S: /* WG changed */
275 rgb_buf_clean (pss);
276 break;
277 diff -ru /store/store/joseph/sane/src-pre1.01r3/backend/snapscan.desc src-pre1.01r3-allarchs/backend/snapscan.desc
278 --- /store/store/joseph/sane/src-pre1.01r3/backend/snapscan.desc Mon Sep 7 09:28:57 1998
279 +++ src-pre1.01r3-allarchs/backend/snapscan.desc Wed Mar 10 21:14:10 1999
280 @@ -28,6 +28,8 @@
281 :comment "Ditto"
282 :model "SnapScan 600"
283 :comment "Ditto"
284 +:model "SnapScan 1236"
285 +:comment "Ditto"
286 :mfg "Vuego"
287 :model "310S"
288 :comment "Close SnapScan 310 compatible."
289 diff -ru /store/store/joseph/sane/src-pre1.01r3/backend/snapscan.h src-pre1.01r3-allarchs/backend/snapscan.h
290 --- /store/store/joseph/sane/src-pre1.01r3/backend/snapscan.h Sun Feb 28 00:59:10 1999
291 +++ src-pre1.01r3-allarchs/backend/snapscan.h Wed Mar 10 22:19:16 1999
292 @@ -54,22 +54,41 @@
293 /* snapscan device field values */
294
295 #define SNAPSCAN_NAME "/dev/sga"
296 -#define SNAPSCAN_VENDOR "AGFA"
297 -#define VUEGO_VENDOR "COLOR"
298 -#define SNAPSCAN_MODEL300 "SnapScan"
299 -#define SNAPSCAN_MODEL310 "SNAPSCAN 310"
300 -#define VUEGO_MODEL310S "FlatbedScanner_4"
301 -#define SNAPSCAN_MODEL600 "SNAPSCAN 600"
302 #define SNAPSCAN_TYPE "flatbed scanner"
303 /*#define INOPERATIVE*/
304
305 typedef enum
306 {
307 + UNKNOWN,
308 SNAPSCAN300, /* the original SnapScan or SnapScan 300 */
309 SNAPSCAN310, /* the SnapScan 310 */
310 SNAPSCAN600, /* the SnapScan 600 */
311 + SNAPSCAN1236, /* the SnapScan 1236 */
312 VUEGO310S /* Vuego-Version of SnapScan 310 WG changed */
313 } SnapScan_Model;
314 +
315 +struct SnapScan_Model_desc
316 +{
317 + char *scsi_name;
318 + SnapScan_Model id;
319 +};
320 +
321 +static struct SnapScan_Model_desc scanners[] =
322 +{
323 + { "FlatbedScanner_4", VUEGO310S },
324 + { "SNAPSCAN 1236", SNAPSCAN1236 },
325 + { "SNAPSCAN 310", SNAPSCAN310 },
326 + { "SNAPSCAN 600", SNAPSCAN600 },
327 + { "SnapScan", SNAPSCAN300 },
328 +};
329 +#define known_scanners (sizeof(scanners)/sizeof(struct SnapScan_Model_desc))
330 +
331 +static char *vendors[] =
332 +{
333 + "AGFA",
334 + "COLOR",
335 +};
336 +#define known_vendors (sizeof(vendors)/sizeof(char*))
337
338 typedef enum
339 {