Copyright © 2000 Alan Cox, David Weinehall, Chris Beauregard
This documentation is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
For more details see the file COPYING in the source distribution of Linux.
Table of Contents
The MCA bus functions provide a generalised interface to find MCA bus cards, to claim them for a driver, and to read and manipulate POS registers without being aware of the motherboard internals or certain deep magic specific to onboard devices.
The basic interface to the MCA bus devices is the slot. Each slot is numbered and virtual slot numbers are assigned to the internal devices. Using a pci_dev as other busses do does not really make sense in the MCA context as the MCA bus resources require card specific interpretation.
Finally the MCA bus functions provide a parallel set of DMA functions mimicing the ISA bus DMA functions as closely as possible, although also supporting the additional DMA functionality on the MCA bus controllers.
Table of Contents
mca_find_adapter — scan for adapters
int mca_find_adapter ( | id, | |
start); |
int id;int start;mca_find_unused_adapter — scan for unused adapters
int mca_find_unused_adapter ( | id, | |
start); |
int id;int start;
Search the MCA configuration for adapters matching the 16bit
ID given. The first time it should be called with start as zero
and then further calls made passing the return value of the
previous call until MCA_NOTFOUND is returned.
Adapters that have been claimed by drivers and those that are disabled are not reported. This function thus allows a driver to scan for further cards when some may already be driven.
mca_read_stored_pos — read POS register from boot data
unsigned char mca_read_stored_pos ( | slot, | |
reg); |
int slot;int reg;mca_read_pos — read POS register from card
unsigned char mca_read_pos ( | slot, | |
reg); |
int slot;int reg;mca_write_pos — read POS register from card
void mca_write_pos ( | slot, | |
| reg, | ||
byte); |
int slot;int reg;unsigned char byte;slotslot number to read from
regregister to read from
bytebyte to write to the POS registers
Store a POS value directly from the hardware. You should not normally need to use this function and should have a very good knowledge of MCA bus before you do so. Doing this wrongly can damage the hardware.
This function may not be used from interrupt context.
Note that this a technically a Bad Thing, as IBM tech stuff says you should only set POS values through their utilities. However, some devices such as the 3c523 recommend that you write back some data to make sure the configuration is consistent. I'd say that IBM is right, but I like my drivers to work.
This function can't do checks to see if multiple devices end up with the same resources, so you might see magic smoke if someone screws up.
mca_set_adapter_name — Set the description of the card
void mca_set_adapter_name ( | slot, | |
name); |
int slot;char * name;Table of Contents
mca_enable_dma — channel to enable DMA on
void mca_enable_dma ( | dmanr); |
unsigned int dmanr;mca_disable_dma — channel to disable DMA on
void mca_disable_dma ( | dmanr); |
unsigned int dmanr;mca_set_dma_addr — load a 24bit DMA address
void mca_set_dma_addr ( | dmanr, | |
a); |
unsigned int dmanr;unsigned int a;mca_get_dma_addr — load a 24bit DMA address
unsigned int mca_get_dma_addr ( | dmanr); |
unsigned int dmanr;mca_set_dma_count — load a 16bit transfer count
void mca_set_dma_count ( | dmanr, | |
count); |
unsigned int dmanr;unsigned int count;mca_get_dma_residue — get the remaining bytes to transfer
unsigned int mca_get_dma_residue ( | dmanr); |
unsigned int dmanr;mca_set_dma_io — set the port for an I/O transfer
void mca_set_dma_io ( | dmanr, | |
io_addr); |
unsigned int dmanr;unsigned int io_addr;