7be0fcf78502d05bf6f019dc69b74dc7072de62d
[pandora-kernel.git] / include / pcmcia / cs.h
1 /*
2  * cs.h
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  *
8  * The initial developer of the original code is David A. Hinds
9  * <dahinds@users.sourceforge.net>.  Portions created by David A. Hinds
10  * are Copyright (C) 1999 David A. Hinds.  All Rights Reserved.
11  *
12  * (C) 1999             David A. Hinds
13  */
14
15 #ifndef _LINUX_CS_H
16 #define _LINUX_CS_H
17
18 #ifdef __KERNEL__
19 #include <linux/interrupt.h>
20 #endif
21
22 /* ModifyConfiguration */
23 typedef struct modconf_t {
24     u_int       Attributes;
25     u_int       Vcc, Vpp1, Vpp2;
26 } modconf_t;
27
28 /* Attributes for ModifyConfiguration */
29 #define CONF_IRQ_CHANGE_VALID   0x0100
30 #define CONF_VCC_CHANGE_VALID   0x0200
31 #define CONF_VPP1_CHANGE_VALID  0x0400
32 #define CONF_VPP2_CHANGE_VALID  0x0800
33 #define CONF_IO_CHANGE_WIDTH    0x1000
34
35 /* For RequestConfiguration */
36 typedef struct config_req_t {
37     u_int       Attributes;
38     u_int       Vpp; /* both Vpp1 and Vpp2 */
39     u_int       IntType;
40     u_int       ConfigBase;
41     u_char      Status, Pin, Copy, ExtStatus;
42     u_char      ConfigIndex;
43     u_int       Present;
44 } config_req_t;
45
46 /* Attributes for RequestConfiguration */
47 #define CONF_ENABLE_IRQ         0x01
48 #define CONF_ENABLE_DMA         0x02
49 #define CONF_ENABLE_SPKR        0x04
50 #define CONF_ENABLE_PULSE_IRQ   0x08
51 #define CONF_VALID_CLIENT       0x100
52
53 /* IntType field */
54 #define INT_MEMORY              0x01
55 #define INT_MEMORY_AND_IO       0x02
56 #define INT_CARDBUS             0x04
57 #define INT_ZOOMED_VIDEO        0x08
58
59 /* For RequestIO and ReleaseIO */
60 typedef struct io_req_t {
61     u_int       BasePort1;
62     u_int       NumPorts1;
63     u_int       Attributes1;
64     u_int       BasePort2;
65     u_int       NumPorts2;
66     u_int       Attributes2;
67     u_int       IOAddrLines;
68 } io_req_t;
69
70 /* Attributes for RequestIO and ReleaseIO */
71 #define IO_SHARED               0x01
72 #define IO_FIRST_SHARED         0x02
73 #define IO_FORCE_ALIAS_ACCESS   0x04
74 #define IO_DATA_PATH_WIDTH      0x18
75 #define IO_DATA_PATH_WIDTH_8    0x00
76 #define IO_DATA_PATH_WIDTH_16   0x08
77 #define IO_DATA_PATH_WIDTH_AUTO 0x10
78
79 /* Bits in IRQInfo1 field */
80 #define IRQ_NMI_ID              0x01
81 #define IRQ_IOCK_ID             0x02
82 #define IRQ_BERR_ID             0x04
83 #define IRQ_VEND_ID             0x08
84 #define IRQ_INFO2_VALID         0x10
85 #define IRQ_LEVEL_ID            0x20
86 #define IRQ_PULSE_ID            0x40
87 #define IRQ_SHARE_ID            0x80
88
89 /* Configuration registers present */
90 #define PRESENT_OPTION          0x001
91 #define PRESENT_STATUS          0x002
92 #define PRESENT_PIN_REPLACE     0x004
93 #define PRESENT_COPY            0x008
94 #define PRESENT_EXT_STATUS      0x010
95 #define PRESENT_IOBASE_0        0x020
96 #define PRESENT_IOBASE_1        0x040
97 #define PRESENT_IOBASE_2        0x080
98 #define PRESENT_IOBASE_3        0x100
99 #define PRESENT_IOSIZE          0x200
100
101 /* For GetMemPage, MapMemPage */
102 typedef struct memreq_t {
103     u_int       CardOffset;
104     u_short     Page;
105 } memreq_t;
106
107 /* For ModifyWindow */
108 typedef struct modwin_t {
109     u_int       Attributes;
110     u_int       AccessSpeed;
111 } modwin_t;
112
113 /* For RequestWindow */
114 typedef struct win_req_t {
115     u_int       Attributes;
116     u_long      Base;
117     u_int       Size;
118     u_int       AccessSpeed;
119 } win_req_t;
120
121 /* Attributes for RequestWindow */
122 #define WIN_ADDR_SPACE          0x0001
123 #define WIN_ADDR_SPACE_MEM      0x0000
124 #define WIN_ADDR_SPACE_IO       0x0001
125 #define WIN_MEMORY_TYPE         0x0002
126 #define WIN_MEMORY_TYPE_CM      0x0000
127 #define WIN_MEMORY_TYPE_AM      0x0002
128 #define WIN_ENABLE              0x0004
129 #define WIN_DATA_WIDTH          0x0018
130 #define WIN_DATA_WIDTH_8        0x0000
131 #define WIN_DATA_WIDTH_16       0x0008
132 #define WIN_DATA_WIDTH_32       0x0010
133 #define WIN_PAGED               0x0020
134 #define WIN_SHARED              0x0040
135 #define WIN_FIRST_SHARED        0x0080
136 #define WIN_USE_WAIT            0x0100
137 #define WIN_STRICT_ALIGN        0x0200
138 #define WIN_MAP_BELOW_1MB       0x0400
139 #define WIN_PREFETCH            0x0800
140 #define WIN_CACHEABLE           0x1000
141 #define WIN_BAR_MASK            0xe000
142 #define WIN_BAR_SHIFT           13
143
144 /* Flag to bind to all functions */
145 #define BIND_FN_ALL     0xff
146
147 #endif /* _LINUX_CS_H */