aboutsummaryrefslogtreecommitdiffstats
path: root/include/pcmcia/ds.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/pcmcia/ds.h')
-rw-r--r--include/pcmcia/ds.h40
1 files changed, 24 insertions, 16 deletions
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
index 93a7ebc34156..a8ce8fc11514 100644
--- a/include/pcmcia/ds.h
+++ b/include/pcmcia/ds.h
@@ -96,6 +96,7 @@ typedef union ds_ioctl_arg_t {
96 96
97#ifdef __KERNEL__ 97#ifdef __KERNEL__
98#include <linux/device.h> 98#include <linux/device.h>
99#include <pcmcia/ss.h>
99 100
100typedef struct dev_node_t { 101typedef struct dev_node_t {
101 char dev_name[DEV_NAME_LEN]; 102 char dev_name[DEV_NAME_LEN];
@@ -103,15 +104,11 @@ typedef struct dev_node_t {
103 struct dev_node_t *next; 104 struct dev_node_t *next;
104} dev_node_t; 105} dev_node_t;
105 106
106/* Flags for device state */ 107#define pcmcia_dev_present(p_dev) \
107#define DEV_PRESENT 0x01 108 (p_dev->socket->pcmcia_state.present)
108#define DEV_CONFIG 0x02
109#define DEV_SUSPEND_NORELEASE 0x04
110#define DEV_CONFIG_PENDING 0x10
111#define DEV_BUSY 0x80
112 109
113#define DEV_OK(l) \ 110#define DEV_OK(l) \
114 ((l) && ((l->state & ~DEV_BUSY) == (DEV_CONFIG|DEV_PRESENT))) 111 ((l) && (!l->suspended) && pcmcia_dev_present(l))
115 112
116 113
117struct pcmcia_socket; 114struct pcmcia_socket;
@@ -133,6 +130,7 @@ struct pcmcia_driver {
133int pcmcia_register_driver(struct pcmcia_driver *driver); 130int pcmcia_register_driver(struct pcmcia_driver *driver);
134void pcmcia_unregister_driver(struct pcmcia_driver *driver); 131void pcmcia_unregister_driver(struct pcmcia_driver *driver);
135 132
133
136struct pcmcia_device { 134struct pcmcia_device {
137 /* the socket and the device_no [for multifunction devices] 135 /* the socket and the device_no [for multifunction devices]
138 uniquely define a pcmcia_device */ 136 uniquely define a pcmcia_device */
@@ -151,25 +149,32 @@ struct pcmcia_device {
151 149
152 /* deprecated, will be cleaned up soon */ 150 /* deprecated, will be cleaned up soon */
153 dev_node_t *dev_node; 151 dev_node_t *dev_node;
154 u_int state;
155 u_int open; 152 u_int open;
156 io_req_t io; 153 io_req_t io;
157 irq_req_t irq; 154 irq_req_t irq;
158 config_req_t conf; 155 config_req_t conf;
159 window_handle_t win; 156 window_handle_t win;
160 void *priv;
161 157
162 u_int p_state; 158 /* Is the device suspended? */
159 u16 suspended:1;
160
161 /* Flags whether io, irq, win configurations were
162 * requested, and whether the configuration is "locked" */
163 u16 _irq:1;
164 u16 _io:1;
165 u16 _win:4;
166 u16 _locked:1;
163 167
164 u8 suspended:1; 168 /* Flag whether a "fuzzy" func_id based match is
165 u8 reserved:3; 169 * allowed. */
170 u16 allow_func_id_match:1;
166 171
167 /* information about this device */ 172 /* information about this device */
168 u8 has_manf_id:1; 173 u16 has_manf_id:1;
169 u8 has_card_id:1; 174 u16 has_card_id:1;
170 u8 has_func_id:1; 175 u16 has_func_id:1;
171 176
172 u8 allow_func_id_match:1; 177 u16 reserved:4;
173 178
174 u8 func_id; 179 u8 func_id;
175 u16 manf_id; 180 u16 manf_id;
@@ -183,6 +188,9 @@ struct pcmcia_device {
183 /* device driver wanted by cardmgr */ 188 /* device driver wanted by cardmgr */
184 struct pcmcia_driver * cardmgr; 189 struct pcmcia_driver * cardmgr;
185#endif 190#endif
191
192 /* data private to drivers */
193 void *priv;
186}; 194};
187 195
188#define to_pcmcia_dev(n) container_of(n, struct pcmcia_device, dev) 196#define to_pcmcia_dev(n) container_of(n, struct pcmcia_device, dev)