2001-10-12 19:36:03

by Linux Bigot

[permalink] [raw]
Subject: SCSI driver query

Hi All

How is the ioctl() entry point in Scsi_Host_Template
used. What device node is associated with it and what
all commands can be passed down through this
interface.

TIA

__________________________________________________
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com


2001-10-14 04:57:13

by Douglas Gilbert

[permalink] [raw]
Subject: Re: SCSI driver query

Linux Bigot <[email protected]> wrote:

> How is the ioctl() entry point in Scsi_Host_Template
> used. What device node is associated with it and what
> all commands can be passed down through this
> interface.

That ioctl can be accessed (if defined) via a "trickle
down" ioctl call to any open SCSI device name (e.g. /dev/sda).

When an ioctl is called on an open SCSI device name
then the first match in the following list processes
it:
- the associated upper level SCSI driver looks for
a match on the ioctl 'cmd' number
- the mid-level looks for a match on the ioctl
'cmd' number
- otherwise if Scsi_Host_Template::ioctl is non-NULL
then it is called for the given SCSI device with
the 'cmd' and 'arg' of the original user ioctl call

A SCSI lower level (adapter) driver is not required to
support Scsi_Host_Template::ioctl in which case it will
be NULL. If it is supported then it is up to that adapter
driver what is supported.


This mechanism only allows an adapter which has attached
SCSI devices to be sent an ioctl. The proc_fs interface
may be useful for contacting an adapter driver even if it
doesn't have any attached devices. Something like:
$ echo "<some_command>" > /proc/scsi/advansys/0


Doug Gilbert