diff options
Diffstat (limited to 'include/pcmcia')
-rw-r--r-- | include/pcmcia/bulkmem.h | 4 | ||||
-rw-r--r-- | include/pcmcia/ciscode.h | 5 | ||||
-rw-r--r-- | include/pcmcia/cistpl.h | 21 | ||||
-rw-r--r-- | include/pcmcia/cs.h | 34 | ||||
-rw-r--r-- | include/pcmcia/ds.h | 80 | ||||
-rw-r--r-- | include/pcmcia/ss.h | 11 |
6 files changed, 81 insertions, 74 deletions
diff --git a/include/pcmcia/bulkmem.h b/include/pcmcia/bulkmem.h index b53b78d497ba..6bc7472293b2 100644 --- a/include/pcmcia/bulkmem.h +++ b/include/pcmcia/bulkmem.h | |||
@@ -35,7 +35,7 @@ typedef struct region_info_t { | |||
35 | #define REGION_BAR_MASK 0xe000 | 35 | #define REGION_BAR_MASK 0xe000 |
36 | #define REGION_BAR_SHIFT 13 | 36 | #define REGION_BAR_SHIFT 13 |
37 | 37 | ||
38 | int pcmcia_get_first_region(client_handle_t handle, region_info_t *rgn); | 38 | int pcmcia_get_first_region(struct pcmcia_device *handle, region_info_t *rgn); |
39 | int pcmcia_get_next_region(client_handle_t handle, region_info_t *rgn); | 39 | int pcmcia_get_next_region(struct pcmcia_device *handle, region_info_t *rgn); |
40 | 40 | ||
41 | #endif /* _LINUX_BULKMEM_H */ | 41 | #endif /* _LINUX_BULKMEM_H */ |
diff --git a/include/pcmcia/ciscode.h b/include/pcmcia/ciscode.h index da19c297dd65..c1da8558339a 100644 --- a/include/pcmcia/ciscode.h +++ b/include/pcmcia/ciscode.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * ciscode.h -- Definitions for bulk memory services | 2 | * ciscode.h |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or modify | 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 | 5 | * it under the terms of the GNU General Public License version 2 as |
@@ -122,4 +122,7 @@ | |||
122 | 122 | ||
123 | #define MANFID_XIRCOM 0x0105 | 123 | #define MANFID_XIRCOM 0x0105 |
124 | 124 | ||
125 | #define MANFID_POSSIO 0x030c | ||
126 | #define PRODID_POSSIO_GCC 0x0003 | ||
127 | |||
125 | #endif /* _LINUX_CISCODE_H */ | 128 | #endif /* _LINUX_CISCODE_H */ |
diff --git a/include/pcmcia/cistpl.h b/include/pcmcia/cistpl.h index c6a069554fd7..d3bbb19caf81 100644 --- a/include/pcmcia/cistpl.h +++ b/include/pcmcia/cistpl.h | |||
@@ -586,12 +586,7 @@ typedef struct cisdump_t { | |||
586 | cisdata_t Data[CISTPL_MAX_CIS_SIZE]; | 586 | cisdata_t Data[CISTPL_MAX_CIS_SIZE]; |
587 | } cisdump_t; | 587 | } cisdump_t; |
588 | 588 | ||
589 | int pcmcia_get_first_tuple(client_handle_t handle, tuple_t *tuple); | ||
590 | int pcmcia_get_next_tuple(client_handle_t handle, tuple_t *tuple); | ||
591 | int pcmcia_get_tuple_data(client_handle_t handle, tuple_t *tuple); | ||
592 | int pcmcia_parse_tuple(client_handle_t handle, tuple_t *tuple, cisparse_t *parse); | ||
593 | 589 | ||
594 | int pcmcia_validate_cis(client_handle_t handle, cisinfo_t *info); | ||
595 | int pcmcia_replace_cis(struct pcmcia_socket *s, cisdump_t *cis); | 590 | int pcmcia_replace_cis(struct pcmcia_socket *s, cisdump_t *cis); |
596 | 591 | ||
597 | /* don't use outside of PCMCIA core yet */ | 592 | /* don't use outside of PCMCIA core yet */ |
@@ -602,4 +597,20 @@ int pccard_parse_tuple(tuple_t *tuple, cisparse_t *parse); | |||
602 | 597 | ||
603 | int pccard_validate_cis(struct pcmcia_socket *s, unsigned int function, cisinfo_t *info); | 598 | int pccard_validate_cis(struct pcmcia_socket *s, unsigned int function, cisinfo_t *info); |
604 | 599 | ||
600 | /* ... but use these wrappers instead */ | ||
601 | #define pcmcia_get_first_tuple(p_dev, tuple) \ | ||
602 | pccard_get_first_tuple(p_dev->socket, p_dev->func, tuple) | ||
603 | |||
604 | #define pcmcia_get_next_tuple(p_dev, tuple) \ | ||
605 | pccard_get_next_tuple(p_dev->socket, p_dev->func, tuple) | ||
606 | |||
607 | #define pcmcia_get_tuple_data(p_dev, tuple) \ | ||
608 | pccard_get_tuple_data(p_dev->socket, tuple) | ||
609 | |||
610 | #define pcmcia_parse_tuple(p_dev, tuple, parse) \ | ||
611 | pccard_parse_tuple(tuple, parse) | ||
612 | |||
613 | #define pcmcia_validate_cis(p_dev, info) \ | ||
614 | pccard_validate_cis(p_dev->socket, p_dev->func, info) | ||
615 | |||
605 | #endif /* LINUX_CISTPL_H */ | 616 | #endif /* LINUX_CISTPL_H */ |
diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h index 52660f32663d..d5838c30d20f 100644 --- a/include/pcmcia/cs.h +++ b/include/pcmcia/cs.h | |||
@@ -109,17 +109,6 @@ typedef struct client_req_t { | |||
109 | 109 | ||
110 | #define CLIENT_THIS_SOCKET 0x01 | 110 | #define CLIENT_THIS_SOCKET 0x01 |
111 | 111 | ||
112 | /* For RegisterClient */ | ||
113 | typedef struct client_reg_t { | ||
114 | dev_info_t *dev_info; | ||
115 | u_int Attributes; /* UNUSED */ | ||
116 | u_int EventMask; | ||
117 | int (*event_handler)(event_t event, int priority, | ||
118 | event_callback_args_t *); | ||
119 | event_callback_args_t event_callback_args; | ||
120 | u_int Version; | ||
121 | } client_reg_t; | ||
122 | |||
123 | /* ModifyConfiguration */ | 112 | /* ModifyConfiguration */ |
124 | typedef struct modconf_t { | 113 | typedef struct modconf_t { |
125 | u_int Attributes; | 114 | u_int Attributes; |
@@ -127,15 +116,16 @@ typedef struct modconf_t { | |||
127 | } modconf_t; | 116 | } modconf_t; |
128 | 117 | ||
129 | /* Attributes for ModifyConfiguration */ | 118 | /* Attributes for ModifyConfiguration */ |
130 | #define CONF_IRQ_CHANGE_VALID 0x100 | 119 | #define CONF_IRQ_CHANGE_VALID 0x0100 |
131 | #define CONF_VCC_CHANGE_VALID 0x200 | 120 | #define CONF_VCC_CHANGE_VALID 0x0200 |
132 | #define CONF_VPP1_CHANGE_VALID 0x400 | 121 | #define CONF_VPP1_CHANGE_VALID 0x0400 |
133 | #define CONF_VPP2_CHANGE_VALID 0x800 | 122 | #define CONF_VPP2_CHANGE_VALID 0x0800 |
123 | #define CONF_IO_CHANGE_WIDTH 0x1000 | ||
134 | 124 | ||
135 | /* For RequestConfiguration */ | 125 | /* For RequestConfiguration */ |
136 | typedef struct config_req_t { | 126 | typedef struct config_req_t { |
137 | u_int Attributes; | 127 | u_int Attributes; |
138 | u_int Vcc, Vpp1, Vpp2; | 128 | u_int Vpp; /* both Vpp1 and Vpp2 */ |
139 | u_int IntType; | 129 | u_int IntType; |
140 | u_int ConfigBase; | 130 | u_int ConfigBase; |
141 | u_char Status, Pin, Copy, ExtStatus; | 131 | u_char Status, Pin, Copy, ExtStatus; |
@@ -389,23 +379,27 @@ int pcmcia_get_status(struct pcmcia_device *p_dev, cs_status_t *status); | |||
389 | int pcmcia_get_mem_page(window_handle_t win, memreq_t *req); | 379 | int pcmcia_get_mem_page(window_handle_t win, memreq_t *req); |
390 | int pcmcia_map_mem_page(window_handle_t win, memreq_t *req); | 380 | int pcmcia_map_mem_page(window_handle_t win, memreq_t *req); |
391 | int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod); | 381 | int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod); |
392 | int pcmcia_release_configuration(struct pcmcia_device *p_dev); | ||
393 | int pcmcia_release_io(struct pcmcia_device *p_dev, io_req_t *req); | ||
394 | int pcmcia_release_irq(struct pcmcia_device *p_dev, irq_req_t *req); | ||
395 | int pcmcia_release_window(window_handle_t win); | 382 | int pcmcia_release_window(window_handle_t win); |
396 | int pcmcia_request_configuration(struct pcmcia_device *p_dev, config_req_t *req); | 383 | int pcmcia_request_configuration(struct pcmcia_device *p_dev, config_req_t *req); |
397 | int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req); | 384 | int pcmcia_request_io(struct pcmcia_device *p_dev, io_req_t *req); |
398 | int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req); | 385 | int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req); |
399 | int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_handle_t *wh); | 386 | int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, window_handle_t *wh); |
400 | int pcmcia_reset_card(struct pcmcia_device *p_dev, client_req_t *req); | ||
401 | int pcmcia_suspend_card(struct pcmcia_socket *skt); | 387 | int pcmcia_suspend_card(struct pcmcia_socket *skt); |
402 | int pcmcia_resume_card(struct pcmcia_socket *skt); | 388 | int pcmcia_resume_card(struct pcmcia_socket *skt); |
403 | int pcmcia_eject_card(struct pcmcia_socket *skt); | 389 | int pcmcia_eject_card(struct pcmcia_socket *skt); |
404 | int pcmcia_insert_card(struct pcmcia_socket *skt); | 390 | int pcmcia_insert_card(struct pcmcia_socket *skt); |
391 | int pccard_reset_card(struct pcmcia_socket *skt); | ||
392 | |||
393 | struct pcmcia_device * pcmcia_dev_present(struct pcmcia_device *p_dev); | ||
394 | void pcmcia_disable_device(struct pcmcia_device *p_dev); | ||
405 | 395 | ||
406 | struct pcmcia_socket * pcmcia_get_socket(struct pcmcia_socket *skt); | 396 | struct pcmcia_socket * pcmcia_get_socket(struct pcmcia_socket *skt); |
407 | void pcmcia_put_socket(struct pcmcia_socket *skt); | 397 | void pcmcia_put_socket(struct pcmcia_socket *skt); |
408 | 398 | ||
399 | /* compatibility functions */ | ||
400 | #define pcmcia_reset_card(p_dev, req) \ | ||
401 | pccard_reset_card(p_dev->socket) | ||
402 | |||
409 | #endif /* __KERNEL__ */ | 403 | #endif /* __KERNEL__ */ |
410 | 404 | ||
411 | #endif /* _LINUX_CS_H */ | 405 | #endif /* _LINUX_CS_H */ |
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h index 8e2a96396478..8c339f5678cf 100644 --- a/include/pcmcia/ds.h +++ b/include/pcmcia/ds.h | |||
@@ -39,7 +39,7 @@ typedef struct win_info_t { | |||
39 | typedef struct bind_info_t { | 39 | typedef struct bind_info_t { |
40 | dev_info_t dev_info; | 40 | dev_info_t dev_info; |
41 | u_char function; | 41 | u_char function; |
42 | struct dev_link_t *instance; | 42 | struct pcmcia_device *instance; |
43 | char name[DEV_NAME_LEN]; | 43 | char name[DEV_NAME_LEN]; |
44 | u_short major, minor; | 44 | u_short major, minor; |
45 | void *next; | 45 | void *next; |
@@ -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 | ||
100 | typedef struct dev_node_t { | 101 | typedef struct dev_node_t { |
101 | char dev_name[DEV_NAME_LEN]; | 102 | char dev_name[DEV_NAME_LEN]; |
@@ -103,34 +104,9 @@ 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 | typedef struct dev_link_t { | ||
107 | dev_node_t *dev; | ||
108 | u_int state, open; | ||
109 | wait_queue_head_t pending; | ||
110 | client_handle_t handle; | ||
111 | io_req_t io; | ||
112 | irq_req_t irq; | ||
113 | config_req_t conf; | ||
114 | window_handle_t win; | ||
115 | void *priv; | ||
116 | struct dev_link_t *next; | ||
117 | } dev_link_t; | ||
118 | |||
119 | /* Flags for device state */ | ||
120 | #define DEV_PRESENT 0x01 | ||
121 | #define DEV_CONFIG 0x02 | ||
122 | #define DEV_STALE_CONFIG 0x04 /* release on close */ | ||
123 | #define DEV_STALE_LINK 0x08 /* detach on release */ | ||
124 | #define DEV_CONFIG_PENDING 0x10 | ||
125 | #define DEV_RELEASE_PENDING 0x20 | ||
126 | #define DEV_SUSPEND 0x40 | ||
127 | #define DEV_BUSY 0x80 | ||
128 | |||
129 | #define DEV_OK(l) \ | ||
130 | ((l) && ((l->state & ~DEV_BUSY) == (DEV_CONFIG|DEV_PRESENT))) | ||
131 | |||
132 | 107 | ||
133 | struct pcmcia_socket; | 108 | struct pcmcia_socket; |
109 | struct config_t; | ||
134 | 110 | ||
135 | struct pcmcia_driver { | 111 | struct pcmcia_driver { |
136 | int (*probe) (struct pcmcia_device *dev); | 112 | int (*probe) (struct pcmcia_device *dev); |
@@ -148,6 +124,7 @@ struct pcmcia_driver { | |||
148 | int pcmcia_register_driver(struct pcmcia_driver *driver); | 124 | int pcmcia_register_driver(struct pcmcia_driver *driver); |
149 | void pcmcia_unregister_driver(struct pcmcia_driver *driver); | 125 | void pcmcia_unregister_driver(struct pcmcia_driver *driver); |
150 | 126 | ||
127 | |||
151 | struct pcmcia_device { | 128 | struct pcmcia_device { |
152 | /* the socket and the device_no [for multifunction devices] | 129 | /* the socket and the device_no [for multifunction devices] |
153 | uniquely define a pcmcia_device */ | 130 | uniquely define a pcmcia_device */ |
@@ -160,21 +137,40 @@ struct pcmcia_device { | |||
160 | /* the hardware "function" device; certain subdevices can | 137 | /* the hardware "function" device; certain subdevices can |
161 | * share one hardware "function" device. */ | 138 | * share one hardware "function" device. */ |
162 | u8 func; | 139 | u8 func; |
140 | struct config_t* function_config; | ||
163 | 141 | ||
164 | struct list_head socket_device_list; | 142 | struct list_head socket_device_list; |
165 | 143 | ||
166 | /* deprecated, a cleaned up version will be moved into this | 144 | /* deprecated, will be cleaned up soon */ |
167 | struct soon */ | 145 | dev_node_t *dev_node; |
168 | dev_link_t *instance; | 146 | u_int open; |
169 | u_int state; | 147 | io_req_t io; |
148 | irq_req_t irq; | ||
149 | config_req_t conf; | ||
150 | window_handle_t win; | ||
151 | |||
152 | /* Is the device suspended, or in the process of | ||
153 | * being removed? */ | ||
154 | u16 suspended:1; | ||
155 | u16 _removed:1; | ||
156 | |||
157 | /* Flags whether io, irq, win configurations were | ||
158 | * requested, and whether the configuration is "locked" */ | ||
159 | u16 _irq:1; | ||
160 | u16 _io:1; | ||
161 | u16 _win:4; | ||
162 | u16 _locked:1; | ||
163 | |||
164 | /* Flag whether a "fuzzy" func_id based match is | ||
165 | * allowed. */ | ||
166 | u16 allow_func_id_match:1; | ||
170 | 167 | ||
171 | /* information about this device */ | 168 | /* information about this device */ |
172 | u8 has_manf_id:1; | 169 | u16 has_manf_id:1; |
173 | u8 has_card_id:1; | 170 | u16 has_card_id:1; |
174 | u8 has_func_id:1; | 171 | u16 has_func_id:1; |
175 | 172 | ||
176 | u8 allow_func_id_match:1; | 173 | u16 reserved:3; |
177 | u8 reserved:4; | ||
178 | 174 | ||
179 | u8 func_id; | 175 | u8 func_id; |
180 | u16 manf_id; | 176 | u16 manf_id; |
@@ -182,22 +178,24 @@ struct pcmcia_device { | |||
182 | 178 | ||
183 | char * prod_id[4]; | 179 | char * prod_id[4]; |
184 | 180 | ||
181 | struct device dev; | ||
182 | |||
183 | #ifdef CONFIG_PCMCIA_IOCTL | ||
185 | /* device driver wanted by cardmgr */ | 184 | /* device driver wanted by cardmgr */ |
186 | struct pcmcia_driver * cardmgr; | 185 | struct pcmcia_driver * cardmgr; |
186 | #endif | ||
187 | 187 | ||
188 | struct device dev; | 188 | /* data private to drivers */ |
189 | void *priv; | ||
189 | }; | 190 | }; |
190 | 191 | ||
191 | #define to_pcmcia_dev(n) container_of(n, struct pcmcia_device, dev) | 192 | #define to_pcmcia_dev(n) container_of(n, struct pcmcia_device, dev) |
192 | #define to_pcmcia_drv(n) container_of(n, struct pcmcia_driver, drv) | 193 | #define to_pcmcia_drv(n) container_of(n, struct pcmcia_driver, drv) |
193 | 194 | ||
194 | #define handle_to_pdev(handle) (handle) | ||
195 | #define handle_to_dev(handle) (handle->dev) | 195 | #define handle_to_dev(handle) (handle->dev) |
196 | 196 | ||
197 | #define dev_to_instance(dev) (dev->instance) | ||
198 | |||
199 | /* error reporting */ | 197 | /* error reporting */ |
200 | void cs_error(client_handle_t handle, int func, int ret); | 198 | void cs_error(struct pcmcia_device *handle, int func, int ret); |
201 | 199 | ||
202 | #endif /* __KERNEL__ */ | 200 | #endif /* __KERNEL__ */ |
203 | #endif /* _LINUX_DS_H */ | 201 | #endif /* _LINUX_DS_H */ |
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h index 2889a69a7a8f..5e0a01ab2216 100644 --- a/include/pcmcia/ss.h +++ b/include/pcmcia/ss.h | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/config.h> | 18 | #include <linux/config.h> |
19 | #include <linux/device.h> | 19 | #include <linux/device.h> |
20 | #include <linux/sched.h> /* task_struct, completion */ | 20 | #include <linux/sched.h> /* task_struct, completion */ |
21 | #include <linux/mutex.h> | ||
21 | 22 | ||
22 | #include <pcmcia/cs_types.h> | 23 | #include <pcmcia/cs_types.h> |
23 | #include <pcmcia/cs.h> | 24 | #include <pcmcia/cs.h> |
@@ -146,14 +147,15 @@ extern struct pccard_resource_ops pccard_static_ops; | |||
146 | /* !SS_CAP_STATIC_MAP */ | 147 | /* !SS_CAP_STATIC_MAP */ |
147 | extern struct pccard_resource_ops pccard_nonstatic_ops; | 148 | extern struct pccard_resource_ops pccard_nonstatic_ops; |
148 | 149 | ||
150 | /* static mem, dynamic IO sockets */ | ||
151 | extern struct pccard_resource_ops pccard_iodyn_ops; | ||
152 | |||
149 | /* | 153 | /* |
150 | * Calls to set up low-level "Socket Services" drivers | 154 | * Calls to set up low-level "Socket Services" drivers |
151 | */ | 155 | */ |
152 | struct pcmcia_socket; | 156 | struct pcmcia_socket; |
153 | 157 | ||
154 | typedef struct io_window_t { | 158 | typedef struct io_window_t { |
155 | u_int Attributes; | ||
156 | kio_addr_t BasePort, NumPorts; | ||
157 | kio_addr_t InUse, Config; | 159 | kio_addr_t InUse, Config; |
158 | struct resource *res; | 160 | struct resource *res; |
159 | } io_window_t; | 161 | } io_window_t; |
@@ -162,7 +164,7 @@ typedef struct io_window_t { | |||
162 | typedef struct window_t { | 164 | typedef struct window_t { |
163 | u_short magic; | 165 | u_short magic; |
164 | u_short index; | 166 | u_short index; |
165 | client_handle_t handle; | 167 | struct pcmcia_device *handle; |
166 | struct pcmcia_socket *sock; | 168 | struct pcmcia_socket *sock; |
167 | pccard_mem_map ctl; | 169 | pccard_mem_map ctl; |
168 | } window_t; | 170 | } window_t; |
@@ -186,7 +188,6 @@ struct pcmcia_socket { | |||
186 | u_short lock_count; | 188 | u_short lock_count; |
187 | pccard_mem_map cis_mem; | 189 | pccard_mem_map cis_mem; |
188 | void __iomem *cis_virt; | 190 | void __iomem *cis_virt; |
189 | struct config_t *config; | ||
190 | struct { | 191 | struct { |
191 | u_int AssignedIRQ; | 192 | u_int AssignedIRQ; |
192 | u_int Config; | 193 | u_int Config; |
@@ -241,7 +242,7 @@ struct pcmcia_socket { | |||
241 | #endif | 242 | #endif |
242 | 243 | ||
243 | /* state thread */ | 244 | /* state thread */ |
244 | struct semaphore skt_sem; /* protects socket h/w state */ | 245 | struct mutex skt_mutex; /* protects socket h/w state */ |
245 | 246 | ||
246 | struct task_struct *thread; | 247 | struct task_struct *thread; |
247 | struct completion thread_done; | 248 | struct completion thread_done; |