Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Jul 1997 10:34:13 -0500
From:      Wm Brian McCane <root@bmccane.uit.net>
To:        Amancio Hasty <hasty@rah.star-gate.com>
Cc:        multimedia@FreeBSD.ORG, chat@FreeBSD.ORG
Subject:   Re: Free At Last: A Scanner Storyn 
Message-ID:  <199707151534.KAA22881@bmccane.uit.net>
In-Reply-To: Your message of "Sat, 28 Jun 1997 23:30:06 PDT." <199706290630.XAA07386@rah.star-gate.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
> This is what I did to the scsi subsystem:
> 
> /sys/scsi/scsiconf.c:
> static struct scsidevs unknowndev =
> 	{
> 		T_UNKNOWN, T_UNKNOWN, 0, "*", "*", "*",
> 		"uk", SC_ONE_LU
> 		/*		"uk", SC_MORE_LUS*/
> 	};
> 
> 
> /sys/scsi/scsi_ioctl.c:
> 
> 	case	XS_BUSY:
> 		SC_DEBUG(xs->sc_link,SDEV_DB3,("busy\n"));
> 		screq->retsts = SCCMD_BUSY;
> 		break;
> 
> 	default:
> 	    /*sc_print_addr(xs->sc_link); */
> 		screq->retsts = SCCMD_UNKNOWN;
> 		break;
> 	}
>
Howdy, sorry it has taken me so long to get back with you, I've been very busy 
(yay! I get paid ;).  Anyway, after making your changes and building a new 
UNIX kernel, it appears to work "correctly".  Except for one small problem:
Whataver is in the buffer passed to the "INQUIRY" command in mustek.c is 
returned unchanged.  The odd thing is that I am being told that the command 
succeeded, and that 96 bytes were read.  I have tried to look at umax_??.c for 
differences, but there are more than a few.  I then tried:

$ scsi -f /dev/uk0 -c "12 0 0 0 60 0" -i 96 "s8"

the Kernel debug output looks like:

uk0(ahc0:3:0): scsi_cmd
uk0(ahc0:3:0): get_xs
uk0(ahc0:3:0): returning
xs(0xf048dc00): flg(0x60)sc_link(0xf048db80)retr(0x2)timo(0x186a0)
                cmd(0xf048dc58)len(0x6)data(0x0)len(0x0)res(0x0)
                err(0x0)bp(0x0)
uk0: command: 0,0,0,0,0,0-[0 bytes]
uk0(ahc0:3:0): scsi_done
uk0: command: 0,0,0,0,0,0-[0 bytes]
uk0(ahc0:3:0): back in cmd()
uk0(ahc0:3:0): sc_err1,err = 0x0 
uk0(ahc0:3:0): free_xs
uk0(ahc0:3:0): ukopen: dev=0x1f00 (unit 0) result 0
uk0(ahc0:3:0): scsi_do_ioctl(0xc0605101)
uk0(ahc0:3:0): user_strategy
uk0(ahc0:3:0): scsi_cmd
uk0(ahc0:3:0): get_xs
uk0(ahc0:3:0): returning
xs(0xf048dc00): flg(0x428)sc_link(0xf048db80)retr(0x0)timo(0x7d0)
                cmd(0xf048dc58)len(0x6)data(0xf377e080)len(0x60)
                res(0x0)err(0x0)bp(0xf0861000)
uk0: command: 12,0,0,0,60,0-[96 bytes]
------------------------------
000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
------------------------------
uk0(ahc0:3:0): abuk0(ahc0:3:0): scsi_done
uk0: command: 12,0,0,0,60,0-[96 bytes]
------------------------------
000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
016: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
032: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
048: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
------------------------------
uk0(ahc0:3:0): calling user done()
uk0(ahc0:3:0): user-done
uk0(ahc0:3:0): no error
uk0(ahc0:3:0): returned from user done()
 uk0(ahc0:3:0): free_xs
uk0(ahc0:3:0): returning to adapter
out to  sleep
uk0(ahc0:3:0): back from sleep
uk0(ahc0:3:0): ukclose:  Closing device

Notice that ALL 0's are returned in the result buffer, which is what is passed 
in the scsi command because they "bzero" the buffer before calling 
scsireq_enter.  Could my problem be because this is a "Unknown device" and is 
thus not copying the result buffer into user space.  Or could it be something 
else?

	brian 






Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199707151534.KAA22881>