History log of /haiku/src/tests/system/kernel/device_manager/playground/driver.cpp
Revision Date Author Comments
# 9f925127 15-May-2008 Axel Dörfler <axeld@pinc-software.de>

This should be the last commit to this one, I'll next work on integrating it
into the kernel:
* Added device_removed() function to the device level as well.
* A device_node now also tracks its published devices.
* Made the driver API more consistent with the device API; instead of the node,
they now get the driverCookie (so they now need to store the node themselves,
the driver cookie could be retrieved via the node).
Alternatively, one could either pass both, or have something similar to what
Ingo did for the file systems, ie. pass a structure that contains both
elements. Suggestions welcome.
* Implemented device node replacement when a better driver becomes available:
the new node (and its devices) is already published even though the old device
is still in use. The new device is B_BUSY until the old one is closed.
* Implemented an update cycle counter: this will prevent a device node from
being probed again, if there is no new driver since the last time; eventually
this will be moved into devfs, though.
* Driver removal and replacement now works as expected in all tested scenarios
(device removed, better driver installed, both with and without open device).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25512 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7a6818d3 14-May-2008 Axel Dörfler <axeld@pinc-software.de>

Work in progress:
* added [un]publish_device() calls to the device manager.
* added a very basic devfs emulation to the playground to be able to test how
the manager reacts to opened devices.
* renamed *_device() functions to *_node() in the device manager API.
* made B_DEVICE_FIND_CHILD_FLAGS a generic flags field, and renamed it to
B_DEVICE_FLAGS.
* added support for keeping a driver loaded as long as its device is available.
* implemented get_next_child_node().
* added test for device removal, and implemented unregister_node() for this.
* fixed some bugs in the device node reference/initialization count maintenance.
* moved more code from register_node() to device_node::Register().
* initialize the device_node::fFlags member to the value of B_DEVICE_FLAGS, and
have additional private flags.
* renamed UninitUnusedChildren() to UninitUnusedDriver(), and fixed this
function by adding the new flag NODE_FLAG_REGISTER_INITIALIZED.
* Now remembers the support when a driver is registered - this will be used
later to be able to compare with a new driver without having to call
supports_device() again.
* Removed NODE_FLAG_REMOVE_ON_UNINIT again, as that was pretty stupid - there
is reference counting for a reason.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25498 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 548c508f 11-May-2008 Axel Dörfler <axeld@pinc-software.de>

More work-in-progress:
* Added a generic (for all devices) and specific (for a specific device) video
driver to be able to play with the replace mechanism (which is not yet done,
but works well for the one usage case tested).
* Added reference counting and initialize counting: now, each node owns a
reference of its parent, and each initialized node owns an initialization
reference of its parent.
* Added locking.
* Moved dump functionality into a member function.
* The same node can now only added once - ie. if a bus tries to register the
same device twice, it will fail.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25453 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2d796918 08-May-2008 Axel Dörfler <axeld@pinc-software.de>

* Changed how the driver paths are found: now, the bus can add type/sub-type/
interface information (in the PCI notion) to a node, and the possible paths
of a device driver are generated from that information by the device manager.
* Removed the "is bus" attribute - the device manager now decides wether or not
a device always loads its children (as opposed to on demand loading only),
even if the B_FIND_CHILD_ON_DEMAND flag is specified.
* device_node::Register() now correctly maintains the fRegistered member field.
* Replaced the driver_module() and driver_data() methods with a get_driver()
method that retrieves all information at once.
* Cleaned attribute names.
* Some other cleanup, adding const where it makes sense.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25394 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 32bcfcf6 22-Apr-2008 Axel Dörfler <axeld@pinc-software.de>

Some more changes towards a working prototype:
* The "net" driver is now also loaded.
* The node tree is now dumped.
* If registering fails, the node is now removed from its parent again
(for now, correct would be to release it).
* device_node::_RegisterDynamic() now also checks for the driver path.
* _RegisterFixed() no longer calls supports_device() - since it has been
directly specified, we will assume the user knows what he is doing.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25112 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2d8e02e4 15-Apr-2008 Axel Dörfler <axeld@pinc-software.de>

* Started playground for the new device manager. This will eventually evolve
into the full thing, and will then be adapted to the kernel.
* Doesn't do a lot at this point - it can be built as a test app under BeOS
and Haiku.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24973 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 9f925127dbb0459be00626ba0559a1f25441fac0 15-May-2008 Axel Dörfler <axeld@pinc-software.de>

This should be the last commit to this one, I'll next work on integrating it
into the kernel:
* Added device_removed() function to the device level as well.
* A device_node now also tracks its published devices.
* Made the driver API more consistent with the device API; instead of the node,
they now get the driverCookie (so they now need to store the node themselves,
the driver cookie could be retrieved via the node).
Alternatively, one could either pass both, or have something similar to what
Ingo did for the file systems, ie. pass a structure that contains both
elements. Suggestions welcome.
* Implemented device node replacement when a better driver becomes available:
the new node (and its devices) is already published even though the old device
is still in use. The new device is B_BUSY until the old one is closed.
* Implemented an update cycle counter: this will prevent a device node from
being probed again, if there is no new driver since the last time; eventually
this will be moved into devfs, though.
* Driver removal and replacement now works as expected in all tested scenarios
(device removed, better driver installed, both with and without open device).


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25512 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 7a6818d3fa3871322557df09106171d2150bdc8b 14-May-2008 Axel Dörfler <axeld@pinc-software.de>

Work in progress:
* added [un]publish_device() calls to the device manager.
* added a very basic devfs emulation to the playground to be able to test how
the manager reacts to opened devices.
* renamed *_device() functions to *_node() in the device manager API.
* made B_DEVICE_FIND_CHILD_FLAGS a generic flags field, and renamed it to
B_DEVICE_FLAGS.
* added support for keeping a driver loaded as long as its device is available.
* implemented get_next_child_node().
* added test for device removal, and implemented unregister_node() for this.
* fixed some bugs in the device node reference/initialization count maintenance.
* moved more code from register_node() to device_node::Register().
* initialize the device_node::fFlags member to the value of B_DEVICE_FLAGS, and
have additional private flags.
* renamed UninitUnusedChildren() to UninitUnusedDriver(), and fixed this
function by adding the new flag NODE_FLAG_REGISTER_INITIALIZED.
* Now remembers the support when a driver is registered - this will be used
later to be able to compare with a new driver without having to call
supports_device() again.
* Removed NODE_FLAG_REMOVE_ON_UNINIT again, as that was pretty stupid - there
is reference counting for a reason.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25498 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 548c508ff7032b9da455319ec37ffc242d3a43fe 11-May-2008 Axel Dörfler <axeld@pinc-software.de>

More work-in-progress:
* Added a generic (for all devices) and specific (for a specific device) video
driver to be able to play with the replace mechanism (which is not yet done,
but works well for the one usage case tested).
* Added reference counting and initialize counting: now, each node owns a
reference of its parent, and each initialized node owns an initialization
reference of its parent.
* Added locking.
* Moved dump functionality into a member function.
* The same node can now only added once - ie. if a bus tries to register the
same device twice, it will fail.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25453 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2d79691811caf4a57330c3e829da598b55e52525 08-May-2008 Axel Dörfler <axeld@pinc-software.de>

* Changed how the driver paths are found: now, the bus can add type/sub-type/
interface information (in the PCI notion) to a node, and the possible paths
of a device driver are generated from that information by the device manager.
* Removed the "is bus" attribute - the device manager now decides wether or not
a device always loads its children (as opposed to on demand loading only),
even if the B_FIND_CHILD_ON_DEMAND flag is specified.
* device_node::Register() now correctly maintains the fRegistered member field.
* Replaced the driver_module() and driver_data() methods with a get_driver()
method that retrieves all information at once.
* Cleaned attribute names.
* Some other cleanup, adding const where it makes sense.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25394 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 32bcfcf6a94f8d003217ce24f5071b0533fb923f 22-Apr-2008 Axel Dörfler <axeld@pinc-software.de>

Some more changes towards a working prototype:
* The "net" driver is now also loaded.
* The node tree is now dumped.
* If registering fails, the node is now removed from its parent again
(for now, correct would be to release it).
* device_node::_RegisterDynamic() now also checks for the driver path.
* _RegisterFixed() no longer calls supports_device() - since it has been
directly specified, we will assume the user knows what he is doing.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@25112 a95241bf-73f2-0310-859d-f6bbb57e9c96


# 2d8e02e435a866704afd745454a5c1165280da2a 15-Apr-2008 Axel Dörfler <axeld@pinc-software.de>

* Started playground for the new device manager. This will eventually evolve
into the full thing, and will then be adapted to the kernel.
* Doesn't do a lot at this point - it can be built as a test app under BeOS
and Haiku.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24973 a95241bf-73f2-0310-859d-f6bbb57e9c96