]> git.neil.brown.name Git - history.git/commit
Introduce struct device_interface.
authorPatrick Mochel <mochel@osdl.org>
Mon, 26 Aug 2002 02:24:19 +0000 (19:24 -0700)
committerPatrick Mochel <mochel@osdl.org>
Mon, 26 Aug 2002 02:24:19 +0000 (19:24 -0700)
commit59d6f10721fe22b4a277e772391cb9198b9114fb
treed7244c4d7938b0681bb6d1e4f0b660f0e11bde54
parent78fc20f75de650fcfa8109468c1bed6999203e5a
Introduce struct device_interface.

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.
drivers/base/Makefile
drivers/base/base.h
drivers/base/class.c
drivers/base/core.c
drivers/base/fs/Makefile
drivers/base/fs/intf.c [new file with mode: 0644]
drivers/base/intf.c [new file with mode: 0644]
include/linux/device.h