aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/airo_cs.c
diff options
context:
space:
mode:
authorDominik Brodowski <linux@dominikbrodowski.net>2005-11-14 15:21:18 -0500
committerDominik Brodowski <linux@dominikbrodowski.net>2006-01-05 17:59:02 -0500
commit98e4c28b7ec390c2dad6a4c69d69629c0f7e8b10 (patch)
treeb3d46f0643352e541d6a39e6da09059687cf713d /drivers/net/wireless/airo_cs.c
parent63e7ebd06402951bc8863ba5b7bc9b9f42044849 (diff)
[PATCH] pcmcia: new suspend core
Move the suspend and resume methods out of the event handler, and into special functions. Also use these functions for pre- and post-reset, as almost all drivers already do, and the remaining ones can easily be converted. Bugfix to include/pcmcia/ds.c Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
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)