aboutsummaryrefslogtreecommitdiffstats
path: root/include/pcmcia
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-05-20 12:09:46 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-05-20 12:09:46 -0400
commit54291263519ac2c9bdda68b23b02fef3808deed4 (patch)
treed71de8172a6ab2bbe3068aece7d8911eeeb276fd /include/pcmcia
parent46ee9645094ad1eb5b4888882ecaa1fb87dcd2a3 (diff)
parentacd200bf45487271d54f05938ad9e30f32a530ee (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6: (29 commits) pcmcia: disable PCMCIA ioctl also for ARM drivers/staging/comedi: dev_node removal (quatech_daqp_cs) drivers/staging/comedi: dev_node removal (ni_mio_cs) drivers/staging/comedi: dev_node removal (ni_labpc_cs) drivers/staging/comedi: dev_node removal (ni_daq_dio24) drivers/staging/comedi: dev_node removal (ni_daq_700) drivers/staging/comedi: dev_node removal (das08_cs) drivers/staging/comedi: dev_node removal (cb_das16_cs) pata_pcmcia: get rid of extra indirection pcmcia: remove suspend-related comment from yenta_socket.c pcmcia: call pcmcia_{read,write}_cis_mem with ops_mutex held pcmcia: remove pcmcia_add_device_lock pcmcia: update gfp/slab.h includes pcmcia: remove unused mem_op.h pcmcia: do not autoadd root PCI bus resources pcmcia: clarify alloc_io_space, move it to resource handlers pcmcia: move all pcmcia_resource_ops providers into one module pcmcia: move high level CIS access code to separate file pcmcia: dev_node removal (core) pcmcia: dev_node removal (remaining drivers) ...
Diffstat (limited to 'include/pcmcia')
-rw-r--r--include/pcmcia/cs.h19
-rw-r--r--include/pcmcia/ds.h29
-rw-r--r--include/pcmcia/mem_op.h116
-rw-r--r--include/pcmcia/ss.h7
4 files changed, 21 insertions, 150 deletions
diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h
index 75fa3530345b..57d8d0393567 100644
--- a/include/pcmcia/cs.h
+++ b/include/pcmcia/cs.h
@@ -85,6 +85,7 @@ typedef struct config_req_t {
85#define CONF_ENABLE_IRQ 0x01 85#define CONF_ENABLE_IRQ 0x01
86#define CONF_ENABLE_DMA 0x02 86#define CONF_ENABLE_DMA 0x02
87#define CONF_ENABLE_SPKR 0x04 87#define CONF_ENABLE_SPKR 0x04
88#define CONF_ENABLE_PULSE_IRQ 0x08
88#define CONF_VALID_CLIENT 0x100 89#define CONF_VALID_CLIENT 0x100
89 90
90/* IntType field */ 91/* IntType field */
@@ -113,25 +114,7 @@ typedef struct io_req_t {
113#define IO_DATA_PATH_WIDTH_16 0x08 114#define IO_DATA_PATH_WIDTH_16 0x08
114#define IO_DATA_PATH_WIDTH_AUTO 0x10 115#define IO_DATA_PATH_WIDTH_AUTO 0x10
115 116
116/* For RequestIRQ and ReleaseIRQ */
117typedef struct irq_req_t {
118 u_int Attributes;
119 u_int AssignedIRQ;
120 irq_handler_t Handler;
121} irq_req_t;
122
123/* Attributes for RequestIRQ and ReleaseIRQ */
124#define IRQ_TYPE 0x03
125#define IRQ_TYPE_EXCLUSIVE 0x00
126#define IRQ_TYPE_TIME 0x01
127#define IRQ_TYPE_DYNAMIC_SHARING 0x02
128#define IRQ_FORCED_PULSE 0x04
129#define IRQ_FIRST_SHARED 0x08 /* unused */
130#define IRQ_HANDLE_PRESENT 0x10 /* unused */
131#define IRQ_PULSE_ALLOCATED 0x100
132
133/* Bits in IRQInfo1 field */ 117/* Bits in IRQInfo1 field */
134#define IRQ_MASK 0x0f
135#define IRQ_NMI_ID 0x01 118#define IRQ_NMI_ID 0x01
136#define IRQ_IOCK_ID 0x02 119#define IRQ_IOCK_ID 0x02
137#define IRQ_BERR_ID 0x04 120#define IRQ_BERR_ID 0x04
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
index aab3c13dc310..c180165fbd3e 100644
--- a/include/pcmcia/ds.h
+++ b/include/pcmcia/ds.h
@@ -62,15 +62,6 @@ struct pcmcia_driver {
62int pcmcia_register_driver(struct pcmcia_driver *driver); 62int pcmcia_register_driver(struct pcmcia_driver *driver);
63void pcmcia_unregister_driver(struct pcmcia_driver *driver); 63void pcmcia_unregister_driver(struct pcmcia_driver *driver);
64 64
65/* Some drivers use dev_node_t to store char or block device information.
66 * Don't use this in new drivers, though.
67 */
68typedef struct dev_node_t {
69 char dev_name[DEV_NAME_LEN];
70 u_short major, minor;
71 struct dev_node_t *next;
72} dev_node_t;
73
74struct pcmcia_device { 65struct pcmcia_device {
75 /* the socket and the device_no [for multifunction devices] 66 /* the socket and the device_no [for multifunction devices]
76 uniquely define a pcmcia_device */ 67 uniquely define a pcmcia_device */
@@ -88,13 +79,14 @@ struct pcmcia_device {
88 struct list_head socket_device_list; 79 struct list_head socket_device_list;
89 80
90 /* deprecated, will be cleaned up soon */ 81 /* deprecated, will be cleaned up soon */
91 dev_node_t *dev_node;
92 u_int open; 82 u_int open;
93 io_req_t io; 83 io_req_t io;
94 irq_req_t irq;
95 config_req_t conf; 84 config_req_t conf;
96 window_handle_t win; 85 window_handle_t win;
97 86
87 /* device setup */
88 unsigned int irq;
89
98 /* Is the device suspended? */ 90 /* Is the device suspended? */
99 u16 suspended:1; 91 u16 suspended:1;
100 92
@@ -191,7 +183,20 @@ int pcmcia_access_configuration_register(struct pcmcia_device *p_dev,
191 183
192/* device configuration */ 184/* device configuration */
193int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req); 185int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req);
194int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req); 186
187int __must_check
188__pcmcia_request_exclusive_irq(struct pcmcia_device *p_dev,
189 irq_handler_t handler);
190static inline __must_check __deprecated int
191pcmcia_request_exclusive_irq(struct pcmcia_device *p_dev,
192 irq_handler_t handler)
193{
194 return __pcmcia_request_exclusive_irq(p_dev, handler);
195}
196
197int __must_check pcmcia_request_irq(struct pcmcia_device *p_dev,
198 irq_handler_t handler);
199
195int pcmcia_request_configuration(struct pcmcia_device *p_dev, 200int pcmcia_request_configuration(struct pcmcia_device *p_dev,
196 config_req_t *req); 201 config_req_t *req);
197 202
diff --git a/include/pcmcia/mem_op.h b/include/pcmcia/mem_op.h
deleted file mode 100644
index 0fa06e5d5376..000000000000
--- a/include/pcmcia/mem_op.h
+++ /dev/null
@@ -1,116 +0,0 @@
1/*
2 * mem_op.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_MEM_OP_H
16#define _LINUX_MEM_OP_H
17
18#include <linux/io.h>
19#include <asm/uaccess.h>
20
21/*
22 If UNSAFE_MEMCPY is defined, we use the (optimized) system routines
23 to copy between a card and kernel memory. These routines do 32-bit
24 operations which may not work with all PCMCIA controllers. The
25 safe versions defined here will do only 8-bit and 16-bit accesses.
26*/
27
28#ifdef UNSAFE_MEMCPY
29
30#define copy_from_pc memcpy_fromio
31#define copy_to_pc memcpy_toio
32
33static inline void copy_pc_to_user(void *to, const void *from, size_t n)
34{
35 size_t odd = (n & 3);
36 n -= odd;
37 while (n) {
38 put_user(__raw_readl(from), (int *)to);
39 (char *)from += 4; (char *)to += 4; n -= 4;
40 }
41 while (odd--)
42 put_user(readb((char *)from++), (char *)to++);
43}
44
45static inline void copy_user_to_pc(void *to, const void *from, size_t n)
46{
47 int l;
48 char c;
49 size_t odd = (n & 3);
50 n -= odd;
51 while (n) {
52 get_user(l, (int *)from);
53 __raw_writel(l, to);
54 (char *)to += 4; (char *)from += 4; n -= 4;
55 }
56 while (odd--) {
57 get_user(c, (char *)from++);
58 writeb(c, (char *)to++);
59 }
60}
61
62#else /* UNSAFE_MEMCPY */
63
64static inline void copy_from_pc(void *to, void __iomem *from, size_t n)
65{
66 __u16 *t = to;
67 __u16 __iomem *f = from;
68 size_t odd = (n & 1);
69 for (n >>= 1; n; n--)
70 *t++ = __raw_readw(f++);
71 if (odd)
72 *(__u8 *)t = readb(f);
73}
74
75static inline void copy_to_pc(void __iomem *to, const void *from, size_t n)
76{
77 __u16 __iomem *t = to;
78 const __u16 *f = from;
79 size_t odd = (n & 1);
80 for (n >>= 1; n ; n--)
81 __raw_writew(*f++, t++);
82 if (odd)
83 writeb(*(__u8 *)f, t);
84}
85
86static inline void copy_pc_to_user(void __user *to, void __iomem *from, size_t n)
87{
88 __u16 __user *t = to;
89 __u16 __iomem *f = from;
90 size_t odd = (n & 1);
91 for (n >>= 1; n ; n--)
92 put_user(__raw_readw(f++), t++);
93 if (odd)
94 put_user(readb(f), (char __user *)t);
95}
96
97static inline void copy_user_to_pc(void __iomem *to, void __user *from, size_t n)
98{
99 __u16 __user *f = from;
100 __u16 __iomem *t = to;
101 short s;
102 char c;
103 size_t odd = (n & 1);
104 for (n >>= 1; n; n--) {
105 get_user(s, f++);
106 __raw_writew(s, t++);
107 }
108 if (odd) {
109 get_user(c, (char __user *)f);
110 writeb(c, t);
111 }
112}
113
114#endif /* UNSAFE_MEMCPY */
115
116#endif /* _LINUX_MEM_OP_H */
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h
index 344705cb42f4..764281b29218 100644
--- a/include/pcmcia/ss.h
+++ b/include/pcmcia/ss.h
@@ -141,10 +141,6 @@ struct pcmcia_socket {
141 u_short lock_count; 141 u_short lock_count;
142 pccard_mem_map cis_mem; 142 pccard_mem_map cis_mem;
143 void __iomem *cis_virt; 143 void __iomem *cis_virt;
144 struct {
145 u_int AssignedIRQ;
146 u_int Config;
147 } irq;
148 io_window_t io[MAX_IO_WIN]; 144 io_window_t io[MAX_IO_WIN];
149 pccard_mem_map win[MAX_WIN]; 145 pccard_mem_map win[MAX_WIN];
150 struct list_head cis_cache; 146 struct list_head cis_cache;
@@ -235,6 +231,9 @@ struct pcmcia_socket {
235 /* non-zero if PCMCIA card is present */ 231 /* non-zero if PCMCIA card is present */
236 atomic_t present; 232 atomic_t present;
237 233
234 /* IRQ to be used by PCMCIA devices. May not be IRQ 0. */
235 unsigned int pcmcia_irq;
236
238#ifdef CONFIG_PCMCIA_IOCTL 237#ifdef CONFIG_PCMCIA_IOCTL
239 struct user_info_t *user; 238 struct user_info_t *user;
240 wait_queue_head_t queue; 239 wait_queue_head_t queue;