aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/airo_cs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/airo_cs.c')
-rw-r--r--drivers/net/wireless/airo_cs.c50
1 files changed, 31 insertions, 19 deletions
diff --git a/drivers/net/wireless/airo_cs.c b/drivers/net/wireless/airo_cs.c
index e328547599dc..80c9de749b52 100644
--- a/drivers/net/wireless/airo_cs.c
+++ b/drivers/net/wireless/airo_cs.c
@@ -492,6 +492,35 @@ static void airo_release(dev_link_t *link)
492 link->state &= ~DEV_CONFIG; 492 link->state &= ~DEV_CONFIG;
493} 493}
494 494
495static int airo_suspend(struct pcmcia_device *p_dev)
496{
497 dev_link_t *link = dev_to_instance(p_dev);
498 local_info_t *local = link->priv;
499
500 link->state |= DEV_SUSPEND;
501 if (link->state & DEV_CONFIG) {
502 netif_device_detach(local->eth_dev);
503 pcmcia_release_configuration(link->handle);
504 }
505
506 return 0;
507}
508
509static int airo_resume(struct pcmcia_device *p_dev)
510{
511 dev_link_t *link = dev_to_instance(p_dev);
512 local_info_t *local = link->priv;
513
514 link->state &= ~DEV_SUSPEND;
515 if (link->state & DEV_CONFIG) {
516 pcmcia_request_configuration(link->handle, &link->conf);
517 reset_airo_card(local->eth_dev);
518 netif_device_attach(local->eth_dev);
519 }
520
521 return 0;
522}
523
495/*====================================================================== 524/*======================================================================
496 525
497 The card status event handler. Mostly, this schedules other 526 The card status event handler. Mostly, this schedules other
@@ -524,25 +553,6 @@ static int airo_event(event_t event, int priority,
524 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; 553 link->state |= DEV_PRESENT | DEV_CONFIG_PENDING;
525 airo_config(link); 554 airo_config(link);
526 break; 555 break;
527 case CS_EVENT_PM_SUSPEND:
528 link->state |= DEV_SUSPEND;
529 /* Fall through... */
530 case CS_EVENT_RESET_PHYSICAL:
531 if (link->state & DEV_CONFIG) {
532 netif_device_detach(local->eth_dev);
533 pcmcia_release_configuration(link->handle);
534 }
535 break;
536 case CS_EVENT_PM_RESUME:
537 link->state &= ~DEV_SUSPEND;
538 /* Fall through... */
539 case CS_EVENT_CARD_RESET:
540 if (link->state & DEV_CONFIG) {
541 pcmcia_request_configuration(link->handle, &link->conf);
542 reset_airo_card(local->eth_dev);
543 netif_device_attach(local->eth_dev);
544 }
545 break;
546 } 556 }
547 return 0; 557 return 0;
548} /* airo_event */ 558} /* airo_event */
@@ -565,6 +575,8 @@ static struct pcmcia_driver airo_driver = {
565 .event = airo_event, 575 .event = airo_event,
566 .detach = airo_detach, 576 .detach = airo_detach,
567 .id_table = airo_ids, 577 .id_table = airo_ids,
578 .suspend = airo_suspend,
579 .resume = airo_resume,
568}; 580};
569 581
570static int airo_cs_init(void) 582static int airo_cs_init(void)