There should be (almost) enough infrastructure in place to do either of
those things using the driver model core. There is now a disk
device_class, with which a struct device_interface can register with. When
a device is added to the class, it is passed to each of the interfaces
registered with the class (via the add_device method).
There is a struct device in struct gendisk, and each device registered
with the class will be the member of a struct gendisk. So, you can do
int add_device(struct device * dev)
{
struct gendisk * disk = container_of(dev,struct gendisk,disk_dev);
...
to get the gendisk structure.
See include/linux/device.h and Documentation/driver-model/ for more info.
Also, /sbin/hotplug will be called after a device is registered with a
class. Greg has been working on this aspect, and should be close to having
it done.
The missing piece is converting the disk drivers to have thier ->devclass
set to the disk class, and having them register with the core.
-pat
-
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/