16e5cac2dSAxel Dörfler /* 26e5cac2dSAxel Dörfler ** Copyright 2004, Axel Dörfler, axeld@pinc-software.de. All rights reserved. 3*77ca5763SAxel Dörfler ** Distributed under the terms of the Haiku License. 46e5cac2dSAxel Dörfler */ 56e5cac2dSAxel Dörfler #ifndef _KERNEL_DEVICE_MANAGER_H 66e5cac2dSAxel Dörfler #define _KERNEL_DEVICE_MANAGER_H 76e5cac2dSAxel Dörfler 86e5cac2dSAxel Dörfler 96e5cac2dSAxel Dörfler #include <SupportDefs.h> 10*77ca5763SAxel Dörfler #include <device_manager.h> 11*77ca5763SAxel Dörfler 12*77ca5763SAxel Dörfler 13*77ca5763SAxel Dörfler // info about a PnP node 14*77ca5763SAxel Dörfler typedef struct pnp_node_info { 15*77ca5763SAxel Dörfler struct pnp_node_info *prev, *next; 16*77ca5763SAxel Dörfler struct pnp_node_info *children_prev, *children_next; 17*77ca5763SAxel Dörfler struct pnp_node_info *notify_prev, *notify_next; 18*77ca5763SAxel Dörfler struct pnp_node_info *parent; 19*77ca5763SAxel Dörfler struct pnp_node_info *children; 20*77ca5763SAxel Dörfler int ref_count; // reference count; see registration.c 21*77ca5763SAxel Dörfler pnp_driver_info *driver; 22*77ca5763SAxel Dörfler void *cookie; 23*77ca5763SAxel Dörfler bool registered; // true, if device is officially existent 24*77ca5763SAxel Dörfler bool init_finished; // true, if publish_device has been completed 25*77ca5763SAxel Dörfler // (sync with loader_lock) 26*77ca5763SAxel Dörfler bool blocked_by_rescan; // true, if device is blocked because of rescan 27*77ca5763SAxel Dörfler bool verifying; // true, if driver is being verified by rescan 28*77ca5763SAxel Dörfler bool redetected; // true, if driver was redetected during rescan 29*77ca5763SAxel Dörfler int num_waiting_hooks; // number of waiting hook calls 30*77ca5763SAxel Dörfler sem_id hook_sem; // sem for waiting hook calls 31*77ca5763SAxel Dörfler int load_block_count; // load-block nest count 32*77ca5763SAxel Dörfler int num_blocked_loads; // number of waiting load calls 33*77ca5763SAxel Dörfler sem_id load_block_sem; // sem for waiting load calls 34*77ca5763SAxel Dörfler int load_count; // # of finished load_driver() calls 35*77ca5763SAxel Dörfler int loading; // # of active (un)load_driver() calls 36*77ca5763SAxel Dörfler uint rescan_depth; // > 0 if scanning is active 37*77ca5763SAxel Dörfler struct pnp_node_attr_info *attributes; // list of attributes 38*77ca5763SAxel Dörfler uint num_io_resources; // number of I/O resources 39*77ca5763SAxel Dörfler io_resource_handle *io_resources; // array of I/O resource (NULL-terminated) 40*77ca5763SAxel Dörfler int defer_probing; // > 0 defer probing for consumers of children 41*77ca5763SAxel Dörfler bool automatically_loaded; // loaded automatically because PNP_DRIVER_ALWAYS_LOADED 42*77ca5763SAxel Dörfler struct pnp_node_info *unprobed_children; // list of un-probed children 43*77ca5763SAxel Dörfler struct pnp_node_info *unprobed_prev, *unprobed_next; // link for unprobed_children 44*77ca5763SAxel Dörfler } pnp_node_info; 45*77ca5763SAxel Dörfler 46*77ca5763SAxel Dörfler 47*77ca5763SAxel Dörfler struct kernel_args; 486e5cac2dSAxel Dörfler 495ed66da0SAxel Dörfler #ifdef __cplusplus 505ed66da0SAxel Dörfler extern "C" { 515ed66da0SAxel Dörfler #endif 526e5cac2dSAxel Dörfler 536e5cac2dSAxel Dörfler extern status_t device_manager_init(struct kernel_args *args); 546e5cac2dSAxel Dörfler 555ed66da0SAxel Dörfler #ifdef __cplusplus 565ed66da0SAxel Dörfler } 575ed66da0SAxel Dörfler #endif 585ed66da0SAxel Dörfler 596e5cac2dSAxel Dörfler #endif /* _KRENEL_DEVICE_MANAGER_H */ 60