2005-03-08 18:53:11 +00:00
|
|
|
#ifndef ISA_H
|
|
|
|
#define ISA_H
|
|
|
|
|
2005-04-22 02:28:16 +00:00
|
|
|
#include "stdint.h"
|
2005-04-13 12:01:44 +00:00
|
|
|
#include "isa_ids.h"
|
2005-04-22 02:28:16 +00:00
|
|
|
#include "nic.h"
|
|
|
|
|
|
|
|
/*
|
|
|
|
* A location on an ISA bus
|
|
|
|
*
|
|
|
|
*/
|
2005-04-26 12:30:14 +00:00
|
|
|
struct isa_driver;
|
2005-04-22 02:28:16 +00:00
|
|
|
struct isa_loc {
|
2005-04-26 12:30:14 +00:00
|
|
|
unsigned int driver;
|
2005-04-22 02:28:16 +00:00
|
|
|
unsigned int probe_idx;
|
|
|
|
};
|
2005-03-08 18:53:11 +00:00
|
|
|
|
2005-04-14 18:46:43 +00:00
|
|
|
/*
|
|
|
|
* A physical ISA device
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
struct isa_device {
|
2005-04-22 02:28:16 +00:00
|
|
|
const char *name;
|
2005-04-26 12:30:14 +00:00
|
|
|
struct isa_driver *driver;
|
2005-04-14 18:46:43 +00:00
|
|
|
uint16_t ioaddr;
|
2005-04-22 02:28:16 +00:00
|
|
|
uint16_t mfg_id;
|
|
|
|
uint16_t prod_id;
|
2005-04-14 18:46:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* An individual ISA device, identified by probe address
|
|
|
|
*
|
|
|
|
*/
|
2005-04-16 09:30:48 +00:00
|
|
|
typedef uint16_t isa_probe_addr_t;
|
2005-03-08 18:53:11 +00:00
|
|
|
|
2005-04-14 18:46:43 +00:00
|
|
|
/*
|
|
|
|
* An ISA driver, with a probe address list and a probe_addr method.
|
|
|
|
* probe_addr() should return 1 if a card is physically present,
|
|
|
|
* leaving the other operations (read MAC address etc.) down to the
|
|
|
|
* main probe() routine.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
struct isa_driver {
|
2005-03-08 18:53:11 +00:00
|
|
|
const char *name;
|
2005-04-16 09:30:48 +00:00
|
|
|
isa_probe_addr_t *probe_addrs;
|
2005-04-14 18:46:43 +00:00
|
|
|
unsigned int addr_count;
|
2005-04-16 09:30:48 +00:00
|
|
|
int ( * probe_addr ) ( isa_probe_addr_t addr );
|
2005-04-14 18:46:43 +00:00
|
|
|
uint16_t mfg_id;
|
|
|
|
uint16_t prod_id;
|
2005-03-08 18:53:11 +00:00
|
|
|
};
|
2005-04-26 12:30:14 +00:00
|
|
|
#define __isa_driver __attribute__ (( section ( ".drivers.isa" ) ))
|
2005-03-08 18:53:11 +00:00
|
|
|
|
2005-04-14 18:46:43 +00:00
|
|
|
/*
|
|
|
|
* Define an ISA driver
|
|
|
|
*
|
|
|
|
*/
|
2005-04-26 12:30:14 +00:00
|
|
|
#define ISA_DRIVER( _name, _probe_addrs, _probe_addr, _mfg_id, _prod_id ) \
|
|
|
|
static struct isa_driver _name __isa_driver = { \
|
2005-04-14 18:46:43 +00:00
|
|
|
.probe_addrs = _probe_addrs, \
|
2005-04-14 19:10:17 +00:00
|
|
|
.addr_count = sizeof ( _probe_addrs ) / sizeof ( _probe_addrs[0] ), \
|
2005-04-14 18:46:43 +00:00
|
|
|
.probe_addr = _probe_addr, \
|
|
|
|
.mfg_id = _mfg_id, \
|
|
|
|
.prod_id = _prod_id, \
|
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* ISA_ROM is parsed by parserom.pl to generate Makefile rules and
|
|
|
|
* files for rom-o-matic.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
#define ISA_ROM( IMAGE, DESCRIPTION )
|
2005-03-08 18:53:11 +00:00
|
|
|
|
2005-04-14 18:46:43 +00:00
|
|
|
/*
|
|
|
|
* Functions in isa.c
|
|
|
|
*
|
|
|
|
*/
|
2005-04-22 11:56:27 +00:00
|
|
|
extern void isa_fill_nic ( struct nic *nic, struct isa_device *isa );
|
2005-04-22 02:28:16 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* ISA bus global definition
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
extern struct bus_driver isa_driver;
|
2005-03-08 18:53:11 +00:00
|
|
|
|
|
|
|
#endif /* ISA_H */
|
|
|
|
|