diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-16 18:20:36 -0400 |
commit | 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2 (patch) | |
tree | 0bba044c4ce775e45a88a51686b5d9f90697ea9d /include/linux/eisa.h |
Linux-2.6.12-rc2v2.6.12-rc2
Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.
Let it rip!
Diffstat (limited to 'include/linux/eisa.h')
-rw-r--r-- | include/linux/eisa.h | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/include/linux/eisa.h b/include/linux/eisa.h new file mode 100644 index 000000000000..4079242dced8 --- /dev/null +++ b/include/linux/eisa.h | |||
@@ -0,0 +1,107 @@ | |||
1 | #ifndef _LINUX_EISA_H | ||
2 | #define _LINUX_EISA_H | ||
3 | |||
4 | #include <linux/ioport.h> | ||
5 | #include <linux/device.h> | ||
6 | |||
7 | #define EISA_SIG_LEN 8 | ||
8 | #define EISA_MAX_SLOTS 8 | ||
9 | |||
10 | #define EISA_MAX_RESOURCES 4 | ||
11 | |||
12 | /* A few EISA constants/offsets... */ | ||
13 | |||
14 | #define EISA_DMA1_STATUS 8 | ||
15 | #define EISA_INT1_CTRL 0x20 | ||
16 | #define EISA_INT1_MASK 0x21 | ||
17 | #define EISA_INT2_CTRL 0xA0 | ||
18 | #define EISA_INT2_MASK 0xA1 | ||
19 | #define EISA_DMA2_STATUS 0xD0 | ||
20 | #define EISA_DMA2_WRITE_SINGLE 0xD4 | ||
21 | #define EISA_EXT_NMI_RESET_CTRL 0x461 | ||
22 | #define EISA_INT1_EDGE_LEVEL 0x4D0 | ||
23 | #define EISA_INT2_EDGE_LEVEL 0x4D1 | ||
24 | #define EISA_VENDOR_ID_OFFSET 0xC80 | ||
25 | #define EISA_CONFIG_OFFSET 0xC84 | ||
26 | |||
27 | #define EISA_CONFIG_ENABLED 1 | ||
28 | #define EISA_CONFIG_FORCED 2 | ||
29 | |||
30 | /* The EISA signature, in ASCII form, null terminated */ | ||
31 | struct eisa_device_id { | ||
32 | char sig[EISA_SIG_LEN]; | ||
33 | unsigned long driver_data; | ||
34 | }; | ||
35 | |||
36 | /* There is not much we can say about an EISA device, apart from | ||
37 | * signature, slot number, and base address. dma_mask is set by | ||
38 | * default to parent device mask..*/ | ||
39 | |||
40 | struct eisa_device { | ||
41 | struct eisa_device_id id; | ||
42 | int slot; | ||
43 | int state; | ||
44 | unsigned long base_addr; | ||
45 | struct resource res[EISA_MAX_RESOURCES]; | ||
46 | u64 dma_mask; | ||
47 | struct device dev; /* generic device */ | ||
48 | #ifdef CONFIG_EISA_NAMES | ||
49 | char pretty_name[DEVICE_NAME_SIZE]; | ||
50 | #endif | ||
51 | }; | ||
52 | |||
53 | #define to_eisa_device(n) container_of(n, struct eisa_device, dev) | ||
54 | |||
55 | static inline int eisa_get_region_index (void *addr) | ||
56 | { | ||
57 | unsigned long x = (unsigned long) addr; | ||
58 | |||
59 | x &= 0xc00; | ||
60 | return (x >> 12); | ||
61 | } | ||
62 | |||
63 | struct eisa_driver { | ||
64 | const struct eisa_device_id *id_table; | ||
65 | struct device_driver driver; | ||
66 | }; | ||
67 | |||
68 | #define to_eisa_driver(drv) container_of(drv,struct eisa_driver, driver) | ||
69 | |||
70 | extern struct bus_type eisa_bus_type; | ||
71 | int eisa_driver_register (struct eisa_driver *edrv); | ||
72 | void eisa_driver_unregister (struct eisa_driver *edrv); | ||
73 | |||
74 | /* Mimics pci.h... */ | ||
75 | static inline void *eisa_get_drvdata (struct eisa_device *edev) | ||
76 | { | ||
77 | return edev->dev.driver_data; | ||
78 | } | ||
79 | |||
80 | static inline void eisa_set_drvdata (struct eisa_device *edev, void *data) | ||
81 | { | ||
82 | edev->dev.driver_data = data; | ||
83 | } | ||
84 | |||
85 | /* The EISA root device. There's rumours about machines with multiple | ||
86 | * busses (PA-RISC ?), so we try to handle that. */ | ||
87 | |||
88 | struct eisa_root_device { | ||
89 | struct device *dev; /* Pointer to bridge device */ | ||
90 | struct resource *res; | ||
91 | unsigned long bus_base_addr; | ||
92 | int slots; /* Max slot number */ | ||
93 | int force_probe; /* Probe even when no slot 0 */ | ||
94 | u64 dma_mask; /* from bridge device */ | ||
95 | int bus_nr; /* Set by eisa_root_register */ | ||
96 | struct resource eisa_root_res; /* ditto */ | ||
97 | }; | ||
98 | |||
99 | int eisa_root_register (struct eisa_root_device *root); | ||
100 | |||
101 | #ifdef CONFIG_EISA | ||
102 | extern int EISA_bus; | ||
103 | #else | ||
104 | # define EISA_bus 0 | ||
105 | #endif | ||
106 | |||
107 | #endif | ||