2 * provides access to device configurations
4 * Copyright 2002-2004, Marcus Overhagen, marcus@overhagen.de.
5 * Distributed under the terms of the MIT License.
9 #include <config_manager.h>
12 #include <bus_manager.h>
15 #include <KernelExport.h>
18 static pci_module_info
*gPCI
= NULL
;
20 #define B_CONFIG_MANAGER_FOR_BUS_MODULE_NAME "bus_managers/config_manager/bus/v1"
22 #define FUNCTION(x, y...) dprintf("%s" x, __FUNCTION__, y)
23 #define TRACE(x) dprintf x
30 driver_get_next_device_info(bus_type bus
, uint64
*cookie
, struct device_info
*info
, uint32 size
)
32 FUNCTION("(bus = %d, cookie = %" B_PRId64
")\n", bus
, *cookie
);
33 return B_ENTRY_NOT_FOUND
;
38 driver_get_device_info_for(uint64 id
, struct device_info
*info
, uint32 size
)
40 FUNCTION("(id = %" B_PRId64
")\n", id
);
41 return B_ENTRY_NOT_FOUND
;
46 driver_get_size_of_current_configuration_for(uint64 id
)
48 FUNCTION("(id = %" B_PRId64
")\n", id
);
49 return B_ENTRY_NOT_FOUND
;
54 driver_get_current_configuration_for(uint64 id
, struct device_configuration
*current
, uint32 size
)
56 FUNCTION("(id = %" B_PRId64
", current = %p, size = %" B_PRIu32
")\n", id
,
58 return B_ENTRY_NOT_FOUND
;
63 driver_get_size_of_possible_configurations_for(uint64 id
)
65 FUNCTION("(id = %" B_PRId64
")\n", id
);
66 return B_ENTRY_NOT_FOUND
;
71 driver_get_possible_configurations_for(uint64 id
, struct possible_device_configurations
*possible
, uint32 size
)
73 FUNCTION("(id = %" B_PRId64
", possible = %p, size = %" B_PRIu32
")\n", id
,
75 return B_ENTRY_NOT_FOUND
;
80 driver_count_resource_descriptors_of_type(const struct device_configuration
*config
, resource_type type
)
82 FUNCTION("(config = %p, type = %d)\n", config
, type
);
83 return B_ENTRY_NOT_FOUND
;
88 driver_get_nth_resource_descriptor_of_type(const struct device_configuration
*config
, uint32 num
,
89 resource_type type
, resource_descriptor
*descr
, uint32 size
)
91 FUNCTION("(config = %p, num = %" B_PRId32
")\n", config
, num
);
92 return B_ENTRY_NOT_FOUND
;
97 driver_std_ops(int32 op
, ...)
101 TRACE(("config_manager: driver module: init\n"));
103 // ToDo: should not do this! Instead, iterate through all busses/config_manager/
104 // modules and get them
105 if (get_module(B_PCI_MODULE_NAME
, (module_info
**)&gPCI
) != 0) {
106 TRACE(("config_manager: failed to load PCI module\n"));
110 case B_MODULE_UNINIT
:
111 TRACE(("config_manager: driver module: uninit\n"));
125 bus_std_ops(int32 op
, ...)
129 TRACE(("config_manager: bus module: init\n"));
131 case B_MODULE_UNINIT
:
132 TRACE(("config_manager: bus module: uninit\n"));
141 struct config_manager_for_driver_module_info gDriverModuleInfo
= {
143 B_CONFIG_MANAGER_FOR_DRIVER_MODULE_NAME
,
148 &driver_get_next_device_info
,
149 &driver_get_device_info_for
,
150 &driver_get_size_of_current_configuration_for
,
151 &driver_get_current_configuration_for
,
152 &driver_get_size_of_possible_configurations_for
,
153 &driver_get_possible_configurations_for
,
155 &driver_count_resource_descriptors_of_type
,
156 &driver_get_nth_resource_descriptor_of_type
,
159 struct module_info gBusModuleInfo
= {
161 B_CONFIG_MANAGER_FOR_BUS_MODULE_NAME
,
166 // ToDo: find out what's in here!
169 module_info
*modules
[] = {
170 (module_info
*)&gDriverModuleInfo
,
171 (module_info
*)&gBusModuleInfo
,