From: Luben Tuikov <luben_tuikov@adaptec.com>
To: James Bottomley <James.Bottomley@SteelEye.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
SCSI Mailing List <linux-scsi@vger.kernel.org>,
Greg KH <greg@kroah.com>
Subject: Re: struct class question
Date: Wed, 29 Jun 2005 19:03:49 -0400 [thread overview]
Message-ID: <42C328D5.7050602@adaptec.com> (raw)
In-Reply-To: <1120082466.5866.13.camel@mulgrave>
On 06/29/05 18:01, James Bottomley wrote:
>>Thus we get the pretty flat sysfs class hierarchy:
>>/sys/class/<if>/<device>
>
> That's by design. The class contains a list of all the devices
> implementing the interface.
Ok, makes sense.
> Interface (class) is tied to struct device. If it doesn't have a struct
> device, then it can't have a class and isn't a proper sysfs leaf. If
Makes sense.
> the device doesn't exist or it can't be directly controlled, then we
> probably don't need a class for it, right? As to whether it needs to
Yes, we don't need a struct device and/or struct class_device for it.
> exist at all if we can't do anything with it, I suppose that depends on
> whether it's necessary to the tree representation or not (a bit like
> channels in SCSI. They have meaning, but no sysfs representation on
> their own).
Very good analogy. In this respect I think we should represent
phys, ports, and expanders just as the discover process sees them,
in the same way, as you pointed out, channels are represented
even though the do not quite exist (but are an abstraction).
>>/sys/class/sas/
>>/sys/class/sas/ha0/
>>/sys/class/sas/ha1/
>>/sys/class/sas/ha1/phys/
>>/sys/class/sas/ha1/ports/
>>etc.
>
>
> No, this is where you go wrong. The sysfs tree exists under the host<n>
> for scsi (and is parented to the PCI/etc device), so you can have
> something like
>
> .../host1/
> .../host1/phys/
> .../host1/ports/
Is this
/sys/class/scsi_host/host1
Or is it (e.g.),
/sys/devices/pci0000:00/0000:00:1f.2/host1
?
> (and obviously you need to know where you're putting the targets under
> this).
True.
> So the rich deep tree is under devices and the class tree represents a
> flat look into that for devices implementing the specific interface.
In which case the flat class/ wouldn't represent phys, ports and expanders
as they do not have struct device/struct class_device; and not directly
controlled by the kernel; just as "channel".
Luben
next prev parent reply other threads:[~2005-06-29 23:03 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-29 21:28 struct class question Luben Tuikov
2005-06-29 22:01 ` James Bottomley
2005-06-29 23:03 ` Luben Tuikov [this message]
2005-06-29 23:30 ` 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=42C328D5.7050602@adaptec.com \
--to=luben_tuikov@adaptec.com \
--cc=James.Bottomley@SteelEye.com \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@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