1. 01 Aug, 2002 4 commits
    • Patrick Mochel's avatar
      driverfs: define struct driverfs_ops and remove struct device dependencies · 137973c1
      Patrick Mochel authored
      In order to read/write attributes, you have to deal directly with the object that owns them. driverfs really
      wants to be generic and not deal directly with those objects. So, we create an intermediate layer that 
      subsystems must implement that converts between the generic objects and the specific objects that own the 
      attributes.
      
      This allows allows attributes to be exported for any object type.
      
      In doing so, it places the responsibility on the subsystems to do the following:
      
      - define their own object-specific attribute structures 
      - define their own driverfs_ops
      - set the ops pointer in struct driver_dir_entry when creating an object's directory 
      - do object reference counting on open() and close()
      - call the show() and store() callbacks of their attribute structure
      - convert between the generic objects and the specific objects from the struct driver_dir_entry and 
        struct attribute pointers (using container_of)
      
      The implementation of this layer for struct device is intended to be used as an example of the interface.
      
      Because this layer of abstraction is now in place, we can move the device attribute structure into 
      include/linux/device.h, and driverfs should be free of references to it completely.
      137973c1
    • Patrick Mochel's avatar
      driverfs: Add struct attribute · 9bb83ce6
      Patrick Mochel authored
      driverfs can only handle passing struct device to read/write functions. In order to free it of this limitation,
      we need a common data structure for driverfs to pass around. 
      
      The only thing that driverfs really needs are the name and mode of the file, which are now located in struct
      attribute.
      
      struct device_attribute gets a struct attribute member, which holds the name and mode. With the DEVICE_ATTR 
      macro, users of the structure require no modification.
      
      device_create_file is modified to take a struct attribute parameter
      
      a to_dev_attr() macro is introduced to convert between a struct attribute to a struct device_attribute
      9bb83ce6
    • Patrick Mochel's avatar
      b74d2576
    • Patrick Mochel's avatar
      driverfs: Declare DEVICE_ATTR macro for initializing device attributes · 8d1290b8
      Patrick Mochel authored
      (hide internal format of the structure)
      8d1290b8
  2. 31 Jul, 2002 2 commits
  3. 30 Jul, 2002 23 commits
  4. 29 Jul, 2002 11 commits