linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: linux-hotplug@vger.kernel.org
Subject: Re: class_device/udev support for tapes?
Date: Tue, 02 Dec 2003 20:09:15 +0000	[thread overview]
Message-ID: <marc-linux-hotplug-107039594512106@msgid-missing> (raw)
In-Reply-To: <marc-linux-hotplug-107038690632125@msgid-missing>

On Tuesday 02 December 2003 19:00, Greg KH wrote:
> On Tue, Dec 02, 2003 at 06:35:18PM +0100, Arnd Bergmann wrote:
> > Has anyone come up with a solution for using udev for tape devices?
>
> The scsi people need to add support for this into the st driver.  They
> also need to add it to their sg driver for scsi generic devices.  They
> know about this, and hopefully are working on it...

Do you mean using the same device class for both the tape and sg chardevs?
Maybe I have misunderstood the current relationship between 'class'
and 'class_interface'. I thought that both sg and tape need to be 
classes, with a scsi tape belonging to both classes and having multiple
tape interfaces. However, scsi currently has a scsi_device class and
registers an sg interface for that.

> > Unlike block devices, there is no master device with anything
> > similar to partitions, but all the interfaces are equal. One way
> > to represent them would be to create a class device without a
> > dev entry and have the chardev interfaces as child kobjects of that:
> >
> > /sys/class/tape/st0/st0/dev
> > /sys/class/tape/st0/st0a/dev
> > /sys/class/tape/st0/nst0/dev
> > /sys/class/tape/st0/device -> ../../...
> > /sys/class/tape/rtibm0/ntibm0/dev
>
> What is "st0" here?  Why not just:
>
> /sys/class/scsi_tape/st0/dev
> /sys/class/scsi_tape/st0a/dev
> /sys/class/scsi_tape/nst0/dev
> /sys/class/scsi_tape/ntibm0/dev

Well, the first three are different representations of the same physical
scsi tape, while the ntibm0 tape is a different non-scsi tape and
also has other chardev representations that I skipped in the example.
They have different drivers (bus types, major numbers, available
chardevs...) but use the same ioctl interface and should therefore be
in the same class (or have the same interface?).

> > This would of course be inconsistant with all the other classes.
> > The second option I see is naming the 'dev' attribute differently:
> >
> > /sys/class/tape/st0/dev-st
> > /sys/class/tape/st0/dev-sta
> > /sys/class/tape/st0/dev-nst
>
> Hm, I probably don't understand tapes.  What's the difference between
> st, sta, and nst?  Are they all different char devices for the same tape
> device?  Doing different things?

Yes. AFAIK, they are almost identical but have minor interface differences.
For s390 and ATAPI, there are only two variants: the default rewinding
devices (/dev/rtibm0, /dev/rtibm1, /dev/ht0, ...) rewind the medium upon
close, the non-rewinding devices (/dev/ntibm0, /dev/ntibm1, /dev/nt0, ...)
don't. Other drivers (scsi, ftape, ...) have up to eight device nodes
per physical device, but I don't know the exact differences. It's a
silly design, but too late to change.
To make things worse, some drivers (well, at least s390 tape) have a block
device interface in addition to the character devices.

	Arnd <><



-------------------------------------------------------
This SF.net email is sponsored by OSDN's Audience Survey.
Help shape OSDN's sites and tell us what you think. Take this
five minute survey and you could win a $250 Gift Certificate.
http://www.wrgsurveys.com/2003/osdntech03.php?site=8
_______________________________________________
Linux-hotplug-devel mailing list  http://linux-hotplug.sourceforge.net
Linux-hotplug-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel

  parent reply	other threads:[~2003-12-02 20:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-02 17:35 class_device/udev support for tapes? Arnd Bergmann
2003-12-02 18:00 ` Greg KH
2003-12-02 20:09 ` Arnd Bergmann [this message]
2003-12-10  1:14 ` Greg KH

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=marc-linux-hotplug-107039594512106@msgid-missing \
    --to=arnd@arndb.de \
    --cc=linux-hotplug@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).