Re: Microtek E6 - mode_sense_1 problem

Randall Hopper (rhh@ct.picker.com)
Wed, 6 May 1998 06:28:08 -0400

--mYCpIKhGyMATD0i+
Content-Type: text/plain; charset=us-ascii

Matto Marjanovic:
|Short answer: The latest version of the backend (0.7, available from
| the backend webpage "http://www.mir.com/mtek/", and sent upstream for
| inclusion on SANE-0.73) has MODE_SENSE_1 disabled, so that problem
| should disappear for the time being.

Ok.

One other piece of useful info. Here's what the NCR driver says about that
"extraneous data discarded" message that's being printed when the
MODE_SENSE_1 cmd is issued:

** The target wants to tranfer too much data
** or in the wrong direction.
** Remember that in extended error.

(The internal error is XE_EXTRA_DATA.)

|Long answer: MODE_SENSE_1 used to cause problems for folks using Solaris,
| because apparently the Solaris scsi driver insisted that this was some
| command reserved for tape drives. Why and how it is causing problems for
| FreeBSD I don't know, this is a new complaint. I am curious, however,
| to know why (if you feel like poking around even more), and I would very
| much appreciate it if you sent me an INQUIRY dump from the Microtek backend
| so that I can compare firmware revisions/etc between your E6 and mine.
| Is it some scsi driver quirk, or is the scanner complaining? The big Q.

Right, I'm also interested in what's really going on. It's a good excuse
to get in there and dig around anyway. :-)

I've attached the INQUIRY info to this msg. I'm guessing that this isn't
H/W though because a friend of mine running Redhat 4.1 also on an NCR
SC-200 w/ an E6 purchased at the same time as mine has
SANE_MICROTEK_DEBUG=100 output that matches mine exactly (incl. INQUIRY),
up until the point in sane_start() where mode_sense_1() fails.

So I would guess this is likely software/driver behavior differences
somewhere (sani_scsi Linux/BSD differences, Linux/BSD NCR driver
differences, ...).

Since you've worked more with SCSI at a cmd level more than I, I've
attached the last part of the SCSI debug output from the NCR driver when
running "scanimage". There's one fully successful ioctl() there (the one
before the MODE_SENSE_1) as well as the MODE_SENSE_1 ioctl() that fails
right after it. Would appreciate it if you could give it a short 10-sec
glance and see if anything just pops out at you.

I wonder if the E6's MODE_SENSE_1 reply isn't exactly 36 bytes. (?)
(a shot in the dark :-)

Thanks,

Randall

--mYCpIKhGyMATD0i+
Content-Type: text/plain
Content-Disposition: attachment; filename="SANE-0.72.INQUIRY.txt"

=== SANE/Microtek backend v0.6 ===
========== Scanner Inquiry Block ========mm
06 31 13 01 5b 16 00 00 20 20 20 20 20 20 20 20
53 63 61 6e 6e 65 72 20 36 30 30 20 20 20 20 20
31 2e 39 31 53 43 53 49 20 46 2f 57 56 33 2e 34
20 43 54 4c 35 33 38 30 03 4f 8c c5 03 ee 66 03
00 03 01 00 00 03 00 01 0e 0e 01 05 00 00 00 00
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff

========== Scanner Inquiry Report ==========
===== Scanner ID...
Device Type Code: 0x06
Model Code: 0x66
Vendor Name: ' ' Model Name: 'Scanner 600 '
Firmware Rev: '1.91'
SCSI F/W version: 3.1 Scanner F/W version: 1.3
Response data format: 0x01
===== Imaging Capabilities...
Modes: Lineart Halftone Gray Color (OnePass)
Resolution Step Sizes: 1% 5% Expanded Resolution Support? yes(but says no)
Supported Bits Per Sample: 4 8
Max. document size code: 0x03
Max. document size: 8.500000 x 13.000000 inches
Frame units: pixels 1/8"'s
# of built-in halftones: 12 Downloadable patterns? Yes
Data Compression:
Contrast Settings: 14 Exposure Settings: 14
Adjustable Shadow/Highlight? yes Adjustable Midtone? yes
Digital brightness/offset? yes
Gamma Table Size: 256 entries of 1 bytes (max. value: 255)
===== Source Options...
Feed type: flatbed ADF support? yes
Document Feeder Support? yes Feeder Backtracking? yes
Feeder Installed? no Feeder Ready? no
Transparency Adapter Installed? no
Fast Color Prescan? no
Selectable Transfer Format? no
Color Transfer Sequence: line-by-line, non-sequential with headers
Three pass scan support? no
ModeSelect-1 and ModeSense-1 Support? yes
Can Disable Linearization Table? no
Can Disable Start-of-Scan Recalibration? yes

--mYCpIKhGyMATD0i+
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="SANE-0.72.SCSIDEBUG"

/kernel: uk0(ncr0:6:0): scsi_do_ioctl(0xc0605101)
/kernel: uk0(ncr0:6:0): user_strategy
/kernel: uk0(ncr0:6:0): scsi_cmd
/kernel: uk0(ncr0:6:0): get_xs
/kernel: uk0(ncr0:6:0): returning
/kernel: xs(0xf06fdf00): flg(0x828)sc_link(0xf06fde80)retr(0x0)timo(0xea60)cmd(0xf06fdf58)len(0x6)data(0xf3e55f9e)len(0x10)res(0x0)err(0x0)bp(0xf0858d00)uk0: command: 16,0,0,0,a,0-[16 bytes]
/kernel: ------------------------------
/kernel: 000: 00 00 00 40 00 00 00 00 00 00 dc 4f bf ef 8e c6
/kernel: ------------------------------
/kernel: uk0(ncr0:6:0): about to sleep
/kernel: uk0(ncr0:6:0): scsi_done
/kernel: uk0: command: 16,0,0,0,a,0-[16 bytes]
/kernel: ------------------------------
/kernel: 000: 00 00 00 40 00 00 00 00 00 00 dc 4f bf ef 8e c6
/kernel: ------------------------------
/kernel: uk0(ncr0:6:0): calling user done()
/kernel: uk0(ncr0:6:0): user-done
/kernel: uk0(ncr0:6:0): no error
/kernel: uk0(ncr0:6:0): returned from user done()
/kernel: uk0(ncr0:6:0): free_xs
/kernel: uk0(ncr0:6:0): returning to adapter
/kernel: uk0(ncr0:6:0): back from sleep
/kernel: uk0(ncr0:6:0): scsi_do_ioctl(0xc0605101)
/kernel: uk0(ncr0:6:0): user_strategy
/kernel: uk0(ncr0:6:0): scsi_cmd
/kernel: uk0(ncr0:6:0): get_xs
/kernel: uk0(ncr0:6:0): returning
/kernel: xs(0xf06fdf00): flg(0x828)sc_link(0xf06fde80)retr(0x0)timo(0xea60)cmd(0xf06fdf58)len(0x6)data(0xf3e55f8a)len(0x24)res(0x0)err(0x0)bp(0xf0858d00)uk0: command: 19,0,0,0,1e,0-[36 bytes]
/kernel: ------------------------------
/kernel: 000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
/kernel: 016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 dc 4f
/kernel: 032: bf ef a1 c6
/kernel: ------------------------------
/kernel: uk0(ncr0:6:0): about to sleep
/kernel: uk0: extraneous data discarded.
/kernel: uk0: COMMAND FAILED (9 0) @f0551000.
/kernel: uk0(ncr0:6:0): scsi_done
/kernel: uk0: command: 19,0,0,0,1e,0-[36 bytes]
/kernel: ------------------------------
/kernel: 000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
/kernel: 016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 dc 4f
/kernel: 032: bf ef a1 c6
/kernel: ------------------------------
/kernel: uk0(ncr0:6:0): calling user done()
/kernel: uk0(ncr0:6:0): user-done
/kernel: uk0(ncr0:6:0): timeout
/kernel: uk0(ncr0:6:0): returned from user done()
/kernel: uk0(ncr0:6:0): free_xs
/kernel: uk0(ncr0:6:0): returning to adapter
/kernel: uk0(ncr0:6:0): back from sleep
/kernel: uk0(ncr0:6:0): ukclose: Closing device

--mYCpIKhGyMATD0i+--

--
Source code, list archive, and docs: http://www.mostang.com/sane/
To unsubscribe: echo unsubscribe sane-devel | mail majordomo@mostang.com