aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pcmcia/cs_internal.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/pcmcia/cs_internal.h')
-rw-r--r--drivers/pcmcia/cs_internal.h62
1 files changed, 17 insertions, 45 deletions
diff --git a/drivers/pcmcia/cs_internal.h b/drivers/pcmcia/cs_internal.h
index 4126a75445ea..da055dc14d98 100644
--- a/drivers/pcmcia/cs_internal.h
+++ b/drivers/pcmcia/cs_internal.h
@@ -10,7 +10,7 @@
10 * are Copyright (C) 1999 David A. Hinds. All Rights Reserved. 10 * are Copyright (C) 1999 David A. Hinds. All Rights Reserved.
11 * 11 *
12 * (C) 1999 David A. Hinds 12 * (C) 1999 David A. Hinds
13 * (C) 2003 - 2008 Dominik Brodowski 13 * (C) 2003 - 2010 Dominik Brodowski
14 * 14 *
15 * 15 *
16 * This file contains definitions _only_ needed by the PCMCIA core modules. 16 * This file contains definitions _only_ needed by the PCMCIA core modules.
@@ -26,6 +26,9 @@
26/* Flags in client state */ 26/* Flags in client state */
27#define CLIENT_WIN_REQ(i) (0x1<<(i)) 27#define CLIENT_WIN_REQ(i) (0x1<<(i))
28 28
29/* Flag to access all functions */
30#define BIND_FN_ALL 0xff
31
29/* Each card function gets one of these guys */ 32/* Each card function gets one of these guys */
30typedef struct config_t { 33typedef struct config_t {
31 struct kref ref; 34 struct kref ref;
@@ -35,7 +38,10 @@ typedef struct config_t {
35 unsigned int ConfigBase; 38 unsigned int ConfigBase;
36 unsigned char Status, Pin, Copy, Option, ExtStatus; 39 unsigned char Status, Pin, Copy, Option, ExtStatus;
37 unsigned int CardValues; 40 unsigned int CardValues;
38 io_req_t io; 41
42 struct resource io[MAX_IO_WIN]; /* io ports */
43 struct resource mem[MAX_WIN]; /* mem areas */
44
39 struct { 45 struct {
40 u_int Attributes; 46 u_int Attributes;
41 } irq; 47 } irq;
@@ -56,18 +62,11 @@ struct pccard_resource_ops {
56 unsigned int attr, 62 unsigned int attr,
57 unsigned int *base, 63 unsigned int *base,
58 unsigned int num, 64 unsigned int num,
59 unsigned int align); 65 unsigned int align,
66 struct resource **parent);
60 struct resource* (*find_mem) (unsigned long base, unsigned long num, 67 struct resource* (*find_mem) (unsigned long base, unsigned long num,
61 unsigned long align, int low, 68 unsigned long align, int low,
62 struct pcmcia_socket *s); 69 struct pcmcia_socket *s);
63 int (*add_io) (struct pcmcia_socket *s,
64 unsigned int action,
65 unsigned long r_start,
66 unsigned long r_end);
67 int (*add_mem) (struct pcmcia_socket *s,
68 unsigned int action,
69 unsigned long r_start,
70 unsigned long r_end);
71 int (*init) (struct pcmcia_socket *s); 70 int (*init) (struct pcmcia_socket *s);
72 void (*exit) (struct pcmcia_socket *s); 71 void (*exit) (struct pcmcia_socket *s);
73}; 72};
@@ -114,11 +113,12 @@ void cb_free(struct pcmcia_socket *s);
114 113
115struct pcmcia_callback{ 114struct pcmcia_callback{
116 struct module *owner; 115 struct module *owner;
117 int (*event) (struct pcmcia_socket *s, 116 int (*add) (struct pcmcia_socket *s);
118 event_t event, int priority); 117 int (*remove) (struct pcmcia_socket *s);
119 void (*requery) (struct pcmcia_socket *s); 118 void (*requery) (struct pcmcia_socket *s);
120 int (*validate) (struct pcmcia_socket *s, unsigned int *i); 119 int (*validate) (struct pcmcia_socket *s, unsigned int *i);
121 int (*suspend) (struct pcmcia_socket *s); 120 int (*suspend) (struct pcmcia_socket *s);
121 int (*early_resume) (struct pcmcia_socket *s);
122 int (*resume) (struct pcmcia_socket *s); 122 int (*resume) (struct pcmcia_socket *s);
123}; 123};
124 124
@@ -146,6 +146,8 @@ void pcmcia_put_socket(struct pcmcia_socket *skt);
146/* ds.c */ 146/* ds.c */
147extern struct bus_type pcmcia_bus_type; 147extern struct bus_type pcmcia_bus_type;
148 148
149struct pcmcia_device;
150
149/* pcmcia_resource.c */ 151/* pcmcia_resource.c */
150extern int pcmcia_release_configuration(struct pcmcia_device *p_dev); 152extern int pcmcia_release_configuration(struct pcmcia_device *p_dev);
151extern int pcmcia_validate_mem(struct pcmcia_socket *s); 153extern int pcmcia_validate_mem(struct pcmcia_socket *s);
@@ -163,8 +165,8 @@ extern struct bin_attribute pccard_cis_attr;
163 165
164int pcmcia_read_cis_mem(struct pcmcia_socket *s, int attr, 166int pcmcia_read_cis_mem(struct pcmcia_socket *s, int attr,
165 u_int addr, u_int len, void *ptr); 167 u_int addr, u_int len, void *ptr);
166void pcmcia_write_cis_mem(struct pcmcia_socket *s, int attr, 168int pcmcia_write_cis_mem(struct pcmcia_socket *s, int attr,
167 u_int addr, u_int len, void *ptr); 169 u_int addr, u_int len, void *ptr);
168void release_cis_mem(struct pcmcia_socket *s); 170void release_cis_mem(struct pcmcia_socket *s);
169void destroy_cis_cache(struct pcmcia_socket *s); 171void destroy_cis_cache(struct pcmcia_socket *s);
170int pccard_read_tuple(struct pcmcia_socket *s, unsigned int function, 172int pccard_read_tuple(struct pcmcia_socket *s, unsigned int function,
@@ -188,34 +190,4 @@ int pccard_get_next_tuple(struct pcmcia_socket *s, unsigned int function,
188 190
189int pccard_get_tuple_data(struct pcmcia_socket *s, tuple_t *tuple); 191int pccard_get_tuple_data(struct pcmcia_socket *s, tuple_t *tuple);
190 192
191
192#ifdef CONFIG_PCMCIA_IOCTL
193/* ds.c */
194extern struct pcmcia_device *pcmcia_get_dev(struct pcmcia_device *p_dev);
195extern void pcmcia_put_dev(struct pcmcia_device *p_dev);
196
197struct pcmcia_device *pcmcia_device_add(struct pcmcia_socket *s,
198 unsigned int function);
199
200/* pcmcia_ioctl.c */
201extern void __init pcmcia_setup_ioctl(void);
202extern void __exit pcmcia_cleanup_ioctl(void);
203extern void handle_event(struct pcmcia_socket *s, event_t event);
204extern int handle_request(struct pcmcia_socket *s, event_t event);
205
206#else /* CONFIG_PCMCIA_IOCTL */
207
208static inline void __init pcmcia_setup_ioctl(void) { return; }
209static inline void __exit pcmcia_cleanup_ioctl(void) { return; }
210static inline void handle_event(struct pcmcia_socket *s, event_t event)
211{
212 return;
213}
214static inline int handle_request(struct pcmcia_socket *s, event_t event)
215{
216 return 0;
217}
218
219#endif /* CONFIG_PCMCIA_IOCTL */
220
221#endif /* _LINUX_CS_INTERNAL_H */ 193#endif /* _LINUX_CS_INTERNAL_H */