aboutsummaryrefslogtreecommitdiffstats
path: root/include/pcmcia
diff options
context:
space:
mode:
Diffstat (limited to 'include/pcmcia')
-rw-r--r--include/pcmcia/cs.h95
-rw-r--r--include/pcmcia/ds.h87
-rw-r--r--include/pcmcia/ss.h1
3 files changed, 61 insertions, 122 deletions
diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h
deleted file mode 100644
index 68d8bde7e8d..00000000000
--- a/include/pcmcia/cs.h
+++ /dev/null
@@ -1,95 +0,0 @@
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 */
23typedef 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 */
36typedef 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/* Configuration registers present */
60#define PRESENT_OPTION 0x001
61#define PRESENT_STATUS 0x002
62#define PRESENT_PIN_REPLACE 0x004
63#define PRESENT_COPY 0x008
64#define PRESENT_EXT_STATUS 0x010
65#define PRESENT_IOBASE_0 0x020
66#define PRESENT_IOBASE_1 0x040
67#define PRESENT_IOBASE_2 0x080
68#define PRESENT_IOBASE_3 0x100
69#define PRESENT_IOSIZE 0x200
70
71/* For RequestWindow */
72typedef struct win_req_t {
73 u_int Attributes;
74 u_long Base;
75 u_int Size;
76 u_int AccessSpeed;
77} win_req_t;
78
79/* Attributes for RequestWindow */
80#define WIN_MEMORY_TYPE_CM 0x00 /* default */
81#define WIN_MEMORY_TYPE_AM 0x20 /* MAP_ATTRIB */
82#define WIN_DATA_WIDTH_8 0x00 /* default */
83#define WIN_DATA_WIDTH_16 0x02 /* MAP_16BIT */
84#define WIN_ENABLE 0x01 /* MAP_ACTIVE */
85#define WIN_USE_WAIT 0x40 /* MAP_USE_WAIT */
86
87#define WIN_FLAGS_MAP 0x63 /* MAP_ATTRIB | MAP_16BIT | MAP_ACTIVE |
88 MAP_USE_WAIT */
89#define WIN_FLAGS_REQ 0x1c /* mapping to socket->win[i]:
90 0x04 -> 0
91 0x08 -> 1
92 0x0c -> 2
93 0x10 -> 3 */
94
95#endif /* _LINUX_CS_H */
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
index 70c58ed2278..8479b66c067 100644
--- a/include/pcmcia/ds.h
+++ b/include/pcmcia/ds.h
@@ -24,9 +24,11 @@
24 24
25#ifdef __KERNEL__ 25#ifdef __KERNEL__
26#include <linux/device.h> 26#include <linux/device.h>
27#include <linux/interrupt.h>
27#include <pcmcia/ss.h> 28#include <pcmcia/ss.h>
28#include <asm/atomic.h> 29#include <asm/atomic.h>
29 30
31
30/* 32/*
31 * PCMCIA device drivers (16-bit cards only; 32-bit cards require CardBus 33 * PCMCIA device drivers (16-bit cards only; 32-bit cards require CardBus
32 * a.k.a. PCI drivers 34 * a.k.a. PCI drivers
@@ -36,8 +38,6 @@ struct pcmcia_device;
36struct config_t; 38struct config_t;
37struct net_device; 39struct net_device;
38 40
39typedef struct resource *window_handle_t;
40
41/* dynamic device IDs for PCMCIA device drivers. See 41/* dynamic device IDs for PCMCIA device drivers. See
42 * Documentation/pcmcia/driver.txt for details. 42 * Documentation/pcmcia/driver.txt for details.
43*/ 43*/
@@ -47,6 +47,8 @@ struct pcmcia_dynids {
47}; 47};
48 48
49struct pcmcia_driver { 49struct pcmcia_driver {
50 const char *name;
51
50 int (*probe) (struct pcmcia_device *dev); 52 int (*probe) (struct pcmcia_device *dev);
51 void (*remove) (struct pcmcia_device *dev); 53 void (*remove) (struct pcmcia_device *dev);
52 54
@@ -90,15 +92,17 @@ struct pcmcia_device {
90 92
91 struct list_head socket_device_list; 93 struct list_head socket_device_list;
92 94
93 /* deprecated, will be cleaned up soon */
94 config_req_t conf;
95 window_handle_t win;
96
97 /* device setup */ 95 /* device setup */
98 unsigned int irq; 96 unsigned int irq;
99 struct resource *resource[PCMCIA_NUM_RESOURCES]; 97 struct resource *resource[PCMCIA_NUM_RESOURCES];
98 resource_size_t card_addr; /* for the 1st IOMEM resource */
99 unsigned int vpp;
100 100
101 unsigned int io_lines; /* number of I/O lines */ 101 unsigned int config_flags; /* CONF_ENABLE_ flags below */
102 unsigned int config_base;
103 unsigned int config_index;
104 unsigned int config_regs; /* PRESENT_ flags below */
105 unsigned int io_lines; /* number of I/O lines */
102 106
103 /* Is the device suspended? */ 107 /* Is the device suspended? */
104 u16 suspended:1; 108 u16 suspended:1;
@@ -174,9 +178,6 @@ int pcmcia_parse_tuple(tuple_t *tuple, cisparse_t *parse);
174/* loop CIS entries for valid configuration */ 178/* loop CIS entries for valid configuration */
175int pcmcia_loop_config(struct pcmcia_device *p_dev, 179int pcmcia_loop_config(struct pcmcia_device *p_dev,
176 int (*conf_check) (struct pcmcia_device *p_dev, 180 int (*conf_check) (struct pcmcia_device *p_dev,
177 cistpl_cftable_entry_t *cf,
178 cistpl_cftable_entry_t *dflt,
179 unsigned int vcc,
180 void *priv_data), 181 void *priv_data),
181 void *priv_data); 182 void *priv_data);
182 183
@@ -206,16 +207,17 @@ pcmcia_request_exclusive_irq(struct pcmcia_device *p_dev,
206int __must_check pcmcia_request_irq(struct pcmcia_device *p_dev, 207int __must_check pcmcia_request_irq(struct pcmcia_device *p_dev,
207 irq_handler_t handler); 208 irq_handler_t handler);
208 209
209int pcmcia_request_configuration(struct pcmcia_device *p_dev, 210int pcmcia_enable_device(struct pcmcia_device *p_dev);
210 config_req_t *req);
211 211
212int pcmcia_request_window(struct pcmcia_device *p_dev, win_req_t *req, 212int pcmcia_request_window(struct pcmcia_device *p_dev, struct resource *res,
213 window_handle_t *wh); 213 unsigned int speed);
214int pcmcia_release_window(struct pcmcia_device *p_dev, window_handle_t win); 214int pcmcia_release_window(struct pcmcia_device *p_dev, struct resource *res);
215int pcmcia_map_mem_page(struct pcmcia_device *p_dev, window_handle_t win, 215int pcmcia_map_mem_page(struct pcmcia_device *p_dev, struct resource *res,
216 unsigned int offset); 216 unsigned int offset);
217 217
218int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod); 218int pcmcia_fixup_vpp(struct pcmcia_device *p_dev, unsigned char new_vpp);
219int pcmcia_fixup_iowidth(struct pcmcia_device *p_dev);
220
219void pcmcia_disable_device(struct pcmcia_device *p_dev); 221void pcmcia_disable_device(struct pcmcia_device *p_dev);
220 222
221/* IO ports */ 223/* IO ports */
@@ -224,15 +226,48 @@ void pcmcia_disable_device(struct pcmcia_device *p_dev);
224#define IO_DATA_PATH_WIDTH_16 0x08 226#define IO_DATA_PATH_WIDTH_16 0x08
225#define IO_DATA_PATH_WIDTH_AUTO 0x10 227#define IO_DATA_PATH_WIDTH_AUTO 0x10
226 228
227/* convert flag found in cfgtable to data path width parameter */ 229/* IO memory */
228static inline int pcmcia_io_cfg_data_width(unsigned int flags) 230#define WIN_MEMORY_TYPE_CM 0x00 /* default */
229{ 231#define WIN_MEMORY_TYPE_AM 0x20 /* MAP_ATTRIB */
230 if (!(flags & CISTPL_IO_8BIT)) 232#define WIN_DATA_WIDTH_8 0x00 /* default */
231 return IO_DATA_PATH_WIDTH_16; 233#define WIN_DATA_WIDTH_16 0x02 /* MAP_16BIT */
232 if (!(flags & CISTPL_IO_16BIT)) 234#define WIN_ENABLE 0x01 /* MAP_ACTIVE */
233 return IO_DATA_PATH_WIDTH_8; 235#define WIN_USE_WAIT 0x40 /* MAP_USE_WAIT */
234 return IO_DATA_PATH_WIDTH_AUTO; 236
235} 237#define WIN_FLAGS_MAP 0x63 /* MAP_ATTRIB | MAP_16BIT | MAP_ACTIVE |
238 MAP_USE_WAIT */
239#define WIN_FLAGS_REQ 0x1c /* mapping to socket->win[i]:
240 0x04 -> 0
241 0x08 -> 1
242 0x0c -> 2
243 0x10 -> 3 */
244
245/* config_reg{ister}s present for this PCMCIA device */
246#define PRESENT_OPTION 0x001
247#define PRESENT_STATUS 0x002
248#define PRESENT_PIN_REPLACE 0x004
249#define PRESENT_COPY 0x008
250#define PRESENT_EXT_STATUS 0x010
251#define PRESENT_IOBASE_0 0x020
252#define PRESENT_IOBASE_1 0x040
253#define PRESENT_IOBASE_2 0x080
254#define PRESENT_IOBASE_3 0x100
255#define PRESENT_IOSIZE 0x200
256
257/* flags to be passed to pcmcia_enable_device() */
258#define CONF_ENABLE_IRQ 0x0001
259#define CONF_ENABLE_SPKR 0x0002
260#define CONF_ENABLE_PULSE_IRQ 0x0004
261#define CONF_ENABLE_ESR 0x0008
262#define CONF_ENABLE_IOCARD 0x0010 /* auto-enabled if IO resources or IRQ
263 * (CONF_ENABLE_IRQ) in use */
264
265/* flags used by pcmcia_loop_config() autoconfiguration */
266#define CONF_AUTO_CHECK_VCC 0x0100 /* check for matching Vcc? */
267#define CONF_AUTO_SET_VPP 0x0200 /* set Vpp? */
268#define CONF_AUTO_AUDIO 0x0400 /* enable audio line? */
269#define CONF_AUTO_SET_IO 0x0800 /* set ->resource[0,1] */
270#define CONF_AUTO_SET_IOMEM 0x1000 /* set ->resource[2] */
236 271
237#endif /* __KERNEL__ */ 272#endif /* __KERNEL__ */
238 273
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h
index 626b63c33d9..731cde010f4 100644
--- a/include/pcmcia/ss.h
+++ b/include/pcmcia/ss.h
@@ -19,7 +19,6 @@
19#include <linux/sched.h> /* task_struct, completion */ 19#include <linux/sched.h> /* task_struct, completion */
20#include <linux/mutex.h> 20#include <linux/mutex.h>
21 21
22#include <pcmcia/cs.h>
23#ifdef CONFIG_CARDBUS 22#ifdef CONFIG_CARDBUS
24#include <linux/pci.h> 23#include <linux/pci.h>
25#endif 24#endif