1. 06 Jan, 2003 6 commits
    • Patrick Mochel's avatar
      net devices: Get network devices to show up in sysfs. · 6ed6b9bf
      Patrick Mochel authored
      - declare net_subsys, and register during net_dev_init().
      - Add kobject to struct net_device.
      - initialize name and register in register_netdevice().
      - remove in unregister_netdevice().
      
      This allows one to see the registered network devices in the system via:
      
      # tree /sys/net/
      /sys/net/
      `-- eth0
      6ed6b9bf
    • Patrick Mochel's avatar
      block devices: use list and lock in block_subsys, instead of those defined in genhd.c. · 426f67eb
      Patrick Mochel authored
      Since block_subsys already contains a list and a lock, use those, instead
      of defining our own static ones.
      
      This allows struct gendisk::full_list to be removed. 
      
      struct gendisk::list is also apparently unused, so it is removed also.
      426f67eb
    • Patrick Mochel's avatar
      remove kernel/platform.c · 93e8f330
      Patrick Mochel authored
      This was never used, and a bad idea to begin with. 
      93e8f330
    • Patrick Mochel's avatar
      acpi: use decl_subsys() macro. · d977f5ed
      Patrick Mochel authored
      d977f5ed
    • Patrick Mochel's avatar
      64e928e3
    • Patrick Mochel's avatar
      kobjects: Remove kobject::subsys and subsystem::kobj. · 85e865ec
      Patrick Mochel authored
      The kobject core no longer references a subsystem directly through a kobject,
      instead using the kobject's dominant kset to reference the subsystem. The 
      registrants of kobjects have been fixed up. 
      
      To aid in this process, a few helpers were introdcuced: 
      
      - kobj_set_kset_s(obj,subsys)
      - kset_set_kset_s(obj,subsys)
      - subsys_set_kset(obj,subsys)
      
      that set the kset ptr of embedded kobjects for objects that have different
      embedded types. See include/linux/kobject.h for more description and usage.
      
      
      struct subsystem::kobj is also removed, relying solely on a subsystem's
      embedded kset for hierarchy information.  Since this requires modification
      of the subsystem declarations, a helper macro has been defined:
      
      decl_subsys(name,type)
      
      which initializes the name and ktype fields of the subsystem's embedded
      kset. All the subsystem declarations have been fixed up.
      85e865ec
  2. 05 Jan, 2003 1 commit
    • Patrick Mochel's avatar
      Introduce struct kset. · 3e815107
      Patrick Mochel authored
      struct kset is what struct subsystem should have originally been called. It
      is a set of kobjects, and nothing more, with a much less confusing name than
      'subsystem.'
      
      struct kset contains an embedded kobject, making it possible to represent it
      in the object hierarchy, and sysfs. This also provides a means for objects
      to easily express a list of subordinate objects. 
      
      struct subsystem still exists, and contains an rwsem, which its subordinate
      ksets use to protect their lists. 
      
      An arbitrary number of ksets may belong to a subsystem. A ksets specifies
      the subsystem it belongs to via its ->subsys field. 
      
      struct subsystem also contains a default kset, which may be used without
      having to define a separate kset. 
      
      The objects that defined subordinate subsystems (bus and class drivers) have
      been converted to use subordinate ksets instead.
      
      
      Note that the usage of ksets is flexible. 
      - ksets may contain a list of objects of any type, not just kobjects.
      - The objects registered with a kset do not have to be registered.
      - ksets themselves do not have to be registered. One can be used by
        simply calling kset_init(). 
      - ksets do not need a name if they are not registered. 
      - Note however that locking must be done manually in these cases.
      3e815107
  3. 04 Jan, 2003 4 commits
    • Patrick Mochel's avatar
      driver model: clean up struct device_class a bit. · 2e1c4037
      Patrick Mochel authored
      - Remove unused class_list.
      - Use lists in subordinate subsystems for storing lists of devices and
        drivers.
      - Rename 'drvsubsys' to 'drivers' and 'devsubsys' to 'devices', to be more
        meaningful.
      2e1c4037
    • Patrick Mochel's avatar
      driver model: clean up struct bus_type a bit. · 46dbdc4e
      Patrick Mochel authored
      - Remove devices list, in favor of using the list in the subordinate
        devices subsystem.
      - Rename devsubsys to 'devices' and drvsubsys to 'drivers'.
      - Use bus's rwsem when iterating over drivers, instead of the 
        subordinate driver subsystem's. (We use that one when adding the 
        driver, and binding it to devices).
      46dbdc4e
    • Patrick Mochel's avatar
      kobject: Introduce struct kobj_type. · 23066070
      Patrick Mochel authored
      This is the first step in morphing struct subsystem into something meaningful.
      
      A subsystem is defined simply as a list of kobjects of a certain type, which
      is far too generic. A subsystem should be representative of a large entity
      of code (i.e. a subsystem of the kernel), not just a simple list. 
      
      This changeset:
      
      - Creates struct kobj_type, a descriptor of the type a kobject is embedded
        in.
      
      - Extracts the fields that are specific to a particular object type from
        struct subsystem and puts them in struct kobj_type, which are
        - the object's release method.
        - the sysfs operations for the object type.
        - the default attributes of the object type.
      
      - Adds ptr to struct kobject to point to its type descriptor. 
      
      - Converts the existing subsystem definitions to define struct kobj_type. 
      
      
      struct kobj_type's are not registered, as they do not have any explicit
      representation in the object hierarchy, nor do they have any fields that
      need runtime initialization. 
      
      A kobject's ktype should be set when it is registered, like its subsystem.
      Note this obviates the need for defining a struct subsystem when an object
      type does not need to be kept in a global list. 
      23066070
    • Patrick Mochel's avatar
  4. 03 Jan, 2003 1 commit
  5. 02 Jan, 2003 28 commits