diff options
Diffstat (limited to 'drivers/isdn/hisax')
-rw-r--r-- | drivers/isdn/hisax/avma1_cs.c | 60 | ||||
-rw-r--r-- | drivers/isdn/hisax/elsa_cs.c | 50 | ||||
-rw-r--r-- | drivers/isdn/hisax/sedlbauer_cs.c | 58 | ||||
-rw-r--r-- | drivers/isdn/hisax/teles_cs.c | 54 |
4 files changed, 100 insertions, 122 deletions
diff --git a/drivers/isdn/hisax/avma1_cs.c b/drivers/isdn/hisax/avma1_cs.c index f7143fe1a2e7..ff6b0e185bc4 100644 --- a/drivers/isdn/hisax/avma1_cs.c +++ b/drivers/isdn/hisax/avma1_cs.c | |||
@@ -67,8 +67,8 @@ module_param(isdnprot, int, 0); | |||
67 | handler. | 67 | handler. |
68 | */ | 68 | */ |
69 | 69 | ||
70 | static void avma1cs_config(dev_link_t *link); | 70 | static void avma1cs_config(struct pcmcia_device *link); |
71 | static void avma1cs_release(dev_link_t *link); | 71 | static void avma1cs_release(struct pcmcia_device *link); |
72 | 72 | ||
73 | /* | 73 | /* |
74 | The attach() and detach() entry points are used to create and destroy | 74 | The attach() and detach() entry points are used to create and destroy |
@@ -82,10 +82,10 @@ static void avma1cs_detach(struct pcmcia_device *p_dev); | |||
82 | /* | 82 | /* |
83 | A linked list of "instances" of the skeleton device. Each actual | 83 | A linked list of "instances" of the skeleton device. Each actual |
84 | PCMCIA card corresponds to one device instance, and is described | 84 | PCMCIA card corresponds to one device instance, and is described |
85 | by one dev_link_t structure (defined in ds.h). | 85 | by one struct pcmcia_device structure (defined in ds.h). |
86 | 86 | ||
87 | You may not want to use a linked list for this -- for example, the | 87 | You may not want to use a linked list for this -- for example, the |
88 | memory card driver uses an array of dev_link_t pointers, where minor | 88 | memory card driver uses an array of struct pcmcia_device pointers, where minor |
89 | device numbers are used to derive the corresponding array index. | 89 | device numbers are used to derive the corresponding array index. |
90 | */ | 90 | */ |
91 | 91 | ||
@@ -95,7 +95,7 @@ static void avma1cs_detach(struct pcmcia_device *p_dev); | |||
95 | example, ethernet cards, modems). In other cases, there may be | 95 | example, ethernet cards, modems). In other cases, there may be |
96 | many actual or logical devices (SCSI adapters, memory cards with | 96 | many actual or logical devices (SCSI adapters, memory cards with |
97 | multiple partitions). The dev_node_t structures need to be kept | 97 | multiple partitions). The dev_node_t structures need to be kept |
98 | in a linked list starting at the 'dev' field of a dev_link_t | 98 | in a linked list starting at the 'dev' field of a struct pcmcia_device |
99 | structure. We allocate them in the card's private data structure, | 99 | structure. We allocate them in the card's private data structure, |
100 | because they generally can't be allocated dynamically. | 100 | because they generally can't be allocated dynamically. |
101 | */ | 101 | */ |
@@ -164,10 +164,8 @@ static int avma1cs_attach(struct pcmcia_device *p_dev) | |||
164 | 164 | ||
165 | ======================================================================*/ | 165 | ======================================================================*/ |
166 | 166 | ||
167 | static void avma1cs_detach(struct pcmcia_device *p_dev) | 167 | static void avma1cs_detach(struct pcmcia_device *link) |
168 | { | 168 | { |
169 | dev_link_t *link = dev_to_instance(p_dev); | ||
170 | |||
171 | DEBUG(0, "avma1cs_detach(0x%p)\n", link); | 169 | DEBUG(0, "avma1cs_detach(0x%p)\n", link); |
172 | 170 | ||
173 | if (link->state & DEV_CONFIG) | 171 | if (link->state & DEV_CONFIG) |
@@ -184,7 +182,7 @@ static void avma1cs_detach(struct pcmcia_device *p_dev) | |||
184 | 182 | ||
185 | ======================================================================*/ | 183 | ======================================================================*/ |
186 | 184 | ||
187 | static int get_tuple(client_handle_t handle, tuple_t *tuple, | 185 | static int get_tuple(struct pcmcia_device *handle, tuple_t *tuple, |
188 | cisparse_t *parse) | 186 | cisparse_t *parse) |
189 | { | 187 | { |
190 | int i = pcmcia_get_tuple_data(handle, tuple); | 188 | int i = pcmcia_get_tuple_data(handle, tuple); |
@@ -192,7 +190,7 @@ static int get_tuple(client_handle_t handle, tuple_t *tuple, | |||
192 | return pcmcia_parse_tuple(handle, tuple, parse); | 190 | return pcmcia_parse_tuple(handle, tuple, parse); |
193 | } | 191 | } |
194 | 192 | ||
195 | static int first_tuple(client_handle_t handle, tuple_t *tuple, | 193 | static int first_tuple(struct pcmcia_device *handle, tuple_t *tuple, |
196 | cisparse_t *parse) | 194 | cisparse_t *parse) |
197 | { | 195 | { |
198 | int i = pcmcia_get_first_tuple(handle, tuple); | 196 | int i = pcmcia_get_first_tuple(handle, tuple); |
@@ -200,7 +198,7 @@ static int first_tuple(client_handle_t handle, tuple_t *tuple, | |||
200 | return get_tuple(handle, tuple, parse); | 198 | return get_tuple(handle, tuple, parse); |
201 | } | 199 | } |
202 | 200 | ||
203 | static int next_tuple(client_handle_t handle, tuple_t *tuple, | 201 | static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple, |
204 | cisparse_t *parse) | 202 | cisparse_t *parse) |
205 | { | 203 | { |
206 | int i = pcmcia_get_next_tuple(handle, tuple); | 204 | int i = pcmcia_get_next_tuple(handle, tuple); |
@@ -208,9 +206,8 @@ static int next_tuple(client_handle_t handle, tuple_t *tuple, | |||
208 | return get_tuple(handle, tuple, parse); | 206 | return get_tuple(handle, tuple, parse); |
209 | } | 207 | } |
210 | 208 | ||
211 | static void avma1cs_config(dev_link_t *link) | 209 | static void avma1cs_config(struct pcmcia_device *link) |
212 | { | 210 | { |
213 | client_handle_t handle; | ||
214 | tuple_t tuple; | 211 | tuple_t tuple; |
215 | cisparse_t parse; | 212 | cisparse_t parse; |
216 | cistpl_cftable_entry_t *cf = &parse.cftable_entry; | 213 | cistpl_cftable_entry_t *cf = &parse.cftable_entry; |
@@ -220,8 +217,7 @@ static void avma1cs_config(dev_link_t *link) | |||
220 | char devname[128]; | 217 | char devname[128]; |
221 | IsdnCard_t icard; | 218 | IsdnCard_t icard; |
222 | int busy = 0; | 219 | int busy = 0; |
223 | 220 | ||
224 | handle = link->handle; | ||
225 | dev = link->priv; | 221 | dev = link->priv; |
226 | 222 | ||
227 | DEBUG(0, "avma1cs_config(0x%p)\n", link); | 223 | DEBUG(0, "avma1cs_config(0x%p)\n", link); |
@@ -232,19 +228,19 @@ static void avma1cs_config(dev_link_t *link) | |||
232 | */ | 228 | */ |
233 | do { | 229 | do { |
234 | tuple.DesiredTuple = CISTPL_CONFIG; | 230 | tuple.DesiredTuple = CISTPL_CONFIG; |
235 | i = pcmcia_get_first_tuple(handle, &tuple); | 231 | i = pcmcia_get_first_tuple(link, &tuple); |
236 | if (i != CS_SUCCESS) break; | 232 | if (i != CS_SUCCESS) break; |
237 | tuple.TupleData = buf; | 233 | tuple.TupleData = buf; |
238 | tuple.TupleDataMax = 64; | 234 | tuple.TupleDataMax = 64; |
239 | tuple.TupleOffset = 0; | 235 | tuple.TupleOffset = 0; |
240 | i = pcmcia_get_tuple_data(handle, &tuple); | 236 | i = pcmcia_get_tuple_data(link, &tuple); |
241 | if (i != CS_SUCCESS) break; | 237 | if (i != CS_SUCCESS) break; |
242 | i = pcmcia_parse_tuple(handle, &tuple, &parse); | 238 | i = pcmcia_parse_tuple(link, &tuple, &parse); |
243 | if (i != CS_SUCCESS) break; | 239 | if (i != CS_SUCCESS) break; |
244 | link->conf.ConfigBase = parse.config.base; | 240 | link->conf.ConfigBase = parse.config.base; |
245 | } while (0); | 241 | } while (0); |
246 | if (i != CS_SUCCESS) { | 242 | if (i != CS_SUCCESS) { |
247 | cs_error(link->handle, ParseTuple, i); | 243 | cs_error(link, ParseTuple, i); |
248 | link->state &= ~DEV_CONFIG_PENDING; | 244 | link->state &= ~DEV_CONFIG_PENDING; |
249 | return; | 245 | return; |
250 | } | 246 | } |
@@ -261,7 +257,7 @@ static void avma1cs_config(dev_link_t *link) | |||
261 | tuple.DesiredTuple = CISTPL_VERS_1; | 257 | tuple.DesiredTuple = CISTPL_VERS_1; |
262 | 258 | ||
263 | devname[0] = 0; | 259 | devname[0] = 0; |
264 | if( !first_tuple(handle, &tuple, &parse) && parse.version_1.ns > 1 ) { | 260 | if( !first_tuple(link, &tuple, &parse) && parse.version_1.ns > 1 ) { |
265 | strlcpy(devname,parse.version_1.str + parse.version_1.ofs[1], | 261 | strlcpy(devname,parse.version_1.str + parse.version_1.ofs[1], |
266 | sizeof(devname)); | 262 | sizeof(devname)); |
267 | } | 263 | } |
@@ -272,7 +268,7 @@ static void avma1cs_config(dev_link_t *link) | |||
272 | tuple.TupleOffset = 0; tuple.TupleDataMax = 255; | 268 | tuple.TupleOffset = 0; tuple.TupleDataMax = 255; |
273 | tuple.Attributes = 0; | 269 | tuple.Attributes = 0; |
274 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; | 270 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; |
275 | i = first_tuple(handle, &tuple, &parse); | 271 | i = first_tuple(link, &tuple, &parse); |
276 | while (i == CS_SUCCESS) { | 272 | while (i == CS_SUCCESS) { |
277 | if (cf->io.nwin > 0) { | 273 | if (cf->io.nwin > 0) { |
278 | link->conf.ConfigIndex = cf->index; | 274 | link->conf.ConfigIndex = cf->index; |
@@ -282,36 +278,36 @@ static void avma1cs_config(dev_link_t *link) | |||
282 | printk(KERN_INFO "avma1_cs: testing i/o %#x-%#x\n", | 278 | printk(KERN_INFO "avma1_cs: testing i/o %#x-%#x\n", |
283 | link->io.BasePort1, | 279 | link->io.BasePort1, |
284 | link->io.BasePort1+link->io.NumPorts1 - 1); | 280 | link->io.BasePort1+link->io.NumPorts1 - 1); |
285 | i = pcmcia_request_io(link->handle, &link->io); | 281 | i = pcmcia_request_io(link, &link->io); |
286 | if (i == CS_SUCCESS) goto found_port; | 282 | if (i == CS_SUCCESS) goto found_port; |
287 | } | 283 | } |
288 | i = next_tuple(handle, &tuple, &parse); | 284 | i = next_tuple(link, &tuple, &parse); |
289 | } | 285 | } |
290 | 286 | ||
291 | found_port: | 287 | found_port: |
292 | if (i != CS_SUCCESS) { | 288 | if (i != CS_SUCCESS) { |
293 | cs_error(link->handle, RequestIO, i); | 289 | cs_error(link, RequestIO, i); |
294 | break; | 290 | break; |
295 | } | 291 | } |
296 | 292 | ||
297 | /* | 293 | /* |
298 | * allocate an interrupt line | 294 | * allocate an interrupt line |
299 | */ | 295 | */ |
300 | i = pcmcia_request_irq(link->handle, &link->irq); | 296 | i = pcmcia_request_irq(link, &link->irq); |
301 | if (i != CS_SUCCESS) { | 297 | if (i != CS_SUCCESS) { |
302 | cs_error(link->handle, RequestIRQ, i); | 298 | cs_error(link, RequestIRQ, i); |
303 | /* undo */ | 299 | /* undo */ |
304 | pcmcia_disable_device(link->handle); | 300 | pcmcia_disable_device(link); |
305 | break; | 301 | break; |
306 | } | 302 | } |
307 | 303 | ||
308 | /* | 304 | /* |
309 | * configure the PCMCIA socket | 305 | * configure the PCMCIA socket |
310 | */ | 306 | */ |
311 | i = pcmcia_request_configuration(link->handle, &link->conf); | 307 | i = pcmcia_request_configuration(link, &link->conf); |
312 | if (i != CS_SUCCESS) { | 308 | if (i != CS_SUCCESS) { |
313 | cs_error(link->handle, RequestConfiguration, i); | 309 | cs_error(link, RequestConfiguration, i); |
314 | pcmcia_disable_device(link->handle); | 310 | pcmcia_disable_device(link); |
315 | break; | 311 | break; |
316 | } | 312 | } |
317 | 313 | ||
@@ -358,7 +354,7 @@ found_port: | |||
358 | 354 | ||
359 | ======================================================================*/ | 355 | ======================================================================*/ |
360 | 356 | ||
361 | static void avma1cs_release(dev_link_t *link) | 357 | static void avma1cs_release(struct pcmcia_device *link) |
362 | { | 358 | { |
363 | local_info_t *local = link->priv; | 359 | local_info_t *local = link->priv; |
364 | 360 | ||
@@ -367,7 +363,7 @@ static void avma1cs_release(dev_link_t *link) | |||
367 | /* now unregister function with hisax */ | 363 | /* now unregister function with hisax */ |
368 | HiSax_closecard(local->node.minor); | 364 | HiSax_closecard(local->node.minor); |
369 | 365 | ||
370 | pcmcia_disable_device(link->handle); | 366 | pcmcia_disable_device(link); |
371 | } /* avma1cs_release */ | 367 | } /* avma1cs_release */ |
372 | 368 | ||
373 | 369 | ||
diff --git a/drivers/isdn/hisax/elsa_cs.c b/drivers/isdn/hisax/elsa_cs.c index bcda675e9103..7a42bd43162f 100644 --- a/drivers/isdn/hisax/elsa_cs.c +++ b/drivers/isdn/hisax/elsa_cs.c | |||
@@ -94,8 +94,8 @@ module_param(protocol, int, 0); | |||
94 | handler. | 94 | handler. |
95 | */ | 95 | */ |
96 | 96 | ||
97 | static void elsa_cs_config(dev_link_t *link); | 97 | static void elsa_cs_config(struct pcmcia_device *link); |
98 | static void elsa_cs_release(dev_link_t *link); | 98 | static void elsa_cs_release(struct pcmcia_device *link); |
99 | 99 | ||
100 | /* | 100 | /* |
101 | The attach() and detach() entry points are used to create and destroy | 101 | The attach() and detach() entry points are used to create and destroy |
@@ -111,7 +111,7 @@ static void elsa_cs_detach(struct pcmcia_device *p_dev); | |||
111 | example, ethernet cards, modems). In other cases, there may be | 111 | example, ethernet cards, modems). In other cases, there may be |
112 | many actual or logical devices (SCSI adapters, memory cards with | 112 | many actual or logical devices (SCSI adapters, memory cards with |
113 | multiple partitions). The dev_node_t structures need to be kept | 113 | multiple partitions). The dev_node_t structures need to be kept |
114 | in a linked list starting at the 'dev' field of a dev_link_t | 114 | in a linked list starting at the 'dev' field of a struct pcmcia_device |
115 | structure. We allocate them in the card's private data structure, | 115 | structure. We allocate them in the card's private data structure, |
116 | because they generally shouldn't be allocated dynamically. | 116 | because they generally shouldn't be allocated dynamically. |
117 | In this case, we also provide a flag to indicate if a device is | 117 | In this case, we also provide a flag to indicate if a device is |
@@ -139,10 +139,9 @@ typedef struct local_info_t { | |||
139 | 139 | ||
140 | ======================================================================*/ | 140 | ======================================================================*/ |
141 | 141 | ||
142 | static int elsa_cs_attach(struct pcmcia_device *p_dev) | 142 | static int elsa_cs_attach(struct pcmcia_device *link) |
143 | { | 143 | { |
144 | local_info_t *local; | 144 | local_info_t *local; |
145 | dev_link_t *link = dev_to_instance(p_dev); | ||
146 | 145 | ||
147 | DEBUG(0, "elsa_cs_attach()\n"); | 146 | DEBUG(0, "elsa_cs_attach()\n"); |
148 | 147 | ||
@@ -151,7 +150,7 @@ static int elsa_cs_attach(struct pcmcia_device *p_dev) | |||
151 | if (!local) return -ENOMEM; | 150 | if (!local) return -ENOMEM; |
152 | memset(local, 0, sizeof(local_info_t)); | 151 | memset(local, 0, sizeof(local_info_t)); |
153 | 152 | ||
154 | local->p_dev = p_dev; | 153 | local->p_dev = link; |
155 | link->priv = local; | 154 | link->priv = local; |
156 | 155 | ||
157 | local->cardnr = -1; | 156 | local->cardnr = -1; |
@@ -190,9 +189,8 @@ static int elsa_cs_attach(struct pcmcia_device *p_dev) | |||
190 | 189 | ||
191 | ======================================================================*/ | 190 | ======================================================================*/ |
192 | 191 | ||
193 | static void elsa_cs_detach(struct pcmcia_device *p_dev) | 192 | static void elsa_cs_detach(struct pcmcia_device *link) |
194 | { | 193 | { |
195 | dev_link_t *link = dev_to_instance(p_dev); | ||
196 | local_info_t *info = link->priv; | 194 | local_info_t *info = link->priv; |
197 | 195 | ||
198 | DEBUG(0, "elsa_cs_detach(0x%p)\n", link); | 196 | DEBUG(0, "elsa_cs_detach(0x%p)\n", link); |
@@ -213,7 +211,7 @@ static void elsa_cs_detach(struct pcmcia_device *p_dev) | |||
213 | device available to the system. | 211 | device available to the system. |
214 | 212 | ||
215 | ======================================================================*/ | 213 | ======================================================================*/ |
216 | static int get_tuple(client_handle_t handle, tuple_t *tuple, | 214 | static int get_tuple(struct pcmcia_device *handle, tuple_t *tuple, |
217 | cisparse_t *parse) | 215 | cisparse_t *parse) |
218 | { | 216 | { |
219 | int i = pcmcia_get_tuple_data(handle, tuple); | 217 | int i = pcmcia_get_tuple_data(handle, tuple); |
@@ -221,7 +219,7 @@ static int get_tuple(client_handle_t handle, tuple_t *tuple, | |||
221 | return pcmcia_parse_tuple(handle, tuple, parse); | 219 | return pcmcia_parse_tuple(handle, tuple, parse); |
222 | } | 220 | } |
223 | 221 | ||
224 | static int first_tuple(client_handle_t handle, tuple_t *tuple, | 222 | static int first_tuple(struct pcmcia_device *handle, tuple_t *tuple, |
225 | cisparse_t *parse) | 223 | cisparse_t *parse) |
226 | { | 224 | { |
227 | int i = pcmcia_get_first_tuple(handle, tuple); | 225 | int i = pcmcia_get_first_tuple(handle, tuple); |
@@ -229,7 +227,7 @@ static int first_tuple(client_handle_t handle, tuple_t *tuple, | |||
229 | return get_tuple(handle, tuple, parse); | 227 | return get_tuple(handle, tuple, parse); |
230 | } | 228 | } |
231 | 229 | ||
232 | static int next_tuple(client_handle_t handle, tuple_t *tuple, | 230 | static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple, |
233 | cisparse_t *parse) | 231 | cisparse_t *parse) |
234 | { | 232 | { |
235 | int i = pcmcia_get_next_tuple(handle, tuple); | 233 | int i = pcmcia_get_next_tuple(handle, tuple); |
@@ -237,9 +235,8 @@ static int next_tuple(client_handle_t handle, tuple_t *tuple, | |||
237 | return get_tuple(handle, tuple, parse); | 235 | return get_tuple(handle, tuple, parse); |
238 | } | 236 | } |
239 | 237 | ||
240 | static void elsa_cs_config(dev_link_t *link) | 238 | static void elsa_cs_config(struct pcmcia_device *link) |
241 | { | 239 | { |
242 | client_handle_t handle; | ||
243 | tuple_t tuple; | 240 | tuple_t tuple; |
244 | cisparse_t parse; | 241 | cisparse_t parse; |
245 | local_info_t *dev; | 242 | local_info_t *dev; |
@@ -249,7 +246,6 @@ static void elsa_cs_config(dev_link_t *link) | |||
249 | IsdnCard_t icard; | 246 | IsdnCard_t icard; |
250 | 247 | ||
251 | DEBUG(0, "elsa_config(0x%p)\n", link); | 248 | DEBUG(0, "elsa_config(0x%p)\n", link); |
252 | handle = link->handle; | ||
253 | dev = link->priv; | 249 | dev = link->priv; |
254 | 250 | ||
255 | /* | 251 | /* |
@@ -261,7 +257,7 @@ static void elsa_cs_config(dev_link_t *link) | |||
261 | tuple.TupleDataMax = 255; | 257 | tuple.TupleDataMax = 255; |
262 | tuple.TupleOffset = 0; | 258 | tuple.TupleOffset = 0; |
263 | tuple.Attributes = 0; | 259 | tuple.Attributes = 0; |
264 | i = first_tuple(handle, &tuple, &parse); | 260 | i = first_tuple(link, &tuple, &parse); |
265 | if (i != CS_SUCCESS) { | 261 | if (i != CS_SUCCESS) { |
266 | last_fn = ParseTuple; | 262 | last_fn = ParseTuple; |
267 | goto cs_failed; | 263 | goto cs_failed; |
@@ -276,25 +272,25 @@ static void elsa_cs_config(dev_link_t *link) | |||
276 | tuple.TupleOffset = 0; tuple.TupleDataMax = 255; | 272 | tuple.TupleOffset = 0; tuple.TupleDataMax = 255; |
277 | tuple.Attributes = 0; | 273 | tuple.Attributes = 0; |
278 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; | 274 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; |
279 | i = first_tuple(handle, &tuple, &parse); | 275 | i = first_tuple(link, &tuple, &parse); |
280 | while (i == CS_SUCCESS) { | 276 | while (i == CS_SUCCESS) { |
281 | if ( (cf->io.nwin > 0) && cf->io.win[0].base) { | 277 | if ( (cf->io.nwin > 0) && cf->io.win[0].base) { |
282 | printk(KERN_INFO "(elsa_cs: looks like the 96 model)\n"); | 278 | printk(KERN_INFO "(elsa_cs: looks like the 96 model)\n"); |
283 | link->conf.ConfigIndex = cf->index; | 279 | link->conf.ConfigIndex = cf->index; |
284 | link->io.BasePort1 = cf->io.win[0].base; | 280 | link->io.BasePort1 = cf->io.win[0].base; |
285 | i = pcmcia_request_io(link->handle, &link->io); | 281 | i = pcmcia_request_io(link, &link->io); |
286 | if (i == CS_SUCCESS) break; | 282 | if (i == CS_SUCCESS) break; |
287 | } else { | 283 | } else { |
288 | printk(KERN_INFO "(elsa_cs: looks like the 97 model)\n"); | 284 | printk(KERN_INFO "(elsa_cs: looks like the 97 model)\n"); |
289 | link->conf.ConfigIndex = cf->index; | 285 | link->conf.ConfigIndex = cf->index; |
290 | for (i = 0, j = 0x2f0; j > 0x100; j -= 0x10) { | 286 | for (i = 0, j = 0x2f0; j > 0x100; j -= 0x10) { |
291 | link->io.BasePort1 = j; | 287 | link->io.BasePort1 = j; |
292 | i = pcmcia_request_io(link->handle, &link->io); | 288 | i = pcmcia_request_io(link, &link->io); |
293 | if (i == CS_SUCCESS) break; | 289 | if (i == CS_SUCCESS) break; |
294 | } | 290 | } |
295 | break; | 291 | break; |
296 | } | 292 | } |
297 | i = next_tuple(handle, &tuple, &parse); | 293 | i = next_tuple(link, &tuple, &parse); |
298 | } | 294 | } |
299 | 295 | ||
300 | if (i != CS_SUCCESS) { | 296 | if (i != CS_SUCCESS) { |
@@ -302,14 +298,14 @@ static void elsa_cs_config(dev_link_t *link) | |||
302 | goto cs_failed; | 298 | goto cs_failed; |
303 | } | 299 | } |
304 | 300 | ||
305 | i = pcmcia_request_irq(link->handle, &link->irq); | 301 | i = pcmcia_request_irq(link, &link->irq); |
306 | if (i != CS_SUCCESS) { | 302 | if (i != CS_SUCCESS) { |
307 | link->irq.AssignedIRQ = 0; | 303 | link->irq.AssignedIRQ = 0; |
308 | last_fn = RequestIRQ; | 304 | last_fn = RequestIRQ; |
309 | goto cs_failed; | 305 | goto cs_failed; |
310 | } | 306 | } |
311 | 307 | ||
312 | i = pcmcia_request_configuration(link->handle, &link->conf); | 308 | i = pcmcia_request_configuration(link, &link->conf); |
313 | if (i != CS_SUCCESS) { | 309 | if (i != CS_SUCCESS) { |
314 | last_fn = RequestConfiguration; | 310 | last_fn = RequestConfiguration; |
315 | goto cs_failed; | 311 | goto cs_failed; |
@@ -352,7 +348,7 @@ static void elsa_cs_config(dev_link_t *link) | |||
352 | 348 | ||
353 | return; | 349 | return; |
354 | cs_failed: | 350 | cs_failed: |
355 | cs_error(link->handle, last_fn, i); | 351 | cs_error(link, last_fn, i); |
356 | elsa_cs_release(link); | 352 | elsa_cs_release(link); |
357 | } /* elsa_cs_config */ | 353 | } /* elsa_cs_config */ |
358 | 354 | ||
@@ -364,7 +360,7 @@ cs_failed: | |||
364 | 360 | ||
365 | ======================================================================*/ | 361 | ======================================================================*/ |
366 | 362 | ||
367 | static void elsa_cs_release(dev_link_t *link) | 363 | static void elsa_cs_release(struct pcmcia_device *link) |
368 | { | 364 | { |
369 | local_info_t *local = link->priv; | 365 | local_info_t *local = link->priv; |
370 | 366 | ||
@@ -377,12 +373,11 @@ static void elsa_cs_release(dev_link_t *link) | |||
377 | } | 373 | } |
378 | } | 374 | } |
379 | 375 | ||
380 | pcmcia_disable_device(link->handle); | 376 | pcmcia_disable_device(link); |
381 | } /* elsa_cs_release */ | 377 | } /* elsa_cs_release */ |
382 | 378 | ||
383 | static int elsa_suspend(struct pcmcia_device *p_dev) | 379 | static int elsa_suspend(struct pcmcia_device *link) |
384 | { | 380 | { |
385 | dev_link_t *link = dev_to_instance(p_dev); | ||
386 | local_info_t *dev = link->priv; | 381 | local_info_t *dev = link->priv; |
387 | 382 | ||
388 | dev->busy = 1; | 383 | dev->busy = 1; |
@@ -390,9 +385,8 @@ static int elsa_suspend(struct pcmcia_device *p_dev) | |||
390 | return 0; | 385 | return 0; |
391 | } | 386 | } |
392 | 387 | ||
393 | static int elsa_resume(struct pcmcia_device *p_dev) | 388 | static int elsa_resume(struct pcmcia_device *link) |
394 | { | 389 | { |
395 | dev_link_t *link = dev_to_instance(p_dev); | ||
396 | local_info_t *dev = link->priv; | 390 | local_info_t *dev = link->priv; |
397 | 391 | ||
398 | dev->busy = 0; | 392 | dev->busy = 0; |
diff --git a/drivers/isdn/hisax/sedlbauer_cs.c b/drivers/isdn/hisax/sedlbauer_cs.c index 6025722001fa..2af48a684654 100644 --- a/drivers/isdn/hisax/sedlbauer_cs.c +++ b/drivers/isdn/hisax/sedlbauer_cs.c | |||
@@ -95,8 +95,8 @@ module_param(protocol, int, 0); | |||
95 | event handler. | 95 | event handler. |
96 | */ | 96 | */ |
97 | 97 | ||
98 | static void sedlbauer_config(dev_link_t *link); | 98 | static void sedlbauer_config(struct pcmcia_device *link); |
99 | static void sedlbauer_release(dev_link_t *link); | 99 | static void sedlbauer_release(struct pcmcia_device *link); |
100 | 100 | ||
101 | /* | 101 | /* |
102 | The attach() and detach() entry points are used to create and destroy | 102 | The attach() and detach() entry points are used to create and destroy |
@@ -119,7 +119,7 @@ static void sedlbauer_detach(struct pcmcia_device *p_dev); | |||
119 | example, ethernet cards, modems). In other cases, there may be | 119 | example, ethernet cards, modems). In other cases, there may be |
120 | many actual or logical devices (SCSI adapters, memory cards with | 120 | many actual or logical devices (SCSI adapters, memory cards with |
121 | multiple partitions). The dev_node_t structures need to be kept | 121 | multiple partitions). The dev_node_t structures need to be kept |
122 | in a linked list starting at the 'dev' field of a dev_link_t | 122 | in a linked list starting at the 'dev' field of a struct pcmcia_device |
123 | structure. We allocate them in the card's private data structure, | 123 | structure. We allocate them in the card's private data structure, |
124 | because they generally shouldn't be allocated dynamically. | 124 | because they generally shouldn't be allocated dynamically. |
125 | 125 | ||
@@ -148,11 +148,10 @@ typedef struct local_info_t { | |||
148 | 148 | ||
149 | ======================================================================*/ | 149 | ======================================================================*/ |
150 | 150 | ||
151 | static int sedlbauer_attach(struct pcmcia_device *p_dev) | 151 | static int sedlbauer_attach(struct pcmcia_device *link) |
152 | { | 152 | { |
153 | local_info_t *local; | 153 | local_info_t *local; |
154 | dev_link_t *link = dev_to_instance(p_dev); | 154 | |
155 | |||
156 | DEBUG(0, "sedlbauer_attach()\n"); | 155 | DEBUG(0, "sedlbauer_attach()\n"); |
157 | 156 | ||
158 | /* Allocate space for private device-specific data */ | 157 | /* Allocate space for private device-specific data */ |
@@ -161,7 +160,7 @@ static int sedlbauer_attach(struct pcmcia_device *p_dev) | |||
161 | memset(local, 0, sizeof(local_info_t)); | 160 | memset(local, 0, sizeof(local_info_t)); |
162 | local->cardnr = -1; | 161 | local->cardnr = -1; |
163 | 162 | ||
164 | local->p_dev = p_dev; | 163 | local->p_dev = link; |
165 | link->priv = local; | 164 | link->priv = local; |
166 | 165 | ||
167 | /* Interrupt setup */ | 166 | /* Interrupt setup */ |
@@ -202,10 +201,8 @@ static int sedlbauer_attach(struct pcmcia_device *p_dev) | |||
202 | 201 | ||
203 | ======================================================================*/ | 202 | ======================================================================*/ |
204 | 203 | ||
205 | static void sedlbauer_detach(struct pcmcia_device *p_dev) | 204 | static void sedlbauer_detach(struct pcmcia_device *link) |
206 | { | 205 | { |
207 | dev_link_t *link = dev_to_instance(p_dev); | ||
208 | |||
209 | DEBUG(0, "sedlbauer_detach(0x%p)\n", link); | 206 | DEBUG(0, "sedlbauer_detach(0x%p)\n", link); |
210 | 207 | ||
211 | if (link->state & DEV_CONFIG) { | 208 | if (link->state & DEV_CONFIG) { |
@@ -227,9 +224,8 @@ static void sedlbauer_detach(struct pcmcia_device *p_dev) | |||
227 | #define CS_CHECK(fn, ret) \ | 224 | #define CS_CHECK(fn, ret) \ |
228 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) | 225 | do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) |
229 | 226 | ||
230 | static void sedlbauer_config(dev_link_t *link) | 227 | static void sedlbauer_config(struct pcmcia_device *link) |
231 | { | 228 | { |
232 | client_handle_t handle = link->handle; | ||
233 | local_info_t *dev = link->priv; | 229 | local_info_t *dev = link->priv; |
234 | tuple_t tuple; | 230 | tuple_t tuple; |
235 | cisparse_t parse; | 231 | cisparse_t parse; |
@@ -251,16 +247,16 @@ static void sedlbauer_config(dev_link_t *link) | |||
251 | tuple.TupleData = buf; | 247 | tuple.TupleData = buf; |
252 | tuple.TupleDataMax = sizeof(buf); | 248 | tuple.TupleDataMax = sizeof(buf); |
253 | tuple.TupleOffset = 0; | 249 | tuple.TupleOffset = 0; |
254 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); | 250 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); |
255 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); | 251 | CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple)); |
256 | CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); | 252 | CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse)); |
257 | link->conf.ConfigBase = parse.config.base; | 253 | link->conf.ConfigBase = parse.config.base; |
258 | link->conf.Present = parse.config.rmask[0]; | 254 | link->conf.Present = parse.config.rmask[0]; |
259 | 255 | ||
260 | /* Configure card */ | 256 | /* Configure card */ |
261 | link->state |= DEV_CONFIG; | 257 | link->state |= DEV_CONFIG; |
262 | 258 | ||
263 | CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(handle, &conf)); | 259 | CS_CHECK(GetConfigurationInfo, pcmcia_get_configuration_info(link, &conf)); |
264 | 260 | ||
265 | /* | 261 | /* |
266 | In this loop, we scan the CIS for configuration table entries, | 262 | In this loop, we scan the CIS for configuration table entries, |
@@ -275,12 +271,12 @@ static void sedlbauer_config(dev_link_t *link) | |||
275 | will only use the CIS to fill in implementation-defined details. | 271 | will only use the CIS to fill in implementation-defined details. |
276 | */ | 272 | */ |
277 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; | 273 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; |
278 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); | 274 | CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple)); |
279 | while (1) { | 275 | while (1) { |
280 | cistpl_cftable_entry_t dflt = { 0 }; | 276 | cistpl_cftable_entry_t dflt = { 0 }; |
281 | cistpl_cftable_entry_t *cfg = &(parse.cftable_entry); | 277 | cistpl_cftable_entry_t *cfg = &(parse.cftable_entry); |
282 | if (pcmcia_get_tuple_data(handle, &tuple) != 0 || | 278 | if (pcmcia_get_tuple_data(link, &tuple) != 0 || |
283 | pcmcia_parse_tuple(handle, &tuple, &parse) != 0) | 279 | pcmcia_parse_tuple(link, &tuple, &parse) != 0) |
284 | goto next_entry; | 280 | goto next_entry; |
285 | 281 | ||
286 | if (cfg->flags & CISTPL_CFTABLE_DEFAULT) dflt = *cfg; | 282 | if (cfg->flags & CISTPL_CFTABLE_DEFAULT) dflt = *cfg; |
@@ -334,13 +330,13 @@ static void sedlbauer_config(dev_link_t *link) | |||
334 | link->io.NumPorts2 = io->win[1].len; | 330 | link->io.NumPorts2 = io->win[1].len; |
335 | } | 331 | } |
336 | /* This reserves IO space but doesn't actually enable it */ | 332 | /* This reserves IO space but doesn't actually enable it */ |
337 | if (pcmcia_request_io(link->handle, &link->io) != 0) | 333 | if (pcmcia_request_io(link, &link->io) != 0) |
338 | goto next_entry; | 334 | goto next_entry; |
339 | } | 335 | } |
340 | 336 | ||
341 | /* | 337 | /* |
342 | Now set up a common memory window, if needed. There is room | 338 | Now set up a common memory window, if needed. There is room |
343 | in the dev_link_t structure for one memory window handle, | 339 | in the struct pcmcia_device structure for one memory window handle, |
344 | but if the base addresses need to be saved, or if multiple | 340 | but if the base addresses need to be saved, or if multiple |
345 | windows are needed, the info should go in the private data | 341 | windows are needed, the info should go in the private data |
346 | structure for this device. | 342 | structure for this device. |
@@ -361,7 +357,7 @@ static void sedlbauer_config(dev_link_t *link) | |||
361 | req.Size = 0x1000; | 357 | req.Size = 0x1000; |
362 | */ | 358 | */ |
363 | req.AccessSpeed = 0; | 359 | req.AccessSpeed = 0; |
364 | if (pcmcia_request_window(&link->handle, &req, &link->win) != 0) | 360 | if (pcmcia_request_window(&link, &req, &link->win) != 0) |
365 | goto next_entry; | 361 | goto next_entry; |
366 | map.Page = 0; map.CardOffset = mem->win[0].card_addr; | 362 | map.Page = 0; map.CardOffset = mem->win[0].card_addr; |
367 | if (pcmcia_map_mem_page(link->win, &map) != 0) | 363 | if (pcmcia_map_mem_page(link->win, &map) != 0) |
@@ -371,7 +367,7 @@ static void sedlbauer_config(dev_link_t *link) | |||
371 | break; | 367 | break; |
372 | 368 | ||
373 | next_entry: | 369 | next_entry: |
374 | CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(handle, &tuple)); | 370 | CS_CHECK(GetNextTuple, pcmcia_get_next_tuple(link, &tuple)); |
375 | } | 371 | } |
376 | 372 | ||
377 | /* | 373 | /* |
@@ -380,14 +376,14 @@ static void sedlbauer_config(dev_link_t *link) | |||
380 | irq structure is initialized. | 376 | irq structure is initialized. |
381 | */ | 377 | */ |
382 | if (link->conf.Attributes & CONF_ENABLE_IRQ) | 378 | if (link->conf.Attributes & CONF_ENABLE_IRQ) |
383 | CS_CHECK(RequestIRQ, pcmcia_request_irq(link->handle, &link->irq)); | 379 | CS_CHECK(RequestIRQ, pcmcia_request_irq(link, &link->irq)); |
384 | 380 | ||
385 | /* | 381 | /* |
386 | This actually configures the PCMCIA socket -- setting up | 382 | This actually configures the PCMCIA socket -- setting up |
387 | the I/O windows and the interrupt mapping, and putting the | 383 | the I/O windows and the interrupt mapping, and putting the |
388 | card and host interface into "Memory and IO" mode. | 384 | card and host interface into "Memory and IO" mode. |
389 | */ | 385 | */ |
390 | CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf)); | 386 | CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf)); |
391 | 387 | ||
392 | /* | 388 | /* |
393 | At this point, the dev_node_t structure(s) need to be | 389 | At this point, the dev_node_t structure(s) need to be |
@@ -433,7 +429,7 @@ static void sedlbauer_config(dev_link_t *link) | |||
433 | return; | 429 | return; |
434 | 430 | ||
435 | cs_failed: | 431 | cs_failed: |
436 | cs_error(link->handle, last_fn, last_ret); | 432 | cs_error(link, last_fn, last_ret); |
437 | sedlbauer_release(link); | 433 | sedlbauer_release(link); |
438 | 434 | ||
439 | } /* sedlbauer_config */ | 435 | } /* sedlbauer_config */ |
@@ -446,7 +442,7 @@ cs_failed: | |||
446 | 442 | ||
447 | ======================================================================*/ | 443 | ======================================================================*/ |
448 | 444 | ||
449 | static void sedlbauer_release(dev_link_t *link) | 445 | static void sedlbauer_release(struct pcmcia_device *link) |
450 | { | 446 | { |
451 | local_info_t *local = link->priv; | 447 | local_info_t *local = link->priv; |
452 | DEBUG(0, "sedlbauer_release(0x%p)\n", link); | 448 | DEBUG(0, "sedlbauer_release(0x%p)\n", link); |
@@ -458,12 +454,11 @@ static void sedlbauer_release(dev_link_t *link) | |||
458 | } | 454 | } |
459 | } | 455 | } |
460 | 456 | ||
461 | pcmcia_disable_device(link->handle); | 457 | pcmcia_disable_device(link); |
462 | } /* sedlbauer_release */ | 458 | } /* sedlbauer_release */ |
463 | 459 | ||
464 | static int sedlbauer_suspend(struct pcmcia_device *p_dev) | 460 | static int sedlbauer_suspend(struct pcmcia_device *link) |
465 | { | 461 | { |
466 | dev_link_t *link = dev_to_instance(p_dev); | ||
467 | local_info_t *dev = link->priv; | 462 | local_info_t *dev = link->priv; |
468 | 463 | ||
469 | dev->stop = 1; | 464 | dev->stop = 1; |
@@ -471,9 +466,8 @@ static int sedlbauer_suspend(struct pcmcia_device *p_dev) | |||
471 | return 0; | 466 | return 0; |
472 | } | 467 | } |
473 | 468 | ||
474 | static int sedlbauer_resume(struct pcmcia_device *p_dev) | 469 | static int sedlbauer_resume(struct pcmcia_device *link) |
475 | { | 470 | { |
476 | dev_link_t *link = dev_to_instance(p_dev); | ||
477 | local_info_t *dev = link->priv; | 471 | local_info_t *dev = link->priv; |
478 | 472 | ||
479 | dev->stop = 0; | 473 | dev->stop = 0; |
diff --git a/drivers/isdn/hisax/teles_cs.c b/drivers/isdn/hisax/teles_cs.c index ea16ebfc028a..698e9ec95f0b 100644 --- a/drivers/isdn/hisax/teles_cs.c +++ b/drivers/isdn/hisax/teles_cs.c | |||
@@ -75,8 +75,8 @@ module_param(protocol, int, 0); | |||
75 | handler. | 75 | handler. |
76 | */ | 76 | */ |
77 | 77 | ||
78 | static void teles_cs_config(dev_link_t *link); | 78 | static void teles_cs_config(struct pcmcia_device *link); |
79 | static void teles_cs_release(dev_link_t *link); | 79 | static void teles_cs_release(struct pcmcia_device *link); |
80 | 80 | ||
81 | /* | 81 | /* |
82 | The attach() and detach() entry points are used to create and destroy | 82 | The attach() and detach() entry points are used to create and destroy |
@@ -89,10 +89,10 @@ static void teles_detach(struct pcmcia_device *p_dev); | |||
89 | /* | 89 | /* |
90 | A linked list of "instances" of the teles_cs device. Each actual | 90 | A linked list of "instances" of the teles_cs device. Each actual |
91 | PCMCIA card corresponds to one device instance, and is described | 91 | PCMCIA card corresponds to one device instance, and is described |
92 | by one dev_link_t structure (defined in ds.h). | 92 | by one struct pcmcia_device structure (defined in ds.h). |
93 | 93 | ||
94 | You may not want to use a linked list for this -- for example, the | 94 | You may not want to use a linked list for this -- for example, the |
95 | memory card driver uses an array of dev_link_t pointers, where minor | 95 | memory card driver uses an array of struct pcmcia_device pointers, where minor |
96 | device numbers are used to derive the corresponding array index. | 96 | device numbers are used to derive the corresponding array index. |
97 | */ | 97 | */ |
98 | 98 | ||
@@ -102,7 +102,7 @@ static void teles_detach(struct pcmcia_device *p_dev); | |||
102 | example, ethernet cards, modems). In other cases, there may be | 102 | example, ethernet cards, modems). In other cases, there may be |
103 | many actual or logical devices (SCSI adapters, memory cards with | 103 | many actual or logical devices (SCSI adapters, memory cards with |
104 | multiple partitions). The dev_node_t structures need to be kept | 104 | multiple partitions). The dev_node_t structures need to be kept |
105 | in a linked list starting at the 'dev' field of a dev_link_t | 105 | in a linked list starting at the 'dev' field of a struct pcmcia_device |
106 | structure. We allocate them in the card's private data structure, | 106 | structure. We allocate them in the card's private data structure, |
107 | because they generally shouldn't be allocated dynamically. | 107 | because they generally shouldn't be allocated dynamically. |
108 | In this case, we also provide a flag to indicate if a device is | 108 | In this case, we also provide a flag to indicate if a device is |
@@ -130,10 +130,9 @@ typedef struct local_info_t { | |||
130 | 130 | ||
131 | ======================================================================*/ | 131 | ======================================================================*/ |
132 | 132 | ||
133 | static int teles_attach(struct pcmcia_device *p_dev) | 133 | static int teles_attach(struct pcmcia_device *link) |
134 | { | 134 | { |
135 | local_info_t *local; | 135 | local_info_t *local; |
136 | dev_link_t *link = dev_to_instance(p_dev); | ||
137 | 136 | ||
138 | DEBUG(0, "teles_attach()\n"); | 137 | DEBUG(0, "teles_attach()\n"); |
139 | 138 | ||
@@ -143,7 +142,7 @@ static int teles_attach(struct pcmcia_device *p_dev) | |||
143 | memset(local, 0, sizeof(local_info_t)); | 142 | memset(local, 0, sizeof(local_info_t)); |
144 | local->cardnr = -1; | 143 | local->cardnr = -1; |
145 | 144 | ||
146 | local->p_dev = p_dev; | 145 | local->p_dev = link; |
147 | link->priv = local; | 146 | link->priv = local; |
148 | 147 | ||
149 | /* Interrupt setup */ | 148 | /* Interrupt setup */ |
@@ -180,9 +179,8 @@ static int teles_attach(struct pcmcia_device *p_dev) | |||
180 | 179 | ||
181 | ======================================================================*/ | 180 | ======================================================================*/ |
182 | 181 | ||
183 | static void teles_detach(struct pcmcia_device *p_dev) | 182 | static void teles_detach(struct pcmcia_device *link) |
184 | { | 183 | { |
185 | dev_link_t *link = dev_to_instance(p_dev); | ||
186 | local_info_t *info = link->priv; | 184 | local_info_t *info = link->priv; |
187 | 185 | ||
188 | DEBUG(0, "teles_detach(0x%p)\n", link); | 186 | DEBUG(0, "teles_detach(0x%p)\n", link); |
@@ -203,7 +201,7 @@ static void teles_detach(struct pcmcia_device *p_dev) | |||
203 | device available to the system. | 201 | device available to the system. |
204 | 202 | ||
205 | ======================================================================*/ | 203 | ======================================================================*/ |
206 | static int get_tuple(client_handle_t handle, tuple_t *tuple, | 204 | static int get_tuple(struct pcmcia_device *handle, tuple_t *tuple, |
207 | cisparse_t *parse) | 205 | cisparse_t *parse) |
208 | { | 206 | { |
209 | int i = pcmcia_get_tuple_data(handle, tuple); | 207 | int i = pcmcia_get_tuple_data(handle, tuple); |
@@ -211,7 +209,7 @@ static int get_tuple(client_handle_t handle, tuple_t *tuple, | |||
211 | return pcmcia_parse_tuple(handle, tuple, parse); | 209 | return pcmcia_parse_tuple(handle, tuple, parse); |
212 | } | 210 | } |
213 | 211 | ||
214 | static int first_tuple(client_handle_t handle, tuple_t *tuple, | 212 | static int first_tuple(struct pcmcia_device *handle, tuple_t *tuple, |
215 | cisparse_t *parse) | 213 | cisparse_t *parse) |
216 | { | 214 | { |
217 | int i = pcmcia_get_first_tuple(handle, tuple); | 215 | int i = pcmcia_get_first_tuple(handle, tuple); |
@@ -219,7 +217,7 @@ static int first_tuple(client_handle_t handle, tuple_t *tuple, | |||
219 | return get_tuple(handle, tuple, parse); | 217 | return get_tuple(handle, tuple, parse); |
220 | } | 218 | } |
221 | 219 | ||
222 | static int next_tuple(client_handle_t handle, tuple_t *tuple, | 220 | static int next_tuple(struct pcmcia_device *handle, tuple_t *tuple, |
223 | cisparse_t *parse) | 221 | cisparse_t *parse) |
224 | { | 222 | { |
225 | int i = pcmcia_get_next_tuple(handle, tuple); | 223 | int i = pcmcia_get_next_tuple(handle, tuple); |
@@ -227,9 +225,8 @@ static int next_tuple(client_handle_t handle, tuple_t *tuple, | |||
227 | return get_tuple(handle, tuple, parse); | 225 | return get_tuple(handle, tuple, parse); |
228 | } | 226 | } |
229 | 227 | ||
230 | static void teles_cs_config(dev_link_t *link) | 228 | static void teles_cs_config(struct pcmcia_device *link) |
231 | { | 229 | { |
232 | client_handle_t handle; | ||
233 | tuple_t tuple; | 230 | tuple_t tuple; |
234 | cisparse_t parse; | 231 | cisparse_t parse; |
235 | local_info_t *dev; | 232 | local_info_t *dev; |
@@ -239,7 +236,6 @@ static void teles_cs_config(dev_link_t *link) | |||
239 | IsdnCard_t icard; | 236 | IsdnCard_t icard; |
240 | 237 | ||
241 | DEBUG(0, "teles_config(0x%p)\n", link); | 238 | DEBUG(0, "teles_config(0x%p)\n", link); |
242 | handle = link->handle; | ||
243 | dev = link->priv; | 239 | dev = link->priv; |
244 | 240 | ||
245 | /* | 241 | /* |
@@ -251,7 +247,7 @@ static void teles_cs_config(dev_link_t *link) | |||
251 | tuple.TupleDataMax = 255; | 247 | tuple.TupleDataMax = 255; |
252 | tuple.TupleOffset = 0; | 248 | tuple.TupleOffset = 0; |
253 | tuple.Attributes = 0; | 249 | tuple.Attributes = 0; |
254 | i = first_tuple(handle, &tuple, &parse); | 250 | i = first_tuple(link, &tuple, &parse); |
255 | if (i != CS_SUCCESS) { | 251 | if (i != CS_SUCCESS) { |
256 | last_fn = ParseTuple; | 252 | last_fn = ParseTuple; |
257 | goto cs_failed; | 253 | goto cs_failed; |
@@ -266,25 +262,25 @@ static void teles_cs_config(dev_link_t *link) | |||
266 | tuple.TupleOffset = 0; tuple.TupleDataMax = 255; | 262 | tuple.TupleOffset = 0; tuple.TupleDataMax = 255; |
267 | tuple.Attributes = 0; | 263 | tuple.Attributes = 0; |
268 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; | 264 | tuple.DesiredTuple = CISTPL_CFTABLE_ENTRY; |
269 | i = first_tuple(handle, &tuple, &parse); | 265 | i = first_tuple(link, &tuple, &parse); |
270 | while (i == CS_SUCCESS) { | 266 | while (i == CS_SUCCESS) { |
271 | if ( (cf->io.nwin > 0) && cf->io.win[0].base) { | 267 | if ( (cf->io.nwin > 0) && cf->io.win[0].base) { |
272 | printk(KERN_INFO "(teles_cs: looks like the 96 model)\n"); | 268 | printk(KERN_INFO "(teles_cs: looks like the 96 model)\n"); |
273 | link->conf.ConfigIndex = cf->index; | 269 | link->conf.ConfigIndex = cf->index; |
274 | link->io.BasePort1 = cf->io.win[0].base; | 270 | link->io.BasePort1 = cf->io.win[0].base; |
275 | i = pcmcia_request_io(link->handle, &link->io); | 271 | i = pcmcia_request_io(link, &link->io); |
276 | if (i == CS_SUCCESS) break; | 272 | if (i == CS_SUCCESS) break; |
277 | } else { | 273 | } else { |
278 | printk(KERN_INFO "(teles_cs: looks like the 97 model)\n"); | 274 | printk(KERN_INFO "(teles_cs: looks like the 97 model)\n"); |
279 | link->conf.ConfigIndex = cf->index; | 275 | link->conf.ConfigIndex = cf->index; |
280 | for (i = 0, j = 0x2f0; j > 0x100; j -= 0x10) { | 276 | for (i = 0, j = 0x2f0; j > 0x100; j -= 0x10) { |
281 | link->io.BasePort1 = j; | 277 | link->io.BasePort1 = j; |
282 | i = pcmcia_request_io(link->handle, &link->io); | 278 | i = pcmcia_request_io(link, &link->io); |
283 | if (i == CS_SUCCESS) break; | 279 | if (i == CS_SUCCESS) break; |
284 | } | 280 | } |
285 | break; | 281 | break; |
286 | } | 282 | } |
287 | i = next_tuple(handle, &tuple, &parse); | 283 | i = next_tuple(link, &tuple, &parse); |
288 | } | 284 | } |
289 | 285 | ||
290 | if (i != CS_SUCCESS) { | 286 | if (i != CS_SUCCESS) { |
@@ -292,14 +288,14 @@ static void teles_cs_config(dev_link_t *link) | |||
292 | goto cs_failed; | 288 | goto cs_failed; |
293 | } | 289 | } |
294 | 290 | ||
295 | i = pcmcia_request_irq(link->handle, &link->irq); | 291 | i = pcmcia_request_irq(link, &link->irq); |
296 | if (i != CS_SUCCESS) { | 292 | if (i != CS_SUCCESS) { |
297 | link->irq.AssignedIRQ = 0; | 293 | link->irq.AssignedIRQ = 0; |
298 | last_fn = RequestIRQ; | 294 | last_fn = RequestIRQ; |
299 | goto cs_failed; | 295 | goto cs_failed; |
300 | } | 296 | } |
301 | 297 | ||
302 | i = pcmcia_request_configuration(link->handle, &link->conf); | 298 | i = pcmcia_request_configuration(link, &link->conf); |
303 | if (i != CS_SUCCESS) { | 299 | if (i != CS_SUCCESS) { |
304 | last_fn = RequestConfiguration; | 300 | last_fn = RequestConfiguration; |
305 | goto cs_failed; | 301 | goto cs_failed; |
@@ -342,7 +338,7 @@ static void teles_cs_config(dev_link_t *link) | |||
342 | 338 | ||
343 | return; | 339 | return; |
344 | cs_failed: | 340 | cs_failed: |
345 | cs_error(link->handle, last_fn, i); | 341 | cs_error(link, last_fn, i); |
346 | teles_cs_release(link); | 342 | teles_cs_release(link); |
347 | } /* teles_cs_config */ | 343 | } /* teles_cs_config */ |
348 | 344 | ||
@@ -354,7 +350,7 @@ cs_failed: | |||
354 | 350 | ||
355 | ======================================================================*/ | 351 | ======================================================================*/ |
356 | 352 | ||
357 | static void teles_cs_release(dev_link_t *link) | 353 | static void teles_cs_release(struct pcmcia_device *link) |
358 | { | 354 | { |
359 | local_info_t *local = link->priv; | 355 | local_info_t *local = link->priv; |
360 | 356 | ||
@@ -367,12 +363,11 @@ static void teles_cs_release(dev_link_t *link) | |||
367 | } | 363 | } |
368 | } | 364 | } |
369 | 365 | ||
370 | pcmcia_disable_device(link->handle); | 366 | pcmcia_disable_device(link); |
371 | } /* teles_cs_release */ | 367 | } /* teles_cs_release */ |
372 | 368 | ||
373 | static int teles_suspend(struct pcmcia_device *p_dev) | 369 | static int teles_suspend(struct pcmcia_device *link) |
374 | { | 370 | { |
375 | dev_link_t *link = dev_to_instance(p_dev); | ||
376 | local_info_t *dev = link->priv; | 371 | local_info_t *dev = link->priv; |
377 | 372 | ||
378 | dev->busy = 1; | 373 | dev->busy = 1; |
@@ -380,9 +375,8 @@ static int teles_suspend(struct pcmcia_device *p_dev) | |||
380 | return 0; | 375 | return 0; |
381 | } | 376 | } |
382 | 377 | ||
383 | static int teles_resume(struct pcmcia_device *p_dev) | 378 | static int teles_resume(struct pcmcia_device *link) |
384 | { | 379 | { |
385 | dev_link_t *link = dev_to_instance(p_dev); | ||
386 | local_info_t *dev = link->priv; | 380 | local_info_t *dev = link->priv; |
387 | 381 | ||
388 | dev->busy = 0; | 382 | dev->busy = 0; |