aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2010-07-28 04:59:06 -0400
committerDominik Brodowski <linux@dominikbrodowski.net>2010-09-29 11:20:21 -0400
commitcdb138080b78146d1cdadba9f5dadbeb97445b91 (patch)
treefae26f709ed0f19648db79059234faf9fa028051 /include
parent899611ee7d373e5eeda08e9a8632684e1ebbbf00 (diff)
pcmcia: do not use win_req_t when calling pcmcia_request_window()
Instead of win_req_t, drivers are now requested to fill out struct pcmcia_device *p_dev->resource[2,3,4,5] for up to four iomem ranges. After a call to pcmcia_request_window(), the windows found there are reserved and may be used until pcmcia_release_window() is called. CC: netdev@vger.kernel.org CC: linux-wireless@vger.kernel.org CC: linux-mtd@lists.infradead.org CC: Jiri Kosina <jkosina@suse.cz> CC: linux-scsi@vger.kernel.org Tested-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
Diffstat (limited to 'include')
-rw-r--r--include/pcmcia/cs.h24
-rw-r--r--include/pcmcia/ds.h28
2 files changed, 21 insertions, 31 deletions
diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h
index 68d8bde7e8d6..63cb9bbe390e 100644
--- a/include/pcmcia/cs.h
+++ b/include/pcmcia/cs.h
@@ -68,28 +68,4 @@ typedef struct config_req_t {
68#define PRESENT_IOBASE_3 0x100 68#define PRESENT_IOBASE_3 0x100
69#define PRESENT_IOSIZE 0x200 69#define PRESENT_IOSIZE 0x200
70 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 */ 71#endif /* _LINUX_CS_H */
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
index 70c58ed2278c..6f7cb38d8850 100644
--- a/include/pcmcia/ds.h
+++ b/include/pcmcia/ds.h
@@ -36,8 +36,6 @@ struct pcmcia_device;
36struct config_t; 36struct config_t;
37struct net_device; 37struct net_device;
38 38
39typedef struct resource *window_handle_t;
40
41/* dynamic device IDs for PCMCIA device drivers. See 39/* dynamic device IDs for PCMCIA device drivers. See
42 * Documentation/pcmcia/driver.txt for details. 40 * Documentation/pcmcia/driver.txt for details.
43*/ 41*/
@@ -92,7 +90,6 @@ struct pcmcia_device {
92 90
93 /* deprecated, will be cleaned up soon */ 91 /* deprecated, will be cleaned up soon */
94 config_req_t conf; 92 config_req_t conf;
95 window_handle_t win;
96 93
97 /* device setup */ 94 /* device setup */
98 unsigned int irq; 95 unsigned int irq;
@@ -209,10 +206,10 @@ int __must_check pcmcia_request_irq(struct pcmcia_device *p_dev,
209int pcmcia_request_configuration(struct pcmcia_device *p_dev, 206int pcmcia_request_configuration(struct pcmcia_device *p_dev,
210 config_req_t *req); 207 config_req_t *req);
211 208
212int pcmcia_request_window(struct pcmcia_device *p_dev, win_req_t *req, 209int pcmcia_request_window(struct pcmcia_device *p_dev, struct resource *res,
213 window_handle_t *wh); 210 unsigned int speed);
214int pcmcia_release_window(struct pcmcia_device *p_dev, window_handle_t win); 211int 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, 212int pcmcia_map_mem_page(struct pcmcia_device *p_dev, struct resource *res,
216 unsigned int offset); 213 unsigned int offset);
217 214
218int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod); 215int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod);
@@ -234,6 +231,23 @@ static inline int pcmcia_io_cfg_data_width(unsigned int flags)
234 return IO_DATA_PATH_WIDTH_AUTO; 231 return IO_DATA_PATH_WIDTH_AUTO;
235} 232}
236 233
234/* IO memory */
235#define WIN_MEMORY_TYPE_CM 0x00 /* default */
236#define WIN_MEMORY_TYPE_AM 0x20 /* MAP_ATTRIB */
237#define WIN_DATA_WIDTH_8 0x00 /* default */
238#define WIN_DATA_WIDTH_16 0x02 /* MAP_16BIT */
239#define WIN_ENABLE 0x01 /* MAP_ACTIVE */
240#define WIN_USE_WAIT 0x40 /* MAP_USE_WAIT */
241
242#define WIN_FLAGS_MAP 0x63 /* MAP_ATTRIB | MAP_16BIT | MAP_ACTIVE |
243 MAP_USE_WAIT */
244#define WIN_FLAGS_REQ 0x1c /* mapping to socket->win[i]:
245 0x04 -> 0
246 0x08 -> 1
247 0x0c -> 2
248 0x10 -> 3 */
249
250
237#endif /* __KERNEL__ */ 251#endif /* __KERNEL__ */
238 252
239#endif /* _LINUX_DS_H */ 253#endif /* _LINUX_DS_H */