From: Douglas Gilbert <dougg@torque.net>
To: Olaf Hering <olh@suse.de>
Cc: linux-scsi@vger.kernel.org, patmans@ibm.com
Subject: Re: sysfs support for sg
Date: Thu, 08 Jan 2004 11:50:03 +1000 [thread overview]
Message-ID: <3FFCB74B.9090102@torque.net> (raw)
In-Reply-To: <20040107224028.GA24290@suse.de>
[-- Attachment #1: Type: text/plain, Size: 1856 bytes --]
Olaf Hering wrote:
> On Wed, Jan 07, Olaf Hering wrote:
>
>
>>Hello,
>>
>>are there any plans to add sysfs support to the sg driver?
>>I see no 'dev' nodes for it.
>>Can stuff like 'sg_start /dev/sg2 0' be done in another way?
>
>
> I missed the /sys/block/sda/device/generic symlink. But still, no dev
> node. Is that supposed to work that way?
Olaf,
lk 2.6.0-rc1 has added sysfs support for sg with
/sys/cdev/major/sg<n> . In that directory
is a symlink to the corresponding SCSI device. When that symlink
is followed the target directory has a symlink called 'generic'
back to /sys/cdev/major/sg<n>. The st driver has similar cdev
bidirectional mapping (and hopefully osst will soon follow).
An example is attached. [BTW 'getcwd' returns the "true" path
as described in "man 3 getcwd".]
The "cdev" changes in the sg and st drivers allow more than
256 devices to be handled. The sg driver limits the number
of devices to 8192. I believe sd is still limited to
128 devices and I not sure about the device limits of sr.
Currently the sg driver lacks driver parameter support within sysfs
(e.g. 'allow_dio' as found in the /proc/scsi/sg directory).
Interestingly the st and osst drivers have /sys/bus/scsi/drivers/st
and osst directories (sd and st drivers also get directories if
their drivers are loaded). It is useful to be able to access
ULDs _prior_ to any (scsi) devices being attached which is not
possible under lk 2.4 .
I have been looking at the lsscsi program again which has been
dormant for 6 months. A symlink that I miss is from a scsi host
(enumerated in the /sys/class/scsi_host directory) to the
driver (and its name) that controls it.
BTW Is there a definitive libsysfs site anywhere? I noticed that
scsi_id provided in the "extras" directory of udev-009 doesn't
build with the libsysfs provided by udev-009.
Doug Gilbert
[-- Attachment #2: sg_sysfs.txt --]
[-- Type: text/plain, Size: 342 bytes --]
# cd /sys/cdev/major/sg0
# ls
device
# tree
.
`-- device -> ../../../devices/pci0000:00/0000:00:0e.0/host0/0:0:1:0
1 directory, 0 files
# cd device/
# ls
block detach_state generic online queue_depth rev type
delete device_blocked model power rescan scsi_level vendor
# cd generic/
# getcwd
/sys/cdev/major/sg0
next prev parent reply other threads:[~2004-01-08 1:52 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-01-07 22:33 sysfs support for sg Olaf Hering
2004-01-07 22:40 ` Olaf Hering
2004-01-08 1:50 ` Douglas Gilbert [this message]
2004-01-08 2:11 ` Douglas Gilbert
2004-01-08 5:41 ` Daniel Stekloff
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3FFCB74B.9090102@torque.net \
--to=dougg@torque.net \
--cc=linux-scsi@vger.kernel.org \
--cc=olh@suse.de \
--cc=patmans@ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.