From: Douglas Gilbert <dougg@torque.net>
To: Frederic TEMPORELLI <frederic.temporelli@bull.net>
Cc: linux-scsi@vger.kernel.org, Patrick Mansfield <patmans@us.ibm.com>
Subject: Re: proc_name in sysfs
Date: Thu, 07 Apr 2005 18:17:26 +1000 [thread overview]
Message-ID: <4254EC96.8070104@torque.net> (raw)
In-Reply-To: <4254D4A4.1000307@bull.net>
Frederic TEMPORELLI wrote:
> Hi,
>
>
> Sorry, no such "driver" directory in /sys/class/scsi_host/hostX/
> (checked: Emulex "lpfc" 8.0.24 and LSI "mptscsih" 3.01.18)
I may have missed the point here. Are you talking about
Patrick's shell script? It sort of works for me. Example:
$ ./scan_hosts.sh
/sys/class/scsi_host/host0 module (driver) is: mptbase
/sys/class/scsi_host/host1 module (driver) is: mptbase
/sys/class/scsi_host/host2 module (driver) is: mptbase
/sys/class/scsi_host/host3 module (driver) is: mptbase
/sys/class/scsi_host/host4 module (driver) is: qla2300
/sys/class/scsi_host/host5 module (driver) is: qla2300
$ lsscsi -H
[0] mptscsih
[1] mptscsih
[2] mptscsih
[3] mptscsih
[4] qla2xxx
[5] qla2xxx
Note that the module name and the proc_name are different!
It looks like Patrick's script gives the module name
"closest" to the PCI bus while proc_name gives the
"upper" lower level driver name :-)
BTW "/bin/pwd" gives a different result to "pwd"
in a bash shell just after a symlink has been
followed.
Doug Gilbert
> note: there's also a "proc_name" interface for LSI "mtpscsih", located
> in /sys/class/scsi_host/hostX/, which is reporting "mptscsih" string.
>
> Any other ideas ?
>
> Best regards.
>
>
> Douglas Gilbert a écrit :
>
>> Patrick Mansfield wrote:
>>
>>> On Wed, Apr 06, 2005 at 01:40:04PM +0200, Frederic TEMPORELLI wrote:
>>>
>>>
>>>> 2/ now, how can we get the adapter module name from sysfs ?
>>>
>>>
>>>
>>>
>>> Why do you need it?
>>>
>>> Anyway, try lsscsi, it walks the sysfs tree:
>>>
>>> [elm3b79 patman]$ lsscsi -H
>>> [0] qla1280
>>> [1] qla1280
>>> [2] qla2xxx
>>> [3] qla2xxx
>>>
>>> Or, script it:
>>>
>>> [elm3b79 tmp]$ more xx.sh
>>> #! /bin/sh
>>>
>>> hdir=/sys/class/scsi_host
>>>
>>> for i in ${hdir}/host*
>>> do
>>> host_dir=$(cd ${i}/device;/bin/pwd)
>>> driver_dir=$(cd ${host_dir}/../driver;/bin/pwd)
>>> module=$(basename ${driver_dir})
>>> # echo ${i} is in: ${host_dir}
>>> echo "${i} module (driver) is: ${module}"
>>> done
>>>
>>> [elm3b79 tmp]$ sh ./xx.sh
>>> /sys/class/scsi_host/host0 module (driver) is: qla1280
>>> /sys/class/scsi_host/host1 module (driver) is: qla1280
>>> /sys/class/scsi_host/host2 module (driver) is: qla2300
>>> /sys/class/scsi_host/host3 module (driver) is: qla2300
>>
>>
>>
>> Patrick,
>> lsscsi currently uses proc_name so it needs to be
>> changed to use the above logic (if LLDs are going
>> to stop populating proc_name).
>>
>> It has been suggested that I extend lsscsi to show
>> transport info (as seen from the HBA) found in the
>> various *_transport directories in sysfs.
>>
>> Also I have been thinking about ways to list less
>> tha all scsi devices. For example: "lsscsi 1:0:3:0"
>> to look at one device and "lsscsi 1:-" for all scsi
>> devices hanging off host1. I'm not sure whether
>> "lsscsi /dev/sda" is a good idea. Any suggestions?
>>
>> Doug Gilbert
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2005-04-07 8:21 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-06 11:40 proc_name in sysfs Frederic TEMPORELLI
2005-04-06 18:36 ` Patrick Mansfield
2005-04-07 1:06 ` Douglas Gilbert
2005-04-07 6:35 ` Frederic TEMPORELLI
2005-04-07 8:17 ` Douglas Gilbert [this message]
2005-04-08 0:02 ` Patrick Mansfield
2005-04-08 7:37 ` Frederic TEMPORELLI
2005-04-08 0:00 ` Patrick Mansfield
2005-04-08 6:46 ` Christoph Hellwig
2005-04-08 8:03 ` Douglas Gilbert
2005-04-11 11:52 ` Christoph Hellwig
2005-04-11 14:19 ` James Bottomley
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=4254EC96.8070104@torque.net \
--to=dougg@torque.net \
--cc=frederic.temporelli@bull.net \
--cc=linux-scsi@vger.kernel.org \
--cc=patmans@us.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox