summaryrefslogtreecommitdiffstats
path: root/src/include/mca.h
blob: e5daf71565b3d361e480eb86ad412cf64e566515 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/*
 * MCA bus driver code
 *
 * Abstracted from 3c509.c.
 *
 */

#ifndef MCA_H
#define MCA_H

#include "isa_ids.h"
#include "dev.h"

/*
 * MCA constants
 *
 */

#define MCA_MOTHERBOARD_SETUP_REG	0x94
#define MCA_ADAPTER_SETUP_REG		0x96
#define MCA_MAX_SLOT_NR			8
#define MCA_POS_REG(n)			(0x100+(n))

/* Is there a standard that would define this? */
#define GENERIC_MCA_VENDOR ISA_VENDOR ( 'M', 'C', 'A' )

/*
 * A physical MCA device
 *
 */
struct mca_device {
	char *magic; /* must be first */
	const char *name;
	unsigned int slot;
	unsigned char pos[8];
	int already_tried;
};
#define MCA_ID(mca) ( ( (mca)->pos[1] << 8 ) + (mca)->pos[0] )

/*
 * An individual MCA device identified by ID
 *
 */
struct mca_id {
        const char *name;
        int id;
};

/*
 * An MCA driver, with a device ID (struct mca_id) table.
 *
 */
struct mca_driver {
	const char *name;
	struct mca_id *ids;
	unsigned int id_count;
};

/*
 * Define an MCA driver
 *
 */
#define MCA_DRIVER( driver_name, mca_ids ) {			\
	.name = driver_name,					\
	.ids = mca_ids,						\
	.id_count = sizeof ( mca_ids ) / sizeof ( mca_ids[0] ),	\
}

/*
 * Functions in mca.c
 *
 */
extern int find_mca_device ( struct mca_device *mca,
			     struct mca_driver *driver );
extern int find_mca_boot_device ( struct dev *dev, struct mca_driver *driver );

#endif