1. 26 Aug, 2002 2 commits
    • Patrick Mochel's avatar
      Introduce struct device_interface. · 59d6f107
      Patrick Mochel authored
      Device interfaces are the logical interfaces of device classes that correlate
      directly to userspace interfaces, like device nodes. 
      
      Device interfaces are registered with the class they belong to. As devices
      are added to the class, they are added to each interface registered with
      the class. The interface is responsible for determining whether the device
      supports the interface or not. 
      
      The interface is responsible for allocating and initializing a struct 
      intf_data and calling interface_add_data() to add it to the device's list
      of interfaces it belongs to. This list will be iterated over when the device
      is removed from the class (instead of all possible interfaces for a class).
      This structure should probably be embedded in whatever per-device data 
      structure the interface is allocating anyway.
      
      Devices are enumerated within the interface. This happens in interface_add_data()
      and the enumerated value is stored in the struct intf_data for that device. 
      
      Interfaces get a directory in driverfs under their class's directory. Each
      time a device is added to the interface, a symlink is created in that 
      directory that points to the device's directory in the physical hierarchy.
      The name of this symlink is the interface-enumerated value of the device.
      59d6f107
    • Patrick Mochel's avatar
      Introduce struct device_class · 78fc20f7
      Patrick Mochel authored
      Device classes describe a type (or class) of device, like an input device
      or network device, etc. This changeset defines a struct device_class that 
      each subsystem is expected to implement and register with the core.
      
      struct device_driver gains a devclass pointer which points to the class it
      belongs to. When the driver is registered, it is added to the class's list
      of drivers. Whenever a device is bound to that driver, it is added to the
      class by calling the class's add_device callback. 
      
      struct device gains a class_num field which is the per-class enumerated value
      of the device. It is incremented each time a device is registered with the
      class.
      
      Each device class gets a driverfs directory in class/<class name> and two
      subdirectories: 'devices' and 'drivers'. For each device added to the class,
      a symlink is created in the devices/ directory that points to the device's
      directory in the physical hierarchy. The name of the symlink is the enumerated
      number the device got when it was registered with the class.
      
      For each driver that's added to the class, a symlink is created in the class's
      drivers/ directory that points to the driver's directory. The name of this 
      symlink is a concatenation of <bus name>:<driver name> (to prevent namespace
      conflicts of drivers with the same name on different buses).
       
      78fc20f7
  2. 25 Aug, 2002 15 commits
  3. 23 Aug, 2002 23 commits