[8739] in linux-scsi channel archive
Re: SCSI driver question
daemon@ATHENA.MIT.EDU (Douglas Gilbert)
Mon May 1 23:27:01 2000
Message-ID: <390E4002.1450F13D@interlog.com>
Date: Mon, 01 May 2000 22:40:02 -0400
From: Douglas Gilbert <dgilbert@interlog.com>
MIME-Version: 1.0
To: Mark Elkins <mokes2001@yahoo.com>
Cc: linux-scsi@vger.rutgers.edu
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Mark Elkins wrote:
>
> Hello,
>
> I checked out the generic SCSI interface, but it
> offers indirect transfers (i.e. user data is copied to
> kernel buffers). I would like to perform direct
> transfers (thus I can give a physical address, or a
> virtual address which I know is mapped to a specific
> physical address). Does anyone know of an appropriate
> mechanism?
[snip]
> Eric Lee Green wrote:
> > "Read the Source, Luke" seems to be the usual
> > response to documentation
> > problems with the Linux kernel. Rather unsatisfying,
> > but (shrug).
> >
> > http://www.torque.net/sg/
> >
> > is the place where the Linux SCSI Generic driver
> > lives. This gives you direct
> > access to the SCSI bus via an interface to the
> > low-level SCSI device drivers.
> > There is sample source code there showing you how to
> > do various things such
> > as, e.g., read/write blocks of data on a hard drive
> > via the low-level READ and
> > WRITE commands.
Mark,
Have another look at that web site and follow the "notes about
the version 3 sg driver" link. The sg driver for the lk 2.3/2.4
has direct IO support in it (which may be what you want) but it is
currently conditionally compiled out. The reason for this was
problems I had with the kiobuf mechanism within the kernel
several months ago. Stephen Tweedie has since updated "kiobuf"
but I'm yet to retest the problem areas (and I think there are
further changes coming). On the weekend I compiled it in just
to test it was still buildable (which it was). The relevant
define in sg.c (showing it's current state) is:
/* #define SG_ALLOW_DIO */
Feel free to experiment with direct transfers but it is probably
important to use the kiobuf mechanism since there are a lot of
thorny issues involved.
Good luck.
Doug Gilbert
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.rutgers.edu