2004-06-07 03:52:08 +04:00
|
|
|
/*
|
2010-04-13 13:48:02 +04:00
|
|
|
* Copyright 2002-2003, Thomas Kurschel. All rights reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef _ISA2_H
|
|
|
|
#define _ISA2_H
|
2004-06-07 03:52:08 +04:00
|
|
|
|
2010-04-13 13:48:02 +04:00
|
|
|
|
|
|
|
/*! ISA bus manager
|
2004-06-07 03:52:08 +04:00
|
|
|
|
|
|
|
This is an improper name - this bus manager uses the PnP manager to
|
|
|
|
load device drivers, but calling it ISA PnP manager would be wrong as
|
|
|
|
ISA PnP information isn't used at all.
|
2004-06-08 10:32:02 +04:00
|
|
|
|
2004-06-07 03:52:08 +04:00
|
|
|
All ISA drivers must be Universal driver (see pnp_manager.h), as they
|
|
|
|
are all direct children of the ISA bus node. Having an ISA PnP bus manager
|
2008-05-26 20:52:27 +04:00
|
|
|
(which we don't), one node would be created per ISA device and thus you
|
|
|
|
could write Specific drivers, but under normal ISA we don't even know
|
2004-06-07 03:52:08 +04:00
|
|
|
how many devices are there, therefore the Universal driver trick.
|
2004-06-08 10:32:02 +04:00
|
|
|
|
2004-06-07 03:52:08 +04:00
|
|
|
Apart from the loading, the main change is the resource manager. In
|
|
|
|
a driver, you must allocate the resources before registering the node and
|
|
|
|
deallocate it when your node is removed and if the driver isn't loaded at
|
|
|
|
this time. If it is, you must delay deallocation until the driver gets
|
2008-05-26 20:52:27 +04:00
|
|
|
unloaded to make sure no new driver touches the same resources like you
|
2004-06-07 03:52:08 +04:00
|
|
|
meanwhile.
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#include <device_manager.h>
|
2004-06-08 10:32:02 +04:00
|
|
|
#include <ISA.h>
|
2004-06-07 03:52:08 +04:00
|
|
|
|
2010-04-13 13:48:02 +04:00
|
|
|
|
2008-05-26 20:52:27 +04:00
|
|
|
// maximum size of one dma transfer
|
2004-06-07 03:52:08 +04:00
|
|
|
// (in bytes for 8 bit transfer, in words for 16 bit transfer)
|
|
|
|
#define B_MAX_ISA_DMA_COUNT 0x10000
|
|
|
|
|
|
|
|
typedef struct isa2_module_info {
|
2008-05-26 20:52:27 +04:00
|
|
|
driver_module_info info;
|
|
|
|
|
|
|
|
uint8 (*read_io_8)(int mapped_io_addr);
|
|
|
|
void (*write_io_8)(int mapped_io_addr, uint8 value);
|
|
|
|
uint16 (*read_io_16)(int mapped_io_addr);
|
|
|
|
void (*write_io_16)(int mapped_io_addr, uint16 value);
|
|
|
|
uint32 (*read_io_32)(int mapped_io_addr);
|
|
|
|
void (*write_io_32)(int mapped_io_addr, uint32 value);
|
2005-01-12 02:19:41 +03:00
|
|
|
|
2004-06-07 03:52:08 +04:00
|
|
|
// don't know what it's for, remains for compatibility
|
2017-11-21 23:32:57 +03:00
|
|
|
phys_addr_t (*ram_address)(phys_addr_t physical_address_in_system_memory);
|
2004-06-07 03:52:08 +04:00
|
|
|
|
|
|
|
// start dma transfer (scattered DMA is not supported as it's EISA specific)
|
|
|
|
status_t (*start_isa_dma)(
|
|
|
|
long channel, // dma channel to use
|
|
|
|
void *buf, // buffer to transfer
|
|
|
|
long transfer_count, // # transfers
|
|
|
|
uchar mode, // mode flags
|
|
|
|
uchar e_mode // extended mode flags
|
|
|
|
);
|
|
|
|
} isa2_module_info;
|
|
|
|
|
|
|
|
// type of isa device
|
|
|
|
#define ISA_DEVICE_TYPE_NAME "isa/device/v1"
|
|
|
|
// directory of ISA drivers
|
|
|
|
// (there is only one device node, so put all drivers under "universal")
|
|
|
|
#define ISA_DRIVERS_DIR "isa"
|
|
|
|
|
|
|
|
|
2008-05-26 20:52:27 +04:00
|
|
|
#endif /* _ISA2_H */
|