All of lore.kernel.org
 help / color / mirror / Atom feed
From: Douglas Gilbert <dougg@torque.net>
To: linux-scsi@vger.kernel.org
Cc: patmans@us.ibm.com
Subject: lsscsi for lk 2.5.51
Date: Sun, 15 Dec 2002 12:51:07 +1100	[thread overview]
Message-ID: <3DFBE00B.1070805@torque.net> (raw)

[-- Attachment #1: Type: text/plain, Size: 1735 bytes --]

Since sysfs now contains a reasonable amount of data about
scsi devices, it is possible to write an application
that scans this information and presents it in a "ls"
form (akin to lspci and lsusb).

Attached is a toy program called lsssci that could
grow into something more useful. It requires lk 2.5.51
or later.

$ lsscsi
[4:0:0:0]  CDROM   CREATIVE CD5233E          1.00  /dev/sr0
[3:0:0:0]  disk    Linux    scsi_debug       0004  /dev/sdb
[2:0:6:0]  tape    SONY     SDT-7000         0192
[0:0:8:0]  disk    FUJITSU  MAM3184MP        0105  /dev/sda


This output corresponds to my system which has these "scsi"
devices:

$ cat /proc/scsi/scsi
Attached devices:
Host: scsi0 Channel: 00 Id: 08 Lun: 00
   Vendor: FUJITSU  Model: MAM3184MP        Rev: 0105
   Type:   Direct-Access                    ANSI SCSI revision: 03
Host: scsi2 Channel: 00 Id: 06 Lun: 00
   Vendor: SONY     Model: SDT-7000         Rev: 0192
   Type:   Sequential-Access                ANSI SCSI revision: 02
Host: scsi3 Channel: 00 Id: 00 Lun: 00
   Vendor: Linux    Model: scsi_debug       Rev: 0004
   Type:   Direct-Access                    ANSI SCSI revision: 03
Host: scsi4 Channel: 00 Id: 00 Lun: 00
   Vendor: CREATIVE Model: CD5233E          Rev: 1.00
   Type:   CD-ROM                           ANSI SCSI revision: 02


sysfs doesn't provide the ANSI SCSI revision number associated
with each device (hopefully Pat can add that in the future).
Otherwise, all the information that /proc/scsi/scsi uses 3
lines per device for, can be compressed onto one line. Putting
the device node (e.g. /dev/sda) seems a useful addition.
[That latter addition is only done currently for block scsi
devices (hence it doesn't appear for the tape).]

Doug Gilbert

[-- Attachment #2: lsscsi.c.gz --]
[-- Type: application/x-gzip, Size: 2279 bytes --]

             reply	other threads:[~2002-12-15  1:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-15  1:51 Douglas Gilbert [this message]
2002-12-18  0:13 ` lsscsi for lk 2.5.51 Douglas Gilbert

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=3DFBE00B.1070805@torque.net \
    --to=dougg@torque.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 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.