aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcmcia/com20020_cs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/pcmcia/com20020_cs.c')
-rw-r--r--drivers/net/pcmcia/com20020_cs.c39
1 files changed, 17 insertions, 22 deletions
diff --git a/drivers/net/pcmcia/com20020_cs.c b/drivers/net/pcmcia/com20020_cs.c
index 44da01cdd26f..a9bcfb4ba15e 100644
--- a/drivers/net/pcmcia/com20020_cs.c
+++ b/drivers/net/pcmcia/com20020_cs.c
@@ -118,8 +118,8 @@ MODULE_LICENSE("GPL");
118 118
119/*====================================================================*/ 119/*====================================================================*/
120 120
121static void com20020_config(dev_link_t *link); 121static void com20020_config(struct pcmcia_device *link);
122static void com20020_release(dev_link_t *link); 122static void com20020_release(struct pcmcia_device *link);
123 123
124static void com20020_detach(struct pcmcia_device *p_dev); 124static void com20020_detach(struct pcmcia_device *p_dev);
125 125
@@ -198,9 +198,8 @@ fail_alloc_info:
198 198
199======================================================================*/ 199======================================================================*/
200 200
201static void com20020_detach(struct pcmcia_device *p_dev) 201static void com20020_detach(struct pcmcia_device *link)
202{ 202{
203 dev_link_t *link = dev_to_instance(p_dev);
204 struct com20020_dev_t *info = link->priv; 203 struct com20020_dev_t *info = link->priv;
205 struct net_device *dev = info->dev; 204 struct net_device *dev = info->dev;
206 205
@@ -251,10 +250,9 @@ static void com20020_detach(struct pcmcia_device *p_dev)
251#define CS_CHECK(fn, ret) \ 250#define CS_CHECK(fn, ret) \
252do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0) 251do { last_fn = (fn); if ((last_ret = (ret)) != 0) goto cs_failed; } while (0)
253 252
254static void com20020_config(dev_link_t *link) 253static void com20020_config(struct pcmcia_device *link)
255{ 254{
256 struct arcnet_local *lp; 255 struct arcnet_local *lp;
257 client_handle_t handle;
258 tuple_t tuple; 256 tuple_t tuple;
259 cisparse_t parse; 257 cisparse_t parse;
260 com20020_dev_t *info; 258 com20020_dev_t *info;
@@ -263,7 +261,6 @@ static void com20020_config(dev_link_t *link)
263 u_char buf[64]; 261 u_char buf[64];
264 int ioaddr; 262 int ioaddr;
265 263
266 handle = link->handle;
267 info = link->priv; 264 info = link->priv;
268 dev = info->dev; 265 dev = info->dev;
269 266
@@ -276,9 +273,9 @@ static void com20020_config(dev_link_t *link)
276 tuple.TupleDataMax = 64; 273 tuple.TupleDataMax = 64;
277 tuple.TupleOffset = 0; 274 tuple.TupleOffset = 0;
278 tuple.DesiredTuple = CISTPL_CONFIG; 275 tuple.DesiredTuple = CISTPL_CONFIG;
279 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(handle, &tuple)); 276 CS_CHECK(GetFirstTuple, pcmcia_get_first_tuple(link, &tuple));
280 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(handle, &tuple)); 277 CS_CHECK(GetTupleData, pcmcia_get_tuple_data(link, &tuple));
281 CS_CHECK(ParseTuple, pcmcia_parse_tuple(handle, &tuple, &parse)); 278 CS_CHECK(ParseTuple, pcmcia_parse_tuple(link, &tuple, &parse));
282 link->conf.ConfigBase = parse.config.base; 279 link->conf.ConfigBase = parse.config.base;
283 280
284 /* Configure card */ 281 /* Configure card */
@@ -291,13 +288,13 @@ static void com20020_config(dev_link_t *link)
291 for (ioaddr = 0x100; ioaddr < 0x400; ioaddr += 0x10) 288 for (ioaddr = 0x100; ioaddr < 0x400; ioaddr += 0x10)
292 { 289 {
293 link->io.BasePort1 = ioaddr; 290 link->io.BasePort1 = ioaddr;
294 i = pcmcia_request_io(link->handle, &link->io); 291 i = pcmcia_request_io(link, &link->io);
295 if (i == CS_SUCCESS) 292 if (i == CS_SUCCESS)
296 break; 293 break;
297 } 294 }
298 } 295 }
299 else 296 else
300 i = pcmcia_request_io(link->handle, &link->io); 297 i = pcmcia_request_io(link, &link->io);
301 298
302 if (i != CS_SUCCESS) 299 if (i != CS_SUCCESS)
303 { 300 {
@@ -311,7 +308,7 @@ static void com20020_config(dev_link_t *link)
311 DEBUG(1,"arcnet: request IRQ %d (%Xh/%Xh)\n", 308 DEBUG(1,"arcnet: request IRQ %d (%Xh/%Xh)\n",
312 link->irq.AssignedIRQ, 309 link->irq.AssignedIRQ,
313 link->irq.IRQInfo1, link->irq.IRQInfo2); 310 link->irq.IRQInfo1, link->irq.IRQInfo2);
314 i = pcmcia_request_irq(link->handle, &link->irq); 311 i = pcmcia_request_irq(link, &link->irq);
315 if (i != CS_SUCCESS) 312 if (i != CS_SUCCESS)
316 { 313 {
317 DEBUG(1,"arcnet: requestIRQ failed totally!\n"); 314 DEBUG(1,"arcnet: requestIRQ failed totally!\n");
@@ -320,7 +317,7 @@ static void com20020_config(dev_link_t *link)
320 317
321 dev->irq = link->irq.AssignedIRQ; 318 dev->irq = link->irq.AssignedIRQ;
322 319
323 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link->handle, &link->conf)); 320 CS_CHECK(RequestConfiguration, pcmcia_request_configuration(link, &link->conf));
324 321
325 if (com20020_check(dev)) 322 if (com20020_check(dev))
326 { 323 {
@@ -334,7 +331,7 @@ static void com20020_config(dev_link_t *link)
334 331
335 link->dev_node = &info->node; 332 link->dev_node = &info->node;
336 link->state &= ~DEV_CONFIG_PENDING; 333 link->state &= ~DEV_CONFIG_PENDING;
337 SET_NETDEV_DEV(dev, &handle_to_dev(handle)); 334 SET_NETDEV_DEV(dev, &handle_to_dev(link));
338 335
339 i = com20020_found(dev, 0); /* calls register_netdev */ 336 i = com20020_found(dev, 0); /* calls register_netdev */
340 337
@@ -351,7 +348,7 @@ static void com20020_config(dev_link_t *link)
351 return; 348 return;
352 349
353cs_failed: 350cs_failed:
354 cs_error(link->handle, last_fn, last_ret); 351 cs_error(link, last_fn, last_ret);
355failed: 352failed:
356 DEBUG(1,"com20020_config failed...\n"); 353 DEBUG(1,"com20020_config failed...\n");
357 com20020_release(link); 354 com20020_release(link);
@@ -365,15 +362,14 @@ failed:
365 362
366======================================================================*/ 363======================================================================*/
367 364
368static void com20020_release(dev_link_t *link) 365static void com20020_release(struct pcmcia_device *link)
369{ 366{
370 DEBUG(0, "com20020_release(0x%p)\n", link); 367 DEBUG(0, "com20020_release(0x%p)\n", link);
371 pcmcia_disable_device(link->handle); 368 pcmcia_disable_device(link);
372} 369}
373 370
374static int com20020_suspend(struct pcmcia_device *p_dev) 371static int com20020_suspend(struct pcmcia_device *link)
375{ 372{
376 dev_link_t *link = dev_to_instance(p_dev);
377 com20020_dev_t *info = link->priv; 373 com20020_dev_t *info = link->priv;
378 struct net_device *dev = info->dev; 374 struct net_device *dev = info->dev;
379 375
@@ -383,9 +379,8 @@ static int com20020_suspend(struct pcmcia_device *p_dev)
383 return 0; 379 return 0;
384} 380}
385 381
386static int com20020_resume(struct pcmcia_device *p_dev) 382static int com20020_resume(struct pcmcia_device *link)
387{ 383{
388 dev_link_t *link = dev_to_instance(p_dev);
389 com20020_dev_t *info = link->priv; 384 com20020_dev_t *info = link->priv;
390 struct net_device *dev = info->dev; 385 struct net_device *dev = info->dev;
391 386