1 #ifndef SP15C_SCSI_H
2 #define SP15C_SCSI_H
3
4 /* sane - Scanner Access Now Easy.
5
6 This file is part of the SANE package.
7
8 This program is free software; you can redistribute it and/or
9 modify it under the terms of the GNU General Public License as
10 published by the Free Software Foundation; either version 2 of the
11 License, or (at your option) any later version.
12
13 This program is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <https://www.gnu.org/licenses/>.
20
21 As a special exception, the authors of SANE give permission for
22 additional uses of the libraries contained in this release of SANE.
23
24 The exception is that, if you link a SANE library with other files
25 to produce an executable, this does not by itself cause the
26 resulting executable to be covered by the GNU General Public
27 License. Your use of that executable is in no way restricted on
28 account of linking the SANE library code into it.
29
30 This exception does not, however, invalidate any other reasons why
31 the executable file might be covered by the GNU General Public
32 License.
33
34 If you submit changes to SANE to the maintainers to be included in
35 a subsequent release, you agree by submitting the changes that
36 those changes may be distributed with this exception intact.
37
38 If you write modifications of your own for SANE, it is your choice
39 whether to permit this exception to apply to your modifications.
40 If you do not wish that, delete this exception notice.
41
42 This file implements a SANE backend for Fujitsu ScanParner 15c
43 flatbed/ADF scanners. It was derived from the COOLSCAN driver.
44 Written by Randolph Bentson <bentson@holmsjoen.com> */
45
46 /* ------------------------------------------------------------------------- */
47 /*
48 * Revision 1.6 2005/09/19 19:57:48 fzago-guest
49 * Replaced __unused__ with __sane_unused__ to avoid a namespace conflict.
50 *
51 * Revision 1.5 2004/11/13 19:53:04 fzago-guest
52 * Fixes some warnings.
53 *
54 * Revision 1.4 2003/12/27 17:48:38 hmg-guest
55 * Silenced some compilation warnings.
56 *
57 * Revision 1.3 2000/08/12 15:09:37 pere
58 * Merge devel (v1.0.3) into head branch.
59 *
60 * Revision 1.1.2.4 2000/03/14 17:47:12 abel
61 * new version of the Sharp backend added.
62 *
63 * Revision 1.1.2.3 2000/02/14 14:20:19 pere
64 * Make lint_catcher static to avoid link problems with duplicate symbols.
65 *
66 * Revision 1.1.2.2 2000/01/26 03:51:48 pere
67 * Updated backends sp15c (v1.12) and m3096g (v1.11).
68 *
69 * Revision 1.7 2000/01/05 05:27:34 bentson
70 * indent to barfin' GNU style
71 *
72 * Revision 1.6 1999/12/03 20:56:44 bentson
73 * add MEDIA CHECK command
74 *
75 * Revision 1.5 1999/11/24 15:57:50 bentson
76 * add license
77 *
78 * Revision 1.4 1999/11/23 19:04:08 bentson
79 * clean up and enhance inquiry command
80 *
81 * Revision 1.3 1999/11/23 06:42:19 bentson
82 * add 4-bit grayscale support; fix color count field placement
83 *
84 * Revision 1.2 1999/11/22 18:15:43 bentson
85 * more work on color support
86 *
87 * Revision 1.1 1999/11/19 15:09:08 bentson
88 * cribbed from m3096g
89 *
90 */
91
92 /****************************************************/
93
94 static inline void
setbitfield(unsigned char *pageaddr, int mask, int shift, int val)95 setbitfield (unsigned char *pageaddr, int mask, int shift, int val) \
96 {
97 *pageaddr = (*pageaddr & ~(mask << shift)) | ((val & mask) << shift);
98 }
99
100 /* ------------------------------------------------------------------------- */
101
102 static inline void
resetbitfield(unsigned char *pageaddr, int mask, int shift, int val)103 resetbitfield (unsigned char *pageaddr, int mask, int shift, int val) \
104 {
105 *pageaddr = (*pageaddr & ~(mask << shift)) | (((!val) & mask) << shift);
106 }
107
108 /* ------------------------------------------------------------------------- */
109
110 static inline int
getbitfield(unsigned char *pageaddr, int mask, int shift)111 getbitfield (unsigned char *pageaddr, int mask, int shift) \
112 {
113 return ((*pageaddr >> shift) & mask);
114 }
115
116 /* ------------------------------------------------------------------------- */
117
118 static inline int
getnbyte(unsigned char *pnt, int nbytes)119 getnbyte (unsigned char *pnt, int nbytes) \
120 {
121 unsigned int result = 0;
122 int i;
123
124 #ifdef DEBUG
125 assert (nbytes < 5);
126 #endif
127 for (i = 0; i < nbytes; i++)
128 result = (result << 8) | (pnt[i] & 0xff);
129 return result;
130 }
131
132 /* ------------------------------------------------------------------------- */
133
134 static inline void
135 putnbyte (unsigned char *pnt, unsigned int value, unsigned int nbytes) \
136 {
137 int i;
138
139 #ifdef DEBUG
140 assert (nbytes < 5);
141 #endif
142 for (i = nbytes - 1; i >= 0; i--)
143 \
144 {
145 pnt[i] = value & 0xff;
146 value = value >> 8;
147 }
148 }
149
150
151 /* ==================================================================== */
152 /* SCSI commands */
153
154 typedef struct
155 {
156 unsigned char *cmd;
157 unsigned int size;
158 }
159 scsiblk;
160
161 /* ==================================================================== */
162
163 #define RESERVE_UNIT 0x16
164 #define RELEASE_UNIT 0x17
165 #define INQUIRY 0x12
166 #define REQUEST_SENSE 0x03
167 #define SEND_DIAGNOSTIC 0x1d
168 #define TEST_UNIT_READY 0x00
169 #define SET_WINDOW 0x24
170 #define SET_SUBWINDOW 0xc0
171 #define OBJECT_POSITION 0x31
172 #define MEDIA_CHECK 0x08
173 #define SEND 0x2a
174 #define READ 0x28
175 #define MODE_SELECT 0x15
176 #define MODE_SENSE 0x1a
177 #define SCAN 0x1b
178
179 /* ==================================================================== */
180
181 static unsigned char reserve_unitC[] =
182 {RESERVE_UNIT, 0x00, 0x00, 0x00, 0x00, 0x00};
183 static scsiblk reserve_unitB =
184 {reserve_unitC, sizeof (reserve_unitC)};
185
186 /* ==================================================================== */
187
188 static unsigned char release_unitC[] =
189 {RELEASE_UNIT, 0x00, 0x00, 0x00, 0x00, 0x00};
190 static scsiblk release_unitB =
191 {release_unitC, sizeof (release_unitC)};
192
193 /* ==================================================================== */
194
195 static unsigned char inquiryC[] =
196 {INQUIRY, 0x00, 0x00, 0x00, 0x1f, 0x00};
197 static scsiblk inquiryB =
198 {inquiryC, sizeof (inquiryC)};
199
200 #define set_IN_return_size(icb,val) icb[0x04]=val
201 #define set_IN_length(out,n) out[0x04]=n-5
202
203 #define get_IN_periph_qual(in) getbitfield(in, 0x07, 5)
204 #define IN_periph_qual_lun 0x00
205 #define IN_periph_qual_nolun 0x03
206 #define get_IN_periph_devtype(in) getbitfield(in, 0x1f, 0)
207 #define IN_periph_devtype_scanner 0x06
208 #define IN_periph_devtype_unknown 0x1f
209 #define get_IN_response_format(in) getbitfield(in + 0x03, 0x0f, 0)
210 #define IN_recognized 0x02
211 #define get_IN_additional_length(in) in[0x04]
212 #define get_IN_vendor(in, buf) snprintf(buf, 0x08 + 1, "%.*s", \
213 0x08, in + 0x08)
214 #define get_IN_product(in, buf) snprintf(buf, 0x10 + 1, "%.*s", \
215 0x10, in + 0x10)
216 #define get_IN_version(in, buf) snprintf(buf, 0x04 + 1, "%.*s", \
217 0x04, in + 0x20)
218 #define get_IN_color_mode(in) getbitfield(in + 0x24, 0xf, 0)
219 #define get_IN_color_seq(in) getbitfield(in + 0x24, 0x7, 4)
220 #define get_IN_adf(in) getbitfield(in + 0x24, 0x1, 7)
221
222 /* ==================================================================== */
223
224 static unsigned char request_senseC[] =
225 {REQUEST_SENSE, 0x00, 0x00, 0x00, 0x00, 0x00};
226 static scsiblk request_senseB =
227 {request_senseC, sizeof (request_senseC)};
228
229 #define set_RS_allocation_length(sb,val) sb[0x04] = (unsigned char)val
230 /* defines for request sense return block */
231 #define get_RS_information_valid(b) getbitfield(b + 0x00, 1, 7)
232 #define get_RS_error_code(b) getbitfield(b + 0x00, 0x7f, 0)
233 #define get_RS_filemark(b) getbitfield(b + 0x02, 1, 7)
234 #define get_RS_EOM(b) getbitfield(b + 0x02, 1, 6)
235 #define get_RS_ILI(b) getbitfield(b + 0x02, 1, 5)
236 #define get_RS_sense_key(b) getbitfield(b + 0x02, 0x0f, 0)
237 #define get_RS_information(b) getnbyte(b+0x03, 4) /* normally 0 */
238 #define get_RS_additional_length(b) b[0x07] /* always 10 */
239 #define get_RS_ASC(b) b[0x0c]
240 #define get_RS_ASCQ(b) b[0x0d]
241 #define get_RS_SKSV(b) getbitfield(b+0x0f,1,7) /* valid, always 0 */
242
243 #define rs_return_block_size 18 /* Says Nikon */
244
245 /* ==================================================================== */
246
247 static unsigned char send_diagnosticC[] =
248 {SEND_DIAGNOSTIC, 0x04, 0x00, 0x00, 0x00, 0x00};
249 static scsiblk send_diagnosticB =
250 {send_diagnosticC, sizeof (send_diagnosticC)};
251
252 /* ==================================================================== */
253
254 static unsigned char test_unit_readyC[] =
255 {TEST_UNIT_READY, 0x00, 0x00, 0x00, 0x00, 0x00};
256 static scsiblk test_unit_readyB =
257 {test_unit_readyC, sizeof (test_unit_readyC)};
258
259 /* ==================================================================== */
260
261 static unsigned char set_windowC[] =
262 {SET_WINDOW, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,};
263 /* opcode, lun, _____4 X reserved____, _transfer length, ctl */
264 static scsiblk set_windowB =
265 {set_windowC, sizeof (set_windowC)};
266 #define set_SW_xferlen(sb, len) putnbyte(sb + 0x06, len, 3)
267 #define get_SW_xferlen(sb) getnbyte(sb + 0x06, 3)
268
269 /* ==================================================================== */
270
271 static unsigned char set_subwindowC[] =
272 {SET_SUBWINDOW};
273 static scsiblk set_subwindowB =
274 {set_subwindowC, sizeof (set_subwindowC)};
275
276 /* ==================================================================== */
277
278 static unsigned char object_positionC[] =
279 {OBJECT_POSITION, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
280 /* ADF, _____Count_____, ________Reserved______, Ctl */
281 static scsiblk object_positionB =
282 {object_positionC, sizeof (object_positionC)};
283
284 #define set_OP_autofeed(b,val) setbitfield(b+0x01, 0x07, 0, val)
285 #define OP_Discharge 0x00
286 #define OP_Feed 0x01
287 /* ==================================================================== */
288
289 static unsigned char media_checkC[] =
290 {MEDIA_CHECK, 0x00, 0x00, 0x00, 0x00, 0x00};
291 /* ADF, _Reserved_, Len, Ctl */
292 static scsiblk media_checkB =
293 {media_checkC, sizeof (media_checkC)};
294
295 #define set_MC_return_size(sb,val) sb[0x04]=val
296 #define get_MC_adf_status(sb) sb[0x00]
297 #define MC_ADF_OK 0x01
298
299 /* ==================================================================== */
300 static unsigned char media_parameter_data_blockC[] =
301 {
302 0x00
303 };
304 static scsiblk media_parameter_data_blockB =
305 {media_parameter_data_blockC, sizeof (media_parameter_data_blockC)};
306 /* ==================================================================== */
307
308 static unsigned char sendC[] =
309 {SEND, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
310 static scsiblk sendB =
311 {sendC, sizeof (sendC)};
312
313 #define set_S_datatype_code(sb, val) sb[0x02] = (unsigned char)val
314 #define S_datatype_imagedatai 0x00
315 #define S_EX_datatype_LUT 0x01 /* Experiment code */
316 #define S_EX_datatype_shading_data 0xa0 /* Experiment code */
317 #define S_user_reg_gamma 0xc0
318 #define S_device_internal_info 0x03
319 #define set_S_datatype_qual_upper(sb, val) sb[0x04] = (unsigned char)val
320 #define S_DQ_none 0x00
321 #define S_DQ_Rcomp 0x06
322 #define S_DQ_Gcomp 0x07
323 #define S_DQ_Bcomp 0x08
324 #define S_DQ_Reg1 0x01
325 #define S_DQ_Reg2 0x02
326 #define S_DQ_Reg3 0x03
327 #define set_S_xfer_length(sb, val) putnbyte(sb + 0x06, val, 3)
328
329 /*
330 static unsigned char gamma_user_LUT_LS1K[512] = { 0x00 };
331 static scsiblk gamma_user_LUT_LS1K_LS1K = {
332 gamma_user_LUT_LS1K, sizeof(gamma_user_LUT_LS1K)
333 };
334 */
335
336 /* ==================================================================== */
337
338 static unsigned char readC[] =
339 {READ, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
340 /* Type, rsvd, type qual, __xfer length__, Ctl */
341 static scsiblk readB =
342 {readC, sizeof (readC)};
343
344 #define set_R_datatype_code(sb, val) sb[0x02] = val
345 #define R_datatype_imagedata 0x00
346 #define R_pixel_size 0x80
347 #define set_R_xfer_length(sb, val) putnbyte(sb + 0x06, val, 3)
348
349 /* ==================================================================== */
350
351 static unsigned char mode_selectC[] =
352 {MODE_SELECT, 0x10, 0x00, 0x00, 0x00, 0x00};
353 static scsiblk mode_selectB =
354 {mode_selectC, sizeof (mode_selectC)};
355
356 /* ==================================================================== */
357
358 static unsigned char mode_senseC[] =
359 {MODE_SENSE, 0x18, 0x03, 0x00, 0x00, 0x00, /* PF set, page type 03 */ };
360 static scsiblk mode_senseB =
361 {mode_senseC, sizeof (mode_senseC)};
362
363 #define set_MS_DBD(b, val) setbitfield(b, 0x01, 3, (val?1:0))
364 #define set_MS_len(b, val) putnbyte(b+0x04, val, 1)
365 #define get_MS_MUD(b) getnbyte(b+(0x04+((int)*(b+0x3)))+0x4,2)
366
367 /* ==================================================================== */
368
369 static unsigned char scanC[] =
370 {SCAN, 0x00, 0x00, 0x00, 0x00, 0x00};
371 static scsiblk scanB =
372 {scanC, sizeof (scanC)};
373
374 #define set_SC_xfer_length(sb, val) sb[0x04] = (unsigned char)val
375
376 /* ==================================================================== */
377
378 /* We use the same structure for both SET WINDOW and GET WINDOW. */
379 static unsigned char window_parameter_data_blockC[] =
380 {
381 0x00, 0x00, 0x00,
382 0x00, 0x00, 0x00, /* reserved */
383 0x00, 0x00, /* Window Descriptor Length */
384 };
385 static scsiblk window_parameter_data_blockB =
386 {window_parameter_data_blockC, sizeof (window_parameter_data_blockC)};
387
388 #define set_WDPB_wdblen(sb, len) putnbyte(sb + 0x06, len, 2)
389 #define get_WDPB_wdblen(sb) getnbyte(sb + 0x06, 2)
390
391 #define WDB_size_empty 0x28 /* wdb_len if nothing is set by inquiry */
392 #define WDB_size_BW 0x40
393 #define WDB_size_Color 0x33
394 #define WDB_size_max 0xff
395
396 /* ==================================================================== */
397
398 static unsigned char window_descriptor_blockC[] =
399 {
400 0x00, /* 0x00 *//* Window Identifier */
401 #define set_WD_wid(sb, val) sb[0] = val
402 #define WD_wid_all 0x00 /* Only one supported */
403 0x00, /* 0x01 *//* reserved, AUTO */
404 #define set_WD_auto(sb, val) setbitfield(sb + 0x01, 1, 0, val)
405 #define get_WD_auto(sb) getbitfield(sb + 0x01, 1, 0)
406 0x00, 0x00, /* 0x02 *//* X resolution in dpi, 0 => 400 */
407 #define set_WD_Xres(sb, val) putnbyte(sb + 0x02, val, 2)
408 #define get_WD_Xres(sb) getnbyte(sb + 0x02, 2)
409 0x00, 0x00, /* 0x04 *//* Y resolution in dpi, 0 => 400 */
410 #define set_WD_Yres(sb, val) putnbyte(sb + 0x04, val, 2)
411 #define get_WD_Yres(sb) getnbyte(sb + 0x04, 2)
412 0x00, 0x00,
413 0x00, 0x00, /* 0x06 *//* Upper Left X in inch/1200 */
414 #define set_WD_ULX(sb, val) putnbyte(sb + 0x06, val, 4)
415 #define get_WD_ULX(sb) getnbyte(sb + 0x06, 4)
416 0x00, 0x00,
417 0x00, 0x00, /* 0x0a *//* Upper Left Y in inch/1200 */
418 #define set_WD_ULY(sb, val) putnbyte(sb + 0x0a, val, 4)
419 #define get_WD_ULY(sb) getnbyte(sb + 0x0a, 4)
420 0x00, 0x00,
421 0x00, 0x00, /* 0x0e *//* Width */
422 #define set_WD_width(sb, val) putnbyte(sb + 0x0e, val, 4)
423 #define get_WD_width(sb) getnbyte(sb + 0x0e, 4)
424 #define WD_width 10200
425 0x00, 0x00,
426 0x00, 0x00, /* 0x12 *//* Length */
427 #define set_WD_length(sb, val) putnbyte(sb + 0x12, val, 4)
428 #define get_WD_length(sb) getnbyte(sb + 0x12, 4)
429 #define WD_length 13200
430 0x00, /* 0x16 *//* Brightness */
431 #define set_WD_brightness(sb, val) sb[0x16] = val
432 #define get_WD_brightness(sb) sb[0x16]
433 #define WD_brightness 0x80
434 0x00, /* 0x17 *//* Threshold */
435 #define set_WD_threshold(sb, val) sb[0x17] = val
436 #define get_WD_threshold(sb) sb[0x17]
437 #define WD_threshold 0x80
438 0x00, /* 0x18 *//* Contrast */
439 #define set_WD_contrast(sb, val) sb[0x18] = val
440 #define get_WD_contrast(sb) sb[0x18]
441 0x05, /* 0x19 *//* Image composition */
442 #define set_WD_composition(sb, val) sb[0x19] = val
443 #define get_WD_composition(sb) sb[0x19]
444 /* lineart, halftone, greyscale, binary color, dither color, multi-color */
445 #define WD_comp_LA 0
446 #define WD_comp_HT 1
447 #define WD_comp_GS 2
448 #define WD_comp_BC 3
449 #define WD_comp_DC 4
450 #define WD_comp_MC 5
451 #define WD_comp_G4 10
452 #define WD_comp_G8 11
453 0x08, /* 0x1a *//* Bits/Pixel */
454 #define set_WD_bitsperpixel(sb, val) sb[0x1a] = val
455 #define get_WD_bitsperpixel(sb) sb[0x1a]
456 0x00, 0x00, /* 0x1b *//* Halftone pattern */
457 #define set_WD_halftone(sb, val) putnbyte(sb + 0x1b, val, 2)
458 #define get_WD_halftone(sb) getnbyte(sb + 0x1b, 2)
459 0x00,
460 /* 0x1d *//*************** STUFF ***************/
461 #define set_WD_rif(sb, val) setbitfield(sb + 0x1d, 1, 7, val)
462 #define get_WD_rif(sb) getbitfield(sb + 0x1d, 1, 7)
463 #define set_WD_pad(sb, val) setbitfield(sb + 0x1d, 7, 0, val)
464 #define get_WD_pad(sb) getbitfield(sb + 0x1d, 7, 0)
465 0x00, 0x00, /* 0x1e *//* bit ordering */
466 #define set_WD_bitorder(sb, val) putnbyte(sb + 0x1e, val, 2)
467 #define get_WD_bitorder(sb) getnbyte(sb + 0x1e, 2)
468 0x00, /* 0x20 *//* compression type */
469 #define set_WD_compress_type(sb, val) sb[0x20] = val
470 #define get_WD_compress_type(sb) sb[0x20]
471 0x00, /* 0x21 *//* compression argument */
472 #define set_WD_compress_arg(sb, val) sb[0x21] = val
473 #define get_WD_compress_arg(sb) sb[0x21]
474 0x00, 0x00,
475 0x00, 0x00,
476 0x00, 0x00, /* 0x22 *//* reserved */
477 0x00, /* 0x28 *//* vendor id code */
478 #define set_WD_vendor_id_code(sb, val) sb[0x28] = val
479 #define get_WD_vendor_id_code(sb) sb[0x28]
480 #define WD_bw 0x00
481 #define WD_color 0xFF
482 0x00, /* 0x29 C *//* parm length */
483 #define set_WD_parm_length(sb, val) sb[0x29] = val
484 #define get_WD_parm_length(sb) sb[0x29]
485 0x00, /* 0x2a C *//* ADF, source, Color */
486 #define set_WD_adf(sb, val) setbitfield(sb + 0x2a, 1, 7, val)
487 #define get_WD_adf(sb) getbitfield(sb + 0x2a, 1, 7)
488 #define set_WD_source(sb, val) setbitfield(sb + 0x2a, 1, 6, val)
489 #define get_WD_source(sb) getbitfield(sb + 0x2a, 1, 6)
490 #define set_WD_color(sb, val) setbitfield(sb + 0x2a, 7, 3, val)
491 #define get_WD_color(sb) getbitfield(sb + 0x2a, 7, 3)
492 #define WD_color_green 0
493 #define WD_color_red 1
494 #define WD_color_greenx 2
495 #define WD_color_blue 3
496 #define WD_color_rgb 4
497 0x00, /* 0x2b C *//* highlight color */
498 #define set_WD_highlight_color(sb, val) sb[0x2b] = val
499 #define get_WD_highlight_color(sb) sb[0x2b]
500 0x00, /* 0x2c C *//* shadow value */
501 #define set_WD_shadow_value(sb, val) sb[0x2c] = val
502 #define get_WD_shadow_value(sb) sb[0x2c]
503 0x00, 0x00, /* 0x2d C *//* line width */
504 #define set_WD_line_width(sb, val) putnbyte(sb + 0x2d, val, 2)
505 #define get_WD_line_width(sb) getnbyte(sb + 0x2d, 2)
506 0x00, 0x00, /* 0x2f C *//* line count */
507 #define set_WD_line_count(sb, val) putnbyte(sb + 0x2f, val, 2)
508 #define get_WD_line_count(sb) getnbyte(sb + 0x2f, 2)
509 0x00, /* 0x31 *//* reserved */
510 0x00, /* 0x32 *//* reserved */
511 0x00, /* 0x33 *//* reserved */
512 0x00, /* 0x34 *//* reserved */
513 0x00, /* 0x35 *//* paper size */
514 #define set_WD_paper_size(sb, val) sb[0x35] = val
515 #define get_WD_paper_size(sb) sb[0x35]
516 0x00, 0x00,
517 0x00, 0x00, /* 0x36 BW *//* paper width X */
518 #define set_WD_paper_width_X(sb, val) putnbyte(sb + 0x36, val, 4)
519 #define get_WD_paper_width_X(sb) getnbyte(sb + 0x36, 4)
520 0x00, 0x00,
521 0x00, 0x00, /* 0x3a BW *//* paper length Y */
522 #define set_WD_paper_length_Y(sb, val) putnbyte(sb+0x3a, val, 4)
523 #define get_WD_paper_length_Y(sb) getnbyte(sb + 0x3a, 4)
524 0x00, /* 0x3e *//* reserved */
525 0x00, /* 0x3f *//* reserved */
526 /* 0x40 (last) */
527 };
528
529 static scsiblk window_descriptor_blockB =
530 {window_descriptor_blockC, sizeof (window_descriptor_blockC)};
531
532 /* ==================================================================== */
533
534 #if 0
535 #define set_WDB_length(wdb,len) (wdb.size = (len))
536 #define WDB_OFF(b) (b + set_window.size)
537 #define WDB_OFF(b, n) (b + set_window.size + \
538 window_parameter_data_block.size + \
539 ( window_descriptor_block.size * (n - 1) ) )
540 #define set_WDPB_wdbnum(sb,n) set_WPDB_wdblen(sb,window_descriptor_block.size*n)
541 #endif
542
543 /* ==================================================================== */
544
545 static scsiblk __sane_unused__ *lint_catcher[] =
546 {&reserve_unitB,
547 &release_unitB,
548 &inquiryB,
549 &request_senseB,
550 &send_diagnosticB,
551 &test_unit_readyB,
552 &set_windowB,
553 &set_subwindowB,
554 &object_positionB,
555 &media_checkB,
556 &media_parameter_data_blockB,
557 &sendB,
558 &readB,
559 &mode_selectB,
560 &mode_senseB,
561 &scanB,
562 &window_parameter_data_blockB,
563 &window_descriptor_blockB};
564
565 #endif /* SP15C_SCSI_H */
566