2 * Copyright 2005, Axel Dörfler, axeld@pinc-software.de. All rights reserved.
3 * Copyright 2002/03, Thomas Kurschel. All rights reserved.
5 * Distributed under the terms of the MIT License.
17 #include <KernelExport.h>
18 #include <device_manager.h>
28 # define TRACE(x) dprintf x
33 // ToDo: this is architecture dependent and should be made differently!
34 // (for example, the Pegasos (PPC based) also has an ISA bus)
37 #define ISA_MODULE_NAME "bus_managers/isa/root/driver_v1"
39 device_manager_info
*pnp
;
43 make_isa_dma_table(const void *buffer
, long buffer_size
, ulong num_bits
,
44 isa_dma_entry
*table
, long num_entries
)
46 // ToDo: implement this?!
52 start_scattered_isa_dma(long channel
, const isa_dma_entry
*table
,
53 uchar mode
, uchar emode
)
55 // ToDo: implement this?!
61 lock_isa_dma_channel(long channel
)
63 // ToDo: implement this?!
69 unlock_isa_dma_channel(long channel
)
71 // ToDo: implement this?!
76 // #pragma mark - driver module API
80 isa_init_driver(device_node
*node
, void **cookie
)
88 isa_uninit_driver(void *cookie
)
94 isa_supports_device(device_node
*parent
)
98 // make sure parent is really pnp root
99 if (pnp
->get_attr_string(parent
, B_DEVICE_BUS
, &bus
, false))
102 if (strcmp(bus
, "root"))
110 isa_register_device(device_node
*parent
)
112 static const device_attr attrs
[] = {
113 // tell where to look for child devices
114 {B_DEVICE_BUS
, B_STRING_TYPE
, {string
: "isa" }},
115 {B_DEVICE_FLAGS
, B_UINT32_TYPE
,
116 {ui32
: B_FIND_CHILD_ON_DEMAND
| B_FIND_MULTIPLE_CHILDREN
}},
120 return pnp
->register_node(parent
, ISA_MODULE_NAME
, attrs
, NULL
, NULL
);
125 std_ops(int32 op
, ...)
129 return arch_isa_init();
130 case B_MODULE_UNINIT
:
139 module_dependency module_dependencies
[] = {
140 { B_DEVICE_MANAGER_MODULE_NAME
, (module_info
**)&pnp
},
144 static isa_module_info isa_module
= {
154 &arch_isa_write_io_8
,
155 &arch_isa_read_io_16
,
156 &arch_isa_write_io_16
,
157 &arch_isa_read_io_32
,
158 &arch_isa_write_io_32
,
159 &arch_isa_ram_address
,
162 &start_scattered_isa_dma
,
163 &lock_isa_dma_channel
,
164 &unlock_isa_dma_channel
167 static isa2_module_info isa2_module
= {
179 NULL
, // removed device
180 NULL
, // register child devices
184 arch_isa_read_io_8
, arch_isa_write_io_8
,
185 arch_isa_read_io_16
, arch_isa_write_io_16
,
186 arch_isa_read_io_32
, arch_isa_write_io_32
,
188 arch_isa_ram_address
,
193 module_info
*modules
[] = {
194 (module_info
*)&isa_module
,
195 (module_info
*)&isa2_module
,