aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/pcmcia/3c589_cs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/pcmcia/3c589_cs.c')
-rw-r--r--drivers/net/pcmcia/3c589_cs.c56
1 files changed, 34 insertions, 22 deletions
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c
index d83fdd8c1943..bbda681ac102 100644
--- a/drivers/net/pcmcia/3c589_cs.c
+++ b/drivers/net/pcmcia/3c589_cs.c
@@ -421,6 +421,38 @@ static void tc589_release(dev_link_t *link)
421 link->state &= ~DEV_CONFIG; 421 link->state &= ~DEV_CONFIG;
422} 422}
423 423
424static int tc589_suspend(struct pcmcia_device *p_dev)
425{
426 dev_link_t *link = dev_to_instance(p_dev);
427 struct net_device *dev = link->priv;
428
429 link->state |= DEV_SUSPEND;
430 if (link->state & DEV_CONFIG) {
431 if (link->open)
432 netif_device_detach(dev);
433 pcmcia_release_configuration(link->handle);
434 }
435
436 return 0;
437}
438
439static int tc589_resume(struct pcmcia_device *p_dev)
440{
441 dev_link_t *link = dev_to_instance(p_dev);
442 struct net_device *dev = link->priv;
443
444 link->state &= ~DEV_SUSPEND;
445 if (link->state & DEV_CONFIG) {
446 pcmcia_request_configuration(link->handle, &link->conf);
447 if (link->open) {
448 tc589_reset(dev);
449 netif_device_attach(dev);
450 }
451 }
452
453 return 0;
454}
455
424/*====================================================================== 456/*======================================================================
425 457
426 The card status event handler. Mostly, this schedules other 458 The card status event handler. Mostly, this schedules other
@@ -448,28 +480,6 @@ static int tc589_event(event_t event, int priority,
448 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; 480 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
449 tc589_config(link); 481 tc589_config(link);
450 break; 482 break;
451 case CS_EVENT_PM_SUSPEND:
452 link->state |= DEV_SUSPEND;
453 /* Fall through... */
454 case CS_EVENT_RESET_PHYSICAL:
455 if (link->state & DEV_CONFIG) {
456 if (link->open)
457 netif_device_detach(dev);
458 pcmcia_release_configuration(link->handle);
459 }
460 break;
461 case CS_EVENT_PM_RESUME:
462 link->state &= ~DEV_SUSPEND;
463 /* Fall through... */
464 case CS_EVENT_CARD_RESET:
465 if (link->state & DEV_CONFIG) {
466 pcmcia_request_configuration(link->handle, &link->conf);
467 if (link->open) {
468 tc589_reset(dev);
469 netif_device_attach(dev);
470 }
471 }
472 break;
473 } 483 }
474 return 0; 484 return 0;
475} /* tc589_event */ 485} /* tc589_event */
@@ -1071,6 +1081,8 @@ static struct pcmcia_driver tc589_driver = {
1071 .event = tc589_event, 1081 .event = tc589_event,
1072 .detach = tc589_detach, 1082 .detach = tc589_detach,
1073 .id_table = tc589_ids, 1083 .id_table = tc589_ids,
1084 .suspend = tc589_suspend,
1085 .resume = tc589_resume,
1074}; 1086};
1075 1087
1076static int __init init_tc589(void) 1088static int __init init_tc589(void)