[sane-devel] FreeBSD and Microtek Scanmaker II

Nakal nakal@web.de
Wed, 18 Jun 2003 01:07:59 +0200


On Tuesday 17 June 2003 23:30, abel deuring wrote:

> First a disclaimer for the following stuff: I don't have FreeBSD
> installed, I used it only rarely, and I never wrote software
> specifically for FreeBSD. So I am writing as a "backseat driver" ;)

<flame-protection>
Try it :)
</flame-protection>

> I assume that you are using FreeBSD's CAM interface.

Yes, that's right.

> Googling quickly for 'freebsd cam.h', I found a version of cam.h at
> http://www.freebsd.cz/pub/FreeBSD/branches/4.0-stable/src/sys/cam/cam
>.h, and found these definitions for the status values 10 and 16:
>
> 10 -> CAM_SEL_TIMEOUT,	/* Target Selection Timeout */
> 16 -> CAM_AUTOSENSE_FAIL = 0x10,/* Autosense: request sense cmd fail
> */
> (definitions of this kind tend to be stable -- but control is better
> than trust some cases: Martin, can you confirm this for your version
> of cam.h?)

The values 10 and 16 are still correct, but I'm sure you are using the 
enums by name. That should be fine, of course. Seems nothing has 
changed in cam.h since 2000/03/17. Even FreeBSD-current (5.1) seems to 
use the same values (2002/01/09).

You can find the kernel sources for cam here (just in case you haven't 
found cam.c):
ftp://ftp2.freebsd.org/pub/FreeBSD/FreeBSD-stable/src/sys/cam

> OK, many commands fail with a selection time out. Not very surprising
> for a slow scanner with probably somewhat dumb firmware ;)

Firmware? :) No firmware patch yet. My scanner is still good :) I'm 
patient.

> Another point: From reading cam.h, I think that the sense handler
> should only be called, if the bit CAM_AUTOSNS_VALID is set in
> ccb_h.status.

Hmmm... that's too high-level for me. I am not really a kernel 
developer. Maybe freebsd mailing lists would help you.
http://www.freebsd.org/support.html#mailing-list

> Generally, I have the impression that the FreeBSD/CAM part of
> sanei_scsi.c could need a review. But that should be done by somebody
> who can run Sane under FreeBSD ;)

Well, I will try to help, but I am also a simple user who just writes 
'make install' in /usr/ports/graphics/xsane and is expecting that 
everything works after few minutes. :)

Generally it is better to have contact with the responsible ports 
committer. You can find him here:
http://www.FreeBSD.org/cgi/ports.cgi?query=xsane&stype=all

The ports version of xsane in FreeBSD ports tree is 0.90. Tomorrow I 
want to take a look, if I am able to build xsane-0.90 with your 
suggested patch.

Martin