Re: struct class question

From: Luben Tuikov (luben_tuikov_at_adaptec.com)
Date: 06/30/05

  • Next message: Michael Buesch: "Re: Build-in XML support?"
    Date:	Wed, 29 Jun 2005 19:03:49 -0400
    To: James Bottomley <James.Bottomley@SteelEye.com>
    
    

    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

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/


  • Next message: Michael Buesch: "Re: Build-in XML support?"

    Relevant Pages

    • Re: The development trend for optical transmission equipment
      ... On the one hand, products based on the PDH technique, which cost less than nine hundred USD, exhibit supreme inexpensiveness; on the other, the optical transmission equipment that develops on the basis of SDH technique, more often than not, is required by customers to be equipped with Ethernet interface or video frequency interface. ... As a typical PDH equipment, OM8E1PCM, produced by Heng Guang Technologies, Co., Ltd in Tianjin, China has integrated eight E1 channels, one 10/100BASE-T Ethernet channel, one NX64bps, V.35 channel and PCM30 with 30 channels. ... At the same time, SDH equipment with E1 channel, 1000M Ethernet interface and multi-channel 100M Ethernet interface has been more and more popularized. ...
      (uk.telecom.mobile)
    • FS: Pre-ebay 2 x UAD PCI cards (ULTRAPAK), 1 x HDSPMADI, 1 x RME ADI648 (UK)
      ... MADI, the professionals' multi-channel audio interface, offers 64 channels of 24 bit audio at a sample rate of up to 48 kHz and 32 channels at up to 96 kHz. ... Any of the outputs, which are divided into 8-channel blocks, can be fed from any 8-channel input block, both on the ADAT and the MADI side. ...
      (rec.audio.pro)
    • Re: ifconfig(8) refactoring -- YACC grammar now online
      ... I think this refactoring of ifconfig is very good. ... yacc grammar as I have never worked with yacc before, ... the interface namespace. ... which would take E1 channels one to thirty-two into this interface. ...
      (freebsd-arch)
    • Re: ifconfig(8) refactoring -- YACC grammar now online
      ... I think this refactoring of ifconfig is very good. ... yacc grammar as I have never worked with yacc before, ... the interface namespace. ... which would take E1 channels one to thirty-two into this interface. ...
      (freebsd-hackers)
    • Re: Multi Valued Interface Models?
      ... programming language used for the logical data model. ... the interface between the software and the DBMS has a model ... the UI interface in the same way as with a database interface. ... data model is about the representation of the data in an interface. ...
      (comp.databases.theory)