linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* scsi sysfs design, ch driver
@ 2005-10-16  5:50 Douglas Gilbert
  2005-10-16  6:39 ` Matthew Wilcox
  0 siblings, 1 reply; 2+ messages in thread
From: Douglas Gilbert @ 2005-10-16  5:50 UTC (permalink / raw)
  To: Linux-SCSI Mailing List

I am trying to map programmatically from an sg device
to whatever [if it has a corresponding upper level device].
The code is looking at this directory:
/sys/devices/pseudo_0/adapter0/host1/target1:0:0/1:0:0:0

and is confronted with these choices:

bus             iocounterbits  power        scsi_changer:sch0    timeout
delete          iodone_cnt     queue_depth  scsi_device:1:0:0:0  type
device_blocked  ioerr_cnt      queue_type   scsi_generic:sg0     vendor
driver          iorequest_cnt  rescan       scsi_level
generic         model          rev          state

Now if it was a block device (sd or sr) there would be a
"block" symlink to follow; if it was a tape device there
would be a "tape" symlink to follow. However as can be seen
it is a medium changer, so why not a "changer" symlink?
The "scsi_changer:sch0" symlink has a useless appendage IMO.
The directory needs to be scanned to find it, and when followed,
if my code is interested, then there are several ways to
determine that its sysfs name is sch0.

So my question is why was "scsi_generic:sg0" form introduced,
especially the ":sg0" part? It may help visually but it
is a nuisance programmatically.

Doug Gilbert

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: scsi sysfs design, ch driver
  2005-10-16  5:50 scsi sysfs design, ch driver Douglas Gilbert
@ 2005-10-16  6:39 ` Matthew Wilcox
  0 siblings, 0 replies; 2+ messages in thread
From: Matthew Wilcox @ 2005-10-16  6:39 UTC (permalink / raw)
  To: Douglas Gilbert; +Cc: Linux-SCSI Mailing List

On Sun, Oct 16, 2005 at 03:50:19PM +1000, Douglas Gilbert wrote:
> So my question is why was "scsi_generic:sg0" form introduced,
> especially the ":sg0" part? It may help visually but it
> is a nuisance programmatically.

It was for the benefit of serial devices (and others) which may have
several classes.

# ls /sys/bus/pci/devices/0000\:00\:04.0
bus     device  local_cpus  subsystem_device  tty:ttyS1
class   driver  modalias    subsystem_vendor  tty:ttyS2
config  irq     resource    tty:ttyS0         vendor

Without the :ttyS*, we'd have three links all called 'tty'.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-10-16  6:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-16  5:50 scsi sysfs design, ch driver Douglas Gilbert
2005-10-16  6:39 ` Matthew Wilcox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).